Downloads · 30 days
0
madhave282809/india-air-quality-predictor
india-air-quality-predictor is a time series forecasting model from madhave282809. Use it for the time series forecasting task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
AI-powered Artificial Neural Network for forecasting air pollution in Indian tier-2 cities.
Downloads · 30 days
0
Access
Public
Updated May 5, 2026
Repo size
2 MB
Likes
0
Public
Click a slice to open those files.
.pt2 MB · 98%
From the Hugging Face model README
AI-powered Artificial Neural Network for forecasting air pollution in Indian tier-2 cities.
This project implements a Bidirectional LSTM with Attention neural network to predict PM2.5, PM10, NO2, SO2, O3, CO, and AQI for the next 6 hours based on 24 hours of historical data.
| City | Profile | Typical AQI |
|---|---|---|
| Lucknow | Industrial + vehicular | Moderate-Poor |
| Noida | Delhi-NCR corridor, severe winters | Poor-Very Poor |
| Bengaluru | Traffic-dominated, moderate | Satisfactory-Moderate |
| Jaipur | Dust + industrial | Moderate |
| Srinagar | Low-moderate, seasonal | Good-Satisfactory |
| Mumbai | Coastal, monsoon washout | Satisfactory-Moderate |
Input (24h × 93 features)
↓
Bidirectional LSTM (64 hidden, 1 layer)
↓
Attention Mechanism
↓
MLP Decoder (256 → 128 → 42)
↓
Output (6h × 7 targets: PM2.5, PM10, NO2, SO2, O3, CO, AQI)
Parameters: ~161K
Framework: PyTorch
| Metric | PM2.5 | PM10 | NO2 | SO2 | O3 | CO | AQI |
|---|---|---|---|---|---|---|---|
| RMSE | 0.25 | 0.25 | 0.38 | 0.15 | 0.89 | 0.23 | 18.71 |
| MAE | 0.20 | 0.20 | 0.34 | 0.12 | 0.89 | 0.20 | 15.13 |
| R² | 0.84 |
Metrics computed on held-out test set with inverse-transformed (original scale) values.
The dataset was generated using realistic pollution profiles based on CPCB (Central Pollution Control Board) documented patterns for Indian cities:
data/india_air_quality_synthetic.csv
├── datetime, city
├── pm25, pm10, no2, so2, o3, co
├── temperature, humidity, wind_speed
├── hour, day_of_week, month, day_of_year
├── aqi, aqi_category
pip install -r requirements.txt
python generate_synthetic_data.py # Create dataset
python preprocess.py # Feature engineering
python train.py # Train ANN
python app.py
import torch
from model import get_model
model = get_model(model_type='lstm_attn', input_dim=93)
model.load_state_dict(torch.load('models/best_model.pt')['model_state_dict'])
# Input: (batch, 24h, 93_features) -> Output: (batch, 6h, 7_targets)
├── data/ # Raw and processed data
├── processed/ # Scaled sequences for training
├── models/ # Trained checkpoints
├── model.py # ANN architectures
├── train.py # Training script
├── preprocess.py # Data preprocessing pipeline
├── generate_synthetic_data.py # Dataset generator
├── app.py # Gradio prediction interface
└── requirements.txt # Dependencies
The current dataset is synthetic and parameterized from published pollution profiles for demonstration and model development. For production deployment, integrate with real-time CPCB CAAQMS data feeds or OpenAQ API with proper API keys.
Apache-2.0