Pawan Hingane
B.Tech (Engineering)
VIT Bhopal University
Air pollution has emerged as a critical environmental and public health challenge worldwide. Identifying the source of pollution—such as vehicular emissions, industrial activity, or natural contributors—is essential for informed decision-making, mitigation strategies, and policy development.
This project presents a machine learning–based approach to classify pollution sources by integrating air quality data, meteorological conditions, spatial proximity features, and geospatial visualization. The primary focus is on developing a realistic, robust, and deployable system, prioritizing generalization and interpretability over artificially inflated performance metrics.
Given environmental data collected from multiple heterogeneous sources, the objective is to predict the primary pollution source (pollution_source) affecting a given geographical location and visually represent pollution patterns for decision support.
- Integrate air quality, weather, and spatial data from multiple sources
- Perform systematic data preprocessing and feature engineering
- Train and evaluate multiple machine learning classification models
- Select a stable model for deployment
- Visualize pollution severity and sources using interactive maps
- Ensure realistic performance while avoiding overfitting
- Source: OpenWeather API
- Features: Temperature, humidity, wind speed, and weather description
- Source: Dataset provided by Ankit Sir
- Features:
- Carbon Monoxide (CO) AQI
- Nitrogen Dioxide (NO₂) AQI
- Ozone (O₃) AQI
- Particulate Matter (PM2.5) AQI
- Overall Air Quality Index (AQI)
- Source: OpenStreetMap (OSM) library
- Features:
- Distance to nearest road
- Distance to industrial areas
- Distance to traffic hotspots
All datasets were merged using spatial coordinates and timestamps to create a unified dataset.
- Standardized column names for consistency
- Removed invalid records and missing target labels
- Handled missing numerical values using median imputation
- Handled missing categorical values using mode imputation
- Label encoding for categorical features
- Label encoding for the target variable
- Standardization using
StandardScalerfor uniform model input
The following engineered features were derived to improve predictive performance:
- Traffic Pollution Index: Average of CO and NO₂ AQI
- Particulate Ratio: PM2.5 AQI relative to overall AQI
- Heat–Humidity Index: Combined effect of temperature and humidity
- Spatial Proximity Features:
- Distance to road (km)
- Distance to industrial area (km)
- Distance to traffic hotspot (km)
To simulate real-world conditions, controlled sensor noise and approximately 18% label noise were introduced.
| Model | Purpose |
|---|---|
| Random Forest | Baseline and deployed production model |
| Decision Tree | Interpretable comparison model |
| XGBoost | Advanced benchmarking model |
- Depth-limited decision trees
- Minimum sample constraints
- Balanced class weights
This model was selected for deployment due to its robustness, stability, and strong generalization capability.
- Used primarily for interpretability
- Hyperparameters optimized to reduce overfitting
- Gradient boosting ensemble model
- Used for performance comparison only
Hyperparameter optimization was performed using RandomizedSearchCV, primarily on the Decision Tree model.
The Random Forest configuration was intentionally preserved to maintain baseline consistency.
- Accuracy
- Precision
- Recall
- Weighted F1-score
- Confusion Matrix
- Stratified K-Fold Cross-Validation
- Random Forest Accuracy: ~80–85%
- Decision Tree: Lower accuracy, expected due to simplicity
- XGBoost: Comparable or slightly higher accuracy
Overfitting was controlled through:
- Model depth constraints
- Minimum sample requirements
- Noise injection
- Cross-validation consistency
Comparable performance across training and test datasets confirms no overfitting.
To enhance interpretability and decision support, model predictions were visualized using interactive geospatial maps:
- Predictions and location data were loaded into an interactive mapping interface
- Folium was used to generate dynamic pollution heatmaps
- Source-specific markers were overlaid to represent pollution origins (e.g., industrial, vehicular)
- High-risk zones were visualized using color gradients based on pollutant severity
- Filters were implemented to explore data by:
- Date
- Location
- Predicted pollution source
The maps were embedded into the web dashboard for user interaction and analysis.
- Data collection from APIs and curated datasets
- Data preprocessing and cleaning
- Feature engineering and transformation
- Model training and evaluation
- Prediction generation
- Geospatial visualization and dashboard integration
- Model serialization using Joblib
- Random Forest selected as the production model
- Saved artifacts include:
pollution_rf_realistic.pklscaler.pkltarget_encoder.pkl
Other models are retained for experimentation and comparison.
This project delivers an end-to-end pollution source classification system that integrates machine learning with geospatial visualization. By focusing on realistic data handling, robust modeling, and interactive mapping, the system provides meaningful insights suitable for real-world environmental monitoring and decision-making.
- Real-time data streaming and alerts
- Advanced GIS-based spatial analysis
- Satellite data integration
- Cloud-based scalable deployment
- OpenWeather API Documentation
- OpenStreetMap (OSM)
- Scikit-learn Documentation
- XGBoost Documentation