Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Peat Fire Prediction Models

The following models are implemented in this directory:

  1. Logistic Regression
  2. U-NET
  4. GNN(PeatNet)
  5. Transformer-Based Encoder(PT-Net) Please refer to the paper for the reasons of why these models are selected.

Hyperparameters Used:

The final model hyperparameters used are mentioned as the default values in the files.

PeatSet Dataset Details

For details about the individual features in the dataset we curated please look in the wiki.

Repository Structure

The directory is structured as follows-



Loader for each dataset returning an array corresponding to the dataset.


Code used to interpolate data to one standard spatial resolution.


Load all data from the datasets using the various dataloaders.



Loader used for linear, unet, unet_lstm models. The loader contains the following Constant values:


these are all the temporal features used for the model prediction. However, the value to be predicted is always deleted before the processing. You can customize this to add/delete datasets for your own experiments


The dataloader supports both pickle and h5 files for the temporal features. The path for the h5 features needs to be provided in the ROOT_DIR and for the pickle features should be provided in the ROOT_DIR_P. Please change the path at the top and provide the directory where the files are located


Currently the only static feature supported is tarnocai, but you can edit the STATIC_FT to add more features The loaders also have the following functions and Classes:

  • lpickle : to load the pickle files from filename fname
  • get_h5 : read h5 files from file_name fname, you can also provide the optional argument index in case you only want a single index, the default values provided consist of all the features. Provide the optional argument check as True to read temporal files. This function returns the data(i.e the feature values), directly read dates, and dates in the day-month format. In case check is False, the last two are None
class PeatDataset:

This takes in the hyperparameters for constructing the dataset. Iterating over this would provide the spatial, temporal, the ground truth output values when called returns the static and temporal features iteratively. The dataset consists of the folowing feature values that can be accessed from outside the class directly: - num_total_days: the total days in the h5 objects - static: the static features - peat_map : binary map of the peatlands constructed from the tarnocai file - num_temporal: the total number of temporal features - num_static: the total number of static features


This is the pytorch geometric dataset for graph based models. All the functions are similar to the peat_loader file, except the fact that iterating over this will lead to different graphs instead of torch tensors. - peat_gnn : loader used for gnn based models provides different functions for adding different kinds of edges. Currently, only uses peat edges. Greater number of peat edges will require higher compute facilities


This folder contains all the relevant models with the exxeption of transformers(due to the different nature of the model). For the Transformer model, please refer to Transformers.ipynb. It must be noted that we still use the same dataset for both the models.


Regular Linear Regression based model. This model regards both spatial information in the batch dimension and each feature consists of both the temporal and spatial values.


This is a helper class that provides the downsampling and the upsampling blocks for the unet architectures

unet :

A regular UNet Architecture consists of multiple downsampling blocks followed by upsampling blocks. Here each feature is considered as a different channel.


unet augmented with a LSTM layer at the end to allow for temporal information to be processed differently.


model that first produces a gnn encoding and then produces the output

gnn :

relational gnn model used to process differnt kinds of edges(requires high compute power) :

train file for UNet, UNet-LSTM, Linear regression

train file for gnn based architecture

Please follow the following steps to run the code:

  1. Install required packages: - pytorch - pytorch geometric - skikit - matplotlib - simplejson
  2. python [] --model <name of model> --conf f --dmodel <hyperparameter for num features> --lr <learning rate> --in_days <num of in days> --out_days <num of out days> --out <feature to output: CO2/CWFIS>

You can also pass in the hyperparameters in the form of a yaml file, in which case use --conf y --output_dir . This is useful in cases where you want to run a grid search.

Follow the following steps to create a new model to test The name of the model should be the same as the file name in Model

To add additional models, follow the following steps:

  1. add file in model directory
  2. name the class as Model
  3. add code for the initialization in


No description, website, or topics provided.






No releases published


No packages published