Air Quality Index Prediction Using Bi-LSTM
Air Quality Index Prediction Using Bi-LSTM
Abstract:- Air quality prediction plays a vital role in less than 10 microns (PM10) and 2.5 microns (PM2.5),
safeguarding public health and guiding environmental ozone (O3), and carbon monoxide (CO) [4].
policy. Traditional single-model approaches often
struggle to accurately forecast air quality fluctuations. In The adverse effects of these pollutants on human
response, this study introduces a robust prediction health are well-documented [5]. The International Energy
system leveraging advanced machine learning Agency estimates that air pollution contributes to
techniques. We present a comparative analysis of several approximately 6.5 million premature deaths annually, with
models including Support Vector Regression (SVR), long-term exposure to pollutants like PM2.5 and traffic-
Genetic Algorithm-Enhanced Extreme Learning related emissions linked to higher incidences of lung cancer,
Machine (GA-KELM), and Deep Belief Network with coronary heart disease, and other illnesses [6].
Back-Propagation (DBN-BP). Additionally, we propose Consequently, there is a growing urgency to develop
the integration of Bidirectional Long Short-Term effective strategies for air quality prediction, which is
Memory (BiLSTM), a deep learning architecture, to integral to environmental protection efforts [7].
further enhance prediction accuracy. Through
comprehensive experimentation and evaluation, we Air quality prediction relies heavily on data collected
demonstrate that BiLSTM outperforms existing models, from monitoring stations scattered across major cities [8].
exhibiting lower Root Mean Square Error (RMSE) and These stations provide valuable insights into pollution levels
Mean Squared Error (MSE) values. Furthermore, by and help inform predictive models. Machine learning
incorporating GA-KELM, we optimize the performance algorithms have emerged as powerful tools for analyzing
of BiLSTM, enhancing its predictive capabilities even such data, offering the ability to automatically learn features
further. The proposed hybrid model not only offers at multiple levels of abstraction [9]. However, challenges
improved accuracy in air quality forecasting but also persist, including the limited availability of comprehensive
contributes to informed decision-making for pollution datasets and the complexity of modeling multiple pollutants
control strategies and public health interventions. This simultaneously [10].
research underscores the significance of exploring
innovative techniques to address pressing environmental Recent research has explored various approaches to
challenges and underscores the potential of machine address these challenges. Wu Q. et al. proposed an optimal-
learning in advancing air quality management. hybrid model for daily Air Quality Index (AQI) prediction,
leveraging data from six atmospheric pollutants [11].
Keywords:- Time Series, Air Quality Forecasting, Machine However, traditional neural network algorithms often
Learning, Extreme Learning Machine, Genetic Algorithm. encounter issues such as slow learning, susceptibility to
local minima, and complex training processes [12].
I. INTRODUCTION
To overcome these limitations, Huang et al. introduced
Air pollution has emerged as a pressing global concern the extreme learning machine (ELM) algorithm, which is
in the twenty-first century, exacerbated by rapid based on the generalized inverse matrix theory and features
industrialization and urbanization [1]. The consequences of a single hidden layer feedforward neural network [13]. The
deteriorating air quality are far-reaching, impacting both the ELM algorithm has demonstrated superior performance in
environment and public health [2]. Research by Li et al. AQI prediction compared to traditional neural networks,
underscores the health risks associated with outdoor offering advantages in terms of parameter selection, training
physical activity in the presence of ambient air pollution, speed, and prediction accuracy [14]. Despite its
particularly in regions experiencing rapid industrial growth effectiveness, the ELM algorithm's reliance on randomly
such as China [3]. In China, as in many other countries, air selected parameters for hidden layer nodes poses challenges
quality is measured using parameters outlined in the Chinese to prediction accuracy [15].
Ambient Air Quality Standards, including sulfur dioxide
(SO2), nitrogen dioxide (NO2), particulate matter with sizes
In this context, this paper aims to address the Cheng et al. (2019) investigated the optimization of
shortcomings of existing air quality prediction models by outdoor air ratio in air conditioning systems for achieving
proposing a novel approach that combines the strengths of targeted indoor air quality and maximal energy savings [5].
machine learning algorithms with enhanced parameter Their study highlights the importance of optimizing
optimization techniques. Specifically, we introduce a hybrid ventilation strategies to maintain indoor air quality while
model that integrates the Bidirectional Long Short-Term minimizing energy consumption. Chaudhary et al. (2018)
Memory (BiLSTM) architecture with the Genetic developed a time series-based LSTM model to predict air
Algorithm-Enhanced Extreme Learning Machine (GA- pollutant concentrations in prominent cities in India,
KELM). This combination aims to improve the accuracy showcasing the applicability of LSTM models in air quality
and robustness of air quality predictions by leveraging the forecasting [6]. Their research contributes to the growing
predictive capabilities of BiLSTM while optimizing model body of literature on data-driven approaches to air quality
parameters through genetic algorithms [16]. prediction.
In summary, this paper contributes to the ongoing Chen et al. (2018) proposed an urban healthcare big
efforts to advance air quality prediction methodologies by data system based on crowdsourced and cloud-based air
introducing a novel hybrid model that addresses the quality indicators, illustrating the potential of crowdsourcing
limitations of existing approaches. By combining BiLSTM data for monitoring urban air quality [7]. Their study
and GA-KELM, we aim to provide more accurate and highlights the role of emerging technologies in expanding
reliable predictions, thereby facilitating informed decision- the scope of air quality monitoring and public health
making for environmental protection and public health surveillance. Du et al. (2021) presented a deep air quality
management. forecasting framework using a hybrid deep learning
approach, combining convolutional neural networks (CNNs)
II. LITERATURE SURVEY and LSTM networks [8]. Their research demonstrates the
effectiveness of hybrid deep learning models in capturing
Air pollution has emerged as a significant complex spatiotemporal patterns in air quality data.
environmental and public health issue globally, necessitating
comprehensive research to understand its causes, effects, Overall, the literature survey highlights the growing
and mitigation strategies. In this literature survey, we review interest in leveraging machine learning techniques for air
key studies related to air pollution monitoring, forecasting, quality monitoring, forecasting, and management. Studies
and control, with a focus on the application of machine have explored a wide range of approaches, including LSTM
learning techniques for air quality prediction. models, deep learning frameworks, and hybrid machine
learning architectures, to improve the accuracy and
Li et al. (2019) highlighted air pollution as a global reliability of air quality predictions. These advancements
problem that requires local solutions, emphasizing the hold promise for informing evidence-based interventions to
importance of addressing air quality issues at the regional mitigate the adverse effects of air pollution on public health
level [1]. This perspective underscores the need for localized and the environment.
air quality monitoring and prediction systems to inform
targeted interventions. Han et al. (2018) introduced a III. METHODOLOGY
Bayesian Long Short-Term Memory (LSTM) model to
evaluate the effects of air pollution control regulations in A. Proposed Work:
China, demonstrating the utility of advanced statistical The proposed work aims to integrate Genetic
techniques for analyzing air quality data [2]. Their work Algorithm (GA) with Extreme Learning Machine (ELM) to
highlights the potential of LSTM models in predicting the enhance air quality prediction, with a specific focus on
impacts of policy interventions on air quality outcomes. predicting PM2.5 levels. GA will be employed to optimize
the selection of hidden nodes and layers within the ELM
Bai et al. (2018) provided an overview of air pollution model, thereby improving its learning capability and
forecasts, discussing various modeling approaches and data prediction accuracy. By leveraging GA's[14] ability to
sources used in air quality prediction [3]. Their review search for optimal solutions within a predefined search
underscores the complexity of air quality forecasting and the space, the ELM model can adaptively adjust its architecture
importance of incorporating diverse data sources, including to better capture the complex relationships inherent in air
meteorological data, satellite observations, and ground-level quality data. Comparative analysis will be conducted against
monitoring data. Ding and Xue (2019) proposed a deep traditional methods such as Support Vector Machines
learning approach for writer identification using inertial (SVM)[16], with performance metrics including Mean
sensor data of air handwriting, demonstrating the versatility Squared Error (MSE) and Root Mean Squared Error
of deep learning techniques in analyzing sensor data for (RMSE) used to evaluate effectiveness. The proposed
diverse applications [4]. approach seeks to provide a more robust and accurate air
quality prediction system, facilitating comprehensive
assessments of pollution levels and their potential impact on
public health and the environment.
B. System Architecture:
The system architecture for air quality prediction (BiLSTM) networks. These algorithms are trained on the
encompasses several key components to effectively process, training data to learn the underlying patterns and
train, and evaluate predictive models. relationships between input features and air quality
outcomes.
Dataset Input:
The system begins by ingesting air quality datasets Performance Evaluation:
containing relevant features such as pollutant Model performance is evaluated using metrics such as
concentrations, meteorological data, and geographical Mean Squared Error (MSE), Root Mean Squared Error
information. (RMSE), and Mean Absolute Error (MAE). These metrics
quantify the discrepancies between predicted and actual air
Data Processing and Visualization: quality values, providing insights into the accuracy and
Pre-processing steps include handling null values, reliability of the models.
normalization, and feature engineering to prepare the data
for modeling. Visualization techniques are employed to gain Air Quality Prediction:
insights into data distributions and correlations. Once trained, the models are deployed to make
predictions on unseen data, estimating air quality parameters
Train-Test Split: such as pollutant concentrations or Air Quality Index (AQI)
The dataset is divided into training and testing sets to values. These predictions are crucial for assessing current
facilitate model training and evaluation. This ensures that and future air quality conditions, enabling informed
the model's performance is assessed on unseen data, helping decision-making for pollution control and public health
to gauge its generalization ability. interventions.
Binary and Multi-Class Training Algorithms: Overall, the system architecture provides a
The system incorporates various training algorithms, comprehensive framework for air quality prediction,
including Genetic Algorithm-Enhanced Extreme Learning leveraging machine learning algorithms and performance
Machine (GA-ELM)[14], Support Vector Regression evaluation techniques to deliver accurate and reliable
(SVR)[16], and Bidirectional Long Short-Term Memory predictions.
C. Dataset:
Table 1 Dataset
The air quality dataset comprises measurements of Data Processing with Keras Data Frame:
various pollutants such as sulfur dioxide (SO2), nitrogen The Keras DataFrame facilitates seamless integration
dioxide (NO2), particulate matter with sizes less than 10 with deep learning frameworks, enabling efficient data
microns (PM10) and 2.5 microns (PM2.5), ozone (O3), and preprocessing and model training for neural network
carbon monoxide (CO). Each observation includes pollutant architectures.
concentrations, along with corresponding timestamps and
geographical locations. Additionally, meteorological data Handling Missing Values:
such as temperature, humidity, wind speed, and atmospheric Similar to Pandas, missing values are addressed to
pressure may be included. This dataset enables exploration ensure data completeness and integrity.
and analysis of air quality trends over time and across
different regions, facilitating research on the impact of Normalization:
pollution on public health and the environment. Numeric features are normalized within the Keras
DataFrame using appropriate scaling techniques. This
D. Data Processing: ensures consistent feature ranges and aids in convergence
during neural network training.
Data Processing with Pandas DataFrame:
The Pandas DataFrame is utilized for efficient data Dropping Unwanted Columns:
manipulation and preprocessing tasks. This includes Columns deemed unnecessary for neural network
handling missing values, normalization, and dropping training are dropped from the Keras DataFrame. This
unwanted columns to prepare the dataset for model training. optimizes computational resources and prevents overfitting
by reducing model complexity.
Handling Missing Values:
Missing values, if any, are addressed through Overall, data processing with both Pandas and Keras
techniques such as imputation or removal. This ensures the DataFrames plays a crucial role in preparing the dataset for
integrity of the dataset and prevents biases in subsequent model training, ensuring data quality, and facilitating
analyses. efficient model convergence.
Normalization: E. Visualization:
Numeric features are normalized to a standard scale, Visualization using Seaborn and Matplotlib enhances
typically between 0 and 1, to ensure consistency and prevent understanding of air quality data through insightful
features with larger scales from dominating the model graphical representations.
training process.
Histograms:
Dropping Unwanted Columns: Seaborn's `histplot` and Matplotlib's `hist` functions
Columns that are irrelevant or redundant for the visualize the distribution of pollutant concentrations,
predictive task are dropped from the DataFrame. This revealing patterns and outliers.
reduces dimensionality and enhances computational
efficiency during model training.
H. Algorithms:
MAE:
Absolute Error is the amount of error in your
measurements. It is the difference between the measured
value and “true” value. For example, if a scale states 90
pounds but you know your true weight is 89 pounds, then
the scale has an absolute error of 90 lbs – 89 lbs = 1 lbs.
REFERENCES
[11]. V. Chaudhary, A. Deshbhratar, V. Kumar, and D. [24]. T. S. Rajput and N. Sharma, ‘‘Multivariate regression
Paul, ‘‘Time series based LSTM model to predict air analysis of air quality index for Hyderabad city:
pollutant’s concentration for prominent cities in Forecasting model with hourly frequency,’’ Int. J.
India,’’ in Proc. Int. Workshop Utility-Driven Mining Appl. Res., vol. 3, no. 8, pp. 443–447, 2017.
(UDM), Aug. 2018, pp. 1–9. [25]. Z. Kang and Z. Qu, ‘‘Application of BP neural
[12]. M. Chen, J. Yang, L. Hu, M. S. Hossain, and G. network optimized by genetic simulated annealing
Muhammad, ‘‘Urban healthcare big data system algorithm to prediction of air quality index in
based on crowdsourced and cloud-based air quality Lanzhou,’’ in Proc. IEEE Comput. Intell. Appl.
indicators,’’ IEEE Commun. Mag., vol. 56, no. 11, (ICCIA), Sep. 2017, pp. 155–160, doi:
pp. 14–20, Nov. 2018. 10.1109/CIAPP.2017.8167199.
[13]. R. Chen, X. Wang, W. Zhang, X. Zhu, A. Li, and C. [26]. B. Liu, S. Yan, J. Li, G. Qu, Y. Li, J. Lang, and R.
Yang, ‘‘A hybrid CNN-LSTM model for typhoon Gu, ‘‘A sequence-tosequence air quality predictor
formation forecasting,’’ GeoInformatica, vol. 23, no. based on the n-step recurrent prediction,’’ IEEE
3, pp. 375–396, Jul. 2019. Access, vol. 7, pp. 43331–43345, 2019.
[14]. S. Du, T. Li, Y. Yang, and S. Horng, ‘‘Deep air [27]. K. Elbaz, I. Hoteit, W. M. Shaban, and S.-L. Shen,
quality forecasting using hybrid deep learning ‘‘Spatiotemporal air quality forecasting and health
framework,’’ IEEE Trans. Knowl. Data Eng., vol. 33, risk assessment over smart city of NEOM,’’
no. 6, pp. 2412–2424, Jun. 2021. Chemosphere, vol. 313, Feb. 2022, Art. no. 137636.
[15]. R. Feng, H.-J. Zheng, H. Gao, A.-R. Zhang, C. [28]. P. C. Campbell, Y. Tang, P. Lee, B. Baker, D. Tong,
Huang, J.-X. Zhang, K. Luo, and J.-R. Fan, R. Saylor, A. Stein, J. Huang, H.-C. Huang, E.
‘‘Recurrent neural network and random forest for Strobach, J. McQueen, L. Pan, I. Stajner, J. Sims, J.
analysis and accurate forecast of atmospheric Tirado-Delgado, Y. Jung, F. Yang, T. L. Spero, and
pollutants: A case study in Hangzhou, China,’’ J. R. C. Gilliam, ‘‘Development and evaluation of an
Cleaner Prod., vol. 231, pp. 1005–1015, Sep. 2019. advanced national air quality forecasting capability
[16]. B. S. Freeman, G. Taylor, B. Gharabaghi, and J. Thé, using the NOAA Global Forecast System version
‘‘Forecasting air quality time series using deep 16,’’ Geosci. Model Develop., vol. 15, no. 8, pp.
learning,’’ J. Air Waste Manage. Assoc., vol. 68, no. 3281–3313, Apr. 2022.
8, pp. 866–886, Aug. 2018. [29]. X.-B. Jin, Z.-Y. Wang, W.-T. Gong, J.-L. Kong, Y.-
[17]. S. Mahajan, H.-M. Liu, T.-C. Tsai, and L.-J. Chen, T. Bai, T.-L. Su, H.-J. Ma, and P. Chakrabarti,
‘‘Improving the accuracy and efficiency of PM2.5 ‘‘Variational Bayesian network with information
forecast service using cluster-based hybrid neural interpretability filtering for air quality forecasting,’’
network model,’’ IEEE Access, vol. 6, pp. 19193– Mathematics, vol. 11, no. 4, p. 837, Feb. 2023.
19204, 2018. [30]. J. Li, W. Shi, and D. Yang, ‘‘Color difference
[18]. J. Jin, J. Gubbi, S. Marusic, and M. Palaniswami, classification of dyed fabrics via a kernel extreme
‘‘An information framework for creating a smart city learning machine based on an improved grasshopper
through Internet of Things,’’ IEEE Internet Things J., optimization algorithm,’’ Color Res. Appl., vol. 46,
vol. 1, no. 2, pp. 112–121, Apr. 2014. no. 2, pp. 388–401, Apr. 2021.
[19]. A. Grover, A. Kapoor, and E. Horvitz, ‘‘A deep
hybrid model for weather forecasting,’’ in Proc. 21st
ACM SIGKDD Int. Conf. Knowl. DiscoveryData
Mining, Aug. 2015, p. 379–386.
[20]. A. Agarwal and M. Sahu, ‘‘Forecasting PM2.5
concentrations using statistical modeling for
Bengaluru and Delhi regions,’’ Environ. Monit.
Assessment, vol. 195, p. 502, Mar. 2023.
[21]. D. J. Lary, T. Lary, and B. Sattler, ‘‘Using machine
learning to estimate global PM2.5 for environmental
health studies,’’ Environ. Health Insights, vol. 9, no.
1, pp. 41–52, 2015.
[22]. Y. Zheng, X. Yi, M. Li, R. Li, Z. Shan, E. Chang,
and T. Li, ‘‘Forecasting fine-grained air quality based
on big data,’’ in Proc. 21th ACM SIGKDD Int. Conf.
Knowl. Discovery Data Mining, New York, NY,
USA, Aug. 2015, pp. 2267–2276.
[23]. Y. Zheng, L. Capra, O. Wolfson, and H. Yang,
‘‘Urban computing: Concepts, methodologies, and
applications,’’ ACM Trans. Intell. Syst. Technol.,
vol. 5, no. 3, p. 38, Sep. 2014.