You are currently viewing a new version of our website. To view the old version click .
Sensors
  • Article
  • Open Access

5 August 2024

Design and Enhancement of a Fog-Enabled Air Quality Monitoring and Prediction System: An Optimized Lightweight Deep Learning Model for a Smart Fog Environmental Gateway

,
and
Department of Computer Science and Engineering, Amrita School of Computing, Amrita Vishwa Vidyapeetham, Coimbatore 641112, India
*
Author to whom correspondence should be addressed.
This article belongs to the Special Issue Artificial Intelligence Methods for Smart Cities—2nd Edition

Abstract

Effective air quality monitoring and forecasting are essential for safeguarding public health, protecting the environment, and promoting sustainable development in smart cities. Conventional systems are cloud-based, incur high costs, lack accurate Deep Learning (DL)models for multi-step forecasting, and fail to optimize DL models for fog nodes. To address these challenges, this paper proposes a Fog-enabled Air Quality Monitoring and Prediction (FAQMP) system by integrating the Internet of Things (IoT), Fog Computing (FC), Low-Power Wide-Area Networks (LPWANs), and Deep Learning (DL) for improved accuracy and efficiency in monitoring and forecasting air quality levels. The three-layered FAQMP system includes a low-cost Air Quality Monitoring (AQM) node transmitting data via LoRa to the Fog Computing layer and then the cloud layer for complex processing. The Smart Fog Environmental Gateway (SFEG) in the FC layer introduces efficient Fog Intelligence by employing an optimized lightweight DL-based Sequence-to-Sequence (Seq2Seq) Gated Recurrent Unit (GRU) attention model, enabling real-time processing, accurate forecasting, and timely warnings of dangerous AQI levels while optimizing fog resource usage. Initially, the Seq2Seq GRU Attention model, validated for multi-step forecasting, outperformed the state-of-the-art DL methods with an average RMSE of 5.5576, MAE of 3.4975, MAPE of 19.1991%, R2 of 0.6926, and Theil’s U1 of 0.1325. This model is then made lightweight and optimized using post-training quantization (PTQ), specifically dynamic range quantization, which reduced the model size to less than a quarter of the original, improved execution time by 81.53% while maintaining forecast accuracy. This optimization enables efficient deployment on resource-constrained fog nodes like SFEG by balancing performance and computational efficiency, thereby enhancing the effectiveness of the FAQMP system through efficient Fog Intelligence. The FAQMP system, supported by the EnviroWeb application, provides real-time AQI updates, forecasts, and alerts, aiding the government in proactively addressing pollution concerns, maintaining air quality standards, and fostering a healthier and more sustainable environment.

1. Introduction

The escalating issue of air pollution poses a significant concern due to its widespread impact on human health and the environment, eliciting attention from industrialists, governments, academicians, and communities worldwide. According to the World Health Organization (WHO), over 92% of cities worldwide do not meet the established air quality guidelines. Air pollution is a major problem, particularly in developing nations like India, which ranks third in greenhouse gas emissions after China and the United States [1]. Despite government efforts, air quality levels have significantly worsened over the years due to various factors, including industrialization, urbanization, weather conditions, geographical features, and vehicular emissions. Air pollution is considered the most significant environmental health threat, where 9 out of 10 people breathe polluted air, causing seven million deaths globally every year [2,3]. It increases the risk of chronic respiratory diseases, impairs cognitive function, contributes to cardiovascular diseases and cancer, and increases susceptibility to viral infections like COVID-19 [4]. Elevated pollution levels seriously affect public health, the climate, the economy, and the ecosystem [5]. With 68% of India’s population projected to live in urban areas by 2050, the current monitoring infrastructure is insufficient. The Central Pollution Control Board (CPCB) has announced that India plans to double the air quality monitoring stations to address these existing challenges. The comprehensive monitoring requirements and the pressing pollution threats necessitate the development of an efficient IoT-based architecture for air quality monitoring and forecasting systems using state-of-the-art technologies. This would enable policymakers to create strategies for pollution prevention and preemptive actions, thereby improving public health, environmental protection, urban planning, public awareness, economic benefits, and regulatory support in smart cities.
Experts estimate that 75 billion Internet of Things (IoT) devices will be connected to cyberspace by 2025 [6]. The advancements in the IoT and Artificial Intelligence (AI) have fueled the development of smart city applications, generating vast and diverse datasets. Efficiently analyzing these growing data in real time and making timely decisions is essential for improving urban life. While Cloud Computing offers substantial computational and storage capabilities for the data, it is limited by computational overhead, bandwidth constraints, and latency [7,8]. To overcome these limitations, Fog Computing (FC) was introduced. FC extends Cloud Computing by bringing computation, communication, storage, and networking closer to IoT data sources at the network’s edge in a decentralized manner [9]. By enabling data processing at fog gateways or nodes positioned between the edge (terminal) and the cloud layer, rather than sending all data directly to the cloud [10], FC reduces reliance on the cloud connections and minimizes potential data flow interruptions [8]. FC offers benefits like low latency, minimized bandwidth usage, real-time decision making and responses, contextual awareness, and scalability, effectively satisfying the Quality of Service(QoS) requirements for smart city applications [11].
To address the challenges in real-time applications, researchers have turned to advanced technologies such as IoT and Fog Computing. Despite the growing significance of FC, the majority of the existing Air Quality Monitoring (AQM) solutions are cloud-based, leading to high monitoring and communication costs. These solutions often lack real-time and accurate multi-step forecasting and timely decision making and fail to optimize Deep Learning (DL) models for the efficient deployment on fog nodes. To address these challenges, this paper proposes a novel Fog-enabled Air Quality Monitoring and Prediction (FAQMP) system, featuring a low-cost AQM node with efficient communication and a Smart Fog Environmental Gateway (SFEG) that incorporates efficient Fog Intelligence to enhance real-time decision support in smart cities. The system effectively integrates state-of-the-art technologies, including Fog Computing (FC), IoT, LPWAN, and Deep Learning (DL). Specifically, Fog Intelligence enables the execution of DL models on fog nodes at the network’s edge. However, the resource constraints of fog nodes pose challenges, leading to innovations in model optimization, energy efficiency, and real-time data processing [12]. With this concern, this paper highlights achieving efficient Fog Intelligence by optimizing DL models for fog nodes like SFEG through an optimized lightweight DL-based Sequence-to-Sequence (Seq2Seq) Gated Recurrent Unit (GRU) model. This model strikes a balance between model performance and computational efficiency, thereby enabling efficient utilization of SFEG resources.
The proposed FAQMP system features a hierarchical, three-layered architecture with the sensing layer, the FC layer, and the cloud (CC) layer. At the sensing layer, an AQM node is equipped with a customized PCB and low-cost sensors to acquire the major air pollutants data that contribute to Air Quality Index (AQI) levels, including particulate matter 2.5 (PM2.5), particulate matter 10 (PM10), nitrogen dioxide (NO2), sulfur dioxide (SO2), carbon monoxide (CO), ozone (O3), and meteorological data, including temperature, pressure, humidity, wind speed (WS), wind direction (WD), and solar radiation (SR). This data is transmitted to the FC layer via LoRa, a Low-Power Wide-Area Network (LPWAN) technology known for its long-range capabilities, cost-effectiveness, and low power consumption [13,14]. The FC layer utilizes Raspberry Pi 3 Model B+ [15] as the Smart Fog Environmental Gateway (SFEG) embedded with Fog Intelligence. The SFEG processes and manages data, provides real-time forecasting, and supports decision making. It includes an Early Warning System (EWS) that detects anomalies and triggers alerts, enabling preemptive actions and rapid responses. The processed data are then sent to the cloud for long-term storage and complex analysis using MQTT. Additionally, the EnviroWeb application provides users with real-time air quality data, forecasts, trends, and alerts, helping them make informed decisions and improve public health and safety.
The proposed system addresses the challenges of DL model deployment for real-time air quality forecasting through fog–cloud collaboration. This collaboration allows to train and optimize the DL model in the cloud and then transfer it to the SFEG to facilitate Fog Intelligence. Initially, a DL-based Seq2Seq GRU Attention model is proposed, which outperforms the state-of-the-art DL baseline models by effectively capturing temporal dependencies in multi-step air quality forecasting. This initial DL model is further optimized through post-training quantization to be lightweight and efficient for deployment on resource-limited fog nodes like SFEG. This optimization enables efficient Fog Intelligence by reducing model size and computational latency while maintaining forecast accuracy.
To the best of our knowledge, no existing studies have developed an end-to-end air quality monitoring and forecasting system by incorporating efficient Fog Intelligence. The proposed FAQMP system effectively integrates Fog Computing with LPWAN, creating a decentralized architecture that reduces monitoring and communication costs. Specifically, it introduces an efficient Fog Intelligence on the SFEG using an optimized lightweight DL model, enabling real-time processing, accurate multi-step forecasting, and timely early warnings and event response to anomalous events, which are crucial for decision support in smart city environments to improve public health and safety.
The main contributions of the work are summarized below:
  • Proposed a novel Fog-enabled Air Quality Monitoring and Prediction (FAQMP) system leveraging IoT with Fog Computing, LPWAN, and DL, aiming to support real-time and low-cost monitoring with accurate forecasting for decision support in smart cities.
  • Developed a Smart Fog Environmental Gateway (SFEG) that introduces efficient Fog Intelligence in the FC layer through fog–cloud collaboration.
  • Developed a user-friendly web application, namely EnviroWeb, to present real-time air quality AQI trends, forecasts, early warnings, and alerts to the users.
  • Proposed a DL-based Seq2Seq GRU Attention model for multivariate multi-step time series air quality forecasting. The model demonstrates superior performance and stability in forecasting air quality for multiple time steps in comparison against baseline models.
  • Developed an optimized lightweight DL model that facilitates efficient Fog Intelligence on the SFEG by striking a balance between computational efficiency and model performance.
The remainder of the paper is structured as follows: Section 2 provides an overview of the related works of air quality monitoring and forecasting systems and discusses the technologies enabling Fog Intelligence in IoT environments. Section 3 presents the proposed framework; the tools and technologies involved; the implementation of fog–cloud collaboration; the scalability aspects; and the real-world impacts. Section 4 describes the methodology for multivariate multi-step air quality forecasting. Section 5 presents the experimental evaluation and results of the proposed optimized lightweight DL model tailored for efficient Fog Intelligence. Finally, Section 6 discusses the concluding remarks and outlines future work.

3. Proposed Approach: A Fog-Based IoT Architecture and Fog–Cloud Collaboration in the FAQMP System

This section discusses the Fog Computing architecture, the functionalities of the SFEG, and the implementation of fog–cloud collaboration.

3.1. Architecture of the FAQMP System and Hardware Implementation

