Pollution Weather Prediction System: Smart Outdoor Pollution Monitoring and Prediction for Healthy Breathing and Living

Air pollution has been a looming issue of the 21st century that has also significantly impacted the surrounding environment and societal health. Recently, previous studies have conducted extensive research on air pollution and air quality monitoring. Despite this, the fields of air pollution and air quality monitoring remain plagued with unsolved problems. In this study, the Pollution Weather Prediction System (PWP) is proposed to perform air pollution prediction for outdoor sites for various pollution parameters. In the presented research work, we introduced a PWP system configured with pollution-sensing units, such as SDS021, MQ07-CO, NO2-B43F, and Aeroqual Ozone (O3). These sensing units were utilized to collect and measure various pollutant levels, such as PM2.5, PM10, CO, NO2, and O3, for 90 days at Symbiosis International University, Pune, Maharashtra, India. The data collection was carried out between the duration of December 2019 to February 2020 during the winter. The investigation results validate the success of the presented PWP system. In the conducted experiments, linear regression and artificial neural network (ANN)-based AQI (air quality index) predictions were performed. Furthermore, the presented study also found that the customized linear regression methodology outperformed other machine-learning methods, such as linear, ridge, Lasso, Bayes, Huber, Lars, Lasso-lars, stochastic gradient descent (SGD), and ElasticNet regression methodologies, and the customized ANN regression methodology used in the conducted experiments. The overall AQI values of the air pollutants were calculated based on the summation of the AQI values of all the presented air pollutants. In the end, the web and mobile interfaces were developed to display air pollution prediction values of a variety of air pollutants.


Introduction and Related Works
The high-paced economy, moving onwards because of construction, agricultural activities, industrial plants, and many other factors, enables development and poses risks to the human race. In such scenarios, it is essential to maintain a healthy life quality that includes some necessary activities, such as having a balanced diet and keeping the body moving. With that, it is also evident to keep effects [21]. Al-Ali et al. and Devrakonda et al. designed a GPRS-controlled monitoring system, but it lacks air pollution monitoring and prediction aspects [22,23]. Marjovi et al. discussed mobile sensor network-based approaches for urban environments. The proposed methods also made use of remote sensing and spatial variability analyses. However, the proposed plans did not include air pollution prediction and monitoring [24]. Abraham et al. discussed an approach to measure indoor pollutants such as CO, O 3 , and CO 2 . However, the proposed method was not tested at outdoor sites [25]. Antonic et al. analyzed a wearable sensing-based system to measure air quality via cloud computing technology [26]. U. Kumar and V. Jain discussed an approach to forecasting ambient air pollutants using an auto regression-based exponential analysis. However, the proposed method was not tested at outdoor sites for accuracy and reliability [27]. Al-Haija et al. examined a microcontroller-based gas monitoring approach. However, the proposed method was focused on general-purpose gas sensing [28]. Shi et al. discussed a system that can do a spatial variability analysis of PM2.5 via network stations. However, the presented method was not applied to other air pollutants, such as CO, PM10, temperature, humidity, and NO 2 [29]. According to an Atlan report, a company called "SocialCops" designed a system to measure Delhi's air pollution. The system used a variety of air pollutant sensors but did not facilitate air pollution prediction [30]. Egondi et al. analyzed the timely variation of PM2.5 concentration levels of Nairobi and Kenya. However, the proposed approach was not applied to a variety of air pollutant parameters [31]. Shi et al. conducted an extensive survey of Northern China regions' pollution processes using a reanalysis meteorology methodology. The proposed approach also made use of remote sensing and spatial variability analyses. However, the proposed system did not include air pollution prediction and monitoring [32]. Zhang et al. discussed the PM2.5 concentration characteristics in five diverse regions of China [33]. Marques et al. developed a system using wired sensing technology. The proposed method was not focused on any air quality monitoring or prediction aspects [34]. Kim et al. calculated the benefits of reducing PM10 and its effects on humans' healthy living around South Korea [35]. In recent times, fellow researchers [36,37] attempted to use a moving vehicle to measure air pollutions' variations using mobile sensor networks. However, the proposed approach was not tested with multiple air pollutants and did not discuss air pollution prediction.
Hog-di et al. discussed an approach to monitor dust particles present in the surrounding atmosphere and its basic predictions. However, the proposed method could not facilitate direct measurements of air pollutants [38]. Richards et al. developed a wired sensing network to provide real-time updates of air pollutants using GUSTO (Generic Ultraviolet Sensors Technologies and Observations) sensing. However, the proposed approach did not offer wireless connectivity and lacked technologies such as the Internet of Things (IoT) and wireless sensing [39]. Reisinger et al. utilized optical absorption methodology for measuring a variety of air pollutants. However, the undertaken study did not facilitate air pollution monitoring and prediction for real-time data [40]. Tiwari et al. presented a microcontroller-based system to monitor methane variations. The proposed method did not facilitate air quality monitoring or prediction [41]. Dhingra et al. put up a basic design to monitor air quality parameters and a mobile application using cloud computing technology. However, the presented system was not tested at outdoor sites and did not perform accuracy and reliability-related assessments [42]. Li et al. discussed an approach that could do constant monitoring of Taiwan using 71 fixed air pollution monitoring stations. However, the conducted research did not present any air quality prediction framework for air pollution monitoring and prediction [43]. Kumar [44][45][46][47]. However, the presented system lacked air pollution prediction and was not suitable for long distances, and its implementation was very costly. Sharma et al. proposed an MSP430 controller-based approach to measure ammonia using carbon nanotube (CNT)-based sensors. The presented approach did not discuss any transmission, monitoring, or prediction approach [48]. Barot et al. examined a QoS (Quality of Service) that enabled an air pollution framework for monitoring air pollutants. However, the proposed approach did not facilitate air pollutants' air pollution prediction using artificial intelligence (A.I.)-based technologies. This work Sensors 2020, 20, 5448 4 of 25 was also coauthored by Pandya S., who represents the presented research work [49]. Pandya et al. discussed a smart sanitizer tunnel to disinfect humans. However, it did not discuss air pollution monitoring and prediction [50]. Kularatna et al. analyzed an Arduino-based system to measure LPG (Liquefied Petroleum Gas). However, the proposed approach did not emphasize air quality monitoring and prediction aspects [51]. According to NAMP reports, India's government proposed a program called "National Air Quality Monitoring," which provided data about various pollutants via the www.aqi.in the portal via 779 networking stations. However, the NAMP (National Air Quality Monitoring Programme) did not offer air pollution prediction and failed to reach its developed or urban parts [52,53]. Therefore, it is essential to consider the issue of pollution prediction based on real-time data.
Recently, previous studies have conducted extensive research in the areas of air pollution and air quality monitoring. Despite this, the fields of air pollution monitoring and prediction remain plagued with unsolved issues concerning incineration, metallurgical process, miscellaneous, and many more. In this study, a pollution weather prediction (PWP) system is presented that can perform air pollution predictions for outdoor sites using various pollution parameters for healthy breathing and living. In the undertaken study, we collected real-time data of air pollutants such as PM2.5, PM10, CO, NO 2 , and O 3 using a variety of sensing units, such as the SDS021 sensing unit, the MQ07-CO sensing unit, the NO2-B43F sensing unit, and an Aeroqual Ozone (O 3 ) sensing unit. The data was collected from an outdoor site situated at Symbiosis International University, Pune, Maharashtra, India. The data collection was carried out between the duration of December 2019 to February 2020 during the winter. The detailed description of the data collection process is described in Section 2.2.3. The investigation results validate the success of the presented PWP system. In the conducted experiments, linear regression and artificial neural network (ANN)-based AQI predictions were performed for 60,000 air pollution samples. In the end, the overall AQI values of air pollutants were calculated based on the summation of AQI values of all the presented air pollutants. The proposed approach can function lifelong and can be retrained using updated pollution data in the future.
The proposed paper is organized as follows: Section 2 presents the pollution weather prediction system's necessity and discusses the detailed PWPS workflow. Section 3 depicts a detailed analysis and discussion of the investigated results of the PWS system and represents a web and mobile interface representation of the presented PWP system. The concluding remarks and the possibility of future enhancements are discussed under Section 4. The Appendix A describes the essential concepts such as air quality monitoring, air quality index (AQI), air monitoring stations, and a list of terminologies used in the experiments.

