You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
State University of São Paulo, Department of Computing, Recogna Laboratory
Joel da Silva Cavalcanti Filho
João Renato Ribeiro Manesco
Eduardo Roldão Nonato Perondini
2. Repository Structure
File/Folder
Description
Demo Notebooks/
Contains Jupyter notebooks demonstrating how to use the Mosqlimate API for model registration, prediction submission, and evaluation. These notebooks serve as practical examples for reproducing the competition workflow.
PatchTST_results/
Stores the prediction results generated using the PatchTST forecasting model. The directory is organized by experiment, containing the JSON files required for submission to the IMDC platform.
TTM_results/
Contains the prediction results produced with the Tiny Time Mixer (TTM) model. Results are organized according to the evaluated datasets and geographical aggregation levels.
img/
Repository images used in the documentation, including figures displayed in the README.
.gitignore
Specifies files and directories that should not be tracked by Git, such as cache files, temporary outputs, and virtual environments.
LICENSE
Defines the license under which the repository is distributed.
README.md
Main documentation of the repository, including project overview, installation instructions, usage examples, and submission workflow.
pyproject.toml
Project configuration file defining metadata, dependencies, and build settings required for the Python environment.
Weekly forecasts for the required target locations in the IMDC submission format.
Execution
Run the training script to fine-tune the model, then run the prediction script using the saved model (./melhor_modelo_ttm_dengue).
PatchTST
Parameter
Value
Architecture
PatchTSTForPretraining
Model type
patchtst
Activation function
gelu
Context length
305
Prediction length
24
Number of input channels
15
Number of targets
1
Hidden dimension (d_model)
128
Feed-forward dimension (ffn_dim)
512
Number of hidden layers
3
Number of attention heads
4
Patch length
16
Patch stride
1
Stride
8
Pooling type
mean
Distribution output
student_t
Loss function
mse
Scaling
std
Positional encoding
sincos
Normalization
batchnorm
Normalization epsilon
1e-5
Pre-normalization
True
Bias
True
Channel attention
True
Share embedding
True
Share projection
True
Use CLS token
False
Input masking
True
Mask type
random
Random mask ratio
0.5
Forecast mask patches
[2]
Channel-consistent masking
False
Unmasked channel indices
None
Mask value
0
Dropout (attention)
0.0
Dropout (feed-forward)
0.0
Dropout (head)
0.0
Dropout (path)
0.0
Dropout (positional)
0.0
Weight initialization std
0.02
Number of parallel samples
100
Output range
None
Data type
float32
Transformers version
5.3.0
Item
Description
Model
PatchTST (PatchTSTForPretraining)
Architecture
Transformer-based self-supervised pretraining model
Training objective
Self-supervised pretraining using masked patch reconstruction
Input variables
Dengue cases and climate variables
Input context
Sliding window applied in the datasets train1, train2, train3, train4
Prediction horizon
53 weeks (configuration parameter)
Patch length
16
Patch stride
8
Number of input channels
Equal to the number of variables in the input tensor
Channel attention
Enabled (True)
Shared embedding
Enabled (True)
Optimizer
AdamW
Backbone learning rate
1 × 10⁻⁵
Head learning rate
1 × 10⁻³
Weight decay
1 × 10⁻²
Learning rate scheduler
Linear scheduler
Warm-up steps
0
Batch size
200
Number of epochs
1
Hyperparameter optimization
None. Hyperparameters were manually selected.
Model checkpoint
Saved after each training iteration as weights/PatchTST-Dengue-ClimateExogs_v{1,2,3,4}.pth and in Hugging Face format under weights/Pretrained_PatchTST_dengue_climate_exogs_v{1,2,3,4}.
Item
Description
Input data
Tensor containing weekly dengue cases and climate variables.
Output
Pretrained PatchTST model weights used for downstream forecasting.
Execution
Run the pretraining script to generate the pretrained weights. Afterwards, run the forecasting script that loads weights/Pretrained_PatchTST_dengue_climate_exogs_v{1,2,3,4} to produce the final predictions.
Fine-tuning Routine | PatchTST
Item
Description
Model
PatchTST (PatchTSTForPrediction)
Initialization
Pretrained weights loaded from weights/Pretrained_PatchTST_dengue_climate_exogs_v{1,2,3,4}
Architecture
Transformer-based PatchTST
Input variables
Dengue cases and climate variables
Input context
Sliding window applied in the datasets train1, train2, train3, train4
Forecast horizon
53 weeks
Patch length
16
Patch stride
8
Number of input channels
Equal to the number of variables in the input tensor
Channel attention
Enabled (True)
Shared embedding
Enabled (True)
Optimizer
AdamW
Backbone learning rate
1 × 10⁻⁵
Prediction head learning rate
1 × 10⁻³
Weight decay
1 × 10⁻²
Learning rate scheduler
Linear scheduler
Warm-up steps
0
Number of epochs
3
Mini-batch size
183 samples
Validation batch size
200
Early stopping
Enabled (based on validation loss)
Hyperparameter optimization
None. Hyperparameters were manually selected.
Model checkpoint
Saved after each epoch as both PyTorch (*.pth) and Hugging Face (save_pretrained) formats.
Strided training windows generated from the dengue and climate tensor.
Validation data
Validation tensor loaded through ValidationDataset.
Output
Fine-tuned PatchTST model for weekly dengue forecasting.
5. Data Usage Restriction
During the model training phase, the fine-tuning process considered the data availability constraints by reserving only the remaining epidemiological weeks for validation. However, these constraints did not impact the inference stage, since the prediction horizon was predefined and remained unchanged.
EKAMBARAM, Vijay et al. Tiny time mixers (ttms): Fast pre-trained models for enhanced zero/few-shot forecasting of multivariate time series. Advances in Neural Information Processing Systems, v. 37, p. 74147-74181, 2024.
NIE, Yuqi et al. A time series is worth 64 words: Long-term forecasting with transformers. arXiv preprint arXiv:2211.14730, 2022.