Observed since 21 Oct, 11:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
The Artificial Intelligence for Nowcasting Pilot Project - Precipitation Benchmark for Latin America (AINPP-PB-LATAM).
Unified scientific benchmark library for precipitation nowcasting in Latin America using deep learning on high-performance computing (HPC) environments.
Adriano P. Almeida
National Institute for Space Research (INPE/Brazil)
adriano.almeida@inpe.br
Alan J. P. Calheiros
National Institute for Space Research (INPE/Brazil)
alan.calheiros@inpe.br
This benchmark is developed and maintained by a team focused on scientific machine learning, reproducible evaluation, and scalable HPC workflows for precipitation nowcasting in Latin America. Its goal is not to deliver a single optimized forecasting solution, but to provide a flexible framework for developing and evaluating regionally adapted models. By enabling systematic comparison of methods, it supports incremental improvements and contributes to more reliable predictions in regions of interest. The benchmark is open to the community, and feedback or contributions are welcome.
uvuv installed on the system (a blazing-fast Python package installer and resolver).git clone git@github.com:SInApSE-INPE/AINPP-PB-LATAM.git
cd AINPP-PB-LATAM
The project relies on uv to maintain its isolated environment. Create a virtual environment:
uv venv
Activate the environment:
# On Linux/macOS
source .venv/bin/activate
CRITICAL: The package must always be installed in editable mode (-e) using uv. Do not use sys.path hacks in your experiments.
# Install the core package along with dev and docs dependencies
uv pip install -e .[dev,docs]
You can check if the CLI is ready and Hydra configuration is locatable:
python main.py --help
The benchmark operates under strict spatio-temporal properties tailored for the Brazilian/Latin-American precipitation models:
.zarr file stores.train: 2018 to 2022validation: 2023test: 2024880 x 970 spatial grids.gsmap_nrt.gsmap_mvk.├── conf/ # Hydra configuration YAMLs
│ ├── config.yaml # Root configuration
│ ├── dataset/ # Dataloader & data path configs
│ ├── discriminator/ # GAN discriminators (e.g. patchgan)
│ ├── evaluation/ # Evaluation metric definitions
│ ├── loss/ # Loss functions (e.g., mse, ssim)
│ ├── model/ # Architecture configurations (unet, afno, etc.)
│ ├── training/ # Optimizer, lr scheduler, epochs
│ └── visualization/ # Plotting parameters
├── docs/ # MkDocs documentation
├── scripts/ # Utilities (legacy running blocks, bash scripts)
│ ├── check_all.sh # Full quality-gate workflow
│ └── enforce_coverage.py # Coverage tools
├── src/
│ └── ainpp_pb_latam/ # Core Python package
│ ├── datasets/ # Zarr loading and sampling logic
│ ├── evaluation/ # Orchestration & benchmark metric calculators applied per threshold/lead_time
│ ├── metrics/ # Pure mathematical calculations agnostic of batch/dataset
│ ├── aggregation/ # Statistical grouping and Tidy dataframe formatting (CSV/Parquet)
│ ├── visualization/ # Handlers for model output plotting (Curves, Diagrams, Maps)
│ ├── inference/ # Unified inference engine for single/historical predictions
│ ├── layers/ # Reusable neural network layers
│ ├── models/ # Model Zoo definitions (UNet, ResNet, etc.)
│ ├── distributed.py # DDP sync rules for Multi-Node
│ ├── engine.py # Standard training loops
│ ├── engine_gan.py # specialized loops for GAN-based setups
│ ├── losses.py # Specialized precipitation loss implementations
│ └── utils.py # Object builders (Loss, Optimizer)
├── tests/ # Pytest suite
├── main.py # Unified CLI Entry point
├── pyproject.toml # Build system definitions
└── uv.lock # Deterministic python dependency tree
The library features rigorously separated pipelines for scientific benchmark evaluation. The architecture divides concerns as follows:
metrics/: Computes pure mathematical metrics. Subdivided into 6 categories based on standard precipitation forecasting properties:
evaluation/: Orchestrates and maps the raw output target against the thresholds (mm/h) and temporal prediction horizons (lead_time).aggregation/: Consolidates statistical properties from the evaluation bounds and builds Tidy long dataframes exportable to both CSV and Parquet.visualization/: Generates diagnostic visual figures over the aggregated benchmark sets directly into the outputs/figures directories. Supported plots are:
The benchmark evaluation generates metrics and plots automatically, but gives you total control via the CLI or Python API.
Execute the unified evaluation over your best model checkpoint:
python main.py task=evaluate checkpoint=outputs/pipelines/unet_direct/checkpoints/best_model.pt
Overwrite constraints seamlessly to test custom thresholds (e.g., severe storms) or ignore specific modules to speed up processing:
python main.py task=evaluate \
model=unet/direct \
checkpoint=outputs/my_model.pt \
+evaluation.thresholds_mm_h=[5.0, 10.0, 25.0] \
+evaluation.lead_times_min=[10, 30, 60] \
+evaluation.probabilistic=false \ # Turn off probabilistic evaluation
+visualization.output_dir=/custom/plot/path
You can utilize the highly optimized standalone packages on your custom prediction loops or notebooks without the Hydra wrapper:
import numpy as np
from ainpp_pb_latam.metrics.continuous import ContinuousMetrics
from ainpp_pb_latam.metrics.categorical import CategoricalMetrics
from ainpp_pb_latam.visualization.plot_maps import plot_comparison
target_map = np.random.rand(256, 256) * 15 # Synthetic observed mm/h
pred_map = target_map * 0.8 + np.random.rand(256, 256) # Synthetic predicted mm/h
# 1. Compute Math metrics agnostic to thresholds
cont_metrics = ContinuousMetrics.compute(pred_map, target_map)
print(f"RMSE: {cont_metrics['RMSE']:.2f}")
# 2. Compute Categorical metrics for heavy rain (> 10mm/h)
cat_metrics = CategoricalMetrics.compute(pred_map, target_map, threshold=10.0)
print(f"CSI (Threat Score): {cat_metrics['CSI']}")
# 3. Export sharp comparison maps
plot_comparison(
target=target_map,
prediction=pred_map,
output_path="comparison_maps.png",
title="Heavy Rain Analysis"
)
python main.py task=<TASK_TYPE>.conf/config.yaml with the sub-dictionaries provided (loss, models, training parameters) and command-line overrides.train, evaluate, infer):
ainpp_pb_latam.datasets.conf/model/ and ships it to GPU (or configures DistributedDataParallel).ainpp_pb_latam.engine, ainpp_pb_latam.evaluation or ainpp_pb_latam.inference and streams data until completion.This project delegates all configurations (hyperparameters, variables, dataset paths, training parameters) to Hydra. We do not use argparse or .env files for architecture controls.
You can override any parameter on the command line using the simple .yaml trajectory:
# Change the learning rate and batch size for a training run:
python main.py task=train training.lr=0.0005 dataset.train_loader.batch_size=32
# Change the model to an AFNO and loss to a Hybrid scheme:
python main.py task=train model=afno loss=hybrid_mse_ssim
We provide specialized loss functions designed for high-intensity precipitation tasks:
WeightedMSE (penalizes heavy rain errors), LogCosh, HuberLoss.SSIMLoss (anti-blurring), SpectralLoss, PerceptualLoss (Feature MSE).HybridLoss (configurable weighted summation).Run any stage via main.py.
| Command | Description |
|---|---|
python main.py task=train | Kickoff training. By default outputs runs to ./outputs/<date>/<time>. |
python main.py task=evaluate checkpoint=/path/to/my_model.pt | Run spatial, continuous, and probabilistic metric validation on the held-out test data. |
python main.py task=infer inference.mode=single checkpoint=/my_model.pt | Run prediction for a single isolated sample and output locally formatted as .nc (NetCDF) or .pt. |
python main.py task=infer inference.mode=historical checkpoint=/my_model.pt | Run bulk batch-by-batch predictions on the whole temporal set via Dataloader, saving cleanly optimized to a Zarr Store. |
./scripts/check_all.sh | Run all Linters, typecheck, and coverage reports at once. |
mkdocs serve | Host documentation locally mimicking github pages structure. |
Quality assurance is mandated globally via the Makefile/Shell scripts. We rely on pytest, coverage, black, isort, and mypy.
# Run all automated tests (Minitest equivalent in Python)
pytest tests/
# Run tests with coverage map pointing at src/ainpp_pb_latam
pytest --cov=src/ainpp_pb_latam tests/
# Shortcut for linting, typing and testing standardly
./scripts/check_all.sh
The framework utilizes torch.distributed and is meant to be run transparently on massive multi-GPU or multi-Node bounds.
Run the process under torchrun and declare how many GPUs to map per node:
# Running DDP with 4 GPUs
torchrun --nproc_per_node=4 main.py task=train dataset.train_loader.batch_size=16
(Variables are aggregated per-batch across GPUs, keeping the effective batch-size as GPUs * node_batch_size).
patience, training terminates.best_model.pt.Error: ModuleNotFoundError: No module named 'ainpp_pb_latam'
Solution: Ensure you actually installed the package into the current uv environment via the editable command.
uv pip install -e .
Error: torch.cuda.OutOfMemoryError / CUDA out of memory.
Solution: Drop the batch size or hidden dimensions through Hydra.
python main.py task=train dataset.train_loader.batch_size=4 model.hidden_channels=[16,16,16]
Error: The system freezes on epoch conclusion or validation phases.
Solution: DDP often hangs if the dataset isn't perfectly sliced, or if evaluation metrics attempt to reduce uneven tensors. Try lowering the number of workers per dataloader using system.num_workers=0 for debug traces.
The authors wish to thank the National Council for Scientific and Technological Development (CNPq, processes 438310/2018-7, 141451/2021-1 and 444205/2024-1), the Brazilian Federal Agency for Support and Evaluation of Higher Education (CAPES), the National Institute for Space Research (INPE) and the Brazilian Space Agency (AEB) of the Ministry of Science, Technology and Innovation (MCTI) for their financial support. The project was supported by the \textit{Laboratório Nacional de Computação Científica} (LNCC, MCTI/Brazil) through the resources of the Santos Dumont supercomputer in the projects IDeepS and CPTEC. This work was also supported by the 4th Research Announcement on the Earth Observations of the Japan Aerospace Exploration Agency (JAXA) (ER4GPN102) and World Meteorological Organization (WMO).
This architecture operates under an MIT open-source license.
If you use this benchmark in your research, please cite the following paper:
@article{almeida2026regional,
author = {Almeida, Adriano P. and Barbosa, Henrique M. J. and Garcia, S{\^a}mia R. and Gagne, David J. and Zhou, Kanghui and Kubota, Takuji and Ushio, Tomoo and Otsuka, Shigenori and Pfreundschuh, Simon and Calheiros, Alan J. P.},
title = {A Regional Benchmark for Deep Learning-Based Hourly Precipitation Nowcasting in Latin America},
journal = {IEEE Access},
year = {2026},
volume = {PP},
number = {99},
pages = {1--1},
doi = {10.1109/ACCESS.2026.3670767}
}
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.0b4 | 20 Mar 2026 | 31 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 11:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:d55494b9576a1abcb20580a415860b5045c08a94f10ddfbcc405be26b63ec876