Predicting NO₂ column densities from the International Wealth Index using CNNs to support emissions monitoring and NDC accountability
This repository contains the replication code for the paper International Wealth Index Predicts NO₂ Column Densities Using Convolutional Neural Networks. It includes a link to access the paper, and step-by-step guidance for replicating and reproducing the study's results.
Link to the Research Square version
Link to the published version will be available after the work is published
Tracking emissions is challenging, especially with long-lived gases like CO₂. Nitrogen dioxide (NO₂), a short-lived pollutant, offers a more dynamic proxy for monitoring human activity and emission patterns.
This repository presents a CNN-based framework that uses the International Wealth Index (IWI) to predict satellite-derived NO₂ column densities. By linking socioeconomic development with atmospheric data, the model enables improved identification of emission hotspots and supports analysis of climate policy targets such as NDCs.
The JavaScript corr_co2_no2.js computes pixel-wise temporal correlations between monthly CO₂ and NO₂ concentrations using satellite observations within the Google Earth Engine (GEE) environment, which is shown in Figure 1.
First, it integrates OCO-2 CO₂ data (monthly collections), and TROPOMI NO₂ Level-3 data over a 43-month period (July 2018 – March 2022). Then it combines the datasets into a unified time series of paired observations to compute Pearson correlation coefficients per pixel across time. Finally, it visualizes the spatial distribution of correlations, highlighting regions of strong positive or negative co-variability
The resulting correlation maps reveal areas where CO₂ and NO₂ share common emission sources (e.g., combustion, urban activity, biomass burning) versus regions where their relationship is decoupled due to atmospheric processes or emission controls.
You can explore the average of CO₂, NO₂ and the correlation map in the GEE app co2-no2
This script TROPOMI_download.py automates the download, processing, and aggregation of TROPOMI NO₂ satellite data over a specified geographic region (Africa) and time period.
For each year–month combination, the workflow Extracts relevant download URLs from a master list of TROPOMI NO₂ files. Then it downloads Level-2 satellite data in parallel using multiprocessing. After that, it applies spatial oversampling to generate Level-3 gridded NO₂ column densities using popy. Finally, it saves monthly aggregated outputs as NetCDF files
The resulting dataset provides high-resolution (0.01°) monthly NO₂ tropospheric column densities, suitable for downstream analysis and modeling.
The script Train_IWI_Wind_NO2.py implements the training pipeline for deep learning models that predict NO₂ concentrations from the International Wealth Index (IWI), with optional inclusion of wind data (ERA5).
The workflow includes:
- Data loading: IWI (NetCDF + CSV), NO₂ (NumPy), and wind fields
- Patch-based preprocessing: creation of large non-overlapping patches and smaller overlapping patches with masking of missing data
- Data augmentation: rotations and flips to increase training diversity
- Train/validation/test splitting: spatially consistent splits with controlled randomization
- CNN model training: configurable architecture with parameters, x: patch size, d: network depth (number of layers), w: network width (filters in deepest layer), and custom metrics: masked MSE and masked R² to handle missing data.
It incorporates some robust evaluation including multiple training iterations with different data splits, random permutation tests to assess statistical significance, and computation of p-values and performance distributions.
Finally the model outputs are stored separatelywhich are organized as:
- x10: models trained on 10 different data splits with multiple pixel shuffles
- x100: models trained on 1000 splits (for best-performing configurations) with extensive permutation testing
The workflow implements a Leave-One-Country-Out (LOCO) evaluation framework to assess how well a convolutional neural network generalizes spatially across Africa. The model predicts NO₂ concentrations using socioeconomic and environmental inputs. This repository contains the code Leave-One-Country-Out_analysis.py used to generate Figure 2 from the paper: Model performance (R²) across African countries.
It is a patch-based preprocessing pipeline. Firstly it extracts multi-scale spatial patches from gridded datasets (IWI, wind, NO₂). After handling missing data, and applying normalization, and data augmentation, it implements a LOCO (Leave-One-Country-Out) evaluation. The script supports single-input (IWI) or multi-input (IWI + wind) setups. It iteratively excludes one country during training, and tests the model performance on the held-out country to produces country-level R² scores.
Regarding the visulization, it generates a choropleth map of Africa in which the countries are shaded by model R² performance to highlight the spatial generalization patterns.
The script R2_statistics.py contains the code used to generate Tables 1 and 2 from the paper, summarizing the performance of all evaluated models under different architectural configurations.
The script aggregates and reports R² statistics across multiple experiments, enabling systematic comparison of model performance under varying: Patch sizes (x), Network depths (d), Network widths (w), and Input configurations (IWI vs. IWI + wind). It also includes a comparison with a linear baseline model.
The code loads precomputed experiment outputs (results.pkl) to extract main R² scores (model performance), and random permutation R² scores (baseline / robustness check). Then it computes summary statistics including Mean R² and Standard deviation of R². It iterates over all model configurations and prints formatted results for direct inclusion in tables (LaTeX-ready format). These values correspond directly to the entries reported in Tables 1 and 2.
The Python script NDC_analysis.py contains the code used to generate the Nationally Determined Contributions (NDCs) analysis in figure 5 over some Africa countries trained models. The trained model is then used to forecast NO₂ emissions up to 2030 and compare these projections with NDCs reported by African countries.
It is important to note that NDC values used in this project were manually extracted from individual country reports and linearly interpolated to align with a common time frame in ehich the start year is 2019 and the target year is 2030. This interpolation is implemented in the code (see linear_interpolation function). Due to the heterogeneity of NDC documents, this step required manual data collection and harmonization.