A 500 m annual nighttime light dataset optimized for Africa from 2000 to 2025
# AfriNTL Code
AfriNTL is an Africa-optimized two-stage nighttime light reconstruction framework for producing annual 500 m nighttime light data. The implementation follows the manuscript methods: Stage I calibrates and desaturates DMSP-OLS time series with a Dynamic Spatio-Temporal Feature Extraction Network (DSTFE), and Stage II reconstructs high-resolution 500 m nighttime lights with population-adaptive sparse convolution and an enhancement-denoising dual-branch network.
## Method Overview
Stage I uses a seven-year temporal window from `Y-3` to `Y+3`, year-difference vectors, saturation-mask vectors, a UNet encoder-decoder, and multi-head temporal attention to generate temporally consistent 1 km calibrated nighttime light fields.
Stage II integrates Stage I output, LandScan population density, DEM-derived terrain relief, NDVI, and MODIS/SDC500 background features. It adapts the receptive field between sparse rural settlements and dense urban agglomerations, enhances weak valid light signals, suppresses geographically induced noise, and outputs 500 m reconstructed radiance.
## Repository Layout
```text
AfriNTL/
models/ PyTorch Stage I and Stage II model definitions
data/ GeoTIFF IO, temporal windows, and dataset classes
training/ L1-loss training and evaluation loops
inference/ Annual raster prediction helpers
metrics/ Radiometric, temporal, super-resolution, and urban metrics
configs/ Default YAML configuration
scripts/ Training, prediction, and validation entry points
examples/ Synthetic forward-pass example
tests/ Synthetic unit tests
```
## Installation
```bash
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
```
## Configuration
Edit `configs/AfriNTL_default.yaml` to match the local project layout. The default configuration follows the manuscript data groups:
- harmonized DMSP-OLS annual GeoTIFFs
- RNTL calibration reference GeoTIFFs
- VIIRS VNL V2 annual GeoTIFFs
- LandSc …