Abstract
Complex spatio-temporal systems like lakes, forests and climate systems exhibit alternative stable states. In such systems, as the threshold value of the driver is crossed, the system may experience a sudden (discontinuous) transition or smooth (continuous) transition to an undesired steady state. Theories predict that changes in the structure of the underlying spatial patterns precede such transitions. While there has been a large body of research on identifying early warning signals of critical transitions, the problem of forecasting the type of transitions (sudden versus smooth) remains an open challenge. We address this gap by developing an advanced machine learning (ML) toolkit that serves as an early warning indicator of spatio-temporal critical transitions, Spatial Early Warning Signal Network (S-EWSNet). ML models typically resemble a black box and do not allow envisioning what the model learns in discerning the labels. Here, instead of naively relying upon the deep learning model, we let the deep neural network learn the latent features characteristic of transitions via an optimal sampling strategy (OSS) of spatial patterns. The S-EWSNet is trained on data from a stochastic cellular automata model deploying the OSS, providing an early warning indicator of transitions while detecting its type in simulated and empirical samples.
Keywords: spatial patterns, catastrophic and non-catastrophic transitions, tipping points, deep learning, early warning indicators, classification
1. Introduction
Bifurcation-induced transitions are observed in various complex systems under adverse conditions such as in human societies [1], disease in organisms [2–4], palaeoclimatic systems [5,6], lake and forest habitats [7,8] and other bio-ecological systems [9,10]. Studies also provide evidence of the association of spatial patterns with an approaching bifurcation [11,12]. At the bifurcation point, the system undergoes either a sudden (catastrophic) shift to an alternative stable state, also known as a critical transition, or the system can experience a smooth (non-catastrophic) change in the state variable depending on the kind of bifurcation. While the former is associated with a first-order or discontinuous transition via a saddle-node/fold bifurcation aka critical transition in the nonlinear dynamics/ecological community, the latter occurs whenever the system undergoes a second-order or continuous transition via other forms of bifurcations (e.g. transcritical, pitchfork and Hopf bifurcations) [13]. Structural changes are envisioned in the system dynamics with variation in the control parameter as the bifurcation point is crossed. While both the catastrophic and the non-catastrophic transitions incur loss and need to be prevented, sudden shifts to undesirable states demand predictions and focused mitigation. Owing to such concerns, classifying the type of transition before the transitions occur is of significant importance across interdisciplinary fields [14–16].
Investigation of spatial statistical properties such as spatial autocorrelation function, spatial variance and other higher order moments of the state variables across space to forewarn transitions have been shown effective in both theoretical and empirical studies [11,17–22]. These indicators arise from the phenomenon of critical slowing down, where a local perturbation takes longer to recover when the system is in the vicinity of a critical point. As a consequence, nearby cells become increasingly similar to one other, thus leading to increased spatial autocorrelations. Furthermore, owing to slowed recovery, the system also exhibits stronger fluctuations, leading to increases in quantities such as spatial variance and higher moments. As the system approaches the tipping point, it takes longer to recover to the equilibrium point upon perturbation. This phenomenon is termed critical slowing down (CSD). Although this is a critical feature before transition, this phenomenon arises in both sudden and smooth transitions [23], on account of which the CSD-based generic early warning signals (EWS) fail to classify the type of a transition. Furthermore, stochasticity can interfere with the strength of the critical slowing down signals [24,25]. Therefore, there is a need to improve our existing toolboxes of EWS that can overcome these limitations.
With the development of modern tools for improved detection of transitions being obligatory, machine learning (ML) methods are the front-runners as they tackle complex data in an automated course of action. Furthermore, ML models are known to capture latent features and hidden patterns from raw data and have widespread utility in tasks involving the classification and regression of high-dimensional datasets. However, thus far, there has been a limited application of ML methods in the context of EWS [14,15]. These recent studies have developed deep learning-based models to forecast critical transitions from pre-transition time series data. Of note, these studies take a step ahead in discerning types of bifurcation in time series generated from mathematical models and empirical data. However, questions such as whether we can classify transitions from sequences of spatio-temporal patterns [26] and whether we can predict the distance from the tipping [27] are only recently addressed with room for further ameliorations.
Here, we aim to develop an ML-based EWS of transitions in spatial systems from spatio-temporal patterns, particularly overcoming the issues when sampling from raw data only without any preprocessing by implementing a novel optimal sampling strategy (OSS). Here, we propose a spatial EWS network (S-EWSNet) composed of time-distributed convolutional neural network (CNN) and long- and short-term memory (LSTM) sub-modules. While it is apparently unclear whether the ML model learns from densities or other system-specific patterns, it is important to ensure this is not the case. With evidence that density gradients across labels (transition classes) are an intruding feature preventing the model from capturing the essential features but a change in density, we implement a novel optimal sampling strategy, namely OSS. This sampling technique for input sequences shall ensure the generality of the S-EWSNet while compelling the model to learn the characteristic features delineating the respective transition types. Furthermore, to account for the robustness of S-EWSNet, we consider simulated data from a different origin than training data, alongside testing on a few available empirical data. With minor data preprocessing and no presumptions on the underlying system, S-EWSNet is an application of ML with the ability to classify diverse bifurcation-induced transitions in real data across cross-disciplinary fields.
2. Models and methods
2.1. Spatially explicit models and data generation
Below, we discuss the details of two spatial models exhibiting sudden and smooth transitions. One of the spatial models is deployed for training (hereafter termed the ‘training model’), and the other one is used for testing (termed the ‘testing model’) the ML model. Data corresponding to two labels: ‘sudden transition’ and ‘smooth transition’, are generated from each spatial model.
The dataset for training the deep learning model is generated using a cellular automata model [17,22] exhibiting smooth (figure 1a ) and sudden (figure 1b ) transitions depending on the strength of positive feedback with variation in driver parameter . The dynamics of the training model can be well explained by the below set of birth–death processes,
Figure 1.
Catastrophic (sudden) and non-catastrophic (smooth) transitions in the training and testing models: Spatial mean density plotted against gradual change in the bifurcation parameter, exhibiting (a) smooth (q = 0.7) and (b) sudden transitions (q = 0.8) used for training, and (c) smooth (f = 0.8) and (d) sudden (f = 0.1 ) transitions used for testing S-EWSNet. Spatial patterns are plotted above respective transition scenarios. Red circles indicate the locations of spatial patterns along gradients of the bifurcation parameter from left to right. Changes in spatial patterns are observed along the transition/bifurcation gradient.
| (2.1) |
where and are the possible entries in a cell and imply an unoccupied and an occupied cell, depending on the probabilistic update rule for states of the system. Entries in each randomly chosen grid cell are updated with a probability of local establishment and considering the influence of local positive feedback using a parameter . The parameter enhances the probability of birth and death depending on whether the neighbouring cells are occupied or unoccupied, respectively, and the change in value consequently determines whether the system undergoes a sudden ( ) or a smooth transition ( ). We consider a two-dimensional lattice of grid for simulation. Further details of the cellular automata model are presented in electronic supplementary material, appendix, S1 and the algorithm used for updating cells in the two-dimensional lattice is summarized in electronic supplementary material, appendix, algorithm A1 [22].
For testing the generalizability of the deep learning model, we consider the local facilitation model [9]. Data from this testing model are generated from stochastic simulations the same manner as the training model using algorithm A1 (see electronic supplementary material, appendix) and exhibit both types of transition (see figure 1c,d ) for different local facilitation rate ( ). The above model is representative of an arid ecosystem and contains three possible states (occupied, degraded and unoccupied). For our purpose, we map occupied cells as and both degraded and unoccupied as . The transition probability from one state to the other for this model is as follows:
| (2.2) |
where denotes the probability of colonizing an unoccupied cell, is the probability of regeneration of a degraded cell, represents the probability of mortality of an occupied cell and is the probability of degradation of an unoccupied cell. is the fraction of globally dispersed seeds, is the abundance of vegetated state and is the probability of finding the neighbour of a cell in a th state ( ). is the intensity of environmental deterioration, is the net effect of intrinsic seed production and competition owing to global density, is the probability of regeneration of a cell lacking any neighbouring occupied cell, is the facilitation rate, is the mortality probability of an occupied cell, and denotes the degradation probability of an unoccupied cell. For spatial simulations of both the models, we consider isotropic lattice, that is, no particular direction is followed to cover all the grids of the lattice. Ground truth labels (or the type of transition) are assigned to the data for the considered parameter regimes by referring to previous literature [9,22].
For the data generation, corresponding to the third label ‘no transition’ from both the training and testing models, we sample the sequences of data at different fixed values of the bifurcation parameter. However, the average density is kept similar to the data corresponding to the other two labels to persuade S-EWSNet to learn more complex features, ignoring the range of densities as an attribute to distinguish the transitions. Spatial bootstrapping, which samples data with replacement randomly so that any correlations in time or space are removed can also be used for generating samples corresponding to the no transition label from raw snapshots. We use an equivalent number of samples corresponding to each label for training the deep learning model.
2.2. Data preprocessing to ensure generality
Conducting preliminary experiments shows that the classes of sudden and smooth transitions are mostly distinguishable just by using the first and second differences in the densities of the snapshots to the point that they are linearly separable (see figure 2). This is owing to the fact that the snapshots are sampled uniformly in time, and sudden shifts where the changes are discontinuous would have larger first and second derivatives near the tipping point. Using these features for early predictions assumes that the driver/bifurcation parameter changes linearly with time, which may not be the case in the real world. The abrupt change of states in the case of sudden transitions also causes the sequences to contain mostly the initial stable state if sampled for a linear increase in the control parameter. This creates another challenge since the stable states far away from the tipping contain less information about the upcoming transition. Such sequences are almost indistinguishable between the classes. The former issue will cause an ML model to learn system-specific feature values, while the latter will lead it to underperform. These issues need to be remedied to ensure that features related to the bifurcation types are captured by the model. Methods like detrending the data or obtaining residuals after smoothing using various smoothing filters may be useful methods for preprocessing data from continuous partial differential equations, but are likely to be associated with manual interventions and preprocessing errors analogous to the temporal counterpart. However, if the underlying data are discrete (binary as in our case), it does not work. This demands the need for a sampling strategy that shall overcome all the aforementioned issues while being computationally efficient. Furthermore, the ML model trained over an optimally sampled training set can be applied to sequences from different provenances.
Figure 2.