The Necessity of the PWP System
The presented PWP system's significant contributions are as follows: (i) An IoT-based framework is proposed to perform real-time data collection of various air pollutants. (ii) Detailed variability analysis of air pollutants such as PM2.5, PM10, CO, NO2, and O3 is conducted in the presented research work. (iii) An AI-based machine learning and an in-depth neural network-based approach are proposed to perform the air pollutant assessment and prediction of AQI values of air pollutants. In the conducted experiments, linear regression and ANN-based AQI prediction were performed. Furthermore, the presented study also found that the customized linear regression methodology outperformed other machine-learning methods, such as the linear [54], ridge [55], Lasso [56], Bayes [57], Huber [58], Lars [59], Lasso-lars [60], stochastic gradient descent (SGD) [61], and ElasticNet [62] regression methodologies, and the customized ANN regression methodology used in the conducted experiments. (iv) In the end, the web and mobile interface was developed to display the air pollution prediction values of a variety of air pollutants. The investigation results validated the success of the presented PWP system.  [58], a NodeMCU controller consists of GPIOs, I2C, UART, ADC, and PWM pins to interface with various sensor modules. Figure 1a represents a microcontroller unit used in the conducted experiments. Table 1 represents a comparative analysis of various controllers available in the market.
Sensors 2020, 20, x 5 of 26 ESP8266 12E/NodeMCU is a cost-effective controller module equipped with a 32-bit microcontroller with 4MB memory. According to [58], a NodeMCU controller consists of GPIOs, I2C, UART, ADC, and PWM pins to interface with various sensor modules. Figure 1a represents a microcontroller unit used in the conducted experiments. Table 1 represents a comparative analysis of various controllers available in the market.  The SDS021 sensing unit can detect and measure 2.5-µm and 10-µm dust particles from the surrounding environment. It is based on the UART protocol and provides a bit rate of 9600 bits/second. The measurement range of the SDS021 sensing unit is 0-100 mg/m 3 . The SDSO21 sensing unit module contains a fan for keeping a consistent wind stream over the detection chamber. The presented sensing unit required a 5-V power backup and a 60-mA current. The SDS021 sensing unit required a 4-mA current in sleep mode. Table 2 shows the technical specification details of the SDS021 sensing unit. Figure 1b represents the SDSO21 sensing unit used to measure the PM2.5 and PM10 concentration levels.  The SDS021 sensing unit can detect and measure 2.5-µm and 10-µm dust particles from the surrounding environment. It is based on the UART protocol and provides a bit rate of 9600 bits/second. The measurement range of the SDS021 sensing unit is 0-100 mg/m 3 . The SDSO21 sensing unit module contains a fan for keeping a consistent wind stream over the detection chamber. The presented sensing unit required a 5-V power backup and a 60-mA current. The SDS021 sensing unit required a 4-mA current in sleep mode. Table 2 shows the technical specification details of the SDS021 Sensors 2020, 20, 5448 6 of 25 sensing unit. Figure 1b represents the SDSO21 sensing unit used to measure the PM2.5 and PM10 concentration levels. The MQ07-CO sensing unit is capable of measuring CO levels with the 9600-bit rate. It is also based on the UART protocol, which facilitates a range between 0-1000 ppm (parts per million). Figure 1c represents the MQ07-CO sensing unit used to measure the carbon monoxide concentration level. Table 3 illustrates the technical specification details of the MQ07-CO sensing unit. NO2-B43F is a low-cost sensing unit that can sense nitrogen-oxide from the surrounding environment. It facilitates strong signal levels along with zero current capability. It allows a resolution up to 50 parts per billion (ppb) and an operating range of 0.001 to 0.02 ppm. Figure 1d represents the NO2-B43F sensing unit, which is used to measure the NO 2 concentration levels. Table 4 describes the technical specification details of a NO2-B43F sensing unit. Aeroqual Ozone O 3 is a low-cost sensing unit that was designed to provide consistent and accurate ozone levels. It has a measurement range of 0.002-0.01 ppm. Figure 1e represents an O 3 sensing unit used to measure the ozone (O 3 ) concentration levels for 1-h and 4-h durations. Table 5 illustrates the technical specification details of an Aeroqual Ozone (O 3 ) sensing unit.