The proposed FAQMP system adopts a three-layered architecture: the sensing layer at the bottom, the FC layer in between, and the CC layer at the top, as depicted in Figure 2. Each layer has distinct functionalities that collaborate to achieve an efficient end-to-end IoT system, managing data processing and analysis across different layers. The architecture is explained in detail as follows:
Figure 2. A three-layered Fog Computing-based architecture of the proposed system.
  • Sensing layer: The sensing layer serves as the foundation for monitoring air quality levels. The primary component of this layer is the AQM sensor node, designed with a PCB configured to function as an end device, as shown in Figure 3a. The PCB modularly integrates an array of dedicated low-cost sensors that acquire pollutant and meteorological parameters, along with a LoRa communication module connected to the controller unit. The controller unit is an Arduino Mega 2560, which is a low-cost, low-power, and resource-constrained microcontroller. Moreover, low-cost sensors have gained importance in facilitating dense deployments, greater coverage, and portability over traditional static monitoring systems. The sensors, as discussed in Table 4, are selected based on their cost, precision, accuracy, range, ability to monitor gases, lifetime, and compatibility with the controller. In particular, the sensors, including SDS011, MICS4514, MQ131, MQ136, BME280, pyranometer, and MPXV7002DP, measure the values of PM2.5, PM10, NO2, SO2, CO, O3, temperature, pressure, humidity, SR, WS, and WD. Moreover, due to variations between sensors in production, it is recommended to calibrate before deployment [27,31] to ensure accuracy in the measured values. Thus, the sensors in our AQM system are calibrated before data acquisition. For instance, Algorithm 1 presents the steps to pre-calibrate sensors like MQ136, where the coefficients x and y are extrapolated based on the characteristic curve presented in the datasheet [88]. The pre-calibration ensures that the sensor provides accurate and reliable readings of the measured gas.
    Figure 3. Hardware of the proposed FAQMP system. (a) Air Quality Monitoring (AQM) Sensor Node. (b) Smart Fog Environmental Gateway (SFEG).
    Table 4. Sensors to monitor the pollutants and meteorological parameters.
Algorithm 1: Pre-Calibration of the MQ136
1 :   R 0 calculation ( R 0 —Sensor resistance in the pure air);
2 :   R g calculation ( R g —Sensor resistance in the presence of a specific gas);
3: Analog read sensor pin;
4: Collect various samples and determine the aggregate (S);
5 :   R 0 = S/clean air factor;
6: Extrapolate coefficients x and y from datasheet;
7: Estimate ppm values, ppm = x × R g R 0 y .
The AQM sensor node is statically placed 5 m from the ground, referring to the CPCB guidelines. It periodically samples the air quality data every minute. After acquiring the heterogeneous air quality and meteorological data, they are unified and appended with the sensor ID and timestamp to form a payload. Each payload comprises twelve floating-point 32-bit numbers (PM2.5, PM10, NO2, SO2, CO, O3, temperature, pressure, humidity, SR, WS, and WD) equal to 48 bytes and a 16-bit integer (authentication number) equal to 2 bytes. The total number of payload bytes to be transmitted from the sensor to the FC layer is 50 bytes, which equals 400 bits. This payload is periodically transmitted to the FC layer through LoRa. The LoRa communication module Dorji DRF1276DM [89] is a unique module embedded with a Semtech SX1276 LoRa chip operating on an ISM frequency band of 433 MHz that is integrated with the controller unit to transmit data to the FC layer. The process by which the end device sends data to the upper-level device in the FC layer is referred to as uplinking. On the other hand, downlinking refers to the process of transmitting data from the fog layer to end devices. The uplinking and downlinking refer to the direction of data transmission between end devices and the FC layer. To ensure reliable data transmission from the AQM node to the FC layer, the adopted radio parameters for the LoRa link are transmission power of +14 dBm, spreading factor (SF) of SF9, coding rate (CR) of 4/5, and bandwidth (BW) of 250 kHz. The transmission power of +14 dBm provides a good trade-off between range and power consumption, ensuring reliable data transmission to the FC layer without the need for excessive power, thereby conserving battery life. SF9 maintains a balance between range and data rate by effectively handling a 50-byte payload. A CR of 4/5 offers robust error correction to ensure data accuracy despite interference. A BW of 250 kHz supports a higher data rate and facilitates quicker and efficient transmission of the payload while maintaining a good range. The adopted LoRa configuration strikes a balance among power consumption, data rate, and range.
The designed AQM system is a low-cost, low-power, multi-sensing, configurable, easily installable, and accurate system with long-range wireless data transmission capabilities to monitor air quality levels. Figure 3a shows the hardware of the proposed AQM sensor node that costs approximately USD 120 and is considerably less expensive than the traditional AQM systems for large-scale monitoring deployments.
  • Fog Computing (FC) Layer: FC is vital for air quality monitoring and forecasting due to its ability to offer computation and storage closer to the data sources with the benefits of minimized response time, optimized bandwidth efficiency, reliability, and reduced burden on the cloud. FC addresses the challenges of data processing, analysis, and transmission in dynamic environmental conditions. For the proof of concept, the proposed system utilizes a cost-effective Raspberry Pi 3 Model B+ as the fog gateway or fog node, as shown in Figure 3b. The fog gateway receives air quality sensor data from the sensing layer using LoRa module Dorji DRF1276DM. The received data are filtered and processed for further analysis. Fog intelligence is introduced by deploying an optimized DL model for on-device inference, enabling efficient processing by eliminating the need to constantly communicate with the cloud for processing. Moreover, the Early Warning System (EWS) detects anomalies and initiates an event response upon detecting dangerous AQI levels. Moreover, the real-time services offered by RPi for air quality data storage, management, communication, data analysis, early warnings, fog intelligence, and fog–cloud collaboration enable it to be a Smart Fog Environmental Gateway (SFEG). The services of the SFEG to manage the data and resources are detailed in Section 3.2. Furthermore, the forecast results and the air quality data are sent to the cloud using MQTT for historical storage and analysis.
  • Cloud Computing (CC) Layer: The cloud layer at the top of the hierarchy centralizes and manages the data obtained from the SFEG in the FC layer. It offers a robust infrastructure to store and process historical air quality data, manage fog nodes, train complex DL models, and serve end-user applications. We chose the AWS platform as it offers a comprehensive suite of secure services like AWS IoT Core, AWS Lambda, DynamoDB, S3, CloudWatch, and Sage Maker, making it an ideal choice for our system requirements. Furthermore, a web application, namely EnviroWeb, is designed to present stakeholders with real-time air quality data, pollutant trends, AQI levels, forecasts, and early warnings using the data stored in the cloud.
Table 5 presents a summary of the tools, technologies, and methods utilized in the three layers of the FAQMP system.
Table 5. A summary of the tools and technologies in the FAQMP system.

3.2. Implementation of Fog–Cloud Collaboration in the Proposed FAQMP System

A significant distinction between the proposed FAQMP system and the traditional system lies in the incorporation of fog–cloud collaboration. Deploying a DL model via a cloud-based solution encounters communication latency, whereas edge- and fog-based solutions face challenges due to resource constraints. To address their standalone limitations, the fog and cloud platforms collaborate actively for model training and forecasting through fog–cloud collaboration. Fog–cloud collaboration entails integration and cooperation between the FC and CC layers for joint execution of DL tasks. As discussed earlier in Section 2.3, the deployment of a DL model for inference is categorized into three types based on its execution at different layers. However, the proposed system employs model training in the cloud and inferencing in the fog layer, fostering Fog Intelligence via fog–cloud collaboration. This approach leverages the computational power and resources of the cloud alongside the real-time capabilities of FC to achieve fast and responsive inference. The realization of fog–cloud collaboration that enables Fog Intelligence is achieved through various functionalities of the SFEG and cloud, as illustrated in Figure 4 and detailed below.
Figure 4. Architecture and data flow of the proposed Fog-enabled Air Quality Monitoring and Prediction (FAQMP) System.
  • Node Authentication: The SFEG’s node authentication module authenticates the AQM sensor nodes to join the SFEG network for continuous transmission of air quality data. Initially, this module sends an authentication number to the AQM node in the sensing layer via LoRa downlink. The AQM node integrates the received authentication number with the collected air quality, forming a payload for LoRa uplinking to the SFEG. Daemons on the SFEG listen for incoming messages, extract live data, including the authentication number, and verify them. If the number matches, the AQM sensor node is authenticated and can send data, ensuring secure and reliable transmission.
  • Data Handler: The SFEG’s data handler filters and preprocesses the received air quality data. Missing values are imputed using linear interpolation, and the AQI is calculated and appended to the preprocessed data. Preprocessing tasks like data cleaning, filtering, aggregation, and formatting enhance the data before analysis. The final prepared data, including PM2.5, PM10, NO2, SO2, CO, O3, temperature, pressure, humidity, WS, WD, and SR, along with the AQI, are stored in the SFEG database to ensure seamless data recovery. SFEG data storage allows the system to remain stable and provide backup even during network outages and intermittent connectivity.
The cloud publisher transmits the data to the cloud over Wi-Fi using MQTT. MQTT [5] is a lightweight publish/subscribe messaging protocol suitable for resource-constrained devices to support low-bandwidth, high-latency, and unreliable network environments. The SFEG publishes air quality data in JSON format under the topic “sfeg/air_quality_data” to the AWS IoT Core broker, which processes the messages and stores the data in DynamoDB via an AWS Lambda function. This setup enables seamless integration of the developed Enviro Web application with DynamoDB for accessing air quality data.
  • Cloud Model Orchestrator: The cloud model orchestrator manages the training, optimization, and storage of the DL model in the cloud for deployment on the SFEG. At first, AWS Sage Maker facilitates model training with historical air quality data by leveraging the powerful compute instances. Based on the comparative analysis of various DL models presented, the Seq2seq GRU Attention model has good multi-step forecasting performance as analyzed from the results in Section 5.1.6. To make the model lightweight and efficient for SFEG, dynamic range quantization based on PTQ in model compression is applied, reducing its size and execution time while maintaining model accuracy. This optimized lightweight Seq2seq GRU Attention model, chosen based on the experimental results from Section 5.2, is then stored in AWS S3.
  • Model Manager: By embracing fog–cloud collaboration, the model manager on the SFEG uses the model downloader to download the model from the AWS S3 bucket using the boto3 library. This model is deployed on the SFEG for inference, introducing efficient Fog Intelligence. Figure 5 illustrates the deployment pipeline [90] for the optimized DL model on a low-resource fog device like SFEG. The local air quality data are fetched, normalized, and fed into the model to generate multi-step forecasts for the next 3 h (12 time steps) at 15 min intervals in real time, without network delays. These live and meaningful forecasts are presented through the EnviroWeb application dashboard to the stakeholders.
    Figure 5. DL model deployment pipeline after model quantization.
Furthermore, the error assessment component determines the cumulative forecasting error of the deployed model over time using Root Mean Square Error (RMSE). If the cumulative error exceeds a predefined threshold, the model update component requests retraining in the cloud with updated air quality samples. The model is retrained and optimized, stored in AWS S3, downloaded by the model downloader, and deployed for new forecasts. This process in the model manager establishes a feedback loop where model retraining allows for regular updates to model parameters ensuring adaptation to seasonal changes and long-term air quality trends, thereby maintaining accuracy over time.
  • Early Warning System (EWS) Handler: The EWS Handler analyzes the live data and forecasted data to detect anomalies and provide insights into the potential issues with the air quality data, including seasonal deviations. If any anomaly exists in the live data based on the AQI threshold defined, it is referred to as a live data anomaly. On the other hand, if an anomaly exists in the forecasted values, it is referred to as a prediction anomaly. Similarly, if an anomaly exists in both live and forecasted data, it is referred to as a discrepancy anomaly. While processing, if an anomaly is detected, the event variable is updated with the anomaly type (e.g., live data anomaly), and then the sub-module of EWS, namely the event response module, is activated as presented in Figure 4.
  • Event Response: Based on the nature of the event, the SFEG’s event response module makes timely decisions and initiates appropriate actions to address the anomaly. These actions include information streaming, actuator control, and sensor network configuration.
    (a)
    Information Streaming: Timely alerts or notifications are sent to users via channels such as email, SMS, and EnviroWeb dashboards. This is crucial for providing immediate information about any detected anomalies, particularly those related to dangerous air quality levels. For testing purposes, we simulated a fire event where the AQI levels increased in the live data. This simulated spike activated the event response module, triggering an immediate reaction. As a result, an email alert was generated and received, as shown in Figure 6, demonstrating how the system works in real time to notify stakeholders about hazardous air quality conditions.
    Figure 6. Real-time alerts triggered by anomalous AQI Levels via email.
    (b)
    Sensor Network Configuration: During a live data anomaly, commands are sent to the controller of the AQM sensor node via LoRa downlinking. These commands adjust the AQM sensor node’s sampling rate to capture more detailed event information.
    (c)
    Actuator Control: During a live data anomaly, commands are sent to activate alarms, adjust ventilation systems, activate air purifiers, and control pollutant emission sources to maintain a healthy environment. This is crucial during time-critical hazardous events, such as dangerous air quality levels, fires, and gas leakages, to enable timely response by promptly reducing the severity of dangerous situations.
