Air Quality Index (AQI) Prediction Using Machine Learning and Deep Learning Approaches

Abhinav VermaInternational Journal for Research in Applied Science and Engineering Technology 2025 · DOI

Abstract

Precise prediction of the Air Quality Index (AQI) is vital for the prevention of public health hazards and policymaking. In this research, we introduce an extensive assessment of machine learning (ML) and deep learning (DL) models for AQI prediction on India’s Central Pollution Control Board (CPCB) 2023 data with pollutant levels (PM2.5, PM10, NO2, SO2, CO, O3) and meteorological features. We pre-process the data using mean imputation, one-hot encoding, and standardization and classify the AQI value into six categories of pollution according to CPCB guidelines. Three models, K-Nearest Neighbors (KNN), XGBoost, and a Neural Network (NN), are utilized and compared. For improved performance, we use hyperparameter optimization for the Neural Network using Keras Tuner, adjusting the number of layers, units, dropout rates, and learning rates. The hyperparameter-optimized Neural Network attains 98.17% accuracy, outperforming conventional models (KNN: 85.39%, XGBoost: 72.91%) and attaining improved precision (98.32%), recall (98.17%), and F1-score (98.18%). Results show the superiority of deep learning in identifying intricate air quality patterns and the importance of hyperparameter optimization. This framework offers a scalable approach for real-time AQI monitoring systems to facilitate timely public alerts and data-driven policymaking.

Introduction

Air pollution is a global health crisis, contributing to millions of premature deaths annually. In India, rapid urbanization has led to frequent "hazardous" air quality levels in major cities. While the Central Pollution Control Board (CPCB) monitors these levels, predicting them accurately remains a challenge. Classic statistical models often fail to capture the non-linear, multivariate interactions between pollutants and weather. This study addresses this gap by applying deep learning to the most recent 2023 CPCB dataset, focusing on how fine-tuning a model’s architecture can lead to deployable real-time monitoring solutions.

Dataset and Preprocessing

The study utilizes the CPCB 2023 dataset, which includes:

  • Pollutants: PM2.5, PM10, NO2, SO2, CO, and O3.
  • Meteorological Variables: Temperature, humidity, and wind speed.
  • Categorical Data: Monitoring station locations and predominant pollutants.

Data preprocessing included mean imputation for missing values, one-hot encoding for categorical features, and standard scaling to normalize the feature set.

Methodology

The researchers employed a regression-to-classification pipeline. Instead of just predicting a category, the models first predict the raw AQI value and then classify it into one of six CPCB-defined categories (from "Good" to "Hazardous").

Three architectures were compared:

  1. K-Nearest Neighbors (KNN): A baseline distance-based regressor.
  2. XGBoost: A gradient-boosted decision tree approach.
  3. Neural Network (NN): A feedforward architecture optimized using Keras Tuner.

The core innovation was systematic hyperparameter optimization. Using a Random Search strategy, the researchers identified the ideal combination of hidden layers (1–5), units per layer (32–512), dropout rates, and learning rates. The final winning configuration featured a three-layer architecture (256-128-64 neurons) with a 0.2 dropout rate.

Results and Discussion

The hyperparameter-tuned Neural Network emerged as the clear winner across all metrics:

  • Accuracy: 98.17% (vs. 85.39% for KNN and 72.91% for XGBoost).
  • Precision/Recall/F1-Score: All exceeded 98%.
  • Public Health Impact: The model achieved a 99.2% recall for "Hazardous" AQI levels, ensuring extreme pollution events are almost never missed.
  • Inference Speed: The model boasts a 300ms prediction time, making it suitable for real-time applications.

Key Insights

  • The Tuning Premium: Systematic hyperparameter tuning provided a 3.5% accuracy gain over the baseline Neural Network, highlighting that architecture design is as critical as model selection.
  • The Failure of XGBoost: Surprisingly, XGBoost performed the worst (72.91%). This is attributed to its inability to handle the complex temporal dependencies inherent in hourly AQI data, as it prioritized feature importance while ignoring time-lagged effects.
  • Capturing Subtle Patterns: The optimized NN was uniquely capable of identifying delayed PM2.5 dispersion in low wind-speed scenarios—a pattern simpler models missed.

Conclusion and Future Work

While the optimized NN demonstrates high accuracy, challenges remain for real-world deployment. The model requires significant computational resources (8.2 GFLOPS) and shows an accuracy gap between urban (98.5%) and rural (89.3%) areas due to monitoring station scarcity.

Future research will focus on Lightweight Edge AI (using quantization and pruning) to allow deployment on low-power hardware. Additionally, the integration of Explainable AI (XAI) techniques like SHAP is proposed to help policymakers understand the specific drivers behind pollution alerts, moving the model from a "black box" to a transparent decision-support tool.

Summary updated

Abstract

Precise prediction of the Air Quality Index (AQI) is vital for the prevention of public health hazards and policymaking. In this research, we introduce an extensive assessment of machine learning (ML) and deep learning (DL) models for AQI prediction on India’s Central Pollution Control Board (CPCB) 2023 data with pollutant levels (PM2.5, PM10, NO2, SO2, CO, O3) and meteorological features. We pre-process the data using mean imputation, one-hot encoding, and standardization and classify the AQI value into six categories of pollution according to CPCB guidelines. Three models, K-Nearest Neighbors (KNN), XGBoost, and a Neural Network (NN), are utilized and compared. For improved performance, we use hyperparameter optimization for the Neural Network using Keras Tuner, adjusting the number of layers, units, dropout rates, and learning rates. The hyperparameter-optimized Neural Network attains 98.17% accuracy, outperforming conventional models (KNN: 85.39%, XGBoost: 72.91%) and attaining improved precision (98.32%), recall (98.17%), and F1-score (98.18%). Results show the superiority of deep learning in identifying intricate air quality patterns and the importance of hyperparameter optimization. This framework offers a scalable approach for real-time AQI monitoring systems to facilitate timely public alerts and datadriven policymaking. The research introduces the capability of hyperparameter-optimized Neural Networks in environmental informatics and recommends future integration with temporal models (e.g., LSTM) for dynamic forecasting.
BibTeX
@article{verma2025air,
  author = {Abhinav Verma},
  title = {{Air Quality Index (AQI) Prediction Using Machine Learning and Deep Learning Approaches}},
  journal = {International Journal for Research in Applied Science and Engineering Technology},
  year = {2025},
  doi = {10.22214/ijraset.2025.71616},
}
Figure