Indoor Air Quality Control Using Backpropagated Neural Networks

: Providing comfortable indoor air quality control in residential construction is an exceedingly important issue. This is due to the structure of the fast response controller of air quality. The presented work shows the break-down and creation of a mathematical model for an interactive, nonlinear system for the required comfortable air quality. Furthermore, the paper refers to designing traditional proportional integral derivative regulators and proportional, integral, derivative regulators with independent parameters based on a backpropagation neural network. In the end, we perform the experimental outputs of a suggested backpropagation neural network-based proportional, integral, derivative controller and analyze model results by applying the proposed system. The obtained results demonstrated that the proposed controller can provide the required level of clean air in the room. The proposed developed model takes into consideration international Heating, Refrigerating, and air conditioning standards as ASHRAE AND ISO. Based on the findings, we concluded that it is possible to implement a proposed system in homes and offer equivalent indoor air quality with continuous mechanical ventilation without a profuse amount of energy.


Introduction
Given the catastrophic level of urban air pollution and the even lower indoor air quality, we are forced to breathe air with a high concentration of life-threatening substances. Moreover, this problem does not depend on the place of residence, it is equally relevant for both a country house and a city apartment.
Even though standard PID controllers have reasonable answers, they cannot wholly control the indeterminacy of AQC systems' dynamics, which are described by their specific rules and variables [4,5]. Since fuzzy logic controllers (FLC) do not need mathematical modeling, they operate like the vital selection to conventional controllers [6,7]. This research paper is described as follows: appropriate literature was examined, indicating methods of control and existing methods of monitoring the prospects; Section 3 a mathematical model that shows indoor air quality is demonstrated; Section 4 describes the design process of backpropagation neural network (BPNN) based PID controller for air quality monitoring and also explains proposed techniques, in Section 5 we demonstrate simulation outcomes, and results of model performed in our laboratory during the research. At the end of the paper, we discuss further work.
Highlights of this research are the following: Firstly, the proposed work demonstrates the deconstruction and construction of a mathematical model for an interactive, nonlinear system that provides the desired agreeable air quality. Secondly, the paper discusses applying a backpropagation neural network (BPNN) to create proportional, integral, derivative (PID) regulators with independent parameters. Finally, we apply the proposed system to the experimental outputs of a proposed BPNN based PID controller and analyze model outcomes. The proposed model shows its efficiency in residential buildings where outdoor environmental factors are minimal to building constructions. However, during the model development, we did not consider working offices, where participation of outdoor parameters (when windows or doors open all time) is high.

Related Works
Proportional-integral-differential (PID) control is the most common mathematical algorithm. It is used to control automated systems of modern industrial and commercial applications. Essentially, these three parameters of the proportional, integral, and derivative are collected using a sensor and then used to adjust the control element, which changes the output of the process to achieve the desired result [8]. This feedback mechanism can be applied to simple operations, for example, regulating the temperature in a house with a thermostat, or to more complex ones, such as building a tracking and stabilization system onboard an airplane.
While PID control is often used because of its adaptability in a wide range of applications and operating conditions, several common problems arise in the process of configuring PID.
Since complex variables must be precisely configured to achieve optimal performance of the managed system, the configuration process can take a lot of time and erroneous attempts. The difficulty may arise in the fact that the settings for a particular system may differ depending on the priorities of the system [9].
PID control algorithms have long been considered the industry standard for control automation [10]. They remain so today, despite certain shortcomings in the configuration process.
Recently, functions such as automatic and adaptive settings have been used more often, which are aimed at reducing the setup time and can often independently achieve the correct settings for a given operation. In recent studies, machine learning methods are used to independently achieve the correct parameters. For example, intelligent controllers, optimized by the use of evolutionary algorithms were developed for the control of the subsystems of an intelligent building [11]. The combination of machine learning, fuzzy control, and evolutionary algorithms culminated in the so-called Computational Intelligence (CI), which is currently being used in architecture. Some sophisticated control methods have integrated fuzzy adaptive control [12][13][14][15], optimum comfort control [16], and minimum-power comfort control [17] to address the nonlinear characteristic of comfort parameters, computation, time delay, and system uncertainty. A backpropagation algorithm-based direct neural network controller has been developed and effectively used in hydronic heating systems [18].
In Japan [19], neural networks have been widely utilized in commercial goods such as air conditioners, electric fans, and so forth. To further fine-tune the equipment to the customers' tastes, a system of two neural networks has been integrated into an air conditioner. Using only sensor inputs, one of the two neural networks calculates the value of the air quality rate. However, this is not always the best option for a particular user. This output is further corrected by the other neural network. This neural network may be trained by the user.
ML methods have been used to model predictive control (MPC) for energy efficiency and interior environment improvement in buildings in last state-of-the-art research. Ferreira et al. [20] used an MPC controller in conjunction with an ANN-based building model to manage the HVAC system in a federal establishment to optimize interior comfort and power consumption. When compared to a traditional hysteresis controller, Bünning et al. [21] installed an MPC controller with a random-forests-based building model in an apartment to regulate room air temperature and observed a 24.9 percent reduction in cooling energy usage. When compared to the original control, Merabet et al. [22] installed an MPC controller with a data-driven building model in an HVAC test facility to improve HVAC energy efficiency and reported an average of 1.5 MWh of energy savings. The trials in the aforementioned research, on the other hand, were only conducted for a limited period, ranging from hours to days. The majority of prior research in the literature on MPC with an ML-based construction model has relied on simulations. Smarra et al. [23] created an MPC controller based on a random-forest-based building model, which was shown to have similar performance to an MPC based on a perfectly-known physics-based building model via simulations. Huang et al. [24] evaluated an MPC controller with a physics-based construction model using an ANN-based airport building model. The results of their simulations indicated a 5%-18% decrease in HVAC energy usage. Chen et al. [25] used an ANN-based building model to create an MPC controller for hybrid ventilation buildings. In their simulations, the MPC controller outperformed a rule-based controller in terms of thermal comfort. Reynolds et al. [26] created an MPC controller for scheduling heating set points in a building based on an ANN-based architectural model. According to their calculations, the MPC controller saved 27% more energy than traditional control. Afram et al. [27] used an ANN-based building model to create an MPC controller for a residential building, and their simulations revealed an energy-saving potential of 6-73 percent. Experiments that might assess MPC's effectiveness using a machine learning-based construction model over a lengthy period of time are currently missing.