Layered Architecture of an IoT-Based Air Quality Monitoring System
The layered architecture of the presented PWP system was classified into seven sub-components: (i) physical sensing layer, (ii) communicating and sensing layer, (iii) cloud service layer, (iv) data preprocessing layer, (v) data visualization layer, (vi) data prediction layer, and (vii) application layer. Figure 2 represents the layered design of a PWP system. Aeroqual Ozone O3 is a low-cost sensing unit that was designed to provide consistent and accurate ozone levels. It has a measurement range of 0.002-0.01 ppm. Figure 1e represents an O3 sensing unit used to measure the ozone (O3) concentration levels for 1-h and 4-hours durations. Table  5 illustrates the technical specification details of an Aeroqual Ozone (O3) sensing unit.

Layered Architecture of an IoT-Based Air Quality Monitoring System
The layered architecture of the presented PWP system was classified into seven subcomponents: (i) physical sensing layer, (ii) communicating and sensing layer, (iii) cloud service layer, (iv) data preprocessing layer, (v) data visualization layer, (vi) data prediction layer, and (vii) application layer. Figure 2 represents the layered design of a PWP system.  The physical layer consists of the sensors, which measure the pollutants present in the atmosphere. The pollutants measured are Particulate Matter 2.5 (PM2.5), Particulate matter 10 (PM10), ozone (O 3 ), nitrogen dioxide (NO 2 ), and carbon monoxide (CO). Figure 3 represents the system architecture of a PWP system. The detailed working of a PWP system is described in the remaining sections.
Sensors 2020, 20, x 8 of 26 (PM10), ozone (O3), nitrogen dioxide (NO2), and carbon monoxide (CO). Figure 3 represents the system architecture of a PWP system. The detailed working of a PWP system is described in the remaining sections.

Communication and Networking Layer
The communication layer establishes a link between the physical sensing layer and the backend. It provides the interface due to which the data can be extracted. Figure 4 represents a detailed communication workflow of a communication layer. As described in the physical layer, pollution sensors connected with a NodeMCU controller measure the pollutants present in the surrounding environment. As shown in Figure 3, a PWP system uses the MQTT protocol (MQTT 5.0) and a HIVEMQ cloud broker to establish an interface between a publisher and a subscriber [63]. In the conducted experiments, the "paho-MQTT" and "paho.mqtt.Client" packages were used (MQTT 5.0, accessed on 20 November 2019). MySQL is responsible for storing the data acquired by the data acquisition module. Finally, the PWP ASP.Net-based web application and a mobile application fetch the pollutant data of various pollutants such as PM2.5, PM10, CO, NO2, and O3 from the MySQL repository and represent in the form of pollution reports.

Communication and Networking Layer
The communication layer establishes a link between the physical sensing layer and the backend. It provides the interface due to which the data can be extracted. Figure 4 represents a detailed communication workflow of a communication layer. As described in the physical layer, pollution sensors connected with a NodeMCU controller measure the pollutants present in the surrounding environment. As shown in Figure 3, a PWP system uses the MQTT protocol (MQTT 5.0) and a HIVEMQ cloud broker to establish an interface between a publisher and a subscriber [63]. In the conducted experiments, the "paho-MQTT" and "paho.mqtt.Client" packages were used (MQTT 5.0, accessed on 20 November 2019). MySQL is responsible for storing the data acquired by the data acquisition module. Finally, the PWP ASP.Net-based web application and a mobile application fetch the pollutant data of various pollutants such as PM2.5, PM10, CO, NO 2 , and O 3 from the MySQL repository and represent in the form of pollution reports.
Sensors 2020, 20, x 8 of 26 (PM10), ozone (O3), nitrogen dioxide (NO2), and carbon monoxide (CO). Figure 3 represents the system architecture of a PWP system. The detailed working of a PWP system is described in the remaining sections.

Communication and Networking Layer
The communication layer establishes a link between the physical sensing layer and the backend. It provides the interface due to which the data can be extracted. Figure 4 represents a detailed communication workflow of a communication layer. As described in the physical layer, pollution sensors connected with a NodeMCU controller measure the pollutants present in the surrounding environment. As shown in Figure 3, a PWP system uses the MQTT protocol (MQTT 5.0) and a HIVEMQ cloud broker to establish an interface between a publisher and a subscriber [63]. In the conducted experiments, the "paho-MQTT" and "paho.mqtt.Client" packages were used (MQTT 5.0, accessed on 20 November 2019). MySQL is responsible for storing the data acquired by the data acquisition module. Finally, the PWP ASP.Net-based web application and a mobile application fetch the pollutant data of various pollutants such as PM2.5, PM10, CO, NO2, and O3 from the MySQL repository and represent in the form of pollution reports.