Separation of the transition class labels using first and second differences in densities: sudden (catastrophic) and smooth (non-catastrophic) transition classes are linearly separable using first and second differences in densities of sequences of snapshots. Snapshots are sampled uniformly in time or linearly across control parameters, adding to easier identification and lack of generalizability.
2.3. Optimal sampling strategy
Both the issues, sampling data far away from a tipping point and linear separability of transition types from trends in first- and second-order differences, mentioned in the previous section, are solved by adopting our optimal sampling technique, termed OSS. With this technique, the sampling must be such that it prevents any information about the control parameter from leaking into the input sequences, which the ML model would otherwise use to distinguish between the classes. Here, we address the above issues by sampling snapshots on the densities rather than the control parameter. The generated snapshots (images) are sorted into buckets based on the density of the snapshot. The input sequences are generated by sampling one snapshot from each bucket. Now the sequence has no information about the control parameter apart from how the spatial patterns evolved overdensities (see figure 3 and the flowchart in figure 4). However, following this OSS, one must generate the sequences before adding them to the bin. We ensure sufficient snapshots in each bin by using differential sampling on the control parameter where a finer resolution is chosen near the tipping point than further away from it. Thus, the OSS automatically prevents the model from learning from differences in densities across class labels, as sequences of snapshots corresponding to each class label now have similar differences in densities. This also addresses the second issue mentioned in the above section, allowing snapshots closer to the tipping to be included in the input sequence. This is essential as changes in the system undergoing a transition are more prominent closer to the tipping, particularly for systems undergoing sudden or critical transitions. The algorithm for sampling input sequences is as follows:
Figure 3.
Example sequence of patterns sampled using OSS: sequence of pre-transition patterns obtained along an increase in bifurcation parameter for sudden (upper panel) and smooth (lower panel) transitions in the training model.
Figure 4.
S-EWSNet architecture and overall model workflow: schematic diagram for S-EWSNet composed of CNN and LSTM layers and a final output layer to classify a transition type from input sequences of pre-processed data (a). The flowchart shows all the steps for the classification of transitions by S-EWSNet. Sequences of snapshots are sampled corresponding to the three labels (no transition, smooth transition and sudden transition) and are then adaptively resampled using OSS and passed through convolution blocks and LSTM layers. The weights from the trained model, S-EWSNet, now return the prediction probability corresponding to classified labels for any test instance (b).
As evident from our analysis in the previous section, raw spatial snapshots considered for training the ML model will overfit and can hamper the generalizability of the model. In addition to the OSS (see algorithm 1) to tackle this issue, we add another check by sampling the lower frequency from the Fourier transform of the raw snapshots. While it is beyond the scope to apprehend the decision of the ML-based early warning indicator, this additional step of employing the Fourier transform is intended to enable the ML model to learn only from the necessary information and bypass density-related features. Carpenter and Brock [28] and Kefi et al. [11] have previously confirmed the efficiency of discrete Fourier transform in deriving indicators showing trends before bifurcation-induced transitions. A peak at the lower frequencies is seen in the case of these bifurcations. Thereby, we clip the Fourier transform of each snapshot in the input sequence from a size of to around the lower frequency components to obtain the centre peak as the input to the model. The intuition behind this step is to remove the system-specific high-frequency data that might mislead the ML model while learning attributes specific to the model and not bifurcations.
2.4. Deep learning model: S-EWSNet
S-EWSNet in figure 4 is built on a CNN-LSTM) architecture. A CNN [29] encoder is time-distributed, consisting of stacked convolutional blocks, each composed of convolutional, batch normalization and rectified linear unit (ReLU) activation layers. The resultant operation after one stacked convolutional block appears as follows:
where is the convolutional operator, BN denotes batch normalization and ReLU is the rectified linear unit activation function. To make S-EWSNet invariant to the input dimension, we apply a max-pooling operation, and this is followed by a dropout layer, an additional check to avoid overfitting. The final output from the CNN is obtained after passing through fully connected layers, which allow learning combinations of all features from the previous layer followed by a dense layer. The output from the CNN is then fed into a LSTM [30] layer, which then feeds into the output dense layer. This is followed by a softmax activation to return the output as a classification label. LSTM is a recurrent neural network found effective in learning trends over long input data sequences. The LSTM is composed of the forget gate ( ), parametrized by , which decides the information to be deleted from the cell state ( ) on obtaining the input ( ) at time and can be defined as follows:
where is the Sigmoid activation function and is the dot product operation. The input gate ( ), parametrized by ( ), determines the information that should be added to the cell state and is defined as
The cell state is obtained by using both and in the following manner:
| (2.3) |
where parametrizes the intermediate cell state and is the Hadamard product. The hidden state and output gate (parametrized by ) of the LSTM are defined as
| (2.4) |
| (2.5) |
S-EWSNet comprises stacked convolutional blocks feeding into an LSTM block with 256 hidden units (see figure 4 for more details).
As the input is made up of complex numbers from the Fourier transform, there are two channels for each pixel in the spatial data: namely, the magnitude and the angle of the complex number. A time-distributed CNN allows us to pre-process the input sequence before actually passing it to the LSTM cells. LSTM cells cannot directly process the input matrix. For processing the matrix, we use convolutional layers, and a network of these layers is applied to each matrix in the input sequence. Next, the intermediate results are fed to the LSTM layers, followed by dense layers that finally return the classified labels corresponding to the input matrices pertaining to sequences of snapshots. Using the time-distributed layer, each input matrix gets processed independently, and the data are finally processed as a sequence from the LSTM and dense layers. The input to S-EWSNet is the sequence of clipped Fourier transform data generated from a sequence of pre-transition spatio-temporal data sampled uniformly on the average density of the snapshots from the training model using the above-mentioned algorithms. In the end, the model outputs labels corresponding to the ‘sudden transition’, ‘smooth transition’ and ‘no transition’ classes on passing sequences of snapshots.
3. Results
3.1. Detecting transitions using S-EWSNet
Guided by the efficiency of deep neural networks in a wide range of complex classification tasks, we investigate the results obtained after training S-EWSNet (CNN-LSTM deep neural network) on data generated using OSS. The deep neural network S-EWSNet was trained using the clipped Fourier transforms of sequences of snapshots sampled from the training model, equation (2.1). The sampling method ensures that in each iteration, a new sequence of snapshots is generated, allowing us to validate the model robustness on data generated from the training model. We test on instances, each being a sequence of length five starting from the highest density, that is, high value ( ). We run the model on this sequence and then delete the first snapshot and add another snapshot of lower density to the end of the sequence. We keep on repeating this process till the tipping point is reached (the mean vegetation cover drops to 0 for the first time; this sample is excluded from the input sequence). The confidence values from S-EWSNet work as an EWS of critical transitions, showing an increasing trend in the prediction probability prior to the transition. The model also discerns such transition from smooth transition or no transition. While testing, the ML model exhibits good results when a minimum of five snapshots are available. The S-EWSNet can classify the type of transition well before the actual point of transition is reached, as observed in figure 5.
Figure 5.
Trends in S-EWSNet indicator on test instances: Probability signals as obtained from S-EWSNet for simulated data corresponding to both transition (sudden and smooth) labels from the (a) and (d) training model (test instances obtained from equation (2.1) but are different to that of training samples), (b) and (e) testing model equation (2.2), and (c) and (f) empirical samples from Savanna ecosystem. In all the instances, we obtain the prediction probability for the type of transition or no transition. We observe that the dominant probability signal is obtained for the correct transition type. The red dashed curve represents the mean density of the snapshots along the bifurcation gradient. The vertical grey dashed line in each sub-figure marks the region after which the correct signal is dominant throughout. Clearly, in all the instances, the dominant probability is obtained for the respective transition type.
We further test S-EWSNet on data generated from the testing model, equation (2.2). The S-EWSNet showed a positive correlation with the expected results. Figure 5c,d highlights the model performance for both the transition labels. For the initial part of the pre-transition data, the S-EWSNet confuses between the transition types as evident from the fluctuations in the prediction probabilities corresponding to the different labels/transition types. However, approaching closer to the bifurcation point, the predictability of S-EWSNet improves, and it signals the type of transition with higher prediction probability. In this model, densities are distributed over a shorter breadth, so to get a sequence of five snapshots on a longer range of the parameter is covered. This is an instance where the data are automatically sampled well before the tipping point compared with that for the training set. Nonetheless, we obtain correct predictions a priori for both out-of-distribution samples (different from training data) representing catastrophic, non-catastrophic and no transitions (see figure 5c,d and electronic supplementary material, figure S2.1 and appendix, S2), indicating the generalizability of S-EWSNet.
3.2. Detecting sudden transitions in empirical data using S-EWSNet
We test the robustness of S-EWSNet on available empirical data that we have access to. These data are a structural vegetation map of the Serengeti ecosystem [31] exhibiting sudden/critical transition, and the data portray the relative influences of landscape factors on the spatial heterogeneity of vegetation in the ecosystem. We show the results for Transect-2 and Transect-4 from the Serengeti ecosystem data to test the generality of our model. We particularly pick these two instances of empirical data to ensure our model results remain unaffected with reduced data length. Here, Transect-2 has a smaller number of snapshots (less than six), while Transect-4 has a higher data length prior to the transition. More details of the datasets are available in Eby et al. [17]. We have scaled the data to fit our model’s input size. In doing so, we first convert the binary-valued data by considering only positive values in the input stream. Next, with the obtained snapshots with different densities, we take into account the Fourier transform for each of the snapshots. The results obtained on testing S-EWSNet with empirical data are consistent with the expected results, and the ML model successfully detects and classifies the critical transition in the data prior to its occurrence. Figure 5e,f depicts the outputs of the S-EWSNet for different instances from this dataset. The results for two other transects that showed critical transition and were publicly available to us are presented in electronic supplementary material, figure S2.2 and appendix, S2). The S-EWSNet correctly predicts critical transition in both instances.
3.3. Robustness of trends obtained using S-EWSNet
We test the reliability of S-EWSNet on a larger ensemble of both in-sample (test samples different from training but generated from the same underlying training model) data and out-of-sample (test samples generated from the testing model) data. We envision the overall predictive performance of S-EWSNet on both sets of instances using receiver operating characteristic (ROC) curves, which is a measure of the trade-off between the true positive rate (TPR) and false positive rate (FPR) of the trained model. True positive rate is the ratio of true positives to the sum of true positives and false negatives. Analogously, FPR is the fraction of false positives to the sum of false positives and true negatives. The ROC curve and the corresponding area under the curve (AUC) quantify the predictability of the classification model plotted at different classification thresholds. A higher AUC indicates a higher accuracy of the model in correctly classifying the corresponding classes. We compute the one-versus-rest ROC on samples (sequence of snapshots) for each class (sudden, smooth and no transition), treating the required class as positive and the rest as negative. In figure 6a–c , we plot the ROC for each class corresponding to the training model. We observe high specificity and sensitivity for each of the classes, though the AUC is higher for no transition followed by the other classes. This indicates that a transition will always be signalled correctly, though a level of uncertainty remains in classifying the transition levels. The ROC curves for the out-of-sample data are shown in figure 6d–f . We observe similar trends as in figure 6a–c , indicating that the trained S-EWSNet is generalizable to out-of-distribution data with similar characteristic behaviour. The overall high AUC indicates reduced chances of false signals when forecasting and classifying transitions using S-EWSNet. The confusion matrices are plotted, and the metrics to evaluate the overall performance of the S-EWSNet on both the training and testing model are reported in electronic supplementary material, figure S3.1, table S3.1 and appendix, S3). Furthermore, to investigate the precedence of sampling using OSS over naive sampling, we plot the ROC curves on the raw snapshots for both the training and testing models for the same set of samples (see red curves in figure 6a–f ). We observe that the model’s performance on test samples from the training data using naive sampling is comparable to that of the model when trained on data generated using OSS. However, applying the OSS considerably improves the performance of test data from a different model.
Figure 6.
Performance of S-EWSNet on ensemble data generated from training and testing models: ROC curves exhibit the performance of S-EWSNet in predicting the three classes of transition (sudden (CT), smooth (ST) and no transition (NT)) on (a)–(c) training, and (d)–(f) testing models. The AUC estimates the goodness of the model. Higher AUC represents better performance. The black-dashed line represents the chance line where predictions are random and occur owing to chance (AUC = 0.5).
4. Conclusion
The impacts of critical transitions to a contrasting state are immense. Its distinction from other classes (smooth transition and no transition) is significant yet challenging. Recent research in anticipating critical transitions in temporal systems using deep learning approaches has obtained favourable outcomes [14,15], and this undoubtedly motivates the search for a deep learning-based indicator of spatio-temporal transitions. While predictions at a temporal scale are agreeable and have proven effective, there are instances where units within systems interact with their neighbours at a spatial scale. Analysing only temporal sequences may be futile in such instances, such as a change in climatic variables [32,33], cancer progression [2,3], vegetation density under grazing pressure [34,35], etc. The advent of deep learning is a bliss to the scientific community intrigued in detecting sudden transitions, waiting to be exploited further. Only a recent study by Dylewsky et al. [26] has developed a deep learning-based spatial indicator of climate tippings.
Here, we have developed a deep learning-based spatial indicator of critical transition, S-EWSNet by employing a novel sampling strategy (OSS) that sets it apart. While OSS is one novel approach to prevent the model from learning trends in global density change to classify transitions, building a training set that includes nonlinear driving can also suffice. However, the choice of nonlinearity could be ample; one has to identify the requisite nonlinear driving to obtain an optimal training set suited for data of varied origins. Having said that, OSS in the present framework serves our purpose of preventing overfitting and increasing the generalizability of S-EWSNet. An immediate question that arises is if OSS could provide trends for an abrupt transition, which may be preceded by a long period of stable dynamics indistinguishable from the no-transition class, which may wash out the relevant EWS information, or if one should include data that have long transients during training instead. During training, if we allow long transients in our data sampling equidistantly, and further apply max pooling, the model will miss out on distinguishable features particular to the transition time that are often present closer to the respective bifurcation, and further downsampling performed owing to max pooling may interpret the transition type incorrectly in a lot of instances as observed. On the contrary, the algorithm of OSS can overcome this issue by forcing the model to learn from the intricate features but the global density patterns. Given the model learns characteristic features particular to a transition type during training, it is able to detect transitions in test samples that may have long and short transients. As evident from our results, S-EWSNet provides an early warning indicator of critical transition and simultaneously can also discern it from other transitions as well as no transition type in out-of-sample simulated and empirical data. Instead of passing the unfiltered data directly to the model, we provide as input to S-EWSNet—clipped Fourier transforms around the lower frequency component corresponding to each snapshot along the environmental gradient. This leverages S-EWSNet from the bias-variance trade-off and overfitting of the model to the training data, which occurs if trained with sequences of raw snapshots as obtained in our preliminary experiments and adds to the generality. This novel approach of data preprocessing ensures the generality of S-EWSNet while allowing S-EWSNet to learn the attributes requisite for correctly classifying transitions and their applicability to a broad range of spatio-temporal systems. The predictions by S-EWSNet for both the simulated and empirical data agree with the ground truth labels.
Although we are limited by the lack of ample real data, we report the effectiveness of S-EWSNet based upon its reliable predictions on data obtained after stochastic simulations of a model of different origin to that of training. While we train S-EWSNet on a local positive feedback system, we test it on a system exhibiting local facilitation with explicit generating equations. Albeit we require preprocessing the data by calculating Fourier transforms, they do not interfere with the computational efficiency but rather add to the novelty and practicality of our proposed method. Computations are inexpensive and may be performed using available packages in different programming languages. Thus, S-EWSNet in its present form is an advanced deep neural network deployed as an indicator of transitions that invariably has scope for further fine-tuning suited to one’s purpose. The utility of S-EWSNet may be envisioned better with validation on more real spatial data exhibiting such transitions. It also opens up the possibility of real-time tracking of spatial climate data and ecosystem variables, spatial patterns of which carry necessary information that will aid in inferring projected risk and formulation of mitigation policies concerning such risks. Albeit the current work is geared towards the cellular-automata systems, in the future, the approach can easily be extended to other types of spatial systems manifesting different types of regular or irregular patterns [36–39].
Acknowledgements
S.D. acknowledges the Ministry of Education (MoE), Govt. of India for Prime Minister’s Research Fellowship (PMRF).
Contributor Information
Smita Deb, Email: smita.19maz0004@iitrpr.ac.in.
Ekansh Mahendru, Email: ekanshmahendru@gmail.com.
Paras Goyal, Email: parasgoyal12@gmail.com.
Vishwesha Guttal, Email: vishwesha.guttal@gmail.com.
Partha Sharathi Dutta, Email: parthasharathi@iitrpr.ac.in.
Narayanan C. Krishnan, Email: ckn@iitpkd.ac.in.
Ethics
This work did not require ethical approval from a human subject or animal welfare committee.
Data accessibility
Codes and data are available in a Github repository [40] and in a Zenodo repository [41].
Supplementary material is available online [42].
Declaration of AI use
We have not used AI-assisted technologies in creating this article.
Authors’ contributions
S.D.: conceptualization, data curation, formal analysis, investigation, methodology, software, validation, visualization, writing—original draft, writing—review and editing; E.M.: conceptualization, data curation, formal analysis, investigation, methodology, software, validation, visualization, writing—original draft; P.G.: conceptualization, data curation, formal analysis, investigation, methodology, software, validation, visualization, writing—original draft; V.G.: conceptualization, methodology, resources, validation, visualization, writing—original draft, writing—review and editing; P.S.D.: conceptualization, funding acquisition, methodology, resources, supervision, validation, visualization, writing—original draft, writing—review and editing; N.C.K.: conceptualization, methodology, resources, software, supervision, validation, visualization, writing—original draft, writing—review and editing.
All authors gave final approval for publication and agreed to be held accountable for the work performed therein.
Conflict of interest declaration
We declare we have no competing interests.
Funding
This work is partially supported by the Science and Engineering Research Board (SERB), Government of India (grant no. CRG/2022/002788).
References
- 1. Scheffer M. 2020. Critical transitions in nature and society. vol. 16. Princeton, NJ: Princeton University Press. ( 10.2307/j.ctv173f1g1) [DOI] [Google Scholar]
- 2. Deb S, Bhandary S, Sinha SK, Jolly MK, Dutta PS. 2022. Identifying critical transitions in complex diseases. J. Biosci. 47 , 1–16. ( 10.1007/s12038-022-00258-7) [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3. Ma Z, Luo Y, Zeng C, Zheng B. 2022. Spatiotemporal diffusion as early warning signal for critical transitions in spatial tumor-immune system with stochasticity. Phys. Rev. Res. 4 , 023039. ( 10.1103/PhysRevResearch.4.023039) [DOI] [Google Scholar]
- 4. Sarkar S, Sinha SK, Levine H, Jolly MK, Dutta PS. 2019. Anticipating critical transitions in epithelial–hybrid-mesenchymal cell-fate determination. Proc. Natl Acad. Sci. USA 116 , 26343–26352. ( 10.1073/pnas.1913773116) [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5. Barnosky AD, et al. 2012. Approaching a state shift in Earth’s biosphere. Nature New Biol. 486 , 52–58. ( 10.1038/nature11018) [DOI] [PubMed] [Google Scholar]
- 6. Lenton TM, Held H, Kriegler E, Hall JW, Lucht W, Rahmstorf S, Schellnhuber HJ. 2008. Tipping elements in the Earth’s climate system. Proc. Natl Acad. Sci. USA 105 , 1786–1793. ( 10.1073/pnas.0705414105) [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7. Cline TJ, Seekell DA, Carpenter SR, Pace ML, Hodgson JR, Kitchell JF, Weidel BC. 2014. Early warnings of regime shifts: evaluation of spatial indicators from a whole‐ecosystem experiment. Ecosphere 5 , 1–13. ( 10.1890/ES13-00398.1) [DOI] [PubMed] [Google Scholar]
- 8. Ratajczak Z, Nippert JB. 2012. Comment on 'Global resilience of tropical forest and savanna to critical transitions'. Science 336 , 541. ( 10.1126/science.1219346) [DOI] [PubMed] [Google Scholar]
- 9. Kéfi S, Rietkerk M, van Baalen M, Loreau M. 2007. Local facilitation, bistability and transitions in arid ecosystems. Theor. Popul. Biol. 71 , 367–379. ( 10.1016/j.tpb.2006.09.003) [DOI] [PubMed] [Google Scholar]
- 10. Kramer MA, et al. 2012. Human seizures self-terminate across spatial scales via a critical transition. Proc. Natl Acad. Sci. USA 109 , 21116–21121. ( 10.1073/pnas.1210047110) [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11. Kéfi S, et al. 2014. Early warning signals of ecological transitions: methods for spatial patterns. PLoS ONE 9 , e92097. ( 10.1371/journal.pone.0092097) [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12. Toko K, Yamafuji K. 1990. Bifurcation characteristics and spatial patterns in an integro-differential equation. Phys. D Nonlinear Phenom. 44 , 459–470. ( 10.1016/0167-2789(90)90158-L) [DOI] [Google Scholar]
- 13. Strogatz SH. 1994. Nonlinear Dynamics and chaos: with applications to physics, biology, chemistry, and engineering. Reading, MA: Perseus Books. [Google Scholar]
- 14. Bury TM, Sujith RI, Pavithran I, Scheffer M, Lenton TM, Anand M, Bauch CT. 2021. Deep learning for early warning signals of tipping points. Proc. Natl Acad. Sci. USA 118 , e2106140118. ( 10.1073/pnas.2106140118) [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15. Deb S, Sidheekh S, Clements CF, Krishnan NC, Dutta PS. 2022. Machine learning methods trained on simple models can predict critical transitions in complex natural systems. R. Soc. Open Sci. 9 , 211475. ( 10.1098/rsos.211475) [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16. Grziwotz F, et al. 2023. Anticipating the occurrence and type of critical transitions. Sci. Adv. 9 , eabq4558. ( 10.1126/sciadv.abq4558) [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17. Eby S, Agrawal A, Majumder S, Dobson AP, Guttal V. 2017. Alternative stable states and spatial indicators of critical slowing down along a spatial gradient in a savanna ecosystem. Global Ecol. Biogeogr. 26 , 638–649. ( 10.1111/geb.12570) [DOI] [Google Scholar]
- 18. Génin A, Majumder S, Sankaran S, Danet A, Guttal V, Schneider FD, Kéfi S. 2018. Monitoring ecosystem degradation using spatial data and the R package spatialwarnings. Methods Ecol. Evol. 9 , 2067–2075. ( 10.1111/2041-210X.13058) [DOI] [Google Scholar]
- 19. Guttal V, Jayaprakash C. 2009. Spatial variance and spatial skewness: leading indicators of regime shifts in spatial ecological systems. Theor. Ecol. 2 , 3–12. ( 10.1007/s12080-008-0033-1) [DOI] [Google Scholar]
- 20. Nijp JJ, Temme A, van Voorn GAK, Kooistra L, Hengeveld GM, Soons MB, Teuling AJ, Wallinga J. 2019. Spatial early warning signals for impending regime shifts: a practical framework for application in real-world landscapes. Glob. Chang. Biol. 25 , 1905–1921. ( 10.1111/gcb.14591) [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21. Phillips B, Anand M, Bauch CT. 2020. Spatial early warning signals of social and epidemiological tipping points in a coupled behaviour-disease network. Sci. Rep. 10 , 7611. ( 10.1038/s41598-020-63849-0) [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22. Sankaran S, Majumder S, Viswanathan A, Guttal V. 2019. Clustering and correlations: inferring resilience from spatial patterns in ecosystems. Methods Ecol. Evol. 10 , 2079–2089. ( 10.1111/2041-210X.13304) [DOI] [Google Scholar]
- 23. Kéfi S, Dakos V, Scheffer M, Van Nes EH, Rietkerk M. 2013. Early warning signals also precede non‐catastrophic transitions. Oikos 122 , 641–648. ( 10.1111/j.1600-0706.2012.20838.x) [DOI] [Google Scholar]
- 24. Chen N, Jayaprakash C, Yu K, Guttal V. 2018. Rising variability, not slowing down, as a leading indicator of a stochastically driven abrupt transition in a dryland ecosystem. Am. Nat. 191 , E1–E14. ( 10.1086/694821) [DOI] [PubMed] [Google Scholar]
- 25. Sharma Y, Abbott KC, Dutta PS, Gupta AK. 2015. Stochasticity and bistability in insect outbreak dynamics. Theor. Ecol. 8 , 163–174. ( 10.1007/s12080-014-0241-9) [DOI] [Google Scholar]
- 26. Dylewsky D, Lenton TM, Scheffer M, Bury TM, Fletcher CG, Anand M, Bauch CT. 2023. Universal early warning signals of phase transitions in climate systems. J. R. Soc. Interface 20 , 20220562. ( 10.1098/rsif.2022.0562) [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27. Zhang H, Wang Q, Zhang W, Havlin S, Gao J. 2022. Estimating comparable distances to tipping points across mutualistic systems by scaled recovery rates. Nat. Ecol. Evol. 6 , 1524–1536. ( 10.1038/s41559-022-01850-8) [DOI] [PubMed] [Google Scholar]
- 28. Carpenter SR, Brock WA. 2010. Early warnings of regime shifts in spatial dynamics using the discrete Fourier transform. Ecosphere 1 , 1–15. ( 10.1890/ES10-00016.1) [DOI] [Google Scholar]
- 29. Goodfellow I, Bengio Y, Courville A. 2016. Deep learning. Cambridge, MA: MIT Press. [Google Scholar]
- 30. Hochreiter S, Schmidhuber J. 1997. Long short-term memory. Neural Comput 9 , 1735–1780. ( 10.1162/neco.1997.9.8.1735) [DOI] [PubMed] [Google Scholar]
- 31. Reed DN, Anderson TM, Dempewolf J, Metzger K, Serneels S. 2009. The spatial distribution of vegetation types in the Serengeti ecosystem: the influence of rainfall and topographic relief on vegetation patch characteristics. J. Biogeo. 36 , 770–782. ( 10.1111/j.1365-2699.2008.02017.x) [DOI] [Google Scholar]
- 32. Mukhin D, Kondrashov D, Loskutov E, Gavrilov A, Feigin A, Ghil M. 2015. Predicting critical transitions in ENSO models. Part II: spatially dependent models. J. Climate 28 , 1962–1976. ( 10.1175/JCLI-D-14-00240.1) [DOI] [Google Scholar]
- 33. Rietkerk M, et al. 2011. Local ecosystem feedbacks and critical transitions in the climate. Ecological Complexity 8 , 223–228. ( 10.1016/j.ecocom.2011.03.001) [DOI] [Google Scholar]
- 34. Kéfi S, Rietkerk M, Alados CL, Pueyo Y, Papanastasis VP, ElAich A, de Ruiter PC. 2007. Spatial vegetation patterns and imminent desertification in Mediterranean arid ecosystems. Nature 449 , 213–217. ( 10.1038/nature06111) [DOI] [PubMed] [Google Scholar]
- 35. van de Koppel J, et al. 2002. Spatial heterogeneity and irreversible vegetation change in semiarid grazing systems. Am. Nat. 159 , 209–218. ( 10.1086/324791) [DOI] [PubMed] [Google Scholar]
- 36. Klausmeier CA. 1999. Regular and irregular patterns in semiarid vegetation. Science 284 , 1826–1828. ( 10.1126/science.284.5421.1826) [DOI] [PubMed] [Google Scholar]
- 37. Siero E, Siteur K, Doelman A, Koppel Jvd, Rietkerk M, Eppinga MB. 2019. Grazing away the resilience of patterned ecosystems. Am. Nat. 193 , 472–480. ( 10.1086/701669) [DOI] [PubMed] [Google Scholar]
- 38. Siteur K, Siero E, Eppinga MB, Rademacher JDM, Doelman A, Rietkerk M. 2014. Beyond Turing: the response of patterned ecosystems to environmental change. Ecol. Complexity 20 , 81–96. ( 10.1016/j.ecocom.2014.09.002) [DOI] [Google Scholar]
- 39. van der Stelt S, Doelman A, Hek G, Rademacher JDM. 2013. Rise and fall of periodic patterns for a generalized Klausmeier–Gray–Scott model. J. Nonlinear Sci. 23 , 39–95. ( 10.1007/s00332-012-9139-0) [DOI] [Google Scholar]
- 40. SMITA1996 . 2024. S-Ewsnet. GitHub. See https://github.com/SMITA1996/S-EWSNet.
- 41. SMITA1996 . 2024. Smita1996/S-Ewsnet: V1.0.2 (V1.0.2). Zenodo. ( 10.5281/zenodo.10949239) [DOI]
- 42. Deb S, Mahendru E, Goyal P, Guttal V, Dutta PS, Krishnan NC. 2024. Supplementary Material from: Optimal Sampling of Spatial Patterns Improves Deep Learning Based Early Warning Signals of Critical Transitions. FigShare ( 10.6084/m9.figshare.c.7214469) [DOI] [PMC free article] [PubMed]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
Codes and data are available in a Github repository [40] and in a Zenodo repository [41].
Supplementary material is available online [42].