Mathematical Model for Determining Indoor Air Quality (CO 2 )
In our work, we get CO 2 as a detector of the air contaminant. By managing the CO 2 to an acceptable level, it is also possible to control other air pollutants to acceptable levels.  The differential alignment, which manages the formation and dissolution of carbon dioxide, based on a variety of balance considerations, is expressed as q i is the volume flow of fresh air via the filter; q 0 is the volume flow rate of air leaked out; V is the indoor air volume; C is the indoor CO 2 concentration at time t; C 0 is the indoor CO 2 concentration at time t 0 , and S is the rate of formation of CO 2 .
For the volume of indoor air inside, Eq. (1) can be rewritten as For simplicity's sake coefficients K 0 and K 1 : The limits of integration in Eq. (4) are from C 0 to C concentration and t 0 to t time. Here C-determines the concentration of CO 2 at time t, C 0 -determines the concentration of CO 2 at the initial moment of time t 0 . The following expression is formed from (4) Thus, Rearranging Eq. (6) leads to And Substituting Eq. (3) into Eq. (8) gives the illative equation that characterizes the generation and decomposition of CO 2 : When a leak from a building, q 0 , is equal to the volume of fresh air, q i , Eq. (9) will be rewritten as the following equation: Eq. (10) will be considered later in connection with experiments that lead to CO 2 generation due to the high occupancy rate and decomposition of CO 2 after residents leave the building.

Data
The survey of indoor air contaminants' characteristics for overall control and air quality management is a compound problem [28,29]. It was offered that measuring and research of indoor CO 2 mass can be used to realize IAQ and ventilation productivity. The severances in managing the IAQ because of time detentions and measuring errors [30]. To reach optimal method efficiency in the space of rapid replication time, system durability, interposition opposition, and small overshoots, a NN PID controller based on the backpropagation algorithm with a weight update algorithm is proposed.

Configuration of Neural Network and PID Based Control
The NN PID controller combines conventional and NN controllers that combine the PID controller's superiority and the NN network. Fig. 2 exemplifies the architecture of a NN PID control comprising the nonlinear prediction mode land the NN PID controller, where r-is define the installation input, G(S)-is define the managed entity, y-is determine the real output, u-defines the monitoring variable, y-is define the prognosis ofỹ, NNM-is define the neural network model to predict theỹ, and F-is define the learning algorithm. The neural network in Fig. 2 is justified on the system status and adjusts the PID controller's arguments to get the best option possible of a determined productivity index. As soon as the neural network is put together in a particular learning algorithm, it is feasible such the output prognosis or variation is utilized to figure out the manage weight or regulate the NN values. But to get the result of the system prediction is so hard to get that the traditional method concludes the controller task's formation and the solution's prediction. In this way, the correct output can be instead of a forecast output for determining an NN's managed weight [31][32][33][34].