Data Analysis Layer
The data analysis layer is responsible for handling the data collection, data preprocessing, and data visualization. The dataset used in the conducted experiments is mainly divided into three categories: (i) Pollutants: the PWP system dataset contains various pollutants such as CO, NO 2 , PM2.5, PM10, and O 3 , concerning their AQI values. (ii) Locations: GPS location coordinates such as latitude and longitude. (iii) Timestamp: timestamp parameters such as date and time. The researchers and governments use an air quality index (AQI) metric to identify the current pollution conditions at a particular location. The air quality index (AQI) is a useful color-coded unitless index that effectively communicates air pollution concentrations to the general public [64,65]. The AQI metric is already used in certain countries such as Malaysia, Canada, and Europe as a primary pollution classification metric. The computation of the AQI of a particular pollutant can be done based on metrics such as the average period obtained from the PM sensing units. The classification risk metric is employed in the conducted experiments based on the AQI values of various pollutants such as PM2.5, PM10, CO, NO 2 , and O 3 . As shown in Table 6, the classification of the risk metrics is described in various categories: good, moderate, unhealthy, very unhealthy, and hazardous. The AQI coefficient can be given by [64], where P obs = average measured concentration in 24 h in mg/m 3 , P max = the maximum concentration of an AQI of a particular pollutant calculated based on the risk classification metric, P min = the minimum concentration of an AQI of a particular pollutant calculated based on the risk classification metric, AQI min = minimum AQI values of a specific pollutant calculated based on the risk classification metric. The molecular conversion coefficient (CMC) to convert a pollutant from ppb to µg/m 3 can be given by [64] CMC where mw = molecular weight and mv = molecular volume. The molecular volume (mv) can be given by [64] mv(in litres) = where T = temperature (K) and P = atmospheric pressure (hPa (hectopascal)). Table 6. A representation of the classification of the air quality index (AQI) risk metrics [64]. As shown in Figure 3, in the presented research work, we introduced a PWP system that is configured with pollution sensing units such as SDS021, MQ07-CO, NO2-B43F, and Aeroqual Ozone (O 3 ). These sensing units were utilized to collect and measure various pollutant levels, such as PM2.5, PM10, CO, NO 2 , and O 3 . The data was collected from an outdoor site situated at Symbiosis International University, Pune, Maharashtra, India. The data collection was carried out between the duration of December 2019 to February 2020 during the winter. After collecting the pollutant data, an AQI was calculated based on the acquired pollutant data, as shown in equation (1) for various pollutants such as PM2.5, PM10, CO, NO 2 , and O 3 . In the experiments, the quantities of pollutants are independent, and the AQI of a particular pollutant is a dependent variable. In the undertaken study, the PWP dataset consists of 189,648 training samples and 18 features. The missing values are majorly present in the pollutants section. If we eliminate a training sample with at least one missing value, then a 50% data loss is expected. Due to many instances, we kept the training samples with missing values for further use. The proposed PWP system was trained with 60 k examples divided into training and testing phases. The rest of the data was used for validation testing. The feature selection dimensionality reduction data preprocessing technique was applied to the PWP dataset to select the presented system's required features. In the PWP dataset, the dependent features are the AQI of the pollutants such as PM2.5, PM10, NO 2 , CO, and O 3 , whereas the independent features are the quantities of PM2.5, PM10, NO 2 , CO, and O 3 . Therefore, it is tough to apply feature extraction here; hence, the feature selection technique was used on the PWP dataset to reduce the data dimensions. In total, 12 features were selected (six dependent variables and six independent variables). During data preprocessing, the standard-scaler scaling technique was applied in the presented research work.

a. Data Visualization
In the undertaken study, a histogram-based analysis was conducted to check the variability of various pollutants. The variability of the pollutants was set between 0 to 100 µm, approximately.
AQI of a particular pollutant = σ × quantity of air pollutants + c where σ = X-intercept/slope and c = constant; c can be a nonzero value if the x-axis starts with a nonzero term. Here, equation (4) and (5) will formulate a hypothetical line of air pollutants such as PM2.5, PM10, CO, NO 2 , O 3 (1 h), and O 3 (4 h). Since time is a categorical value and fed to the PWP system, it may be considered a relative value that can affect the PWP system's overall accuracy.
(O3). These sensing units were utilized to collect and measure various pollutant levels, such as PM2.5, PM10, CO, NO2, and O3. The data was collected from an outdoor site situated at Symbiosis International University, Pune, Maharashtra, India. The data collection was carried out between the duration of December 2019 to February 2020 during the winter. After collecting the pollutant data, an AQI was calculated based on the acquired pollutant data, as shown in equation (1) for various pollutants such as PM2.5, PM10, CO, NO2, and O3. In the experiments, the quantities of pollutants are independent, and the AQI of a particular pollutant is a dependent variable. In the undertaken study, the PWP dataset consists of 189,648 training samples and 18 features. The missing values are majorly present in the pollutants section. If we eliminate a training sample with at least one missing value, then a 50% data loss is expected. Due to many instances, we kept the training samples with missing values for further use. The proposed PWP system was trained with 60 k examples divided into training and testing phases. The rest of the data was used for validation testing. The feature selection dimensionality reduction data preprocessing technique was applied to the PWP dataset to select the presented system's required features. In the PWP dataset, the dependent features are the AQI of the pollutants such as PM2.5, PM10, NO2, CO, and O3, whereas the independent features are the quantities of PM2.5, PM10, NO2, CO, and O3. Therefore, it is tough to apply feature extraction here; hence, the feature selection technique was used on the PWP dataset to reduce the data dimensions.
In total, 12 features were selected (six dependent variables and six independent variables). During data preprocessing, the standard-scaler scaling technique was applied in the presented research work.