The event response helps to avoid exposure to abnormal pollutant levels, mitigate air pollution-related health risks, and address environmental concerns effectively.
  • Fog manager: The fog manager is mainly responsible for managing all the modules of the SFEG. It includes tasks such as resource allocation, data processing, data transmission, communication management, and overall coordination of activities within the FC environment.
In summary, the implementation of fog–cloud collaboration allows efficient utilization of data, knowledge, and resources across the fog and cloud layers, resulting in proactive decision making and improved responsiveness to address the requirements of real-time IoT-based air quality application services.

3.3. EnviroWeb Application

EnviroWeb, a user-friendly web application, empowers users with real-time air quality data and forecasting insights. By leveraging state-of-the-art technologies for air quality monitoring and prediction, EnviroWeb sets a new standard to help individuals and communities make informed decisions to protect their health and well-being and take a proactive step toward improved air quality levels. The main features of the Enviro Web application are presented below:
  • Real-time Air Quality Data: The application offers real-time measurements of air pollution and meteorological data, as well as the Air Quality Index (AQI), as shown in Figure 7.
    Figure 7. Graphical User Interface of the EnviroWeb application displaying the live pollutants, Air Quality Index (AQI) level, and recommendations for citizens in real time.
  • Historical Data Analysis and Visualization: The application features customizable visualizations in charts and graphs to illustrate the historical pollution and AQI trends over a user-specified period (day, week, or month).
  • Air Quality Forecast and Recommendations: The application presents AQI predictions for the next 3 h at an interval of 15 min. Based on the live and forecasted air quality data, decisions are made and recommendations are presented to the users related to health, travel, lifestyle changes, behavioral adjustments, and actions to reduce pollution levels.
  • Smart Alerts: When an anomalous event or hotspot is detected based on the live and forecasted air quality levels, alerts are presented in the dashboard as a part of the EWS Handler’s actuation (information streaming), as discussed previously in Section 3.2.
  • Maps: The interactive map uses color-coded markers based on the AQI level of a specific location, allowing the users to navigate and explore the surrounding AQM station locations and determine AQI hotspots.
  • Data Export and Sharing: The data export and sharing feature allows users to export the monitoring and forecast data.
The front-end application module is implemented through the Angular framework, a prevalent and extensively employed JavaScript platform to build responsive web applications. The backend uses AWS DynamoDB APIs to ensure seamless interaction with DynamoDB, allowing for efficient data management and retrieval of air quality data.

3.4. City-Wide Air Quality Management with FAQMP: Achieving Scalability and Real-Time Insights

Scaling the FAQMP system involves addressing the complexities and demands of monitoring and forecasting air quality on a larger, city-wide scale. This includes deploying thousands of AQM sensor nodes across multiple city locations, which creates a comprehensive network that delivers detailed and representative air quality data. This expanded network results in more accurate and reliable insights. This section explores the challenges and solutions associated with scaling the FAQMP system and highlights its real-world impact.

3.4.1. Challenges and Bottlenecks in Scaling the Proposed FAQMP System

The challenges and potential bottlenecks in scaling the FAQMP system to a city-wide scale is outlined below:
  • Data Volume and Management: Increased data from a growing number of sensors nodes will demand robust processing and storage solutions at fog nodes, such as the SFEGs.
  • Resource Management: As the number of AQM sensor node increases, managing computational resources efficiently becomes crucial, requiring careful resource allocation.
  • Communication Efficiency: Deployment of thousands of sensors leads to higher network traffic. Therefore, ensuring efficient communication among the sensor node, SFEG, and the cloud layer is essential for seamless data exchange and low-latency processing.
  • Resource Constraints: Fog nodes like SFEG typically have limited CPU, memory, and storage resources compared to cloud servers, a fact which constrains their ability to process large volumes of sensor data and run complex algorithms.
  • Real-time Processing: Handling high volumes of air quality data and complex forecasting models while maintaining minimal latency and timely responses is challenging.
  • Model adaption and Performance: DL models must adapt to varying air quality patterns and environmental conditions by continuous retraining, which can be resource-intensive.
  • Maintenance and Management: Managing and calibrating numerous sensors to ensure accurate air quality data are complex tasks.
  • Cost Management: Scaling involves higher costs for hardware, installation, maintenance, and ongoing operations.
  • Data Security: Ensuring the security and privacy of sensitive information is crucial.
While scaling the proposed FAQMP system, addressing the discussed issues is crucial to ensure effectiveness and efficiency in monitoring and forecasting air quality levels.

3.4.2. City-Wide Implementation of the FAQMP System—Addressing the Scalability Challenges

By examining the challenges in scaling the FAQMP system from the previous section, the following discussion presents strategies to address these complexities, ensuring the successful deployment and operation of thousands of sensors in a scaled environment.
Let us consider scaling the proposed FAQMP system as in Figure 8 by deploying AQM sensor nodes across various city locations like residential areas, city parks, and industrial zones with each collecting the air pollution and meteorological data. The decentralized, hierarchical Fog Computing architecture uses distributed fog nodes, i.e., SFEGs in the fog layer to manage and process data from the AQM nodes. Each AQM node connects to a local SFEG in the intermediary FC layer and transmits data via LoRa, supporting efficient communication over long distances. Moreover, setting up LoRa in a mesh network will support a dynamic allocation of resources and routing of tasks based on current network conditions, offering significant benefits, including enhanced network resilience, improved data routing, and increased coverage. Each SFEG aggregates, preprocesses, and filters the data collected from the connected AQM sensor nodes, minimizing the volume of data transmitted to the central cloud. Local storage at the SFEGs helps temporarily retain sensor data, reducing data loss. These strategies help mitigate network congestion, optimize bandwidth, and reduce cloud storage requirements.
Figure 8. City-wide implementation of the proposed FAQMP system.
To maintain efficiency and responsiveness, Fog Intelligence employs lightweight DL models optimized for SFEGs, providing real-time air quality forecasts with minimal response time and improved performance. This approach allows scaling without overburdening the limited resources of SFEG. Furthermore, to keep the system adaptive to changing conditions, the DL models are periodically retrained. Since doing this directly on the SFEGs would be too resource-intensive, the system uses the proposed fog–cloud collaboration strategy where model retraining occurs in the cloud and real-time inference on the SFEG. This collaboration manages resources effectively, minimizes latency, and ensures efficient model updates.
For instance, if a fire is detected at any location of the city, the anomaly detection in the Early Warning System module alerts users through the EnviroWeb application, enabling timely responses and actions to critical events. The sensor network configuration captures detailed event information, and automated controls manage alarms and extinguishers. This automation scales operational capabilities without manual intervention, ensuring effective emergency responses. In addition, automated calibration adjusts sensors for drift and environmental changes. Moreover, cost-efficient hardware and technologies as in the proposed system help to manage the scaling expenses.
The above discussion clarifies how the FAQMP system can address scalability challenges such as managing large data volumes, optimizing resource allocation, maintaining efficient communication, ensuring real-time processing, model adaption, operational efficiency, and cost management, enabling it to effectively and efficiently monitor and forecast air quality levels across extensive urban areas.

3.4.3. The Role of the FAQMP System in Shaping Public Health Policies and Urban Development

The proposed FAQMP system tackles air quality challenges through a multi-faceted approach and is significantly impactful in shaping public health policies and urban development based on the following:
  • Public Health Protection: The system provides real-time AQI monitoring and forecasts via EnviroWeb, offering health advisories to vulnerable populations to reduce pollutant exposure. The recommendations will allow citizens to make informed decisions about outdoor activities and travel for an enhanced quality of life.
  • Timely Warnings and Responses: The EWS module of the FAQMP system detects anomalous pollution events and triggers alerts via email and EnviroWeb and captures detailed information through adaptive sensor sampling. Identifying pollution sources enables targeted interventions and regulations to decrease emissions.
  • Proactive Measures: Multi-step forecasting helps predict future hour’s air quality trends, allowing urban planners to implement preemptive strategies in real time and manage pollution peaks.
  • Dynamic Policy Adaptation: The FAQMP system enables the formulation and adjustment of policies related to environmental regulations, emission standards, industrial regulations, and urban design based on the real-time AQI data.
  • Enhanced Urban Planning and Resource Allocation: The FAQMP system will help urban planners identify pollution hotspots based on AQI levels, enabling optimized resource allocation for pollution control and urban infrastructure improvements, such as green spaces and buffer zones.
  • Traffic Management: The data from the FAQMP system will support optimizing traffic flow and congestion management strategies, leading to reduced vehicular emissions.
  • Community Engagement and Sustainable Development: The system promotes transparency and public awareness through EnviroWeb, fostering community involvement and sustainable development.
  • Economic Benefits: The FAQMP system reduces healthcare costs and environmental damage through efficient monitoring and targeted interventions.
In summary, this section detailed the system architecture, and the hardware and software implementation of the FAQMP system, discussed its scalability, and highlighted its impact in urban planning.

4. Methodology

In this research, a GRU-based Seq2Seq architecture with an attention mechanism is investigated for multivariate multi-step forecasting of air quality levels over future time steps.

4.1. Gated Recurrent Unit (GRU)

The Gated Recurrent Unit (GRU) [91] is an advanced variant of an RNN, designed to address vanishing and exploding gradient problems by means of its gating mechanism. It effectively learns the long-term dependencies in time series data through its simpler internal structure and shorter training time compared to LSTM. The GRU architecture as shown in Figure 9 has an update gate, which regulates the retention and integration of past and new information, and a reset gate, which regulates how much of the previous state is to be forgotten. This GRU design supports handling both short-term and long-term dependencies efficiently.
Figure 9. GRU architecture.
The equations of the update gate (zt) and the reset gate (rt) in the GRU are presented in the following Equations (2)–(6):
r t = σ W r . h t 1 , x t + b r
u t = σ W u . h t 1 , x t + b u
h t ~ = t a n h W h t ~ . r t h t 1 , x t + b h
h t = 1 u t   h t 1 + u t h t ~
y t = σ W o . h t
u t   a n d   r t represent the update gate and reset gate, respectively; h t ~ denotes the candidate hidden state; h t represents the hidden state, and tanh is the hyperbolic tangent function. The activation function σ is used for both the forget and update gates.
Wr, Wu, and W h t ~ are the learned weight matrices associated with the reset gate, update gate, and candidate output, respectively. br, bu, and bh are the bias vectors, and ∗ represents the element-wise multiplication.

4.2. Sequence-to-Sequence (Seq2Seq) GRU Attention Model

