zhangrenchao commited on
Commit
dabedd5
·
verified ·
1 Parent(s): b11ef36

Add English model card

Browse files
Files changed (1) hide show
  1. README.md +145 -0
README.md ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - OneScience
7
+ - Earth Science
8
+ - Air Quality
9
+ - Random Forest
10
+ - Meteorological Normalization
11
+ frameworks: PyTorch
12
+ ---
13
+
14
+ <p align="center"><strong><span style="font-size: 30px;">MeteoNorm-RF</span></strong></p>
15
+
16
+ # Model Introduction
17
+
18
+ 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.
19
+
20
+ Paper: Assessing the impact of clean air action on air quality trends in Beijing using a machine learning technique
21
+ https://doi.org/10.5194/acp-19-11303-2019
22
+
23
+ # Model Description
24
+
25
+ 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.
26
+
27
+ # Use Cases
28
+
29
+ | Use Case | Description |
30
+ | :---: | :--- |
31
+ | Meteorological normalization | Estimate normalized pollutant concentrations through weather resampling. |
32
+ | Air-quality trends | Compute robust trends for six pollutants. |
33
+ | Local engineering validation | Preserve 12 stations, six pollutants, hourly frequency, and full features. |
34
+ | ModelScope/OneCode execution | Validate data, training, inference, air-quality metrics, and visualization. |
35
+ | Multi-GPU training | Validate distributed task parallelism and checkpoint workflows through `torchrun`. |
36
+
37
+ # Usage Instructions
38
+
39
+ ## 1.OneCode
40
+
41
+ [Try intelligent, one-click AI4S programming](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)
42
+
43
+ ## 2. Download and Installation
44
+
45
+ ```bash
46
+ hf download OneScience-Group/MeteoNorm-RF --local-dir ./MeteoNorm-RF
47
+ cd MeteoNorm-RF
48
+ ```
49
+
50
+ ### Environment Dependencies
51
+
52
+ **Hardware Requirements**
53
+
54
+ - A GPU or DCU is recommended.
55
+ - A CPU can be used for connectivity validation with the default small-sample configuration.
56
+ - DCU users must install DTK in advance. DTK 25.04.2 or later, or the OneScience-recommended version matching the current cluster, is recommended.
57
+
58
+ **DCU Environment**
59
+
60
+ ```bash
61
+ # Activate DTK and Conda first
62
+ conda create -n onescience311 python=3.11 -y
63
+ conda activate onescience311
64
+ pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
65
+ ```
66
+
67
+ **GPU Environment**
68
+
69
+ ```bash
70
+ # Activate Conda first
71
+ conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
72
+ conda activate onescience311
73
+ pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/ --trusted-host mirrors.onescience.ai
74
+ ```
75
+
76
+ ### Training Data
77
+
78
+ 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.
79
+
80
+ ```bash
81
+ python scripts/fake_data.py
82
+ ```
83
+
84
+ ### Training
85
+
86
+ For single-GPU training, use:
87
+
88
+ ```bash
89
+ python scripts/train.py
90
+ ```
91
+
92
+ For multi-GPU training, use:
93
+
94
+ ```bash
95
+ 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
96
+ ```
97
+
98
+ 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:
99
+
100
+ ```text
101
+ result/checkpoints/meteonorm_rf.pkl
102
+ result/training/metrics.json
103
+ ```
104
+
105
+ ### Trained Weights
106
+
107
+ The paper provides no pretrained model weights, and no weights are bundled under `weight/`.
108
+
109
+ ### Inference
110
+
111
+ ```bash
112
+ python scripts/inference.py
113
+ ```
114
+
115
+ 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:
116
+
117
+ ```text
118
+ result/output/predictions.npz
119
+ ```
120
+
121
+ ### Evaluation and Visualization
122
+
123
+ ```bash
124
+ python scripts/result.py
125
+ ```
126
+
127
+ 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:
128
+
129
+ ```text
130
+ result/evaluation/metrics.json
131
+ result/evaluation/comparison.png
132
+ ```
133
+
134
+ # Official OneScience Information
135
+
136
+ | Platform | OneScience Main Repository | Skills Repository |
137
+ | --- | --- | --- |
138
+ | Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
139
+ | GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
140
+
141
+ # Citation and License
142
+
143
+ This repository is an independent engineering reproduction of the public MeteoNorm-RF specifications, with code licensed under the Apache License 2.0.
144
+
145
+ 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.