a. Data Visualization
In the undertaken study, a histogram-based analysis was conducted to check the variability of various pollutants. The variability of the pollutants was set between 0 to 100 µm, approximately. AQI of a particular pollutant = × quantity of air pollutants + Where σ = X-intercept/slope and = constant; can be a nonzero value if the x-axis starts with a nonzero term. Here, equation (4) and (5) will formulate a hypothetical line of air pollutants such as PM2.5, PM10, CO, NO2, O3 (1 h), and O3 (4 h). Since time is a categorical value and fed to the PWP system, it may be considered a relative value that can affect the PWP system's overall accuracy.  Here, the x-axis represents time, and the y-axis represents the contamination values of the air pollutants. The air pollutants' variability analysis is described using various graphical representations such as line graphs, scatter graphs, and histograms. The visual representation of line graphs and scatter charts indicates the linear relation of the pollutants concerning time, whereas the histogram depicts the pollutants' variability. Figure 6a shows slight variability when the scale is reduced to 0-25 µm. Furthermore, PM10 ranges from 2 to 12-+ µm. PM2.5 ranges from 2 to 8 µm. The rest of the pollutants like CO, NO 2 , O 3 (1 h), and O 3 (4 h) have values from 0 to 1 µm. Figure 6b represents the variability of different gases such as PM2.5, PM10, and CO. It indicates that the variability of CO exceeds the frequency of 140 marks; it was also recorded that CO-based air contamination remained zero for the maximum time of the day, with less variability recorded throughout the day. Furthermore, it could be observed that PM2.5-based air contamination remained around 35 µm, with high variability recorded throughout the day. PM10-based air contamination remained about 105 µm for the day's maximum time, with high variability recorded throughout the day.  Figure 6a,b represents the variability analysis of various air pollutants such as PM2.5, PM10, CO, NO2, O3 (1 h), and O3 (4 h). Here, the x-axis represents time, and the y-axis represents the contamination values of the air pollutants. The air pollutants' variability analysis is described using various graphical representations such as line graphs, scatter graphs, and histograms. The visual representation of line graphs and scatter charts indicates the linear relation of the pollutants concerning time, whereas the histogram depicts the pollutants' variability. Figure 6a shows slight variability when the scale is reduced to 0-25 µm. Furthermore, PM10 ranges from 2 to 12-+ µm. PM2.5 ranges from 2 to 8 µm. The rest of the pollutants like CO, NO2, O3 (1 h), and O3 (4 h) have values from 0 to 1 µm. Figure 6b represents the variability of different gases such as PM2.5, PM10, and CO. It indicates that the variability of CO exceeds the frequency of 140 marks; it was also recorded that CObased air contamination remained zero for the maximum time of the day, with less variability recorded throughout the day. Furthermore, it could be observed that PM2.5-based air contamination remained around 35 µm, with high variability recorded throughout the day. PM10-based air contamination remained about 105 µm for the day's maximum time, with high variability recorded throughout the day. Figure 6b also represents a variety of air pollutants' values concerning time. It can be observed that the PM2.5, PM10, and CO average contamination values were recorded around 0 to 35 µm, 0-7 µm, and 0-115 µm, respectively.

Data Prediction Layer
The data prediction layer is responsible for predicting AQI values of various air pollutants using linear regression methodology. The PWP dataset labeled data such as the AQI values and quantities of a particular pollutant. The samples used in the conducted experiments were continuous and predictable. Table 7 represents the details of the data collection for the conducted experiments. In the first phase of the presented system, linear regression methodology was applied to achieve a hypothetical line of air pollutants, as shown in Figure 9. The predicted AQI coefficient (Y predicted ) of a single pollutant can be given by where σ = slope parameter, x = quantity of a particular pollutant, and c = predicted AQI coefficient constant; c can be a nonzero value if the x-axis starts with a nonzero term.
Predicted AQI = y-predicted quantity if a particular pollutant Now, to calculate the error between the Y predicted and Y actual values, the cost function j (σ ) can be given by where m = the number of training examples. To achieve the value of the minimum cost function j (σ ) and to calculate the slope parameter σ, a gradient descent methodology-based optimization function can be represented by a gradient descendant graph of j (σ ), as shown in Figure 7.

Data Prediction Layer
The data prediction layer is responsible for predicting AQI values of various air pollutants using linear regression methodology. The PWP dataset labeled data such as the AQI values and quantities of a particular pollutant. The samples used in the conducted experiments were continuous and predictable. Table 7 represents the details of the data collection for the conducted experiments.

(a) Linear Regression based prediction:
In the first phase of the presented system, linear regression methodology was applied to achieve a hypothetical line of air pollutants, as shown in Figure 9. The predicted AQI coefficient ( ) of a single pollutant can be given by  To obtain the optimum global value of a cost function ( ) , we applied the repeated convergence of a gradient descent technique as below:  To obtain the optimum global value of a cost function j (σ ), we applied the repeated convergence of a gradient descent technique as below: where α = learning rate and temp = a temporary variable. If a slope parameter σ is ahead of a derivative ( ) value, then the derivative of a negative slope will be -ve; otherwise, the value of a slope parameter σ will be gradually incremented and shift towards the optimum global value. If an optimum global value is behind, then the derivative ( ) the value will be +ve. Therefore, the value of a slope parameter σ will gradually decrease and shift towards the optimum global value. The applied learning rate α will be in the range of 0.001. If a learning rate α is high, then it may skip the optimum global value. If a learning rate α is low, it will require additional time to reach the optimum global value. After applying the gradient descent methodology, a slope parameter σ can be calculated, and the predicted AQI coefficient (Y predicted ) of a particular air pollutant can be given by Similarly, all the remaining pollutants were calculated. After the completion of the training process, the PWP prediction system provided the following parameter values: σ = 734.33, λ = 11.08, µ = 4.00, φ = 2.00, ξ = 943.78, Therefore, the final predicted AQI coefficient (Y predicted ) can be given by Predicted AQI Coefficient Y predicted = (734.33 * NO2) + (11.08 * CO) + (4.00 * PM2.5) + (2.00 * PM10) + (943.78 * O3) + 0 (10) Similarly, in general, the predicted AQI coefficient (Y predicted ) can also be represented by where W = weight values of the parameters of air pollutants, n = number of air pollutants, x = quantities of pollutants of N, and N represents a set of air pollutants = {PM 2.5, PM 10, CO, NO2, O3} (12).