A Seq2Seq model is an encoder–decoder structure designed to map an input sequence to a target sequence. However, a traditional encoder–decoder model has challenges with temporal information loss, especially with longer sequences, which can degrade performance. To overcome these limitations, the proposed Seq2Seq GRU Attention model incorporates an attention mechanism. This attention mechanism selectively emphasizes relevant parts of the input sequence, allowing the model [92] to focus on crucial information and manage dependencies across long sequences effectively. The temporal attention layer is positioned as the interface between the encoder and the decoder. The architecture of the Seq2Seq model with attention mechanism is shown in Figure 10.
Figure 10. Architecture of the Sequence-to-Sequence GRU Attention mechanism.
Let us consider the Seq2Seq GRU Attention model as a scholar working on a complex research article with the help of a comprehensive textbook. The encoder is analogous to the scholar, who reads and summarizes the textbook into a concise study guide, capturing the essential information and key points. The attention mechanism is like a highlighter that the scholar employs to identify the most critical sections of the study guide, emphasizing areas that are essential for comprehending the subject matter. Finally, the decoder is like the scholar writing the final article, utilizing the highlighted study material to produce a well-informed research paper. In air quality forecasting, the input data can be compared to the comprehensive textbook: the encoder uses GRU units to convert the input air quality data sequence into a compact, high-level summary known as the context vector. This summary captures essential patterns and trends from the historical data. The attention mechanism dynamically assigns different weights to various parts of the input sequence based on their significance in forecasting air quality levels. It highlights the most relevant parts of this vector for each forecasting step. The decoder employs GRU units to generate multi-step future predictions based on this highlighted information; i.e., it leverages the weighted context from the attention mechanism to make accurate predictions, considering the most relevant historical data for each forecast step. This process enables the model to convert extensive historical air quality data into actionable forecasts, like how a scholar turns extensive study material into a well-organized and insightful research paper.
The components of the Seq2Seq GRU Attention model are discussed in detail below
  • Encoder: The encoder is a GRU that processes the given input sequence X = [ x 0 , x 1 , . x T ] to generate a sequence of hidden states [ h 1 ,   h 2 ,   . . . . h T ] , where T is the length of the input sequence. At each encoding time step t, the hidden state h t is updated by using both the input vector x t and the previous hidden state h t 1 , as illustrated in Equation (7).
    h t = G R U _ E n c o d e r ( h t 1 , x t )
  • Attention Mechanism: The attention mechanism in the Seq2seq GRU-based Attention model allows focus on significant parts of the input sequence while generating output in the decoder, guided by attention scores.
  • Attention Score Calculation: The “attention score” or “alignment score” for each encoder hidden state hi is calculated using a scoring function. The attention score et,i indicates how much importance the decoder’s previous state places on the specific encoder state hi. The attention score is calculated as illustrated in Equation (8).
e t , i = S t 1 T . h i
where et,i is the attention score based on the dot product of the vectors that signifies the correlation between the previous decoder’s hidden state S t 1 T and i th hidden state of the encoder hi at time step t and T refers to the transpose operation.
  • Attention weight calculation: Attention weights are the normalized version of the attention scores. After computing the attention scores e t , i , a softmax function is applied to these scores to obtain the temporal attention weights α t , i as displayed in Equation (9).
      α t , i = S o f t m a x e t , i = exp ( e t , i ) k = 1 T e x p ( e t , k )
    where T denotes the length of the input sequence.
  • Context vector calculation: The context vector is a fixed-size representation of the input sequence, calculated by combining the encoder’s hidden states with the attention weights as illustrated in Equation (10):
c t = i = 1 T α t , i . h i
It represents a focused summary of the input sequence, with different elements weighted according to their relevance to the current decoding step t. Higher α t , i values indicate an increased significance of the associated hidden state ( h i ) . This enables the attention mechanism to assign higher attention weights to elements in the input sequence that are more relevant to generating output at the current time step. The weighted summation mechanism in the context vector calculation allows the model to focus on different parts of the sequence dynamically and utilize relevant information from the hidden states of the encoder based on the attention weights during decoding.
3.
Decoder: The decoder is another GRU that reads the information from the context vector and its internal states to generate the output sequence. The context vector c t obtained from the attention mechanism is combined with the decoder’s previous hidden state ( s t 1 ) and previous target output ( y t 1 ) , then fed to the GRU unit to compute the current hidden state s t as in Equation (11). s t acts as an initial point to compute the output sequence.
s t = f s t 1 , y t 1 , c t        
where f is the GRU function.
  • The output layer is a regression function that outputs the predicted value y t . The decoder generates the output sequence at each time step t based on the current hidden state s t , previous output y t 1 , and context vector c t as expressed in Equation (12).
    y t = s o f t m a x W . [ c t , s t , y t 1 + b )
  • W is the weight matrix; b is a bias vector, and [ c t , s t , y t 1 ] represents the concatenation of the context vector, the current hidden state, and the previous output.
Similarly, the steps involved in the attention mechanism (step 2) and the decoder (step 3) are repeated until the maximum sequence length is reached.

5. Experimental Evaluation

We carried out experiments to create an optimized lightweight model for air quality forecasting, aiming to enable efficient deployment of Deep Learning (DL) models for Fog Intelligence on the Smart Fog Environmental Gateway (SFEG).
Experiment I involved determining an accurate multivariate multi-step DL-based air quality forecasting model by comparing the state-of-the-art methods. Subsequently, this determined model is made lightweight by conversion to a TFLite model and optimized by applying the PTQ technique based on model compression as discussed in Section 2.3.1. Experiment II focused on validating the performance of the optimized lightweight model. This involved analyzing the effects of different quantization methods on the initial model to ensure efficient deployment on fog nodes by reducing model size and lowering execution time while maintaining high model accuracy.

5.1. Experiment I: DL-Based Multivariate Multi-Step Forecasting

Multivariate multi-step air quality forecasting refers to a prediction modeling task that forecasts values of pollutant variables for future h time steps based on the multiple input variables (air quality and meteorological variables), where h N denotes the forecasting horizon. If h = 1, the forecasting is simplified to single-step forecasting.
This section demonstrates the effectiveness of the proposed Seq2Seq GRU Attention model for the multivariate multi-step air quality forecasting model by comparing its performance with baselines using historical air quality data. Figure 11 shows the stages involved in carrying out Experiment I.
Figure 11. Steps involved in multivariate multi-step air quality forecasting.

5.1.1. Dataset Description

This study utilized historical air quality data obtained from the CPCB, a government-established AQM station located in SIDCO Kurichi, Coimbatore, Tamil Nadu, India (latitude: 22.544697, longitude: 88.342606) [93]. The dataset spans samples of one year, from June 2019 to June 2020, with 35,232 samples recorded at 15 min intervals, and is publicly accessible on the CPCB website. The investigative variables included the primary air pollutants and meteorological parameters such as PM2.5, PM10, NO2, SO2, CO, O3, humidity, WS, WD, and SR. The dimensions of PM2.5, PM10, SO2, NO2, and O3 are expressed in micrograms per cubic meter (μg/m3), while CO is measured in milligrams per cubic meter (mg/m3). The EDA indicates that the pollutant levels exhibit an increase during the winter months of December, January, and February, in contrast to the monsoon months of June and July. This is because the meteorological conditions greatly influence the air quality levels and play a crucial role in enhancing the forecasting performance [14].

5.1.2. Data Preprocessing

Data preprocessing is an important step in air quality modeling as it enhances the representation of collected data and improves model performance. It involves handling the missing values, addressing the outliers, normalizing the data, and performing a dataset split. The air quality data from AQM stations may reveal missing values and inconsistent measurements due to sensor malfunctioning, power failure, or influence of external and uncontrollable factors. In such cases, missing values increase the uncertainty of the data, making it difficult to effectively capture the temporal characteristics. As part of preprocessing, missing values are identified and imputed using the linear interpolation method as expressed in Equation (13), to ensure temporal continuity between the data points and improve the model’s effectiveness. We then identified the outliers using IQR and replaced them using linear interpolation.
y = y 1 + t t 1 t 2 t 1   y 2 y 1
y* is the missing value at the time t , and ( t 1 ,   y 1 ) and ( t 2 , y 2 ) are the data points of two known samples. The data y 1 , y 2 ,   and   y are in a straight line, and t* is inside or outside the time interval [ t 1 ,   t 2 ]. In addition, the data are normalized using min–max scaling in the boundary of [0, 1] via a linear transformation as expressed in Equation (14). The normalization eliminates the influence of measurement scale differences among different features in the dataset and improves the model convergence,
x = x x m i n x max x m i n
where x* represents the normalized feature value and x m a x and x m i n represent the maximum and minimum values of the features, respectively.
The data are transformed into time series samples, and the train–test split is performed on the dataset, where the training set comprises 80% of the data and the testing set has 20% of the data. The training set is employed for model fitting, and the testing set is used to evaluate the performance of the model.
A multivariate time series of air quality data comprising variables of air pollutants and meteorological parameters recorded over consecutive time intervals is represented as X i = x i , j ,   i = 1 ,   2 , n ;   j = 1 ,   2 , m , where i is the time dimension, n is the time series length, j is the feature dimension, and m represents the maximum value of variable dimension. X i vector refers to the values of air pollutants and meteorological variables at the ith time step. The representation can be illustrated as a two-dimensional matrix, as shown in Equation (15):
X i = x 11 x 12 x 1 m x 21 x 22 x 2 m x n 1 x n 2 x n m
During the training of a multivariate multi-step forecasting model, historical time series samples are utilized. Each sample consists of observations of all the features over a fixed window size, serving as the inputs. The output pair comprises samples with a sequence of target variables for the future time steps. In the multi-output strategy, a single function F maps the input to the output pairs, as in Equation (16) during training.
X ^ t + 1 , X ^ t + 2 , X ^ t + 3 , ,   X ^ t + h   = F   X t w + 1 , ,   X t   where   t w , ,   n h
where F is a non-linear mapping function in the training phase, w is the sliding window size, X ^ t + h   denotes the predicted value at time t + h, and X ^ represents the target variable.

5.1.3. Experimental Settings and Baselines

The experiments are conducted on an Apple MacBook Pro equipped with an M1 chip featuring an 8-core CPU and 8 GB of unified memory. The DL models are implemented in Python 3.7 using the Keras framework built on TensorFlow.
The state-of-the-art models, including GRU, Seq2Seq-GRU, GRU Autoencoder, GRU Attention, Seq2Seq LSTM Attention, Seq2Seq BiLSTM Attention, GRU-LSTM Autoencoder, LSTM-GRU, and LSTM-GRU Attention, are considered baselines for comparison against the proposed model.

5.1.4. Evaluation Metrics

This section demonstrates the effectiveness of the proposed Seq2Seq GRU Attention model. To evaluate the predictive performance of the models investigated in the study, various statistical metrics, including Root Mean Square Error (RMSE), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE), Pearson’s Correlation Coefficient ( R 2 ), and Theil’s U1 Index, are utilized, as depicted in Equations (17)–(21).
R M S E             =   1 N j = 1 N y j y ^ j   2
M A E                   =   1 N j = 1 N y j y ^ j
R 2                           =   1 j = 1 N y j y ^ j   2 j = 1 N y j y ¯ j   2
        M A P E             = 1 N j = 1 N y j y ^ j   2 y j × 100 %
T h e i l s   U 1 = 1 N j = 1 N y j y ^ j   2 1 N j = 1 N y j   2 + 1 N j = 1 N y ^ j   2
where y j and y ^ j denote the actual and predicted values of jth observation respectively, y ¯ i denotes the average of the actual values, and N is the total number of samples. The models exhibit a better forecasting performance and fitting effect when the RMSE, MAE, MAPE, and Theil’s U1 values are smaller and R2 is closer to 1.

5.1.5. Hyperparameter Tuning

Hyperparameter tuning is crucial for enhancing DL model performance by determining the optimal combination of parameters in the network architecture. It enhances model accuracy, optimizes processing time, and mitigates overfitting. There are several methods for hyperparameter optimization, like manual search, random search, grid search, Bayesian optimization, and metaheuristic algorithms. In our work, we adopted grid search with holdout validation for multi-step air quality forecasting. This approach evaluates the performance of the model used by systematically testing various hyperparameter combinations on the training set and verifying their effectiveness on the testing set. The hyperparameters of the proposed Seq2Seq GRU Attention model are the number of encoder and decoder units, activation function, optimizer, learning rate, forecast horizon, batch size, epochs, and window size. Table 6 displays the range of hyperparameter values and the optimal values obtained through a grid search for the proposed model. Finally, the proposed model is retrained using these optimal values on the entire training set to ensure accurate multi-step forecasting.
Table 6. Hyperparameters of the proposed Seq2Seq GRU Attention model and the optimal values.

