This requires the development of advanced risk management strategies that utilize state-of-the-art technologies. However, in this context, the data show a bias toward an imbalanced setting, where the incidence of wildfire events is significantly lower than typical situations. This imbalance, coupled with the inherent complexity of highdimensional spatio-temporal data, poses significant challenges for training deep learning architectures. Moreover, since precise wildfire predictions depend mainly on weather data, finding away to reduce computational costs to enable more frequent updates using the latest weather forecasts would be beneficial. This paper investigates how adopting a contrastive framework can address these challenges through enhanced latent representations for the patch’s dynamic features. We thus introduce anew morphology-based curriculum contrastive learning that mitigates issues associated with diverse regional characteristics and enables the use of smaller patch sizes without compromising performance.
An experimental analysis is performed to validate the effectiveness of the proposed modeling strategies. 1 Introduction
Wildfires have a tremendous impact on natural ecosystems and human health. They induce a loss of biodiversity, due to the destruction of plants, animals, and soil; they lead to an increase of hydrogeological risks, because of soil impermeabilization and reduced slope stability; and they cause elevated emissions of toxic substances that are harmful to humans. Climate change increases the probability of wildfires in regions where rising temperatures are paired with extended dry periods, such as the Mediterranean area; indeed, dry vegetation acts as fuel for wildfires, aiding their ignition and spread. In this context, it is crucial to devise novel and more effective risk management strategies, by taking advantage of state-ofthe-art technologies. In fact, the rise in average temperatures and the increase in the duration of hot seasons could reduce the effectiveness of existing wildfire protection programs and activities. Enhancing wildfire risk management requires accurate forecasting of the likelihood and the spread of wildfires. The most renowned and widely used one is the Canadian Fire Weather Index (FWI), which has been adopted since 2007 within the European Forest Fire
∗ Corresponding Authors: {fabrizio.loscudo, alessio.derango}@unical.it
Information System (EFFIS) network. The Canadian Index exploits two kinds of data, respectively populated by “dynamic” and “static” variables. The former category includes, for instance, wind speed/direction and air temperature, relative humidity, and precipitation: these variables change over time and are usually collected on an hourly scale and then summarized on a daily scale.
Instead, static variables report information on the morphology of the territory of interest, such as the elevation above sea level, the slope, the land exposure, and - hence - they are assumed to be constant in time. FWIbased forecasting systems, implemented at both continental and local scales, have demonstrated significant effectiveness in real-world applications. Recent research has focused on enhancing these systems’ quality and reliability, particularly by developing complex models that consider additional triggering factors. Consequently, deep learning models have emerged to predict wildfire risk indices, incorporating anthropic variables such as proximity to urban centers and roads.The most noticeable examples are the convolutional LSTM based approach of Kondylatos et al ., and 2D-3D CNN framework of Eddin et al .. Figure 1. Wildfire burnt areas, accoring to the datasets used in the experimentation and referring to the Greece and the southern Italy. This paper moves a further step in the direction of defining more accurate wildfire indices, by proposing a predictive approach based on the Contrastive Learning (CL) framework. Additionally, we also aim to reduce the computational cost associated with the forecast forecasting task. More specifically, our goal is to devise a supervised CL approach tailored to distinguish the severity of risks of the various geographical areas by suitably embedding such areas into the latent space: clusters of areas with similar kinds of wildfire risks should be drawn closer together, whereas areas exhibiting different behaviors should be driven apart. By employing a more principled method to design the internal structure of the latent space, we can acquire significant meaningful representations, even when the input information is reduced in size. Eventually, this will positively affect the total computational expense of the prediction by decreasing the number of necessary operations. However, in practice, implementing this approach poses several challenges in such a given application scenario, where similar risks emerge from areas that can be very different from each others in terms of their features. Indeed, moving from the empirical observation that a basic supervised CL approach is ineffective to reach the prefixed goals, we adopt an ad-hoc architecture and introduce a carefully designed sampling strategy that leverages the dynamics of morphologically similar regions. Specifically, we examine the impact of incorporating a contrastive term during model training: first, we apply the contrastive term in a fine-tuning phase following the main training; second, we assess the results when the complete training includes this additional regularization term. Subsequently, we suggest refining the label-based sampling approach by implementing a strategy that preserves morphological similarity among samples. We therefore propose two strategies, namely “historical-based” and “curriculum-based” samplings, to enhance the contrastive signal provided to the model during training.
This section provides a review of some relevant related works in this field and, in addition, it provides some background and references on Con strastive Learning, for it being a key ingredient of our architecture. 2.1 Predicting wildfire risk
The influence of diverse factors on the incidence of forest fires has been firstly investigated by Wu et al .. The work also compared the predictive performance of a multilayer perceptron (MLP) with that of logistic regression for wildfire prediction. In the same year, the research detailed in explored the impact of landscape topology—defined by the spatial distribution and interaction of various land-cover types—on fire ignition. This study introduced a deep learning model, Deep Fire Topology, which employs a convolutional neural network (CNN) to evaluate and predict the risk of wildfire ignition. Hout et al . subsequently conceptualized wildfire risk prediction as a scene classification challenge and employed U-Net architectures to anticipate wildfire propagation. A similar approach utilizing a U-Net++ model for global wildfire forecasting was presented by. In the realm of recurrent neural networks, Yoon and Voulgaris introduced a method leveraging a network with gated recurrent units (GRUs) to model historical data, complemented by a convolutional neural network (CNN) to predict wildfire probability maps over multiple temporal steps. Kondylatos et al . assessed various deep learning models, including long short-term memory (LSTM) and convolutional LSTM networks, demonstrating superior performance over traditional Fire Weather Index (FWI) methods in predicting next-day fire danger. Additionally, the study employed explainable AI techniques to analyze the critical influence of wetness-related variables. Recently, introduced a dual 2D-3D convolutional neural network (CNN) framework for predicting wildfire risks. The 2D CNN component processes static features, including digital elevation, slopes, road proximity, population density, and proximity to water bodies. In contrast, the 3D CNN component handles dynamic factors such as temperature, diurnal land surface temperatures, soil moisture levels, relative humidity, wind velocity, 2-meter air temperature, NDVI, atmospheric pressure, 2-meter dewpoint temperature, and precipitation totals. Furthermore, two adaptive normalization blocks, sensitive to local positioning, were integrated into the 3D CNN branch to adjust dynamic features using static features. Empirical evaluations on the FireCube and NDWS (Next Day Wildfire Spread) datasets revealed that this method surpassed traditional approaches such as random forest, XGBoost, LSTM, and convLSTM in performance. To the best of our knowledge, it also establishes anew state of the art on these datasets.
Consequently, we adopt this model as the foundational architecture and benchmark for our study. 2.2 Contrastive learning
Contrastive learning is commonly referred to loss functions originating from metric distance learning or triplet-based approaches. These functions are employed to enhance representation learning, usually within supervised settings where labels guide the selection of positive and negative pairs. The primary distinction between triplet losses and contrastive losses pertains to the number of positive and negative pairs associated with each data point; specifically, triplet losses engage exactly one positive and one negative pair for each anchor. When positive pairs are derived from the same class, selecting negative samples becomes more complex. Schroff et al . emphasized the necessity of meticulous negative mining to attain optimal performance. Self-supervised contrastive losses similarly employ a single positive pair for each anchor sample. These pairs are identified either through co-occurrence or data augmentation, while numerous negative pairs are associated with each anchor. Typically, these negatives are chosen randomly and uniformly, leveraging weak knowledge such as patches from disparate images or frames from randomly chosen videos. This method presumes a minimal likelihood of false negatives. In recent developments, Khosla et al . suggested incorporating multiple positives per anchor in addition to numerous negatives. This approach of using numerous positive and negative pairs for each anchor has enabled the authors to achieve state-of-the-art performance without the need for challenging hard negative mining, which can be difficult to fine-tune. In this regard, sampling good candidates plays a crucial role during training as documented in. Robinson et al . study how to sample good and informative negative examples for CL. They propose anew unsupervised method to select the hard-negative samples with user control. Jiang et al . propose a principled approach to strategically select unlabeled data from an external source, in order to learn generalizable, balanced and diverse representations for relevant classes. Lastly, the authors in introduce a curriculum CL framework that incrementally selects negative samples ranging from easy to challenging, using a score function to identify the hardness of the negatives. In our study, we maintain the use of multiple positive and negative samples for each anchor, and design two different sampling strategies on the labeled data. However, we differentiate our method by restricting the selection along the temporal dimension and the morphological similarity. As discussed in the following section, the historicalbased sampling solely uses temporally varied versions of the same patch as positive and negative samples. In contrast, the curriculumbased approach involves sampling patches with static features, such as morphology and trigger factors, that increasingly differ from those of the anchor patch. 3 Datasets description
We selected two datasets for our study. The first is the FireCube dataset which is intended for pixel-wise classification and documents wildfire events in Greece over a decade. To offer a detailed and current representation of wildfire occurrences, it integrates diverse data sources, including satellite imagery, meteorological data, and historical fire records. Daily updates ensure the dataset remains current, enhancing the accuracy and reliability of wildfire predictions and response strategies. FireCube thus constitutes a substantial advancement in wildfire research and management.
This dataset encompasses an area of 1253 km × 983 km in the Eastern Mediterranean. The key aim is to forecast wildfire occurrences exceeding 0 . 3 km in each cell for the subsequent day, within a binary classification framework where the positive class indicates fire occurrence. We utilized variables suggested by Kondylatos et al.. As discussed in Section 4, to address dataset imbalance, we applied a sampling method to achieve balance. Post-sampling, the dataset comprises 71471 training examples, 6430 validation cases, and 42820 test cases. Notably, 2021’s test data capture a significant fire season in Greece. The data samples can be accessed in. Figure 2 illustrates the distribution of data values across the two classes, focusing solely on the dynamic features of the balanced Greece dataset. The second dataset focuses on a specific region in southern Italy, namely Calabria, a peninsula of approximately 15 , 000 km with a predominantly north-south orientation and a coastline of about 800 km. The fire events were directly detected through field observations by the Carabinieri Forestale, the official police authority responsible for this task. Consequently, this dataset offers a significantly higher level of accuracy and detail. The dataset is derived from spatial interpolation of meteorological variables from station measurements provided by the Regional Monitoring Network. This dataset also has a higher spatial resolution, with a cell size of 100 meters, in contrast to the 1 km resolution of the FireCube dataset. To reduce the number of patches due to the higher resolution, a
Figure 2. Box plot of the dynamic features from the balanced version of the Greece dataset. fixed-size grid partitioning approach is employed to produce nonoverlapping patches. However, this method does not ensure that wildfire occurrences are centered within the patches, requiring the model to learn a more complex task in this new configuration. Thus, the Calabria dataset comprises a total of 23079 training samples, 3049 validation samples, and 6380 testing samples. Figure 3 illustrates the distribution of data values across the two classes of the balanced Calabria dataset. Figure 3.
Box plot of the dynamic features from the Calabria dataset. 4 Method
In this section, we describe our methodology for enhancing the accuracy of wildfire risk predictions. This improvement is accomplished by refining the latent representations produced by the model through a tailored CL strategy. Due to the high dimensionality and complexity of the data, a direct application of CL would be ineffective. Consequently, to manage the intricacies of multivariate spatio-temporal data, we introduce a two-stage approach. The first phase involves selecting a representative subset from the original dataset for training a deep neural network. In the second phase, the network is trained using supervised learning. The sampling strategy may either leverage the contrastive signal (via label or curriculum sampling) throughout training or divide training into two sub-phases: initial training on the full dataset without sampling, followed by fine-tuning with historical sampling. In either case, the CL methods aim to enhance the latent representations of the dynamic features to improve the accuracy and reliability of the prediction. We now formalize the data context and proceed to elaborate on each of the stages in detail. The conceptual framework represents the application scenario as a multivariate spatio-temporal data cube, structured with two spatial dimensions for geographical coverage and a third for sequential temporal observations. Each entry contains multiple feature values, with the overall region divided into smaller subdivisions, or patches, to define data granularity. A patch is defined as a discrete geographic area, spanning from a few hundred square meters to several kilometers. These patches are typically described by static and dynamic attributes. Formally, we can represent the data associated with a patch as a tuple x = ⟨v, t, w, h⟩, where v encapsulates the features (both static and dynamic), t represents the temporal dimension ranging from t = 0 to T, and wand h correspond to the spatial dimensions. After formalizing the patches, we propose two labeling strategies for binary classification. Using a sliding-window approach, the area is segmented into overlapping patches, where the labeling is determined by the central cell of each patch. Here, a positive label indicates that a wildfire will ignite at the center of the w × h area at time t + 1. Alternatively, using a grid-based, non-overlapping patch system, a positive label denotes any wildfire occurrence within the patch at time t + 1. While this method increases prediction complexity, it addresses high-resolution data issues and helps reduce computational
costs. Regardless of the labeling strategy, the dataset remains imbalanced, with fewer positive samples. Our initial methodology phase is designed to address this imbalance. 4.1 Phase One
In the initial stage, the primary step involves structuring the raw data into patches. The process of creating these patches is defined with the patch size parameter, which regulates the amount of contextual information each patch contains.
Employing larger patch sizes allows the model to capture more information, albeit at the risk of introducing more varied data, which might negatively impact the model’s performance while uselessly increasing the computational cost of the forecast. Following the creation and labeling of patches, it becomes necessary to select a subset of negative samples due to the inherent data imbalance. The number of negative samples should ideally match that of positive ones, though handling a slightly higher number remains feasible. Notably, significant discrepancies in feature values between samples of the two classes can simplify the classification task, as the model could learn to discriminate based on non-informative features unrelated to wildfire events. To mitigate this, a similarity-based subsampling method is advisable. Initially, an informative static feature, such as the Land Use Susceptibility Index, is selected as a proxy to evaluate the similarity between patches. Subsequently, an appropriate number of bins is determined for partitioning the negative samples. For each positive sample in the dataset, one or more negative samples are drawn from the bin corresponding to the specific feature value of the positive sample. This approach ensures the creation of a pseudo-balanced version of the original dataset. We notice that while a basic static feature is currently used as a proxy for measuring similarity, future methodologies could incorporate more advanced techniques, such as clustering methods based on embeddings generated by specialized neural networks. The final step in the initial phase addresses the temporal aspect of the data. The temporal parameter, denoted as t, defines the extent of historical information accessible to the model for making predictions. The optimal value of t can be determined through hyperparameter tuning, especially in response to the variability of certain features. Empirical evidence presented in indicates that incorpo
rating data from the preceding ten time steps yields satisfactory results. 4.2 Phase Two
In the second phase, a neural network of adequate size is trained on the updated version of the dataset generated in the first phase.
Conceptually, any chosen model should be capable of effectively managing the two types of features. For instance, Eddin et al. propose a dual-branch architecture that processes dynamic and static features independently while allowing static features to influence dynamic features through a normalization signal. In general, we can define any parametric function f θ that accepts as input the outputs of two distinct, yet potentially interrelated functions f θ [d] [and] [ f] θ [ s] [. These] functions map dynamic and static features to their respective latent spaces, resulting in latent vectors z d and z s . Depending on the complexity of the dataset, these representations might require varying degrees of additional non-linear transformations before computing the classification output. The predicted value ˆ y = f θ ( z d , z s ), where z d = f θ [d] [(] [x] [d] [)][ and] z s = f θ [s] [(] [x] [s] [)][, is calculated for the patch] [ x] [ =] [ ⟨][x] [d] [, x] [s] [⟩] [. This pre-] dicted value is subsequently used to train the entire model in a supervised manner, utilizing an appropriate objective function such as cross-entropy loss L CE ( y, ˆ y ), where y is the label assigned to the patch x . The purpose of CL is therefore to improve the informative value of dynamic feature representations, denoted as z d . Depending on the chosen sampling strategy we can either use the contrastive signal during the entire training (labels or curriculum sampling), or splitting the training into two parts and training on the full dataset without CL, then fine-tuning with historical sampling and CL. This differentiation is essential due to the significant reduction in data accessible for training caused by historical sampling, as we will discuss later. The emphasis on z d stems from the understanding that dynamic features are the primary source of information for the classification task. Consequently, improving the quality of their latent representations is likely to result in more accurate and reliable predictions. Additionally, since our approach operates within a supervised framework, we can leverage the label information of an anchor sample x [a]
to identify positive and negative samples, x [p] and x [n] respectively. This allows us to apply a suitable loss function, such as the triplet margin loss, as an auxiliary regularization term. This loss function is defined as follows:
LT L ( z d [a] [, z] d [p] [, z] d [n] [) =] E z d [p] [,z] d [n] [[max] [{][d] [(] [z] d [a] [, z] d [p] [)] [ −] [d] [(] [z] d [a] [, z] d [n] [) +] [ m,] [}] []]
In Eq., the latent representation z d [a] [=] [ f] θ [ d] [(] [x] [a] [)][ corresponds to] the anchor sample x [a], and z d [p] [=] [ f] θ [ d] [(] [x] [p] [)][ is derived by sampling] a positive instance x [p] ∼ P using x [a] ’s label information from the entire dataset. Here, P denotes the set of samples with the same label as x [a] .
A similar process is applied to obtain z d [n] [. The function] d ( z d [i] [, z] d [j] [) =] [ ||][z] d [i] [−] [z] d [j] [||] [p] [ is the chosen] [ p] [-norm, and] [ m] [ denotes a] predetermined margin. In our experiments, we also investigate a second constrastive term introduced in, named Supervised Contrastive Loss . Pursuing the same goal of the previous loss, it computes the pairwise similarities between all the latent projections in a batch, scaled by a temperature parameter to control the sharpness of the distribution. For each
1 Here, x d and x s refer to the sets of dynamic and static variables associated with the patch x sample, it identifies positive pairs (the other samples in the batch that share the same class label) and calculates the negative log-probability of these positive pairs relative to all other samples, excluding the anchor itself, to avoid trivial solutions. It can be defined as follows:
̸
L SCL =
B
̸
B �
i =1
̸
1
|P ( i ) |
̸
− exp( z [i] d [⊤] τ· z [j] d )
� log B
j∈P ( i ) z [i] d [⊤]
̸
�
̸
� B exp( τ z [i] d [⊤] τ· z [k] d )
k =1 , k = ̸ i
B �
̸
Either of the above approaches limit the variability among input features, allowing the model to learn smoother z d representations, as shown in Table 1 for the FireCube dataset and Table 5 in the Supplementary Material for the Calabria dataset. Those tables report the average normalized difference for dynamic features, calculated using triplet-based comparisons. For each anchor patch, we thus randomly select ten positive and ten negative samples using the labelbased sampling, while for the historical and curriculum sampling we create ten triplets, respectively, using pre-computed maps. ̸ The results show that, for higher-resolution features, the tighter constraints of historical and curriculum sampling produce the larger ratio between the mean distance between the dynamic features of the anchor and the negative samples and the anchor and the positive samples, δ ( x [a] d [, x] d [n] [)] [/δ] [(] [x] d [a] [, x] [p] d [)][. Those features should provide] more useful information than the lower ones for which the historical still maintains a high ratio in general, whereas the curriculum pays a small price due to the higher numerosity of the samples. The random label-based sampling reaches a good difference between the anchor and the negative samples, but shows a similar variability also between the anchor and the positive ones. Finally, our curriculum sampling shows the lowest difference on the anchor-positive pairs, but also reports the smallest difference among the comparisons between anchors and negative samples. We evaluate the proposed contrastive sampling strategies within two distinct training paradigms. In the first approach, CL is applied as a fine-tuning step after the model has been pre-trained on the full dataset. At this stage, the model has already learned discriminative features in the z d representations, primarily due to the diversity of negative samples in the balanced training set. The CL objective is then used to refine these representations using a more selectively curated dataset. In the second approach, the model is trained end-to-end with the contrastive objective from the outset. Further details are provided in Appendix B of the Supplementary Material. 5 Results
We conduct experiments on the training methodologies delineated in Section 4 with dual objectives. The primary objective is to evaluate the effectiveness of our sampling techniques in terms of classification accuracy, comparing it against various models and different CL sampling techniques.
The secondary aim is to examine the influence of the geographical area size on the quality of the predictions. In the CL framework, we evaluate four distinct configurations: the triplet-marginal loss approach Eq. using standard label-based sampling, alongside our historical and curriculum sampling methods, and the modern Supervised Contrastive Loss Eq. using labelbased sampling. We then examine two potential classification frameworks. In the first framework, we model the dynamics of the central cell within a specified area using all adjacent cells as sources of contextual information, the FireCube dataset. Conversely, in the second framework, we aim to model the dynamics of all points within the area, thus requiring the model to accommodate a more complex data distribution, the Calabria dataset. To evaluate the influence of contextual information on prediction accuracy, we conducted experiments using various patch sizes. Beginning with the 25 × 25 patch size as utilized in, we progressively decreased the dimensions to define three additional scenarios, maintaining fixed the center cell: 15 × 15, 5 × 5, and 1 × 1. For each specified patch size, all models were retrained from the initial state. In this study, the model LOAN introduced in serves as the reference baseline, modified slightly to fit smaller patch sizes. These architectural modifications are consistently employed across all models implementing CL methodologies. We also select two recent larger models that employ the selfattention mechanism to capture spatiotemporal dependencies. We perform a comparative analysis with recent transformer-based mod
̸
where Bis the batch size, P ( i ) the set of indices of all positive samples for the anchor sample i according to its label and τ the temperature parameter that controls the scaling of the similarities computed by the dot product. In our proposed sampling strategy, we opted for using a tripletloss, as it promises improved optimization of relative distances and higher discriminative capability by employing a margin. In general, contrastive loss functions on pairwise comparisons aiming to reduce the distance between an anchor and a positive example while increasing the distance between the anchor and a negative example. However, it does not rigorously ensure that the negative example is adequately distant from the anchor compared to the positive example. In contrast, triplet-loss engages with a triplet of samples and should guarantee that the distance between the anchor and the positive example is less than the distance between the anchor and the negative example by at least by a specified margin. The objective function used for the training is then defined as:
L CE ( y, ˆ y ) + γ ∗L CL ( z d [a] [, z] d [p] [, z] d [n] [)]
where L CE represents the binary cross-entropy, L CL is one between LT Land L SCL, and γ = |L CE |/|L CL | for |L CL | > 0, and 0 otherwise. This γ adequately scales the contribution of the contrastive term to match the magnitude of the primary target of the learning which is L CE . 4.3 Sampling strategies
The main complexity in implementing the CL approach in this context stems from the significant variation in dynamic features among patches sharing the same labels, attributable to inherent differences in the nature of the areas covered. Consequently, the model must reconcile these disparities within closely related latent representations. Experimental results indicate that this leads to the acquisition of noisier latent representations, thereby reducing the overall model performance. To mitigate this, we propose restricting the sampling following two distinct approaches: historical and curriculum sampling. The historical sampling limits the sampling to patches within the history of the anchor or its closest neighbors . It is worth to notice that, with this strategy, we are focusing solely on patches with positive events to construct historical sets, we thus significantly reduce the volume of data available for training. Without appropriate countermeasures, this reduction could negatively impact the training process and result in suboptimal performance. Thus, we also propose a curriculum-based strategy to sample patches according to their morphological similarity to the anchor. We use the term curriculum for this sampling strategy, since we progressively sample patches that are different from the anchor using a score function f score ( x [i] s [, x] [j] s [)] between the normalized version of x [i] s [and] [ x] [j] s [. The primary advantage] of employing similarity-based sampling lies in its ability to leverage the entire dataset for the construction of positive and negative sample pairs. Additional details in Appendix A of the Supplementary Material. 2 We had to include closest neighbors due to the scarcity of different versions of positive patches in the studied datasets. Table 1. Average Difference over Dynamic Features from the FireCube dataset computed using triplets chosen solely based on label data, triplets selected through our historical methodology, and finally through our curriculum methodology. Avg. Anchor-Positive Diff ( ↓ ) Avg. Anchor-Negative Diff ( ↑ ) ratio ( ↑ ) Feature Resolution Feature Name Label Historical Curriculum Label Historical Curriculum Label Hist.
Curr. NDVI 1 km 16 days 0.45 ± 1e-01 0.27 ± 8e-02 0.16 ± 8e-02 0.43 ± 1e-01 0.32 ± 8e-02 0.29 ± 9e-02 1.0 1.2 1.8 High -1Km LST Day 1km 0.42 ± 1e-01 0.32 ± 2e-01 0.27 ± 2e-01 0.54 ± 1e-01 0.55 ± 1e-01 0.40 ± 1e-01 1.3 1.7 1.5 LST Night 1km 0.43 ± 1e-01 0.35 ± 2e-01 0.21 ± 1e-01 0.54 ± 1e-01 0.53 ± 2e-01 0.39 ± 1e-01 1.3 1.5 1.8
Low -9Km
era5 max d2m 0.10 ± 5e-02 0.11 ± 9e-02 0.03 ± 2e-02 0.16 ± 6e-02 0.26 ± 1e-01 0.04 ± 2e-02 1.6 2.3 1.4
era5 max t2m 0.09 ± 5e-02 0.11 ± 9e-02 0.04 ± 3e-02 0.20 ± 7e-02 0.47 ± 1e-01 0.07 ± 3e-02 2.2 4.2 1.8
era5 max SP 0.21 ± 8e-02 0.20 ± 1e-01 0.02 ± 1e-02 0.23 ± 7e-02 0.21 ± 1e-01 0.03 ± 1e-02 1.1 1.1 1.8
era5 max TP 0.07 ± 6e-02 0.03 ± 5e-02 0.06 ± 6e-02 0.14 ± 9e-02 0.27 ± 2e-01 0.08 ± 7e-02 2.0 9.3 1.2 era5 max Wind Speed 0.21 ± 1e-01 0.16 ± 1e-01 0.09 ± 9e-02 0.21 ± 1e-01 0.16 ± 1e-01 0.15 ± 1e-01 1.0 1.0 1.7 era5 min RH 0.31 ± 1e-01 0.21 ± 1e-01 0.19 ± 1e-01 0.36 ± 1e-01 0.41 ± 2e-01 0.32 ± 2e-01 1.2 2.0 1.6
SMINX 0.31 ± 1e-01 0.15 ± 1e-01 0.27 ± 2e-01 0.47 ± 2e-01 0.49 ± 1e-01 0.39 ± 2e-01 1.5 3.2 1.5
els, namely TimeSformer and Video Swin Transformer 3D. These transformer models offer a distinct advantage over CNNbased model by reducing the reliance on strong inductive biases, allowing them to generalize better to diverse spatio-temporal dynamic patterns. However, this flexibility comes at a cost: transformers typically demand significantly higher computational resources for training compared to CNNs. The CNN model utilized, for instance, has approximately 414 k parameters, while TimeSformer has around 1 . 16 M, and the Swin Transformer is the most extensive with 1 . 8 M parameters. This trade-off between flexibility and computational efficiency is an important factor when considering transformer models for forecasting tasks, especially in resource-constrained environ ments. Experimental settings details. In accordance with the methodology presented by Eddin et al., our model training encompassed a total of 40 epochs, maintaining all architectural parameters and hyperparameters consistent with the original study. The sole modification in our contrastive learning (CL) approaches involved an increase in the learning rate from the initial 3 × 10 [−] to 3 × 10 [−] (according to our experimental findings, our attempts to increase the learning rate in the original configuration resulted in a diminished performance). As detailed in Section 4, this serves as a fine-tuning phase; thus, training with the CL term is initiated only after completing 30 epochs, followed by an additional 10 epochs. Using the triplet loss, for each batch item, regarded as an anchor, pairs of positive and negative samples are selected based on the information on the label. After experimental testing, we fix the margin value at 5 for our strategies and 20 for the traditional label-based approach; the related ablation study is reported in Table 9 in the Supplementary Material. To address the presence of negative samples in the label-based contrastive learning (CL) process, we limit the number of fine-tuning epochs to five. This approach ensures that each positive sample is encountered twice, similar to the historical contrastive sampling (CS) method: once as an anchor sample and once as a negative sample. In the conventional CL framework based on the triplet-loss, the entire dataset is leveraged. Our historical CL method follows an analogous training regime to the label-based CL strategy but uses a subset of the initial dataset. Initially, we select all positive examples from the dataset. For each patch, two sets of positive and negative samples, derived from the patch’s history, are constructed. During training, for each patch in the batch, positive and negative samples are randomly drawn from its historical data. Finally, we evaluate the newer supervised contrastive loss, as introduced in, as a substitute for the triplet loss. Unlike before, sampling is unnecessary; instead, every sample in the batch is used to calculate the contrastive loss. As for the historical case, the finetuning lasts for 10 epochs. In addition to our proposed approach, we perform a comparative analysis with recent transformer-based models, namely TimeSformer and Video Swin Transformer 3D. Both models leverage the self-attention mechanism to capture spatio-temporal dependencies within video data. The TimeSformer model utilizes divided space-time attention, enabling efficient modeling of long-range de
pendencies, while the Video Swin Transformer employs hierarchical attention mechanisms that improve feature extraction at multiple scales. These transformer models offer a distinct advantage over CNN-based model by reducing the reliance on strong inductive biases, allowing them to generalize better to diverse spatiotemporal dynamic patterns.
However, this flexibility comes at a cost: transformers typically demand significantly higher computational resources for training compared to CNNs. The CNN model utilized, for instance, has approximately 414 k parameters, while TimeSformer has around 1 . 16 M, and the Swin Transformer is the most extensive with 1 . 8 M parameters. This trade-off between flexibility and computational efficiency is an important factor when considering transformer models for forecasting tasks, especially in resourceconstrained environments. All experiments were carried out using a single node with 96 CPUs, 512 GB RAM, and an NVIDIA V100 GPU with 16 GB VRAM.
Access to the code to replicate experiments can be granted upon request for academic purposes. Greece Dataset. Table 2 displays the classification outcomes from the various models. For each patch size, we initially present outcomes from the transformer models alongside our baseline, LOAN. A pre-trained LOAN model is then fine-tuned using four separate contrastive methodologies: three using Eq. 1 and one that employs Eq. 2. The suffixes indicate the adopted training sampling strategies: LTL denotes label sampling with triplet loss, HTL represents historical sampling with triplet loss, and CTL curriculum sampling with triplet loss. SCL describes the model utilizing supervised contrastive loss. Finally, we present results for three of the four models trained across all epochs using the contrastive framework, as historical sampling is suboptimal in this context due to data constraints. The results substantiate the performance enhancements facilitated by the CL approach in four scenarios. They show a significant performance improvement in the CL method that employs curriculum sampling, especially when compared with other CL outcomes. Due to this specific sampling method, the model maintains its performance even with a reduced patch size of 5 × 5. This indicates that the necessary FLOPS can be reduced from 168 . 2 M to 7 . 8 M without impacting performance, or down to just 664 .
4 k with a minor performance decrease by adopting a patch size 1 × 1. As noted previously, we believe that the significant variability in dynamic features among same-class samples (within the context of CL) acts as a source of noise, hindering the model’s ability to learn discriminative latent representations. This is substantiated by the findings in Table 3, which present an analysis of the models’ latent spaces. We calculate the mean pairwise distance among normalized latent vectors from a subset of the original dataset . In the table, The Pos-Pos and Neg-Neg distances are denoted by the mean intra-class distance, while Pos-Neg distances are indicated by the mean interclass distance. We normalize the latent vectors before computing the distance. We also offer the ratio of inter-class to intra-class distances
3 This subset is obtained by collecting all positive samples from the test dataset and randomly selecting an equal amount of negative samples. Table 2. Aggregated results over the years 2020 and 2021 from the FireCube dataset are reported. Each value represents the mean performance across five independent trials. The best results are highlighted in bold . Class-wise performance details are provided in Appendix D of the Supplementary Material. PS Model Precision AUROC IoU F1
TimeSformer 0.90 ± 2e-02 0.95 ± 2e-03 0.82 ± 5e-03 0.90 ± 3e-03
SwinTransformer3D 0.89 ± 2e-02 0.95 ± 4e-03 0.80 ± 8e-03 0.89 ± 5e-03 LOAN (Baseline) 0.90 ± 5e-02 0.95 ± 1e-03 0.81 ± 1e-02 0.89 ± 7e-03
LOAN+ LTL - ft 0.91 ± 4e-02 0.97 ± 2e-03 0.83 ± 1e-02 0.91 ± 8e-03 LOAN+ SCL - ft 0.90 ± 5e-02 0.95 ± 2e-03 0.81 ± 2e-02 0.90 ± 1e-02 LOAN+ HTL - ft (Ours) 0.90 ± 1e-02 0.96 ± 8e-04 0.82 ± 5e-03 0.90 ± 3e-03 LOAN+ CTL - ft (Ours) 0.93 ± 1e-02 0.98 ± 2e-03 0.87 ± 5e-03 0.93 ± 3e-03
LOAN+ LTL - full 0.91 ± 2e-02 0.97 ± 2e-03 0.84 ± 6e-03 0.91 ± 4e-03 LOAN+ SCL - full 0.91 ± 3e-02 0.96 ± 4e-03 0.83 ± 1e-02 0.91 ± 8e-03 LOAN+ CTL - full (Ours) 0.93 ± 2e-02 0.98 ± 1e-03 0.88 ± 4e-03 0.93 ± 2e-03
TimeSformer 0.88 ± 6e-02 0.95 ± 2e-03 0.77 ± 6e-02 0.87 ± 4e-02
SwinTransformer3D 0.91 ± 3e-02 0.96 ± 7e-03 0.83 ± 7e-03 0.91 ± 4e-03 LOAN (Baseline) 0.89 ± 8e-02 0.97 ± 2e-03 0.78 ± 4e-02 0.87 ± 2e-02
LOAN+ LTL - ft 0.90 ± 6e-02 0.97 ± 6e-03 0.80 ± 5e-02 0.89 ± 3e-02 LOAN+ SCL - ft 0.91 ± 6e-02 0.97 ± 3e-03 0.82 ± 5e-02 0.90 ± 3e-02 LOAN+ HTL - ft (Ours) 0.91 ± 2e-02 0.97 ± 1e-03 0.84 ± 5e-03 0.91 ± 3e-03 LOAN+ CTL - ft (Ours) 0.94 ± 2e-02 0.99 ± 1e-03 0.89 ± 3e-03 0.94 ± 2e-03
LOAN+ LTL - full 0.89 ± 7e-02 0.97 ± 3e-03 0.79 ± 6e-02 0.88 ± 4e-02 LOAN+ SCL - full 0.91 ± 5e-02 0.97 ± 4e-03 0.83 ± 4e-02 0.91 ± 2e-02 LOAN+ CTL - full (Ours) 0.95 ± 2e-02 0.99 ± 2e-03 0.90 ± 1e-02 0.95 ± 5e-03
TimeSformer 0.89 ± 5e-02 0.95 ± 3e-03 0.79 ± 4e-02 0.88 ± 2e-02
SwinTransformer3D 0.91 ± 3e-02 0.96 ± 7e-03 0.83 ± 7e-03 0.91 ± 4e-03 LOAN (Baseline) 0.89 ± 8e-02 0.97 ± 2e-03 0.78 ± 4e-02 0.87 ± 3e-02
LOAN+ LTL - ft 0.89 ± 7e-02 0.97 ± 6e-03 0.79 ± 6e-02 0.88 ± 4e-02 LOAN+ SCL - ft 0.90 ± 7e-02 0.97 ± 3e-03 0.80 ± 7e-02 0.89 ± 4e-02 LOAN+ HTL - ft (Ours) 0.91 ± 3e-02 0.97 ± 1e-03 0.84 ± 6e-03 0.91 ± 3e-03 LOAN+ CTL - ft (Ours) 0.94 ± 2e-02 0.99 ± 1e-03 0.89 ± 4e-03 0.94 ± 2e-03
LOAN+ LTL - full 0.90 ± 6e-02 0.96 ± 7e-03 0.80 ± 5e-02 0.89 ± 3e-02 LOAN+ SCL - full 0.91 ± 6e-02 0.97 ± 2e-03 0.82 ± 5e-02 0.90 ± 3e-02 LOAN+ CTL - full (Ours) 0.95 ± 3e-02 0.99 ± 2e-03 0.90 ± 1e-02 0.95 ± 7e-03
TimeSformer 0.88 ± 5e-02 0.95 ± 3e-03 0.78 ± 3e-02 0.88 ± 2e-02
SwinTransformer3D 0.91 ± 3e-02 0.96 ± 1e-03 0.83 ± 7e-03 0.90 ± 4e-03 LOAN (Baseline) 0.91 ± 5e-02 0.97 ± 3e-03 0.83 ± 3e-02 0.91 ± 2e-02
LOAN+ LTL - ft 0.92 ± 5e-02 0.97 ± 4e-03 0.84 ± 2e-02 0.91 ± 1e-02 LOAN+ SCL - ft 0.92 ± 3e-02 0.97 ± 5e-03 0.84 ± 1e-02 0.91 ± 6e-03 LOAN+ HTL - ft (Ours) 0.91 ± 3e-02 0.97 ± 2e-03 0.84 ± 9e-03 0.91 ± 6e-03 LOAN+ CTL - ft (Ours) 0.95 ± 3e-02 0.99 ± 1e-03 0.89 ± 6e-03 0.94 ± 3e-03
LOAN+ LTL - full 0.91 ± 7e-02 0.97 ± 5e-03 0.81 ± 6e-02 0.90 ± 4e-02 LOAN+ SCL - full 0.92 ± 4e-02 0.97 ± 3e-03 0.85 ± 2e-02 0.92 ± 1e-02 LOAN+ CTL - full (Ours) 0.95 ± 3e-02 0.99 ± 1e-03 0.91 ± 2e-02 0.95 ± 1e-02
Table 3. Average distance intra- and inter-class for latent codes calculated by the different models. We report the overall best results in black and the best results among the models fully trained with the contrastive terms in blue . Fine-tuning Full PS Distance Baseline LTL SCL HTL CTL LTL SCL CTL
Intra-Cl. ( ↓ ) 1.07 0.89 1.13 0.91 1.06 0.86 1.12 1.02 Inter-Cl. ( ↑ ) 1.42 1.27 1.4 1.43 1.39 1.23 1.4 1.33 ratio ( ↑ ) 1.33 1.42 1.24 1.58 1.32 1.43 1.24 1.31
Intra-Cl. ( ↓ ) 0.86 0.83 1.08 0.8 0.93 0.86 1.08 0.9 Inter-Cl. ( ↑ ) 1.16 1.21 1.35 1.26 1.27 1.16 1.33 1.27 ratio ( ↑ ) 1.35 1.46 1.25 1.58 1.36 1.35 1.23 1.4
Intra-Cl. ( ↓ ) 0.74 0.7 1.07 0.7 0.82 0.71 1.03 0.8 Inter-Cl. ( ↑ ) 1.03 1.14 1.34 1.17 1.17 1.04 1.26 1.18 ratio ( ↑ ) 1.39 1.62 1.25 1.67 1.42 1.46 1.23 1.48
Intra-Cl.
( ↓ ) 0.48 0.68 0.88 0.65 0.62 0.72 1.02 0.56 Inter-Cl. ( ↑ ) 0.75 1.17 1.33 1.23 1.13 1.16 1.27 0.92 ratio ( ↑ ) 1.57 1.72 1.51 1.88 1.82 1.62 1.24 1.64
for a clearer comparison of different training methods. Table 3 shows that historical sampling improves the structure of the latent space, resulting in greater distances between classes and consistent intra-class distances in various patch sizes. However, this enhancement does not translate directly to better performance in the classification task, where it remains comparable to other contrastive methods. Finally, curriculum sampling does help to better shape the latent space, when the contrastive signal is adopted throughout the entire training, and also reach higher classification performance. Calabria Dataset. The classification task outcomes derived from the Calabria dataset are summarized in Table 4. Within this new ap
Table 4. Overview of the aggregated metrics computed for the years 2017 and 2018 using the Calabria dataset. In this setting, patches are not centered on the target event; rather, wildfire occurrences may appear at any location within the patch. Each reported value corresponds to the mean over five independent trials.
Class-wise results are provided in Appendix D of the Supplementary Material. Aggregate Model Precision AUROC IoU F1
FWI 0.67 ± 0.032 0.72 ± 0.002 0.50 ± 0.034 0.66 ± 0.030
TimeSformer 0.83 ± 1e-02 0.91 ± 2e-03 0.70 ± 8e-03 0.83 ± 6e-03
SwinTransformer3D 0.79 ± 7e-02 0.85 ± 3e-03 0.63 ± 3e-02 0.77 ± 3e-02 LOAN (Baseline) 0.89 ± 3e-02 0.95 ± 2e-03 0.80 ± 8e-03 0.89 ± 5e-03
LOAN+ LTL - ft 0.97 ± 4e-03 1.00 ± 2e-04 0.95 ± 2e-03 0.97 ± 9e-04 LOAN+ SCL - ft 0.96 ± 3e-02 0.99 ± 2e-04 0.92 ± 3e-03 0.96 ± 1e-03 LOAN+ HTL - ft (Ours) 0.73 ± 8e-02 0.77 ± 2e-03 0.54 ± 6e-02 0.70 ± 5e-02 LOAN+ CTL - ft (Ours) 0.85 ± 1e-02 0.92 ± 3e-03 0.74 ± 6e-03 0.85 ± 4e-03
LOAN+ LTL - Full 0.97 ± 3e-02 0.99 ± 2e-04 0.94 ± 2e-03 0.97 ± 9e-04 LOAN+ SCL - Full 0.98 ± 1e-02 1.00 ± 5e-05 0.97 ± 8e-04 0.98 ± 4e-04 LOAN+ CTL - Full (Ours) 0.98 ± 2e-02 0.99 ± 2e-04 0.95 ± 2e-03 0.98 ± 9e-04
plication scenario, our sampling strategies exhibit reduced efficacy during the fine-tuning phase, whereas curriculum sampling matches the SCL method’s performance when applied for the entire training. This situation is justified by the difference in the dynamic features of the two datasets. The Figures 2 and 3 in Section 3 demonstrate that the Calabria dataset exhibits greater feature regularity between the two classes. Consequently, our sampling method yields a diminished benefit as label-based sampling already guarantees sample similarity. However, despite being more challenging, the models utilizing a CL approach achieve consistent gains over the baseline due to the higher resolution of the data.
In the full-training approach, all evaluated models yield similar results with only minimal variation. 6 Conclusions
This study presents an innovative methodology to enhance contrastive learning (CL) for wildfire risk prediction through curriculum data, improving model robustness and accuracy. By integrating similarity-based perspectives into the CL framework, this approach addresses limitations in current methods, providing a more effective solution. To our knowledge, this is the first systematic analysis of CL in predicting wildfire risk. The experimental results in Section 5 confirm our methodology’s effectiveness. Across diverse patch sizes, our model consistently outperformed both the baseline and conventional CL models. In more complex scenarios, where wildfire events may occur anywhere within the patch, the model demonstrated strong generalization and classification accuracy, reinforcing its robustness. Integrating curriculum sampling into the CL framework improved model performance, reliability, and robustness across various conditions while reducing computational costs without sacrificing accuracy. Although CL is a consolidate approach, our proposed morphology-aware curriculum CL paves the way for advancements by enabling future research to refine it through enhanced training sample selection based on similarity measures in autoencoderderived latent spaces. Utilizing autoencoders to generate latent representations could allow the identification and selection of more representative and diverse training samples, likely improving model generalizability.
Future work could also explore self-supervised techniques that leverage intrinsic temporal and spatial data patterns to generate pseudo-labels, facilitating learning of recurring structures in historical data. In practical applications, organizations and institutions whose responsibilities or operational mandates are directly or indirectly concerned with the prevention, management, or mitigation of wildfire hazards may readily integrate the proposed approach into their existing systems. Adopting this approach could provide high-accuracy predictions and, under specific circumstances, also reduce computational cost. Acknowledgements
This work was funded by the Next Generation EU - Italian NRRP, Mission 4, Component 2, Investment 1.5, call for the creation and strengthening of “Innovation Ecosystems”, building “Territorial R&D Leaders” - project Tech4You
- Technologies for climate change adaptation and quality of life improvement, n. ECS0000009. This work reflects only the authors’ views and opinions, neither the Ministry for University and Research nor the European Commission can be considered responsible for them.