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.


中文说明

模型简介

MeteoNorm-RF 使用随机森林和气象重采样,将北京空气污染的气象影响与长期排放趋势分离,用于评估清洁空气行动。该模型保留季节、日内和站点差异,并联合分析六种主要污染物在气象归一化后的变化。

论文《使用机器学习技术评估清洁空气行动对北京空气质量趋势的影响》
https://doi.org/10.5194/acp-19-11303-2019

模型描述

该方法由伯明翰大学、中国科学院及合作机构团队提出。论文使用北京 12 个国家监测站的六种污染物逐小时观测和机场气象数据。随机森林对同一小时和相邻季节窗口中的气象条件重采样,估计气象归一化浓度。该模型支持计算气象归一化污染物浓度和开展 Theil-Sen 长期趋势分析。

使用场景

使用场景 说明
气象归一化 通过气象重采样估计归一化后的污染物浓度。
空气质量趋势 计算六种污染物的稳健趋势。
本地工程验证 保留 12 个站点、六种污染物、逐小时频率和全部特征。
ModelScope/OneCode 运行 验证数据、训练、推理(inference)、空气质量指标和可视化。
多 GPU 训练 通过 torchrun 验证分布式任务并行和模型权重(检查点)(checkpoint)流程。

使用说明

1.OneCode

体验智能一键 AI4S 编程

2. 下载与安装

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

环境依赖

硬件要求

  • 建议使用 GPU 或 DCU。
  • 可使用 CPU 在默认小样本配置下验证连通性。
  • DCU 用户必须提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,或使用 OneScience 推荐的与当前集群匹配的版本。

DCU 环境

# 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 环境

# 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

训练数据

本仓库使用小规模合成数据集进行工程验证,其中包含 12 个监测站、六种污染物、21 个时间/气象/站点特征、逐小时关系及完整表格维度。合成数据保留真实的站点数、污染物、输入特征和逐小时频率,将时段缩短为 30 天,同时保留排放、交通、天气和站点结构。这些数据仅用于验证随机森林、气象归一化、训练、推理和评估,不代表官方观测或训练规模。

python scripts/fake_data.py

训练

单 GPU 训练使用以下命令。

python scripts/train.py

多 GPU 训练使用以下命令。

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

训练按固定 70/30 划分拟合六输出随机森林,支持进程级的树并行。默认配置将论文中的数百棵树减少至 12 棵,同时保留站点、污染物和输入维度。训练产物保存至以下路径。

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

训练权重

论文未提供预训练模型权重,weight/ 中也未附带权重。

推理

python scripts/inference.py

推理加载本地森林模型权重(检查点),根据时间、气象及站点特征预测六种污染物浓度。随后对同一小时和相邻季节窗口中的气象条件重采样,形成归一化集成。输出保留常规预测、归一化均值及时空索引。推理结果保存至以下路径。

result/output/predictions.npz

评估与可视化

python scripts/result.py

评估逐污染物计算 RMSE、R²、FAC2、MB、MGE、NMB、NMGE、COE 和 IOA,并对比观测浓度与气象归一化浓度。评估还保存全部六种污染物的 Theil-Sen 趋势,并生成预测技巧和归一化趋势的对比图。合成数据结果仅用于工程验证,不代表论文的正式性能。评估结果保存至以下路径。

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

OneScience 官方信息

引用与许可证

本仓库是对公开 MeteoNorm-RF 规范的独立工程复现,代码采用 Apache License 2.0。

原始论文采用 CC BY 4.0 许可证。论文、官方观测及第三方资源仍受各自项目的许可证和条款约束。

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