5.1.6. Experimental Results: Analysis and Discussion

This section presents the experimental results analyzing the performance of the Seq2Seq GRU Attention model and baseline models in forecasting six primary pollutants responsible for the AQI: PM2.5, PM10, SO2, NO2, and O3 over multiple future time steps. During testing, we fed the model with pollutants and meteorological data as the input to forecast pollutant concentrations for the next three hours and outputted pollutants in twelve consecutive time steps (i.e., next three hours) at a 15 min time interval. All models are tested on the same test set, and the forecasting performance is assessed in terms of RMSE, MAE, R2, MAPE, IA, and Theil’s U1.
Although we analyzed the forecasting performance of all six pollutants, with page considerations, we present only the forecasting performance of the two significant pollutants, PM2.5 and PM10, in Table 7 and Table 8, at different stages of multi-step forecasting (1st time step to 12th time step). After analyzing the impact of forward forecasting step size on the forecasting performance for PM2.5 and PM10 in Table 7 and Table 8, and other pollutants, a common observation reveals that as the forecast time step increases, the RMSE, MAE, MAPE, and Theil’s U1 gradually increase, while R2 decreases for all the models. This indicates that multi-step prediction poses a significant challenge compared to single-step forecasting, primarily because the forecasting horizon significantly impacts accuracy owing to the uncertainty in time series air quality data arising due to weather patterns, environmental conditions, and other factors that affect air quality. Therefore, it is crucial to consider the forecasting horizon when evaluating the forecasting models to ensure their effectiveness in providing reliable predictions over different time steps. Nevertheless, the proposed model exhibits good performance in multi-step forecasting, even when the time step increases. The results of the proposed model are highlighted in bold.
Table 7. Evaluation of the DL-based multivariate multi-step forecasting models to forecast PM2.5 for 12 consecutive time steps.
Table 8. Evaluation of the DL-based multivariate multi-step forecasting models to forecast PM10 for 12 consecutive time steps.
From analyzing the forecasting performance results of PM2.5 in Table 7, the proposed Seq2Seq GRU Attention model achieved the best performance for long-term forecasting (t + 12), with the lowest RMSE (7.9083), MAE (5.4929), MAPE (27.4658), and U1 (0.177) and highest R2 (0.5309) against the baseline models. On the contrary, the GRU has the highest error rates for single-step-ahead forecasting (t + 1) and long-term forecasting (t + 12) when compared to the other models that are hybrid RNNs and encoder–decoder-based models. Similarly, analyzing the performance results of PM10 in Table 8, the proposed Seq2Seq GRU Attention model achieved the lowest RMSE (11.7805), MAE (8.3638), MAPE (29.323), and U1 (0.1925) and highest R2 (0.6212) compared to the baselines for long-term forecasting (t + 12). This is mainly because the attention mechanism in the Seq2Seq GRU architecture of the proposed system improves the long-term forecasting performance of the pollutants. In addition, the line graphs in Figure 12, Figure 13, Figure 14 and Figure 15 illustrate the performances of the various models compared in forecasting PM2.5 and PM10 concentrations over future time steps (t + 1 to t + 12). Moreover, it illustrates the ability of the proposed Seq2Seq GRU Attention model to maintain the lowest error and outperform the baselines, proving its effectiveness and stability in multi-step forecasting
Figure 12. Error metrics of DL models to forecast PM2.5 over twelve time steps (t1–t12). (a) RMSE comparison; (b) MAE comparison; (c) MAPE comparison.
Figure 13. Performance metrics of DL models to forecast PM2.5 over twelve time steps (t1–t12). (a) R2 comparison; (b) Theil’s U1 comparison.
Figure 14. Error metrics of DL models to forecast PM10 over twelve time steps (t1–t12). (a) RMSE comparison; (b) MAE comparison; (c) MAPE comparison.
Figure 15. Performance metrics of DL models to forecast PM10 over twelve time steps (t1–t12). (a) R2 comparison; (b) Theil’s U1 comparison.
In addition, Table 9 presents the performance metrics (RMSE, MAE, MAPE, R2, and U1) of various models for each pollutant (PM2.5, PM10, NO2, SO2, CO, and O3), with values representing the average errors across twelve time steps (t + 1 to t + 12) for each model and pollutant. The last column displays the average performance across all pollutants, providing a comprehensive assessment of the model’s performance.
Table 9. Comparative analysis of average forecasting errors (1st to 12th time steps) of various models for all the primary pollutants (PM2.5, PM10, NO2, SO2, CO, and O3).
The results of Table 9 are discussed below:
  • The traditional RNN model, GRU, exhibited the least average forecasting performance with an RMSE, MAE, MAPE, R2, and Theil’s U1 of 9.2129, 7.1219, 44.63, 0.081, and 0.2268, respectively. Moreover, the effectiveness of the GRU is improved through a hybrid RNN approach like the LSTM-GRU, which demonstrates better performance. Compared to the GRU, a hybrid LSTM-GRU has a better average forecasting performance across all the pollutants, where RMSE, MAE, MAPE, and Theil’s U1 are decreased by 10.89%, 11.32%, 16.54%, and 4.32%, respectively, while R2 is increased by 0.1052.
  • Seq2Seq GRU exhibited improved average forecasting performance over the RNN variants (LSTM-GRU and GRU). This indicates that introducing an encoder–decoder into the RNN model is beneficial to enhance the forecasting performance. For instance, compared with the LSTM-GRU, the RMSE of Seq2Seq GRU decreases by 3.19%, the MAE decreases by 5.79%, MAPE decreases by 7.38%, Theil’s U1 decreases by 9.19%, and R2 increases by 0.1553.
  • The forecasting performance of the Autoencoder model (GRU Autoencoder), a variant of the encoder–decoder is superior to the Seq2Seq GRU for all the pollutants. Despite this, the hybrid variant of AE (GRU-LSTM Autoencoder) has better performance than the GRU-AE. Compared with the GRU Autoencoder, the RMSE, MAE, MAPE, and Theil’s U1 of the GRU-LSTM Autoencoder decrease by 8.81%, 6.76%, 7.06%, and 7.24% respectively, and R2 increases by 0.0931.
  • Moreover, adding an attention mechanism to the LSTM-GRU architecture, as seen in the LSTM-GRU Attention, led to an enhancement in forecasting performance. Compared with the LSTM-GRU, the RMSE, MAE, MAPE, and Theil’s U1 of the LSTM-GRU Attention model decrease by 12.76%, 15.45%, 19.23%, and 15.14%, respectively, and R2 is increased by 0.2022. The encoder–decoder-based attention variants (Seq2Seq LSTM Attention, Seq2Seq Bi-LSTM Attention, and Seq2Seq GRU Attention) exhibit improved performance over the Seq2Seq GRU. This indicates that introducing an attention mechanism overcomes the limitations of the traditional Seq2seq RNN models by dynamically focusing on relevant input sequences to capture contextual information critical for accurate predictions, mitigating information loss from fixed-length context vectors, addressing the vanishing gradient problem for effectively capturing long-range dependencies, and generating context-related forecasts with enhanced performance.
  • The Seq2Seq Bi-LSTM Attention exhibits a similar average forecasting performance compared to the GRU-LSTM Autoencoder; the latter demonstrates better efficacy specifically for the pollutants PM2.5, NO2, and O3. However, the proposed Seq2Seq GRU Attention model demonstrates the best average performance across twelve time steps for each of the pollutants, as well as superior average forecasting performance across all the pollutants in comparison with the baselines. Compared with the Seq2Seq Bi-LSTM Attention, the average forecasting performance of the proposed model across all the pollutants in terms of RMSE decreases by 18.27%, MAE decreases by 33.83%, MAPE decreases by 33.51%, Theil’s U1 decreases by 18.95%, and R2 increases by 28.70%.
  • The proposed Seq2Seq GRU Attention achieves the best average forecasting performance across six pollutants for 12 time steps, with an average RMSE of 5.5576, MAE of 3.4975, MAPE of 19.1991, R2 of 0.6926, and Theil’s U1 of 0.6926, as highlighted in bold in Table 10.
    Table 10. TensorFlow and TensorFlow Lite models file size comparison.
In addition, Figure 16 presents the bar chart illustrating the performance metrics (RMSE, MAE, MAPE, R2, and Theil’s U1) of various models across all pollutants over 12 time steps, showing that the Seq2seq GRU Attention model attains enhanced average forecasting performance over the baseline models.
Figure 16. Performance metrics (RMSE, MAE, MAPE, R2, and U1) of the compared models across all pollutants (PM2.5, PM10, NO2, SO2, CO, and O3) over 12 time steps (t1–t12): (a) Average RMSE; (b) Average MAE; (c) Average MAPE; (d) Average R2; (e) Average Theil’s U1; and Model 1—GRU, Model 2—LSTM-GRU, Model 3—Seq2Seq GRU, Model 4—GRU Autoencoder, Model 5—GRU-LSTM Autoencoder, Model 6—GRU Attention, Model 7—LSTM-GRU Attention, Model 8—Seq2Seq LSTM Attention, Model 9—Seq2Seq Bi-LSTM Attention, and Our model—Seq2Seq GRU Attention.
To summarize the extensive experimental analysis, the results show that the Seq2seq GRU Attention model demonstrates superior forecasting performance by outperforming the baseline models for accurate multivariate multi-step air quality forecasting. The attention mechanism effectively captures the relationship between current and past time sequences to improve stability in long-term predictions of all the primary pollutants (PM2.5, PM10, NO2, SO2, CO, and O3) responsible for determining AQI levels.

5.2. Experiment II: Evaluation of an Optimized Lightweight DL Model for Efficient Fog Intelligence

After determining an accurate AQ forecasting model (initial model) based on Experiment I, the study developed an optimized lightweight variant to facilitate efficient model deployment for Fog Intelligence on the resource-constrained fog node (SFEG). To achieve this, we converted the initial DL model (Seq2SeqGRUAttention model) built using TensorFlow (TF) into a TensorFlow Lite (TFLite) model. During this conversion, TFLite provided support for quantization techniques based on model compression. This section evaluates and compares the resulting TFLite models on the fog node, i.e., the SFEG, resulting from different post-training quantization techniques like dynamic range quantization, integer with float fallback quantization, full-integer-only quantization, and float16 quantization. This analysis helps to determine the suitable post-training technique resulting in an optimized lightweight Seq2Seq GRU Attention model that effectively reduces the model’s size and execution time while maintaining high forecast accuracy on the SFEG. This ensures that the model remains efficient and accurate.
The Raspberry Pi 3 Model B+, serving as the SFEG, is used to evaluate the performance of the TFLite models. It features a BCM2837 Quad-Core processor, 1 GB of RAM, built-in Wi-Fi, and Bluetooth 4.1 with BLE. Its support for TFLite, a lightweight version of TensorFlow, enabled the execution of DL models for real-time data processing in Fog Computing environments. TFLite is characterized by two main components:
  • TFLite converter: The TFLite converter converts TF models into an optimized format by applying optimization techniques such as quantization, model pruning, and operator fusion to reduce model size and increase inference speed. It generates a TensorFlow Lite model file (.tflite) that contains the converted model in a format that the TFLite interpreter can handle.
  • TFLite interpreter: The TFLite interpreter loads the TFLite model (optimized model), prepares it for execution, and enables on-device inferencing using the input data. It enables the efficient execution of TFLite models.