(b) Artificial Neural Network-based Prediction:
In the second phase of the presented system, artificial neural network methodology is applied to predict various air pollutants' hypothetical line. The mathematical model was used to build the new equation to estimate the PWP system for air pollutants such as NO 2 , PM2.5, PM10, CO, and O 3 . An ANN is a machine-learning model that follows some of the observed genetic nervous classification properties and draws on adaptive genetic erudition. In short, to solve a problem using ANN, the following steps must be taken:

1.
Select the type of machine-learning network for the kind of regression problem to be resolved, such as identifying a PWP system for an air pollutant gas estimator. One of the best solutions for that purpose is to use a multilayered machine-learning perceptron network.

2.
Data preprocessing: The data gathered for this study consists of a set of 189,648 training sample instances; each instance being composed of six variables. All variables were initially expressed in ppm, such as NO 2 , PM2.5, PM10, CO, O 2 , and O 3 . The sample data was later normalized into [0.1, 0.9] the interval, which streamlined the ANN model's learning. 3.
ANN Model design: There are numbers of machine-learning architectures to select from, each having its particular parameters and compensations for its specific problem. One of the most widespread machine-learning models is the feed-forward multilayered perceptron. In this network, the ANN model consists of 7 layers: an input layer, five hidden layers, and an output layer. The hidden layers contain 512, 512, 256, 128, and 64 neurons, respectively. The final layer includes a single output neuron. The hidden layers consist of all the probable networks between the input to the output layer and allow for a combined impact of multiple independent variables on the output layer. The first input layer relates to the independent variables (NO 2 , PM2.5, PM10, CO, O 2 , and O 3 ), while the final output layer corresponds to the dependent variable score of the PWP system for air pollutant gases. To achieve the final architecture mixture, such as setting the size and number of the hidden layers, we were accompanied by a cross-validation method. The architecture used in the undertaken study is a customized multilayered ANN model, as shown in Figure 8. To build a customized ANN model to predict the AQI values of various pollutants, various parameters such as the activation function, error functions, and optimizers must be configured. In the undertaken study, the rectilinear unit (ReLU) was used as an activation function; a mean absolute and mean squared error was chosen as the error function. Furthermore, adam was chosen as an optimizer. In the end, the number of neurons and hidden layers were selected based on the size and features of the dataset, as represented in Table 7. To set the weights for all the nodes in the ANN, a backpropagation technique was employed. The learning rate was set to 0.2, and the momentum term was 0.3. The ANN training was stopped when the mean squared errors (MSE) reached below 0.001.
Sensors 2020, 20, x 14 of 26 1. Select the type of machine-learning network for the kind of regression problem to be resolved, such as identifying a PWP system for an air pollutant gas estimator. One of the best solutions for that purpose is to use a multilayered machine-learning perceptron network. 2. Data preprocessing: The data gathered for this study consists of a set of 189,648 training sample instances; each instance being composed of six variables. All variables were initially expressed in ppm, such as NO2, PM2.5, PM10, CO, O2, and O3. The sample data was later normalized into [0.1, 0.9] the interval, which streamlined the ANN model's learning. 3. ANN Model design: There are numbers of machine-learning architectures to select from, each having its particular parameters and compensations for its specific problem. One of the most widespread machine-learning models is the feed-forward multilayered perceptron. In this network, the ANN model consists of 7 layers: an input layer, five hidden layers, and an output layer. The hidden layers contain 512, 512, 256, 128, and 64 neurons, respectively. The final layer includes a single output neuron. The hidden layers consist of all the probable networks between the input to the output layer and allow for a combined impact of multiple independent variables on the output layer. The first input layer relates to the independent variables (NO2, PM2.5, PM10, CO, O2, and O3), while the final output layer corresponds to the dependent variable score of the PWP system for air pollutant gases. To achieve the final architecture mixture, such as setting the size and number of the hidden layers, we were accompanied by a cross-validation method. The architecture used in the undertaken study is a customized multilayered ANN model, as shown in Figure 8. To build a customized ANN model to predict the AQI values of various pollutants, various parameters such as the activation function, error functions, and optimizers must be configured. In the undertaken study, the rectilinear unit (ReLU) was used as an activation function; a mean absolute and mean squared error was chosen as the error function. Furthermore, adam was chosen as an optimizer. In the end, the number of neurons and hidden layers were selected based on the size and features of the dataset, as represented in Table 7. To set the weights for all the nodes in the ANN, a backpropagation technique was employed. The learning rate was set to 0.2, and the momentum term was 0.3. The ANN training was stopped when the mean squared errors (MSE) reached below 0.001.

Results and Discussion
In the undertaken study, we presented two approaches to predict a variety of air pollutants, such as PM2.5, PM10, CO, NO2, and O3: (i) the linear regression-based approach (ii) ANN-based approach.

Results and Discussion
In the undertaken study, we presented two approaches to predict a variety of air pollutants, such as PM2.5, PM10, CO, NO 2 , and O 3 : (i) the linear regression-based approach (ii) ANN-based approach.