Neural Network PID Controller
Let the fault be defined as e(k) = r(k) − y(k), where r(k) defines an objective signal, y(k) defines the final installation output. At the discrete-time, the PID control method is set as: where k p , k i , and k d are the proportional, integral, and derivative coefficients. Besides, the derivative profit of the PID regulator must be fixed. Eq. (14) can be rewritten as: In Eq. (14) f [·] is a function associated with k p , k i , and k d . By training a BPNN, can be detected the best management rule [35][36][37] .   Fig. 3 shows the NN module used to accommodate the strengthening of the PID controller, applying the adaptive way with the metering data u(k), y(k), and r(k). In our study, the layers of the BPNN used have M input neurons, three output neurons (k p , k i , and k d ), and Q hidden neurons. The results of the BPNN define the three arguments of the PID controller.
where o (1) j defines the output result of j-th neuron into the input layer. Accordingly, the inscribed characters (1), (2), and (3) in the equations mean the input, hidden, and output layers. The hidden layer inputs and outputs can be signifying as [38]: where net (2) i is defined by the i-th neurons of input of the hidden layer, w (2) ij determines the weight of the hidden layers, and f [·] determines the activation function. The outputs of the input and output layer can be signifying as follows: where w (3) li are the weights of the output layer, w lQ is the valve, and g[·] is the function that defines activation.
Based on the gradient way by utilizing the BP method, to lessen the productivity of index function J is signifying as: And where m is the learning rate and is the smoothing factor ∂J ∂w In (18) ∂y(k + 1) ∂u(k) , which figure out with the least-squares method. In (18), the difference of u(k) to k p , k i , and k d is expressed as: Therefore: The hidden layers weights update: And

Nonlinear Prediction
This method suggested how the life-cycle controls system being a nonlinear system [39]. For the air-conditioning for variable-frequency method, the managed object is assumed to be a nonlinear system: where y(k) is output, and u(k) is input at time k, relatively, n y, and n u , the methods of {y} and {u}, relatively.
By considering the prognosis ofŷ(k + 1) or ∂ŷ(k + 1) ∂u(k) , three-layers BPNN method (NNM in Fig. 3), the prognosis method has n y + n u + 1 input and Q hidden neurons, also one output neuron [40]. To oversimplify the prognosis in nonlinear systems, activation of hidden layer neurons will depend on the Sigm1oid functions, and the output layer will be a linear function. The calculation of the prediction of the BPNN is described as following. Assume that the input also the output of the system {y(k)} and {u(k)} constitute the input layer and the input method of the NN: The hidden layers of input and output are expressed as: The result of the output layer can be written as follows: The backward learning of the BPNN model is done by the BP learning algorithm modifying the weights and valve values and making the target function J y a minimum: The weight is modified by: where m is defined as the speed of training, a is a smoothing coefficient, and both are in (0,1).
The activation function's derivative can be written as: So, ∂ŷ(k + 1) ∂u(k) can be expressed as follows:
Apply increment operation to k, after return to the step b) Fig. 4 demonstrates flowchart of PID control using BPNN model. The following steps are described in Fig. 4.  2) Assemble the r(k), y(k), and computation of error: 3) To get the PID arguments k p , k i , and k d , determine every neuron's inputs and outputs. 4) Calculate the Output. 5) Training in an online form. To implement your adaptive adjustment of the parameters PID k e , k I , and k d , regulate every neuron's weight in NN utilizing the algorithm of backpropagation. 6) Perform the k = k + 1 and return to rule 1).