Together, the TFLite converter and interpreter enable an efficient deployment of TF-based DL models on fog devices with reduced memory footprint and inference.
We evaluated the resulting file size, execution time, and model accuracy of the TensorFlow Lite model with and without quantization. Table 11 compares the file size of the original TF model and the TFLite model that is not optimized on the SFEG. The original file size measures 1176 KB, while the TFLite version is significantly smaller at 397 KB, representing a reduction of three times in size. File size reduction is a key step for resource-constrained devices with minimal storage.
Table 11. File size comparison TF and TFLite models.
Furthermore, size reduction is achieved through post-training quantization. With the TFLite model’s size of 397 KB as a reference, dynamic range quantization achieves a reduction of 70%, full-integer quantization achieves about a 68% reduction, and float16 quantization results in around a 48% reduction, as shown in Figure 17. Based on these findings, dynamic range quantization outperforms other quantization techniques, albeit only slightly surpassing full-integer quantization in terms of file size reduction.
Figure 17. TensorFlow Lite models—file size comparison.
The execution time to forecast the test data is measured, and the results are presented in Table 12. The original TF model has the highest execution time of 323.5977 s, as there is no model compression involved. Among the TFLite models with and without quantization, the TFLite model without quantization has the lowest execution time, as there is no quantization involved. Moreover, when considering the quantized TFLite models, dynamic range quantization has a slightly higher execution compared to the TFLite model without quantization because of the additional processing required for quantization. However, dynamic range quantization offers a good balance between model size reduction and execution. Although full-integer quantization can achieve a 69% reduction in file size compared to the TFLite model that is not quantized, it has a higher execution time compared to other methods, with an execution time of 68.8838 s. In addition, float16 quantization has an effective execution time with a latency of 54.7483 as compared to the other TFLite models with quantization.
Table 12. Comparison of execution time (seconds) for TFLite models.
In addition to considering model size and execution time, we also evaluated the accuracy of the model for post-training quantization. Table 13 illustrates how quantization affects the average model accuracy of the six pollutants across 12 time steps for the original TF model (i.e., Seq2Seq GRU Attention model determined from Table 9) and TFLite models. If the focus is mainly on model accuracy, opting for original TF model or TFLite without quantization can be considered. However, it is not the most effective option to reduce model size and improve execution time for efficient execution on the fog nodes. Hence, TFLite models with post-training quantization are considered. The TFLite models offered a file size reduction compared to the original TF models, while showing varying levels of execution time and accuracy. Dynamic range and float16 quantization methods maintain model accuracy like the TFLite model without quantization. In addition, the full-integer quantization method has lower accuracy compared to other methods. Specifically, the dynamic range quantization outperforms other TFLite models in terms of model accuracy and file size reduction, but with a slightly longer execution time than float16 quantization.
Table 13. Comparison of average model accuracy of the six pollutants across 12 time steps for the original TF models and TFLite models.
On the other hand, float16 quantization strikes a balance between accuracy and execution time. While it may offer slightly lower accuracy compared to dynamic range quantization, it compensates by providing the advantage of the shortest execution time. Additionally, float16 quantization achieves only a moderate reduction in file size. Moreover, full-integer quantization offers a good file size reduction but impacts model accuracy and execution time; i.e., file size reduction comes at the expense of model accuracy and longer execution times impacting the real-time responsiveness of the SFEG.
Based on the experimental results, applying dynamic range quantization to the Seq2Seq GRU Attention results in an optimized lightweight model that maintains good model accuracy, offers a significant reduction in file size, and minimizes execution time, striking a good balance between performance and computational efficiency compared to other post-training quantization methods. The deployment of this optimized lightweight model on the SFEG will enable efficient Fog Intelligence and enhance the effectiveness of the FAQMP system through accurate multi-step air quality forecasting, timely early warnings through EnviroWeb and event response with reduced latency, and optimized fog resource utilization.

6. Conclusions and Future Works

Compared to the traditional air quality monitoring systems that process data in the centralized cloud, this study proposes a novel Fog-enabled Air Quality Monitoring and Prediction (FAQMP) system, based on IoT, Fog Computing, and Deep Learning for efficient real-time decision support in smart cities. Fog Computing brings storage, computation, and networking closer to the edge for faster processing, reduced latency, reliability, and minimized bandwidth consumption, reducing the burden of the cloud. In the three-layered architecture of the proposed FAQMP system, the sensing layer has a cost-effective AQM node designed with a customized PCB that interfaces an array of sensors to the Arduino Mega 2560 controller to acquire pollutant and meteorological parameters. These data are wirelessly transmitted to the Smart Fog Environmental Gateway (SFEG) in the fog layer using LoRa, a long-range, low-cost, and low-power LPWAN-based solution. Further, an efficient Fog Intelligence is facilitated in the SFEG through an optimized lightweight DL-based Seq2Seq GRU Attention model for real-time accurate forecasting, timely early warnings, and faster event response with effective utilization of fog resources. The Seq2Seq GRU Attention model for multivariate multi-step forecasting of air quality levels combines the strength of the Seq2Seq architecture with the attention mechanism. The experimental results reveal that Seq2Seq GRU Attention improved the forecasting accuracy and stability in comparison with the state-of-the-art DL methods, with an average RMSE of 5.5576, MAE of 3.4975, MAPE of 19.1991, R2 of 0.6926, and Theil’s U1 of 0.1325 across the six primary pollutants (PM2.5, CO2, CO, SO2, NO2, and O3) for the future twelve time steps. Subsequently, to facilitate optimized model deployment on the resource-constrained fog nodes like SFEG, post-training quantization techniques like dynamic range quantization, integer with float fallback quantization, full-integer-only quantization, float16 quantization, are applied to the initial model. The evaluation shows that the results achieved through dynamic range quantization outperformed other methods with a significant reduction in file size, good forecast accuracy, and improved execution time, striking a balance between performance and computational efficiency. This makes the proposed optimized lightweight model suitable for deployment on the SFEG to enable efficient Fog Intelligence and thereby enhance the effectiveness of the FAQMP system. Furthermore, the EnviroWeb application presents real-time air quality data and alerts to the stakeholders. In summary, the proposed FAQMP system enables real-time and low-cost monitoring, efficient communication, accurate multi-step forecasting with optimized fog resource utilization, and decision support through timely early warnings, and event responses. This will empower informed decision making to address pollution concerns and maintain safe AQI levels in smart cities
While intelligence in Fog Computing is still in its early stages, our study offers promising directions for further exploration. Despite its advantages, a limitation of this work is that the performance of the proposed optimized lightweight model has not been analyzed across various resource-constrained fog environments. Future work will address this by evaluating the model in different settings. Additionally, the accuracy of sensor data collected in the AQM node will be enhanced through automated calibration procedures to improve reliability and consistency in air quality measurements.

Author Contributions

Conceptualization, D.B.P.; methodology, D.B.P., A.N.V. and B.S.P.; validation, A.N.V. and B.S.P.; formal analysis, D.B.P.; investigation, D.B.P.; writing—original draft preparation, D.B.P.; writing—review and editing, A.N.V. and B.S.P.; visualization, D.B.P.; supervision, A.N.V. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not Applicable.

Data Availability Statement