Air Pollution Prediction Using a Linear Regression Methodology
In a PWP linear regression-based air pollution prediction methodology, the gradient descent is used as an optimization algorithm, as discussed in Section 2.2.4. Figure 9a-f represents a predicted AQI value of the PM2.5, PM10, CO, NO 2 , O 3 (1 h), and O 3 (4 h) air pollutants. The X-axis represents the air pollutants' quantities, and the Y-axis represents the air pollutants' AQI values. The presented results consist of three features: (i) a hypothetical line, (ii) raw data, and (iii) test data. The hypothetical line is generated by the presented customized linear regression-based air pollution prediction system. The raw data are represented with red color; the test data are the data used for the predictions depicted by a cross-blue shade structure. The overall AQI is generated after the summation of all the AQI values of the air pollutants. The parameters of NO 2 , CO, O 3 (1 h), O 3 (4 h), PM2.5, and PM10 are 734.33, 11.08, 943.78, 1176.2, 4, and 2, respectively. The lowest value of the x-intercept is two, which is of PM10 pollutants. It indicates that a high increment in PM10 may cause only a slight change in the AQI. The PM2.5 x-intercept is 4, which means that a high increment in a pollutant may cause less increment in an AQI value than PM10. The x-intercept of CO is 11.08, which means that a high increment in pollutants may cause less increment in an AQI but more as compared to PM2.5 and PM10. The x-intercept of NO 2 is 734, which means that a low increment of NO 2 may cause a high increment of an AQI value. The x-intercepts of O 3 (1 h) and O 3 (4 h) have the maximum readings, i.e., 943.78 and 1176.20, which means a slight increment in O 3 cause a considerable increment in an AQI as compared to NO 2 . Each value depicts a different conclusion. PM10 has the lowest value of x-intercept, i.e., 2, which indicates that even an enormous increment in PM10 cannot cause a significant change in the overall AQI. The x-intercept of PM2.5 pollutants is 4, meaning that a high increment in this pollutant value can cause a little increment in the AQI value compared to PM10. The x-intercept of CO is 11.08, which indicates that a high increment in the pollutant value may cause a slight increment in the overall AQI; in comparison to PM2.5 and PM10, this increment caused by CO is considered more significant. The x-intercept of NO 2 is 734, indicating that even a low increment in NO 2 may cause a high increment in the overall AQI value. The x-intercepts of O 3 (1 h) and O 3 (4 h) have the maximum readings, i.e., 943.78 and 1176.20, which means that even a slight increment in O 3 may cause a considerable increment in the overall AQI as compared to NO 2 and others.
the particular matter pollutants. As shown in Figure 9d, the dispersion rate of the NO2 pollutants was very high compared to the other pollutants. In the case of NO2, a huge inclination was noticed according to the graphical representation scale. As shown in Figure 9e,f, the highest inclination was recorded in the O3 pollutant (1 h) and O3 pollutant (4-hour) graphs.
where order (causing minor changes to significant changes) = O3, NO2, CO, PM2.5, and PM10. A deep neural network generates a hypothetical line. Furthermore, the raw data is represented with a red color, and the test data is represented using a cross-shade blue color structure. In the end, the overall AQI values were calculated based on the summation of the AQI values of all the presented air pollutants. Table 9 represents the accuracy metrics of an ANN algorithm for PM2.5, PM10, CO, NO2,

Air Pollution Prediction Using Artificial Neural Networks
In a PWP ANN-based air pollution prediction methodology, ReLU was used as an activation function, and adam was used as an optimization function with an RMSE loss function, as described in Section 2.2.4. Figure 9a-f also represents an ANN predicted AQI value of PM2.5, PM10, CO, NO 2 , O 3 (1 h), and O 3 (4 h) air pollutants. The X-axis represents quantities of air pollutants, and the Y-axis represents the AQI values of air pollutants. Color coding was used to describe three features: (i) hypothetical line, (ii) raw data, and (iii) test data. As shown in Figure 9a, a gradual incline was noticed in the AQI value of a PM2.5 pollutant based on the conducted experiments. Similarly, in the case of a PM10 pollutant, a minor incline was observed compared to the PM2.5 pollutants. Figure 9c depicts a concentration level of CO pollutants and indicates a lesser scale as compared to the PM2.5 and PM10 pollutants. Furthermore, in the case of a CO pollutant, a greater inclination was recorded than the particular matter pollutants. As shown in Figure 9d, the dispersion rate of the NO 2 pollutants was very high compared to the other pollutants. In the case of NO 2 , a huge inclination was noticed according to the graphical representation scale. As shown in Figure 9e,f, the highest inclination was recorded in the O 3 pollutant (1 h) and O 3 pollutant (4-h) graphs.
where order (causing minor changes to significant changes) = O 3 , NO 2 , CO, PM2.5, and PM10. A deep neural network generates a hypothetical line. Furthermore, the raw data is represented with a red color, and the test data is represented using a cross-shade blue color structure. In the end, the overall AQI values were calculated based on the summation of the AQI values of all the presented air pollutants. Table 9 represents the accuracy metrics of an ANN algorithm for PM2.5, PM10, CO, NO 2 , O 3 (1 h), and O 3 (4 h). It indicates that the PM2.5 pollutant recorded the maximum accuracy as compared to all the other pollutants. Furthermore, for the rest of the pollutants, such as the PM10, CO, NO2, O 3 (1 h), and O 3 (4 h) pollutants, a recorded accuracy below the rudimentary level was recorded less than 85%. It also concludes that the customized linear regression methodology outperformed the ANN algorithm's customized version in the conducted experiments. However, the NO 2 and CO pollutants recorded around 84% and 83% accuracy, respectively. In the cases of PM2.5 and PM10, the documented accuracy was around 90% and 84%, respectively. Nevertheless, pollutants such as O 3 (1 h) and CO recorded the lowest accuracy, which was approximately 79% and 77%.   [3], Bayes [4], Huber [5], Lars [6], Lasso-Lars [7], SGD [8], ElasticNet [9], and ANN regression methodologies. It also indicates that linear regression methodology recorded the maximum accuracy, which was around 99% among all the other methods. Furthermore, it can also be observed that the customized version of the ANN regression methodology used in the conducted experiments recorded the minimum accuracy for a variety of air pollutants, as compared to the remaining machine-learning methodologies. It recorded 90%, 84%, 83%, 84.79%, 79% and, 77% accuracy for the air pollutants such as PM2.5, PM10, CO, NO 2 , O 3 (1 h), and O 3 (4 h), respectively. Furthermore, Table 11 represents the error metrics comparison of the linear [1], ridge [2], Lasso [3], Bayes [4], Huber [5], Lars [6], Lasso-Lars [7], SGD [8], ElasticNet [9], and ANN regression methodologies. It can be observed from the obtained error calculations that the linear regression methodology recorded the very minimal mean absolute and mean squared errors, which were around 1.12% and 3.22%, respectively. Furthermore, it also indicates that the customized ANN methodology used in the conducted experiments recorded the minimum accuracy for a variety of air pollutants, such as PM2.5, PM10, CO, NO 2 , O 3 (1 h), and O 3 (4 h), as compared to the remaining machine-learning methodologies. It recorded the maximum mean absolute and squared errors around 11.23% and 21.63%, respectively.