Experiment Results
Indoor environment air quality is investigated by using an advanced control technique based on a BPNN. As said earlier, by using a fuzzy logic-based controller, the system controls CO 2 concentration inside the room. The experiments were executed from September 2020 until the end of February 2021. The concentration of CO 2 is approximately 300-400 ppm outdoor. The succeeding list shows the steps to prepare for the experiment: • The air conditioning system is utilized to provide the room with fresh air.
• A carbon dioxide sensor is used to determine CO 2 concentration.
• As suggested, a fuzzy-based PID controller controlled the working ability of the air conditioner. • The permissible over the limit of CO 2 level is defined as 1000 ppm.
• Operating(working) hours are between 9.00 and 18.00 To simulate the real situation, opening the window or doors continually, occupation of the experimental room with people, or space (when people go out), are also considered during experiments. CO 2 concentration levels may change and affect the controller's work and comfort when considering the situations listed above. Furthermore, folks may come back to the workplace and leave the office earlier or later than the established working hours. CO 2 is not made when there is no air-conditioning space because it is an air pollutant related to accommodations. This means that, when the working day begins, the level of CO 2 in the room is similar to the levels of outdoor CO 2 . Therefore, after 9.00, depending on the occupation of the office, CO 2 levels start to increase. Thus, when the first employer comes to work, the CO 2 controller must be starting its work. Fig. 5 illustrates CO 2 level changes during one working day in January 2021. We can see that, when the working day started, the CO 2 concentration level was low, at about 9.00 it rises sharply due to employers coming to work, and then, due to the controller's work, it fell to less than 1000 ppm. During lunchtime, starting from 13:00 and lasting until 14:00, there was a slight decrease to 600 ppm with a window open. After 14:00, as people return to work, CO 2 concentration increased immediately, followed by a comparatively steady-state level. After 18:00, when the employees left, the CO 2 concentration level decreased.  6 indicates the average monthly internal value of CO 2 within the experiment, starting from September 2020 until February 2021. The red line represents the average monthly value of CO 2 inside the room within labor time from 9:00 to 18:00, and they change among 850-930 ppm. They are approximately 125-60 ppm lower than the original CO 2 value. The blue line indicates the importance of internal average monthly CO 2 regulated after the management operation transmitted to a stable state. In normal conditions, the intermediate monthly CO 2 level in the room is between 940-1000 ppm. Consequently, the CO 2 maintains at an allowable level inside the room, and the stable small faults, meaning that within the laboring day when the controller is working, no over ventilation. The level of CO 2 in the room must be monitored, unlike the level of relative humidity and temperature, which should be regulated within a given range. It behaves when the air conditioning region is open or free [41]; the CO 2 concentration in the room is diminished; this achieved the lower setting. In this case, the CO 2 concentration meanings of indoor are apportioned in a comparative diapason. The standard deviation is not appropriate for the conception of the productivity of IAQ control in the room. Therefore, the inside temperature is generally used to study the controller. The level of the maximum monthly internal CO 2 value is shown in Fig. 7. Thus, according to the study results, the highest value for every day is 1100 parts ppm. This level, which does not harm the human body, does not persist for an extended period [42].

Discussion
Traditional PID control achieves greater performance and higher control accuracy in heating, ventilation, and air conditioning systems when the PID control parameters, percentage gain, integral time, differential time, and sampling period, are adjusted and calibrated. There are certain drawbacks, such as a greater overshoot and a longer reaction time. PID parameter optimization and tuning need a particular math model, and if the PID controlled system is used in an HVAC system, parameter tuning necessitates a mix of theory and experimentation.
In an HVAC system, fuzzy control may minimize overshoot and cut reaction time, improving operating performance. However, a static mistake may occur in a fuzzy control system at times. The steady-state performance index isn't quite good enough, and the control accuracy isn't quite there.
The hybrid control switches between PID and fuzzy control depending on the threshold amount. The hybrid fuzzy-PID control shows both the benefit and the flaw at the same time. Individual control in an HVAC system is inferior to hybrid fuzzy-PID control.
The threshold amount in hybrid fuzzy-PID control is critical to the HVAC system's performance. The region of error and output, as well as experiments and other factors, should all be considered when selecting a threshold valve. In such cases, the use of machine learning has its advantages. Using internal and external parameters, machine learning can predict the necessary PID parameters and will be ready in advance to adjust the parameters. In our study, we used neural networks of backpropagation to predict and quickly adjust parameters.
The suggested approach has been proven to be effective in residential structures when outside environmental influences are limited. However, we did not include functioning offices in the model since they have many outside characteristics (windows or doors open all the time). In further, we are planning to expand our research by applying two more changes. Firstly, we are going to adapt our math model and machine learning model for adjusting PID parameters for office building air quality control by considering the high involvement of outdoor parameters. Secondly, we are going to develop a model for control three comfort parameters as temperature, humidity, and air quality.

Conclusion
The relevance of the work is determined by the need to improve the comfort of residential premises, which includes the improvement of their air quality. At present, taking into account energy-efficient work to ensure a comfortable building's comfortable climate attracts a lot of interest and attention. To get maximum correctness in monitoring the comfort parameters, mathematical models are explored. With the help of a developed mathematical model, a PID controller has been designed, which will give high accuracy and fast response when used using neural network algorithms.
The proposed BPNN PID regulator's effectiveness was demonstrated in experiments. Comfortable meanings inside the room corresponded to the international comfort standards, as indicated by ASHRAE and ISO. We'll use the presence detector and GPU's learning system to improve the system and get more reliable results.
In PID regulation, because complicated variables must be properly set for the controlled system to operate at its best, the configuration procedure may take a long time and result in many failed attempts. The issue may emerge as a result of the fact that the settings for a given system may vary based on the system's priorities.