Data are available in a publicly accessible repository at “https://github.com/DivyaBharathi18/Fog-enabled-Air-Quality-Monitoring-and-Prediction”, accessed on 25 July 2024. The air quality dataset is derived from the resources available in the CPCB (Central Pollution Control Board, India) website: https://airquality.cpcb.gov.in/ccr/#/caaqm-dashboard-all/caaqm-landing/caaqm-data-repository, accessed on 25 July 2024.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Bakır, H.; Ağbulut, Ü.; Gürel, A.E.; Yıldız, G.; Güvenç, U.; Soudagar, M.E.M.; Hoang, A.T.; Deepanraj, B.; Saini, G.; Afzal, A. Forecasting of Future Greenhouse Gas Emission Trajectory for India Using Energy and Economic Indexes with Various Metaheuristic Algorithms. J. Clean. Prod. 2022, 360, 131946. [Google Scholar] [CrossRef]
  2. Air Pollution and Health | UNECE. Available online: https://unece.org/air-pollution-and-health (accessed on 5 January 2023).
  3. Yuan, L.; Li, H.; Fu, S.; Zhang, Z. Learning Behavior Evaluation Model and Teaching Strategy Innovation by Social Media Network Following Learning Psychology. Front. Psychol. 2022, 13, 843428. [Google Scholar] [CrossRef] [PubMed]
  4. Wu, X.; Nethery, R.C.; Sabath, M.B.; Braun, D.; Dominici, F. Air Pollution and COVID-19 Mortality in the United States: Strengths and Limitations of an Ecological Regression Analysis. Sci. Adv. 2020, 6, eabd4049. [Google Scholar] [CrossRef] [PubMed]
  5. Pekdogan, T.; Udriștioiu, M.T.; Yildizhan, H.; Ameen, A. From Local Issues to Global Impacts: Evidence of Air Pollution for Romania and Turkey. Sensors 2024, 24, 1320. [Google Scholar] [CrossRef] [PubMed]
  6. Georgiev, D. Internet of Things Statistics, Facts & Predictions [2024’s Update]. Available online: https://review42.com/resources/internet-of-things-stats/ (accessed on 13 January 2024).
  7. Bharathi, P.D.; Ananthanarayanan, V.; Sivakumar, P.B. Fog Computing-Based Environmental Monitoring Using Nordic Thingy: 52 and Raspberry Pi. In Smart Innovation, Systems and Technologies; Springer: Singapore, 2019; pp. 269–279. [Google Scholar]
  8. Losada, M.; Cortés, A.; Irizar, A.; Cejudo, J.; Pérez, A. A Flexible Fog Computing Design for Low-Power Consumption and Low Latency Applications. Electronics 2020, 10, 57. [Google Scholar] [CrossRef]
  9. Brogi, A.; Forti, S.; Guerrero, C.; Lera, I. How to Place Your Apps in the Fog: State of the Art and Open Challenges. Softw. Pract. Exp. 2019, 50, 719–740. [Google Scholar] [CrossRef]
  10. Daraghmi, Y.-A.; Daraghmi, E.Y.; Daraghma, R.; Fouchal, H.; Ayaida, M. Edge–Fog–Cloud Computing Hierarchy for Improving Performance and Security of NB-IoT-Based Health Monitoring Systems. Sensors 2022, 22, 8646. [Google Scholar] [CrossRef] [PubMed]
  11. Yousefpour, A.; Patil, A.; Ishigaki, G.; Kim, I.; Wang, X.; Cankaya, H.C.; Zhang, Q.; Xie, W.; Jue, J.P. FOGPLAN: A Lightweight QoS-Aware Dynamic Fog Service Provisioning Framework. IEEE Internet Things J. 2019, 6, 5080–5096. [Google Scholar] [CrossRef]
  12. Himeur, Y.; Sayed, A.N.; Alsalemi, A.; Bensaali, F.; Amira, A. Edge AI for Internet of Energy: Challenges and Perspectives. Internet Things 2024, 25, 101035. [Google Scholar] [CrossRef]
  13. Peruzzi, G.; Pozzebon, A. Combining LoRaWAN and NB-IoT for Edge-to-Cloud Low Power Connectivity Leveraging on Fog Computing. Appl. Sci. 2022, 12, 1497. [Google Scholar] [CrossRef]
  14. Fraga-Lamas, P.; Celaya-Echarri, M.; Lopez-Iturri, P.; Castedo, L.; Azpilicueta, L.; Aguirre, E.; Suárez-Albela, M.; Falcone, F.; Fernández-Caramés, T.M. Design and Experimental Validation of a LoRaWAN Fog Computing Based Architecture for IoT Enabled Smart Campus Applications. Sensors 2019, 19, 3287. [Google Scholar] [CrossRef] [PubMed]
  15. Bharathi, P.D.; Narayanan, V.A.; Sivakumar, P.B. Fog Computing Enabled Air Quality Monitoring and Prediction Leveraging Deep Learning in IoT. J. Intell. Fuzzy Syst. 2022, 43, 5621–5642. [Google Scholar] [CrossRef]
  16. National Air Quality Index. Available online: https://cpcb.nic.in/displaypdf.php?id=bmF0aW9uYWwtYWlyLXF1YWxpdHktaW5kZXgvQWJvdXRfQVFJLnBkZg== (accessed on 18 January 2023).
  17. Grace, R.K.; Manju, S. A Comprehensive Review of Wireless Sensor Networks Based Air Pollution Monitoring Systems. Wirel. Pers. Commun. 2019, 108, 2499–2515. [Google Scholar] [CrossRef]
  18. Dhingra, S.; Madda, R.B.; Gandomi, A.H.; Patan, R.; Daneshmand, M. Internet of Things Mobile–Air Pollution Monitoring System (IoT-Mobair). IEEE Internet Things J. 2019, 6, 5577–5584. [Google Scholar] [CrossRef]
  19. Laskar, M.R.; Sen, P.K.; Mandal, S.K.D. An IoT-Based e-Health System Integrated With Wireless Sensor Network and Air Pollution Index. In Proceedings of the 2019 Second International Conference on Advanced Computational and Communication Paradigms (ICACCP), Gangtok, India, 25–28 February 2019. [Google Scholar] [CrossRef]
  20. Alam, S.S.; Islam, A.J.; Hasan, M.; Rafid, M.N.M.; Chakma, N.; Imtiaz, N. Design and Development of a Low-Cost IoT Based Environmental Pollution Monitoring System. In Proceedings of the 2018 4th International Conference on Electrical Engineering and Information & Communication Technology (iCEEiCT), Dhaka, Bangladesh, 13–15 September 2018. [Google Scholar] [CrossRef]
  21. Kelechi, A.H.; Alsharif, M.H.; Agbaetuo, C.; Ubadike, O.; Aligbe, A.; Uthansakul, P.; Kannadasan, R.; Aly, A.A. Design of a Low-Cost Air Quality Monitoring System Using Arduino and ThingSpeak. Comput. Mater. Contin. Comput. Mater. Contin. 2022, 70, 151–169. [Google Scholar] [CrossRef]
  22. Kumar, T.; Doss, A. AIRO: Development of an Intelligent IoT-Based Air Quality Monitoring Solution for Urban Areas. Procedia Comput. Sci. 2023, 218, 262–273. [Google Scholar] [CrossRef]
  23. Bobulski, J.; Szymoniak, S.; Pasternak, K. An IoT System for Air Pollution Monitoring with Safe Data Transmission. Sensors 2024, 24, 445. [Google Scholar] [CrossRef] [PubMed]
  24. Kairuz-Cabrera, D.; Hernandez-Rodriguez, V.; Schalm, O.; Laguardia, A.M.; Laso, P.M.; Sánchez, D.A. Development of a Unified IoT Platform for Assessing Meteorological and Air Quality Data in a Tropical Environment. Sensors 2024, 24, 2729. [Google Scholar] [CrossRef] [PubMed]
  25. Asha, P.; Natrayan, L.; Geetha, B.T.; Beulah, J.R.; Sumathy, R.; Varalakshmi, G.; Neelakandan, S. IoT Enabled Environmental Toxicology for Air Pollution Monitoring Using AI Techniques. Environ. Res. 2022, 205, 112574. [Google Scholar] [CrossRef]
  26. Arroyo, P.; Gómez-Suárez, J.; Suárez, J.I.; Lozano, J. Low-Cost Air Quality Measurement System Based on Electrochemical and PM Sensors with Cloud Connection. Sensors 2021, 21, 6228. [Google Scholar] [CrossRef]
  27. Barthwal, A. A Markov Chain–Based IoT System for Monitoring and Analysis of Urban Air Quality. Environ. Monit. Assess. 2022, 195, 235. [Google Scholar] [CrossRef] [PubMed]
  28. Samad, A.; Kieser, J.; Chourdakis, I.; Vogt, U. Developing a Cloud-Based Air Quality Monitoring Platform Using Low-Cost Sensors. Sensors 2024, 24, 945. [Google Scholar] [CrossRef]
  29. Binsy, M.S.; Sampath, N. User Configurable and Portable Air Pollution Monitoring System for Smart Cities Using IoT. In International Conference on Computer Networks and Communication Technologies; Lecture Notes on Data Engineering and Communications Technologies; Springer: Singapore, 2018; pp. 345–359. [Google Scholar]
  30. Palomeque-Mangut, S.; Meléndez, F.; Gómez-Suárez, J.; Frutos-Puerto, S.; Arroyo, P.; Pinilla-Gil, E.; Lozano, J. Wearable System for Outdoor Air Quality Monitoring in a WSN with Cloud Computing: Design, Validation and Deployment. Chemosphere 2022, 307, 135948. [Google Scholar] [CrossRef] [PubMed]
  31. Koziel, S.; Pietrenko-Dabrowska, A.; Wojcikowski, M.; Pankiewicz, B. Efficient Calibration of Cost-Efficient Particulate Matter Sensors Using Machine Learning and Time-Series Alignment. Knowl.-Based Syst. 2024, 295, 111879. [Google Scholar] [CrossRef]
  32. Koziel, S.; Pietrenko-Dabrowska, A.; Wojcikowski, M.; Pankiewicz, B. Field Calibration of Low-Cost Particulate Matter Sensors Using Artificial Neural Networks and Affine Response Correction. Measurement 2024, 230, 114529. [Google Scholar] [CrossRef]
  33. Lai, X.; Yang, T.; Wang, Z.; Chen, P. IoT Implementation of Kalman Filter to Improve Accuracy of Air Quality Monitoring and Prediction. Appl. Sci. 2019, 9, 1831. [Google Scholar] [CrossRef]
  34. Moursi, A.S.; El-Fishawy, N.; Djahel, S.; Shouman, M.A. An IoT Enabled System for Enhanced Air Quality Monitoring and Prediction on the Edge. Complex Intell. Syst. 2021, 7, 2923–2947. [Google Scholar] [CrossRef] [PubMed]
  35. Kristiani, E.; Yang, C.-T.; Huang, C.-Y.; Wang, Y.-T.; Ko, P.-C. The Implementation of a Cloud-Edge Computing Architecture Using OpenStack and Kubernetes for Air Quality Monitoring Application. J. Spec. Top. Mob. Netw. Appl. Mob. Netw. Appl. 2020, 26, 1070–1092. [Google Scholar] [CrossRef]
  36. Senthilkumar, R.; Venkatakrishnan, P.; Balaji, N. Intelligent Based Novel Embedded System Based IoT Enabled Air Pollution Monitoring System. Microprocess. Microsyst. 2020, 77, 103172. [Google Scholar] [CrossRef]
  37. Santos, J.; Leroux, P.; Wauters, T.; Volckaert, B.; De Turck, F. Anomaly Detection for Smart City Applications over 5G Low Power Wide Area Networks. In Proceedings of the NOMS 2018—2018 IEEE/IFIP Network Operations and Management Symposium, Taipei, Taiwan, 23–27 April 2018. [Google Scholar] [CrossRef]
  38. Jabbar, W.A.; Subramaniam, T.; Ong, A.E.; Shu’Ib, M.I.; Wu, W.; De Oliveira, M.A. LoRaWAN-Based IoT System Implementation for Long-Range Outdoor Air Quality Monitoring. Internet Things 2022, 19, 100540. [Google Scholar] [CrossRef]
  39. Moses, L.; Tamilselvan, N.; Raju, N.; Karthikeyan, N. IoT Enabled Environmental Air Pollution Monitoring and Rerouting System Using Machine Learning Algorithms. IOP Conf. Series. Mater. Sci. Eng. 2020, 955, 012005. [Google Scholar] [CrossRef]
  40. Manalu, I.P.; Silalahi, S.M.; Wowiling, G.I.; Sigiro, M.M.T.; Zalukhu, R.P.; Nababan, P.K. Lora Communication Design and Performance Test (Case Study: Air Quality Monitoring System). In Proceedings of the 2023 International Conference of Computer Science and Information Technology (ICOSNIKOM), Binjia, Indonesia, 10–11 November 2023. [Google Scholar] [CrossRef]
  41. Nalakurthi, N.V.S.R.; Abimbola, I.; Ahmed, T.; Anton, I.; Riaz, K.; Ibrahim, Q.; Banerjee, A.; Tiwari, A.; Gharbia, S. Challenges and Opportunities in Calibrating Low-Cost Environmental Sensors. Sensors 2024, 24, 3650. [Google Scholar] [CrossRef] [PubMed]
  42. Pant, A.; Joshi, R.C.; Sharma, S.; Pant, K. Predictive Modeling for Forecasting Air Quality Index (AQI) Using Time Series Analysis. Avicenna J. Environ. Health Eng. 2023, 10, 38–43. [Google Scholar] [CrossRef]
  43. Castelli, M.; Clemente, F.M.; Popovič, A.; Silva, S.; Vanneschi, L. A Machine Learning Approach to Predict Air Quality in California. Complexity 2020, 2020, 8049504. [Google Scholar] [CrossRef]
  44. Doreswamy, S.H.K.; Km, Y.; Gad, I. Forecasting Air Pollution Particulate Matter (PM2.5) Using Machine Learning Regression Models. Procedia Comput. Sci. 2020, 171, 2057–2066. [Google Scholar] [CrossRef]
  45. Liang, Y.-C.; Maimury, Y.; Chen, A.H.-L.; Juarez, J.R.C. Machine Learning-Based Prediction of Air Quality. Appl. Sci. 2020, 10, 9151. [Google Scholar] [CrossRef]
  46. Zhu, D.; Cai, C.; Yang, T.; Zhou, X. A Machine Learning Approach for Air Quality Prediction: Model Regularization and Optimization. Big Data Cogn. Comput. 2018, 2, 5. [Google Scholar] [CrossRef]
  47. Dairi, A.; Harrou, F.; Khadraoui, S.; Sun, Y. Integrated Multiple Directed Attention-Based Deep Learning for Improved Air Pollution Forecasting. IEEE Trans. Instrum. Meas. 2021, 70, 3520815. [Google Scholar] [CrossRef]
  48. Jiao, Y.; Wang, Z.; Zhang, Y. Prediction of Air Quality Index Based on LSTM. In Proceedings of the 2019 IEEE 8th Joint International Information Technology and Artificial Intelligence Conference (ITAIC), Chongqing, China, 24–26 May 2019. [Google Scholar] [CrossRef]
  49. Wang, X.; Yan, J.; Wang, X.; Wang, Y. Air Quality Forecasting Using the GRU Model Based on Multiple Sensors Nodes. IEEE Sens. Lett. 2023, 7, 6003804. [Google Scholar] [CrossRef]
  50. Rao, K.S.; Devi, G.L.; Ramesh, N. Air Quality Prediction in Visakhapatnam with LSTM Based Recurrent Neural Networks. Int. J. Intell. Syst. Appl. 2019, 11, 18–24. [Google Scholar] [CrossRef]
  51. Belavadi, S.V.; Rajagopal, S.; Ranjani, R.; Mohan, R. Air Quality Forecasting Using LSTM RNN and Wireless Sensor Networks. Procedia Comput. Sci. 2020, 170, 241–248. [Google Scholar] [CrossRef]
  52. Fang, W.; Zhu, R.; Lin, J.C.-W. An Air Quality Prediction Model Based on Improved Vanilla LSTM with Multichannel Input and Multiroute Output. Expert Syst. Appl. 2023, 211, 118422. [Google Scholar] [CrossRef]
  53. Middya, A.I.; Roy, S. Pollutant Specific Optimal Deep Learning and Statistical Model Building for Air Quality Forecasting. Soc. Sci. Res. Netw. 2022, 301, 118972. [Google Scholar] [CrossRef]
  54. Athira, V.; Geetha, P.; Vinayakumar, R.; Soman, K.P. DeepAirNet: Applying Recurrent Networks for Air Quality Prediction. Procedia Comput. Sci. 2018, 132, 1394–1403. [Google Scholar] [CrossRef]
  55. Lin, C.-Y.; Chang, Y.-S.; Abimannan, S. Ensemble Multifeatured Deep Learning Models for Air Quality Forecasting. Atmos. Pollut. Res. 2021, 12, 101045. [Google Scholar] [CrossRef]
  56. Liu, H.; Yan, G.; Duan, Z.; Chen, C. Intelligent Modeling Strategies for Forecasting Air Quality Time Series: A Review. Appl. Soft Comput. 2021, 102, 106957. [Google Scholar] [CrossRef]
  57. Sarkar, N.; Gupta, R.; Keserwani, P.K.; Govil, M.C. Air Quality Index Prediction Using an Effective Hybrid Deep Learning Model. Environ. Pollut. 2022, 315, 120404. [Google Scholar] [CrossRef]
  58. Huang, C.-J.; Kuo, P.-H. A Deep CNN-LSTM Model for Particulate Matter (PM2.5) Forecasting in Smart Cities. Sensors 2018, 18, 2220. [Google Scholar] [CrossRef]
  59. Sharma, E.; Deo, R.C.; Soar, J.; Prasad, R.; Parisi, A.V.; Raj, N. Novel Hybrid Deep Learning Model for Satellite Based PM10 Forecasting in the Most Polluted Australian Hotspots. Atmos. Environ. 2022, 279, 119111. [Google Scholar] [CrossRef]
  60. Yeo, I.; Choi, Y.; Lops, Y.; Sayeed, A. Efficient PM2.5 Forecasting Using Geographical Correlation Based on Integrated Deep Learning Algorithms. Neural Comput. Appl. 2021, 33, 15073–15089. [Google Scholar] [CrossRef]
  61. Yang, Y.; Mei, G.; Izzo, S. Revealing Influence of Meteorological Conditions on Air Quality Prediction Using Explainable Deep Learning. IEEE Access 2022, 10, 50755–50773. [Google Scholar] [CrossRef]
  62. Chang, Y.-S.; Chiao, H.-T.; Abimannan, S.; Huang, Y.-P.; Tsai, Y.-T.; Lin, K.-M. An LSTM-Based Aggregated Model for Air Pollution Forecasting. Atmos. Pollut. Res. 2020, 11, 1451–1463. [Google Scholar] [CrossRef]
  63. Du, S.; Li, T.; Yang, Y.; Horng, S.-J. Deep Air Quality Forecasting Using Hybrid Deep Learning Framework. IEEE Trans. Knowl. Data Eng. 2021, 33, 2412–2424. [Google Scholar] [CrossRef]
  64. Kow, P.-Y.; Wang, Y.-S.; Zhou, Y.; Kao, I.-F.; Issermann, M.; Chang, L.-C.; Chang, F.-J. Seamless Integration of Convolutional and Back-Propagation Neural Networks for Regional Multi-Step-Ahead PM2.5 Forecasting. J. Clean. Prod. 2020, 261, 121285. [Google Scholar] [CrossRef]
  65. Janarthanan, R.; Partheeban, P.; Somasundaram, K.; Elamparithi, P.N. A Deep Learning Approach for Prediction of Air Quality Index in a Metropolitan City. Sustain. Cities Soc. 2021, 67, 102720. [Google Scholar] [CrossRef]
  66. Al-Janabi, S.; Alkaim, A.; Al-Janabi, E.; Aljeboree, A.; Mustafa, M. Intelligent Forecaster of Concentrations (PM2.5, PM10, NO2, CO, O3, SO2) Caused Air Pollution (IFCsAP). Neural Comput. Appl. 2021, 33, 14199–14229. [Google Scholar] [CrossRef]
  67. Mokhtari, I.; Bechkit, W.; Rivano, H.; Yaici, M.R. Uncertainty-Aware Deep Learning Architectures for Highly Dynamic Air Quality Prediction. IEEE Access 2021, 9, 14765–14778. [Google Scholar] [CrossRef]
  68. Hu, K.; Guo, X.; Gong, X.; Wang, X.; Liang, J.; Li, D. Air Quality Prediction Using Spatio-Temporal Deep Learning. Atmos. Pollut. Res. 2022, 13, 101543. [Google Scholar] [CrossRef]
  69. Feng, H.; Zhang, X. A Novel Encoder-Decoder Model Based on Autoformer for Air Quality Index Prediction. PLoS ONE 2023, 18, e0284293. [Google Scholar] [CrossRef]
  70. Zhang, B.; Zou, G.; Qin, D.; Lu, Y.; Jin, Y.; Wang, H. A Novel Encoder-Decoder Model Based on Read-First LSTM for Air Pollutant Prediction. Sci. Total Environ. 2021, 765, 144507. [Google Scholar] [CrossRef]
  71. Alhnaity, B.; Kollias, S.; Leontidis, G.; Jiang, S.; Schamp, B.; Pearson, S. An Autoencoder Wavelet Based Deep Neural Network with Attention Mechanism for Multi-Step Prediction of Plant Growth. Inf. Sci. 2021, 560, 35–50. [Google Scholar] [CrossRef]
  72. Feng, L.; Zhao, C.; Sun, Y. Dual Attention-Based Encoder–Decoder: A Customized Sequence-to-Sequence Learning for Soft Sensor Development. IEEE Trans. Neural Netw. Learn. Syst. 2021, 32, 3306–3317. [Google Scholar] [CrossRef]
  73. Chen, Z.; Yu, H.; Geng, Y.-A.; Li, Q.; Zhang, Y. EvaNet: An Extreme Value Attention Network for Long-Term Air Quality Prediction. In Proceedings of the 2020 IEEE International Conference on Big Data (Big Data), Atlanta, GA, USA, 10–13 December 2020. [Google Scholar] [CrossRef]
  74. Li, S.; Xie, G.; Ren, J.; Guo, L.; Yang, Y.; Xu, X. Urban PM2.5 Concentration Prediction via Attention-Based CNN–LSTM. Appl. Sci. 2020, 10, 1953. [Google Scholar] [CrossRef]
  75. Du, S.; Li, T.; Yang, Y.; Horng, S.-J. Multivariate Time Series Forecasting via Attention-Based Encoder–Decoder Framework. Neurocomputing 2020, 388, 269–279. [Google Scholar] [CrossRef]
  76. Jia, P.; Cao, N.; Yang, S. Real-Time Hourly Ozone Prediction System for Yangtze River Delta Area Using Attention Based on a Sequence to Sequence Model. Atmos. Environ. 2021, 244, 117917. [Google Scholar] [CrossRef]
  77. Blogs. Available online: https://community.intel.com/t5/Blogs/ct-p/blogs/ai-inference-at-scale#gs.6ojv36 (accessed on 10 February 2023).
  78. Andrade, P.; Silva, I.; Silva, M.; Flores, T.; Cassiano, J.; Costa, D.G. A TinyML Soft-Sensor Approach for Low-Cost Detection and Monitoring of Vehicular Emissions. Sensors 2022, 22, 3838. [Google Scholar] [CrossRef]
  79. Maccantelli, F.; Peruzzi, G.; Pozzebon, A. Traffic Level Monitoring in Urban Scenarios with Virtual Sensing Techniques Enabled by Embedded Machine Learning. In Proceedings of the 2023 IEEE Sensors Applications Symposium (SAS), Ottawa, ON, Canada, 18–20 July 2023. [Google Scholar] [CrossRef]
  80. Liu, D.; Kong, H.; Luo, X.; Liu, W.; Subramaniam, R. Bringing AI to Edge: From Deep Learning’s Perspective. Neurocomputing 1507 2022, 485, 297–320. [Google Scholar] [CrossRef]
  81. Post-Training Quantization. Available online: https://www.tensorflow.org/lite/performance/post_training_quantization (accessed on 15 June 2023).
  82. Lee, H.; Lee, N.; Lee, S. A Method of Deep Learning Model Optimization for Image Classification on Edge Device. Sensors 2022, 22, 7344. [Google Scholar] [CrossRef]
  83. Shuvo, M.M.H.; Islam, S.K.; Cheng, J.; Morshed, B.I. Efficient Acceleration of Deep Learning Inference on Resource-Constrained Edge Devices: A Review. Proc. IEEE 2023, 111, 42–91. [Google Scholar] [CrossRef]
  84. Lalapura, V.S.; Amudha, J.; Satheesh, H.S. Recurrent Neural Networks for Edge Intelligence. ACM Comput. Surv. 2021, 54, 91. [Google Scholar] [CrossRef]
  85. Merenda, M.; Porcaro, C.; Iero, D. Edge Machine Learning for AI-Enabled IoT Devices: A Review. Sensors 2020, 20, 2533. [Google Scholar] [CrossRef]
  86. Yao, J.; Zhang, S.; Yao, Y.; Wang, F.; Ma, J.; Zhang, J.; Chu, Y.; Ji, L.; Jia, K.; Shen, T.; et al. Edge-Cloud Polarization and Collaboration: A Comprehensive Survey for AI. IEEE Trans. Knowl. Data Eng. 2022, 1, 6866–6886. [Google Scholar] [CrossRef]
  87. Polino, A.; Pascanu, R.; Alistarh, D. Model Compression via Distillation and Quantization. arXiv 2018. [Google Scholar] [CrossRef]
  88. MQ136 Datasheet. Available online: https://pdf1.alldatasheet.com/datasheet-pdf/view/1131997/hanwei/mq-136.html (accessed on 6 February 2023).
  89. Makhija, J.; Nakkeeran, M.; Narayanan, V.A. Detection of Vehicle Emissions Through Green IoT for Pollution Control. In Advances in Automation, Signal Processing, Instrumentation, and Control; Lecture Notes in Electrical Engineering; Springer: Singapore, 2021; pp. 817–826. [Google Scholar] [CrossRef]
  90. Gorospe, J.; Mulero, R.; Arbelaitz, O.; Muguerza, J.; Antón, M.Á. A Generalization Performance Study Using Deep Learning Networks in Embedded Systems. Sensors 2021, 21, 1031. [Google Scholar] [CrossRef]
  91. Eren, B.; Aksangür, İ.; Erden, C. Predicting next Hour Fine Particulate Matter (PM2.5) in the Istanbul Metropolitan City Using Deep Learning Algorithms with Time Windowing Strategy. Urban Clim. 2023, 48, 101418. [Google Scholar] [CrossRef]
  92. He, Y.-L.; Chen, L.; Gao, Y.; Ma, J.-H.; Xu, Y.; Zhu, Q.-X. Novel Double-Layer Bidirectional LSTM Network with Improved Attention Mechanism for Predicting Energy Consumption. ISA Trans. 2022, 127, 350–360. [Google Scholar] [CrossRef] [PubMed]
  93. Central Control Room for Air Quality Management—All India, CPCB. Available online: https://airquality.cpcb.gov.in/ccr/#/caaqm-dashboard-all/caaqm-landing/caaqm-data-repository (accessed on 23 January 2023).
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.