PWPS Web and Mobile Interface
We designed a web and mobile interface for the presented pollution weather prediction system based on the conducted experiments. Figure 10a,b represents a web and mobile interface of a PWP system. The proposed study was carried out to provide the pollution predictions of various air pollutants, such as PM2.5, PM10, CO, NO 2 , and O 3 . The application layer of the conducted study consists of a web application called "PollutionWeatherPredictionSystem." This application presents the data collected, such as the concentration levels of various air pollutants. The application works pretty simply yet efficiently; the user interacts with the website through a calendar control that takes a specific date as the input, fetches the corresponding data from the database on MySQL, and displays it to the user, as shown below. Figure 10c represents a date-wise pollution prediction of 13 June 2020 to 24 June 2020.
Sensors 2020, 20, x 21 of 26 a specific date as the input, fetches the corresponding data from the database on MySQL, and displays it to the user, as shown below. Figure 10c represents a date-wise pollution prediction of 13 June 2020 to 24 June 2020.

Conclusions and Future Work Discussion
In the presented research work, we proposed an economic pollution weather system to predict various air pollutants for outdoor sites. The proposed PWP system consists of five layers. The physical sensing layer consists of different sensing units of air pollutants connected to a connection layer via a HIVEMQ (MQTT-based) broker. The data analysis layer performs a variability analysis of various air pollutants and discusses the variability analysis results. In the presented research work, we used machine learning and deep neural network-based approaches to predict the AQI values of various air pollutants, such as PM2.5, PM10, CO, NO 2 , and O 3 . In the future, the presented method can function lifelong and can be retrained according to the updated dataset. Based on the conducted experiments, we also found that the customized linear regression methodology outperformed other machine-learning methods, such as the linear, ridge, Lasso, Bayes, Huber, Lars, Lasso-Lars, SGD, and ElasticNet regression methodologies, and the customized ANN regression methodology used in the conducted experiments. In the case of linear regression methodology, it was observed that, whenever there were slight increases in the pollutants such as PM2.5, PM10, and CO, the overall AQI was not affected too much. However, the overall AQI value was significantly impacted whenever there was some increase in the NO 2 and O 3 pollutants. The overall AQI value was calculated based on the summation of all the presented air pollutants' AQI values. In the end, the web and mobile interface was developed to display the air pollution prediction values of a variety of air pollutants. In the future, fellow researchers can research places with high altitudes, geographical variations, and spatiotemporal variations.
Funding: This research received no external funding.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A.1 Air Quality Monitoring
Air quality monitoring is an important topic to be taken into consideration, as an unhealthy and polluted environment can cost many lives, along with worsening the conditions of the ecosystem. It justifies the importance of awareness about the air quality and the measures to make it better and healthy and use techniques such as data preprocessing to standardize data and remove the unrequired, along with data visualization for identifying trends and evaluating modeling outputs. In addition to this, it also includes a web application called "PollutionWeather" to provide real-time daily, weekly, and monthly pollution-related updates. The latest technologies, such as the Internet of Things, embedded systems, wireless sensor networks, and artificial intelligence, can provide updates related to the recorded variations in the surrounding environment. Due to this, fellow researchers have made enormous efforts to develop complete air quality monitoring and prediction frameworks. The extensive research in air pollution has brought in various positive outcomes to decrease the factors that affect human health.

Appendix A.2 Air Quality Index
Concerning the issues present because of air pollution, measures like the air quality index become of utmost importance. The AQI helps to know the quality of air that we humans breathe. Hence, it can help determine the risk factors that come into the picture and the necessary steps to have better air quality and a better living environment. The AQI metric is used in certain countries such as Malaysia, Canada, and Europe as a primary pollution classification metric [64,65].

Appendix A.3 Air Monitoring Stations
Technically, the monitoring stations can successfully predict the air pollutants present, but they come with pitfalls like all other models. Firstly, the data generated by distanced stations are very sparse, leading to predictions with low granularity and severe difficulty in predicting air pollutions caused by unusual events. Additionally, the devices and the maintenance of the system demands a high cost. Today, most of the methods ruling out the traditional way include the use of IoT (the Internet of Things)-based systems or the concept of participatory sensing, which is significant, low-cost, and comes with the help of smart technology