MeteoNorm-RF

Model Introduction

MeteoNorm-RF uses random forests and meteorological resampling to separate weather effects from long-term emission trends in Beijing air pollution for clean-air-action assessment. It preserves seasonal, diurnal, and station differences while jointly analyzing weather-normalized changes in six major pollutants.

Paper: Assessing the impact of clean air action on air quality trends in Beijing using a machine learning technique
https://doi.org/10.5194/acp-19-11303-2019

Model Description

The method was proposed by teams from the University of Birmingham, the Chinese Academy of Sciences, and collaborating institutions. The paper uses hourly observations of six pollutants from 12 Beijing national monitoring stations and airport meteorology. The random forest estimates weather-normalized concentrations by resampling meteorological conditions within matching hours and nearby seasonal windows. The model supports weather-normalized pollutant concentrations and Theil-Sen long-term trend analysis.

Use Cases

Use Case Description
Meteorological normalization Estimate normalized pollutant concentrations through weather resampling.
Air-quality trends Compute robust trends for six pollutants.
Local engineering validation Preserve 12 stations, six pollutants, hourly frequency, and full features.
ModelScope/OneCode execution Validate data, training, inference, air-quality metrics, and visualization.
Multi-GPU training Validate distributed task parallelism and checkpoint workflows through torchrun.

Usage Instructions

1.OneCode

Try intelligent, one-click AI4S programming

2. Download and Installation

hf download OneScience-Group/MeteoNorm-RF --local-dir ./MeteoNorm-RF
cd MeteoNorm-RF

Environment Dependencies

Hardware Requirements

  • A GPU or DCU is recommended.
  • A CPU can be used for connectivity validation with the default small-sample configuration.
  • DCU users must install DTK in advance. DTK 25.04.2 or later, or the OneScience-recommended version matching the current cluster, is recommended.

DCU Environment

# Activate DTK and Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai

GPU Environment

# Activate Conda first
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai

Training Data

This repository uses a small synthetic dataset for engineering validation, including 12 monitoring stations, six pollutants, 21 temporal/meteorological/station features, hourly relationships, and the full tabular dimensions. Synthetic data retain the real station count, pollutants, input features, and hourly frequency while shortening the period to 30 days and preserving emission, traffic, weather, and station structure. These data validate random forests, meteorological normalization, training, inference, and evaluation only and do not represent official observations or training scale.

python scripts/fake_data.py

Training

For single-GPU training, use:

python scripts/train.py

For multi-GPU training, use:

torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.py

Training fits the six-output random forest with a fixed 70/30 split and supports process-level tree parallelism. The default reduces hundreds of paper trees to 12 without reducing stations, pollutants, or input dimensions. Training artifacts are saved to:

result/checkpoints/meteonorm_rf.pkl
result/training/metrics.json

Trained Weights

The paper provides no pretrained model weights, and no weights are bundled under weight/.

Inference

python scripts/inference.py

Inference loads the local forest checkpoint and predicts six pollutant concentrations from temporal, meteorological, and station features. Weather conditions are then resampled within matching hours and nearby seasonal windows to form normalized ensembles. Outputs retain ordinary predictions, normalized means, and temporal and spatial indices. Inference results are saved to:

result/output/predictions.npz

Evaluation and Visualization

python scripts/result.py

Evaluation computes pollutant-wise RMSE, R², FAC2, MB, MGE, NMB, NMGE, COE, and IOA and compares observed and weather-normalized concentrations. It also saves Theil-Sen trends for all six pollutants and generates a comparison of predictive skill and normalized trends. Synthetic-data results validate engineering only and do not represent formal paper performance. Evaluation results are saved to:

result/evaluation/metrics.json
result/evaluation/comparison.png

Official OneScience Information

Citation and License

This repository is an independent engineering reproduction of the public MeteoNorm-RF specifications, with code licensed under the Apache License 2.0.

The original paper is licensed under CC BY 4.0; the paper, official observations, and third-party resources remain subject to the licenses and terms of their respective projects.

Downloads last month
12
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support