A method for predicting air quality in underground building spaces
By adopting LSTM-based prediction models and improved ICSS strategies in the air quality prediction of underground building space, the problem of difficult to model complex nonlinear effects and overfitting in the prior art is solved, and higher prediction accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202510081778.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-01-20
Smart Images

Figure CN119539202B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of data prediction, and in particular relates to an air quality prediction method suitable for underground building spaces. Background Art
[0002] Compared with ground buildings, underground building spaces have more prominent air quality issues due to their special enclosure and use environment. Air quality prediction for underground building spaces is not only related to human health and environmental safety, but also has important significance for facility operation management and energy utilization optimization.
[0003] Air quality prediction in underground building spaces is of great importance to human health, safety management, energy optimization, and regulatory compliance. Currently, there are many methods for predicting air quality in underground building spaces (such as physical models, data-driven models, hybrid models, etc.). However, due to the special environment and complex factors of underground buildings, these methods still have certain problems and limitations in practical applications, including: (1) Physical models rely on pollutant diffusion and fluid mechanics theory, which makes it difficult to model complex nonlinear effects; (2) Traditional models, such as regression models, cannot fully explore the implicit patterns and nonlinear characteristics in the data; (3) Data-driven models (such as deep learning models) overfit to the data of specific underground spaces and are difficult to generalize to underground buildings of different types or structures.
[0004] The Individual and Collective Learning Balance Strategy (ICSS) is a new meta-heuristic optimization algorithm that aims to balance the two learning modes of individual learning and collective learning, and achieve efficient exploration and utilization in the search space through dynamic switching. The performance of the ICSS algorithm is highly dependent on the random counter value and the frequency of learning strategy switching. The choice of parameters has a great impact on the optimization effect of different problems, and the setting of these parameters lacks general theoretical guidance. The random counter and perturbation strategy of the ICSS algorithm have high randomness, which makes the algorithm unstable on complex problems, especially in low-dimensional or high-convergence scenarios. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides an air quality prediction method suitable for underground building spaces. By introducing an intelligent prediction method, the deficiencies of the existing methods are solved, the environmental quality of underground spaces can be effectively improved, and strong support can be provided for green and sustainable underground building management.
[0006] To achieve the above-mentioned purpose of the invention, the present invention adopts the following technical solution: an air quality prediction method applicable to underground building space, the prediction method specifically includes the following steps.
[0007] S1. Collect multi-source data related to air quality in underground building space, select high-feature variables from the multi-source data, and construct a data set using the high-feature variables, wherein the data set includes Q groups of time series data;
[0008] S2. Construct a prediction model based on LSTM and use a long short-term memory network to model time series data. The time series data includes input feature variables and output target pollutant concentrations. The time series data in the data set is divided into a test set and a training set according to a certain ratio.
[0009] S3, input the training set into the LSTM prediction model, and use the improved individual and collective learning balance strategy to adjust the learning rate r and the number of hidden units h of the LSTM prediction model, train the LSTM prediction model, and obtain a high-performance air quality prediction model; the improved individual and collective learning balance strategy includes: first, through the guiding factor and directional disturbance factor Combined with the historical optimal solution, the direction of agent individual position update in the individual learning stage is optimized; secondly, a diversity maintenance mechanism is introduced in the collective learning stage and a distance-based penalty term is introduced to punish agents that are too close to the global optimal solution. The agent individuals are punished, forcing the corresponding agent individuals to deviate from the current solution, and improving the optimization mathematical model in the collective learning stage.
[0010] S4. Input high-feature variables in the test set into a high-performance air quality prediction model, output accurate target pollutant concentrations, and obtain the air quality of the underground building space.
[0011] Furthermore, in underground building spaces, air quality related data is collected through multi-source sensors and monitoring equipment, and the multi-source data is processed to obtain high-feature variables. The specific method is: standardize the collected multi-source data, eliminate dimensional differences, and clean the data, including time series data standardization and outlier removal, where the time series data standardization is designed by taking the mean and standard deviation of the original data points as the standard, and the mathematical model is: ;
[0012] In the formula, is the original data point, i.e., the original characteristic value; is the qth original data point, Q original data points constitute a feature variable, is the standardized data point, where .
[0013] Furthermore, the method for removing outliers from the time series data of the feature variable is as follows: Suppose the time series data set of the cth feature variable is , for each data point, the average distance between it and its k nearest neighbor data points is calculated, and the average neighborhood distance of all data points is stored as an array , define a dynamic threshold based on the average neighborhood distance and the average neighborhood distance standard deviation , for each data point , comparing their average neighborhood distance With dynamic threshold, if Greater than ,but The outliers are removed.
[0014] Furthermore, the screened high-feature variables are used to construct a final data set, wherein the final data set includes input feature variables and output feature variables, wherein the input feature variables include temperature, humidity, wind speed, vehicle flow, and spatial volume; the output feature variables are actual pollutant concentrations, and the pollutant targeted by the present invention is PM2.5, wherein the input feature variables are arranged in time series order, with the first 70 percent of the data being used as a training set, and the remaining 30 percent of the data being used as a test set.
[0015] Furthermore, the air quality prediction model for underground building space based on LSTM is trained with input data as the training set. The learning rate r and the number of hidden units h of the LSTM prediction model are optimized by using the improved individual and collective learning balance strategy, so that the LSTM prediction model can achieve the best performance under the optimal learning rate r and the number of hidden units h, thereby improving the accuracy of air quality prediction for underground building space. Among them, the learning rate r is the step size for controlling the update of LSTM model parameters, which determines the amplitude of weight update at each gradient descent. A learning rate that is too small will result in a long training time. A learning rate that is too large will result in a large parameter update amplitude, resulting in divergence during training. Air quality prediction involves complex nonlinear relationships, and the size of the learning rate needs to be balanced. The number of hidden units affects the capacity and expression ability of the model. Each hidden unit stores memory information of a specific time step, which is used to capture the long-term and short-term dependencies of time series data. A hidden unit that is too small will result in insufficient model capacity, inability to capture complex nonlinear relationships, and easy underfitting, resulting in inaccurate predictions. A hidden unit that is too large will result in overfitting.
[0016] Furthermore, the agent individual position of the improved individual and collective learning balance strategy is a two-dimensional vector, that is, each agent individual position for , each agent's individual position With a set of learning rate r and number of hidden units h Mapping, that is ; The number of proxy individuals is the set number of learning rate r and hidden unit number h. The improved individual and collective learning balance strategy is used to update the proxy individual position. At the same time, the fitness function is used to evaluate the proxy individual position, and the update direction of the improved individual and collective learning balance strategy for the proxy individual position is adjusted to obtain the optimal proxy individual position. The optimal proxy individual position is the optimal learning rate r and hidden unit number h value in the training process of the air quality prediction model for underground building space after analysis; wherein, in the prediction of air quality in underground building space, the design of the fitness function needs to be able to quantify the gap between the model prediction performance and the actual target.
[0017] Furthermore, the fitness function of the present invention combines the trade-off between prediction accuracy and complexity and is defined as:
[0018] ; In the formula, is the fitness value of each agent's individual position, that is, ; is the weight coefficient of model complexity, is the weight coefficient of the prediction error, + =1; is the pollutant concentration of the qth time series predicted by the model, is the actual pollutant concentration of the qth time series, is the number of hidden units corresponding to the position of the i-th agent individual; according to the design, the smaller the fitness value, the higher the accuracy of the current air quality prediction model training for underground building space, that is, the more accurate the current learning rate r and the number of hidden units h.
[0019] For the optimization mathematical model of the individual learning stage of the individual and collective learning balance strategy, a guided search strategy is introduced and combined with the information of the historical optimal solution to optimize the directionality of individual learning and reduce the impact of pure random disturbance on the optimization accuracy of the solution; the improved optimization mathematical model of the individual learning stage is:
[0020] ;
[0021] In the formula, is the position of the i-th agent at the k+1th iteration, is the position of the i-th agent at the k-th iteration, is the optimal solution found by the ith agent in its search history, A random perturbation follows a Gaussian distribution, is the position standard deviation of the ith agent, is the guiding factor, controlling the degree of approach to the historical optimal solution; is the directional perturbation factor, which controls the intensity of random exploration.
[0022] Furthermore, the guiding factor The mathematical model is:
[0023] ; In the formula, is the maximum value of the bootstrap factor, which is 0.8. is the current iteration number, is the maximum number of iterations, is the global optimal solution of the kth iteration, is the global optimal solution of the k-1th iteration, that is, the historical optimal solution, is the fitness calculation function;
[0024] Furthermore, the directional perturbation factor The mathematical model is:
[0025] ; In the formula, is the maximum value of the directional disturbance factor, which is 0.5. is the population size, is the global optimal solution, is the position of the i-th agent at the k-th iteration.
[0026] Furthermore, the optimization mathematical model of the collective learning stage for the individual and collective learning balance strategy is introduced into the collective learning, and a diversity maintenance mechanism and a distance-based penalty term are introduced to punish the solution that is too close to the global optimal solution. The agent individuals are penalized, forcing the corresponding agent individuals to deviate from the current solution. The distribution diversity of the solution is enhanced by the above method, so as to explore more areas. The optimization mathematical model of the improved collective learning stage is:
[0027] ;
[0028] In the formula, is the position of the i-th agent at the k+1th iteration, is the position of the i-th agent at the k-th iteration, is the position of the jth agent at the kth iteration, j≠i, is the global optimal solution, is the population size, is the square of the standard deviation of the Gaussian function.
[0029] Furthermore, the i-th agent is calculated With other agents The weighted average distance is calculated, and the influence intensity of diversity maintenance is adjusted by the penalty factor μ. The surrounding agent density is too high, that is, When it becomes larger, the penalty value Become larger, The mathematical model is:
[0030] ,
[0031] lead to Decreases, thereby weakening the trend of approaching the global optimal solution, making the i-th agent individual deviate from the crowded area; if the i-th agent individual In relatively sparse areas, the penalty value is small and the trend of approaching the global optimal solution remains strong.
[0032] Furthermore, through the improved method proposed by the present invention, in the process of searching for the optimal solution, if the diversity maintenance item is large, that is, the penalty value Enlarge, global boot item The effect of will be weakened, so that the agent individuals stay away from the dense area, avoiding the solution from falling into the local optimum, affecting the accuracy of the solution; if the diversity maintenance term is small, that is, the penalty value becomes smaller, the effect of the global guidance term will be fully preserved, and the agent individuals are more inclined to move closer to the global optimal solution.
[0033] Furthermore, the learning rate r and the number of hidden units h of the LSTM prediction model are adjusted using the improved individual and collective learning balance strategy to obtain the optimal learning rate and hidden unit value. The specific steps are as follows:
[0034] S301. Randomly initialize the position of each agent individual, use the fitness function to calculate the fitness value of each agent individual position, record the agent individual position corresponding to the current minimum fitness value, and record it as the global optimal solution of the kth iteration. ;
[0035] S302: Whether the current number of iterations is greater than the maximum number of iterations, if so, the position of the agent is updated, and the agent position corresponding to the current minimum fitness value, i.e., the global optimal solution, is updated. Parse to the values of the learning rate and number of hidden units of the LSTM prediction model; otherwise, perform an update of the agent's individual bit position;
[0036] S303, using an improved individual and collective learning balance strategy to update the position of the agent individual, including using an improved optimization mathematical model of the individual learning stage and an improved optimization mathematical model of the collective learning stage to update the position of the agent individual; wherein a dynamic switching factor is used to control the switching between the individual learning stage and the collective learning stage; if P ≥ 0.5, the individual learning stage is executed, otherwise the collective learning stage is executed;
[0037] ; In the formula, is the dynamic switching factor, is the ranking of the current agent in the fitness positive order distribution, is the mean of the fitness rankings in the agent population;
[0038] S304: Calculate the updated agent individual position fitness value using the fitness function, record the agent individual position corresponding to the minimum fitness value again, compare the agent individual position best solution of the kth iteration and the k-1th iteration, and take the smaller fitness value of the two as the global optimal solution of the kth iteration. ;
[0039] S305. Increase the current number of iterations by one, and return to execute S302.
[0040] The one or more technical solutions provided by the present invention have at least the following technical effects and advantages: introducing an ICSS strategy to optimize LSTM hyperparameters, an improved individual and collective learning balance strategy to combine historical optimal solutions in the individual learning stage to improve the directionality of the solution, and introducing a diversity maintenance mechanism in the collective learning stage to prevent premature convergence; a fitness function design that comprehensively considers prediction accuracy and model complexity, considers model prediction performance and complexity overhead, dynamically balances the relationship between the two, effectively combines the LSTM model with the improved ICSS hyperparameter optimization strategy, solves the common nonlinear complexity problems in underground building air quality prediction, significantly improves the prediction performance, convergence speed and resource utilization efficiency of the model, and at the same time has good robustness and adaptability, which is an important technical support for green and sustainable underground space management. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A flow chart of an air quality prediction method applicable to underground building space provided by the present invention;
[0042] Figure 2 A flow chart of a method for adjusting the learning rate r and the number of hidden units h of the LSTM prediction model using the improved individual and collective learning balance strategy provided by the present invention;
[0043] Figure 3 It is a comparison diagram of the fitness of the ICSS-LSTM prediction method and the prediction method of the present invention for setting the learning rate and the number of hidden units during the LSTM prediction model training process;
[0044] Figure 4 The result diagram of setting the number of hidden units for the ICSS-LSTM prediction method and the prediction method of the present invention;
[0045] Figure 5 This is a graph showing the learning rate setting results of the ICSS-LSTM prediction method and the prediction method of the present invention;
[0046] Figure 6This is the training result diagram of the air quality prediction model;
[0047] Figure 7 This is the air quality prediction result diagram;
[0048] Figure 8 Air quality prediction error map. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] Embodiment 1, as Figure 1 As shown, the present invention provides an air quality prediction method applicable to underground building spaces, and the prediction method specifically includes steps S1-S4.
[0051] S1. Collect multi-source data related to air quality in underground building spaces, select high-feature variables from the multi-source data, and construct a data set using the high-feature variables. The data set includes Q groups of time series data.
[0052] First, in the underground building space, air quality related data are collected through multi-source sensors and monitoring equipment. The collected air quality related data, including temperature, humidity, wind speed, vehicle flow, space volume and actual pollutant concentration, are statistically processed into xlsx tables and then standardized, including time series data standardization and outlier removal. The time series data standardization is designed with the mean and standard deviation of the original data points as the standard. The mathematical model is:
[0053] ; In the formula, is the original data point, i.e., the original characteristic value; is the qth original data point, Q original data points constitute a feature variable, is the standardized data point, where ; During the implementation process, Q is set to 100, that is, 100 sets of data.
[0054] Secondly, the outliers of the time series data of the feature variables are removed by setting the time series data set of the cth feature variable to , each data point calculates the average distance between it and its m nearest neighbor data points , the formula is: ; Where j = 1,...,m; the average neighborhood distance of all data points is stored as an array , define a dynamic threshold based on the average neighborhood distance and the average neighborhood distance standard deviation , for each data point , comparing their average neighborhood distance With dynamic threshold, if Greater than ,but The dynamic threshold is considered as an outlier and is removed. Defined as: , where mean is the mean function and std is the standard deviation function; during the implementation, the number of feature variables is set to 6 and the number of nearest neighbor data points m is set to 3.
[0055] S2. Construct a prediction model based on LSTM and use a long short-term memory network to model time series data. The time series data includes input feature variables and output target pollutant concentrations. The time series data in the data set is divided into a test set and a training set according to a certain ratio.
[0056] First, build an LSTM model and set the input layer, LSTM layer and output layer; then, divide the time series data into input and target sequences, and arrange the input feature variables in the order of the time series. The first 70% of the data is used as the training set, and the remaining 30% of the data is used as the test set.
[0057] S3. Input the training set into the LSTM prediction model, and use the improved individual and collective learning balance strategy to adjust the learning rate r and the number of hidden units h of the LSTM prediction model, train the LSTM prediction model, and obtain a high-performance air quality prediction model.
[0058] First, a training set is input into the input layer of the LSTM model, and the training set is used to train the LSTM prediction model so that the LSTM prediction model is adapted to the air quality prediction of underground building spaces. Then, the improved individual and collective learning balance strategy is used to adjust the learning rate r and the number of hidden units h of the LSTM prediction model to obtain the optimal learning rate r and the number of hidden units h values for the LSTM layer of the LSTM prediction model. After training 1000 times, the output layer maps the LSTM layer output to the target value for output. The trained LSTM model is the high-performance air quality prediction model of the present invention.
[0059] S4. Input high-feature variables in the test set into a high-performance air quality prediction model, output accurate target pollutant concentrations, and obtain the air quality of the underground building space.
[0060] Embodiment 2: construct a model to adjust the learning rate r and the number of hidden units h of the LSTM prediction model using the improved individual and collective learning balance strategy. The specific steps are:
[0061] S301. Randomly initialize the position of each agent individual, use the fitness function to calculate the fitness value of each agent individual position, record the agent individual position corresponding to the current minimum fitness value, and record it as the global optimal solution of the kth iteration. ;
[0062] S302: Whether the current number of iterations is greater than the maximum number of iterations, if so, the position of the agent is updated, and the agent position corresponding to the current minimum fitness value, i.e., the global optimal solution, is updated. Parse to the values of the learning rate and number of hidden units of the LSTM prediction model; otherwise, perform an update of the agent's individual bit position;
[0063] S303, using an improved individual and collective learning balance strategy to update the position of the agent individual, including using an improved optimization mathematical model of the individual learning stage and an improved optimization mathematical model of the collective learning stage to update the position of the agent individual; wherein a dynamic switching factor is used to control the switching between the individual learning stage and the collective learning stage; if P ≥ 0.5, the individual learning stage is executed, otherwise the collective learning stage is executed;
[0064] ; In the formula, is the dynamic switching factor, is the ranking of the current agent in the fitness positive order distribution, is the mean of the fitness rankings in the agent population;
[0065] S304: Calculate the updated agent individual position fitness value using the fitness function, record the agent individual position corresponding to the minimum fitness value again, compare the agent individual position best solution of the kth iteration and the k-1th iteration, and take the smaller fitness value of the two as the global optimal solution of the kth iteration. ;
[0066] S305. Increase the current number of iterations by one, and return to execute S302.
[0067] First, randomly initialize the position of each agent individual to:
[0068] ,
[0069] Set the maximum position of the agent individual , the minimum position of the agent individual , maximum number of iterations Set to 60, the population size N of the agent individual is set to 50; then define the fitness function:
[0070] ; Weight coefficient of model complexity Set to 0.5, the weight coefficient of the prediction error It is set to 0.5. According to the design, the smaller the fitness value, the higher the accuracy of the current air quality prediction model training for underground building space, that is, the more accurate the current learning rate r and the number of hidden units h.
[0071] Second, each agent's individual position for , each agent's individual position With a set of learning rate r and number of hidden units h Mapping, that is ; .
[0072] Then, the mathematical model of the individual and collective learning balance strategy is improved and defined as: The improved mathematical model of optimization in the individual learning stage is:
[0073] ;
[0074] In the formula, is the position of the i-th agent at the k+1th iteration, is the position of the i-th agent at the k-th iteration, is the optimal solution found by the ith agent in its search history, A random perturbation follows a Gaussian distribution, is the position standard deviation of the ith agent, is the guiding factor, controlling the degree of approach to the historical optimal solution; is the directional perturbation factor, which controls the intensity of random exploration, where the guiding factor The mathematical model is:
[0075] ; In the formula, is the maximum value of the bootstrap factor, which is 0.8. is the current iteration number, is the maximum number of iterations, is the global optimal solution of the kth iteration, is the global optimal solution of the k-1th iteration, that is, the historical optimal solution, is the fitness calculation function;
[0076] Among them, the directional disturbance factor The mathematical model is:
[0077] ; In the formula, is the maximum value of the directional disturbance factor, which is 0.5. is the population size, is the global optimal solution, is the position of the i-th agent at the k-th iteration;
[0078] The improved optimization mathematical model of the collective learning stage is:
[0079] ;
[0080] In the formula, is the position of the i-th agent at the k+1th iteration, is the position of the i-th agent at the k-th iteration, is the position of the jth agent at the kth iteration, j≠i, is the global optimal solution, is the population size, is the square of the standard deviation of the Gaussian function.
[0081] Finally, in order to further verify the effectiveness of the method of the present invention, the standard individual and collective learning balance strategy is used to optimize the prediction of air quality in underground building space (ICSS-LSTM), and compared with the improved high-performance air quality prediction model of underground building space proposed in the present invention. The code design of the entire specific implementation plan is completed in Maltab, the system is established, and the entire system is run to obtain the following results: Figures 3 to 6 's effect diagram.
[0082] Specifically, Figure 3 As shown in FIG. 1 , the fitness comparison diagram of the ICSS-LSTM prediction method and the prediction method of the present invention for the setting of the learning rate r and the number of hidden units h in the prediction model training process of LSTM, the fitness value of the ICSS-LSTM prediction method rapidly dropped to 0.0744905 in the first 10 iterations, and was not further optimized subsequently, falling into the local optimum, and ultimately failing to break through the local optimal solution; while the method of the present invention also rapidly dropped in the first 10 iterations, but continued to optimize after the 10th iteration, and the fitness value further dropped to 0.0673013 in the 18th iteration, and the fitness value was significantly better than the fitness value of the ICSS-LSTM prediction method; further, corresponding to the change in fitness value, as shown in FIG. Figure 4 and Figure 5 , the change of the value during the setting of the number of hidden units and the learning rate; the corresponding Figure 4 In the 10th iteration, the optimal number of hidden units obtained by the ICSS-LSTM prediction method is 40, and correspondingly, the optimal number of hidden units obtained by the prediction method of the present invention is 6 at the 18th iteration; Figure 5In the results, the ICSS-LSTM prediction method reaches stability at the 10th iteration, and the best learning rate obtained by the ICSS-LSTM prediction method is 0.000264144. Correspondingly, at the 18th iteration, the best learning rate obtained by the prediction method of the present invention is 0.000308592.
[0083] Specifically, the optimal learning rate r and the number of hidden units h obtained by the ICSS-LSTM prediction method and the prediction method of the present invention are input into the air quality prediction model training, and the training set accounts for 70%, and the following is obtained: Figure 6 As shown in the training result diagram of the air quality prediction model, the results of the ICSS-LSTM prediction method fluctuate greatly, and the deviation from the true value is more obvious. In some samples, the predicted values have large errors, especially in areas with high pollutant concentrations and low pollutant concentrations. The prediction results of the method proposed in the present invention are closer to the true values, and the overall trend is highly consistent with the true values. In areas with high pollutant concentrations and low pollutant concentrations, the prediction error is significantly smaller than that of the ICSS-LSTM method. Compared with the ICSS-LSTM method, the prediction curve of the method of the present invention is smoother and has smaller fluctuations.
[0084] Specifically, the test set (accounting for 30%) is processed using a high-performance air quality prediction model to obtain the following Figure 7 and Figure 8 As shown in, the air quality prediction result diagram and the air quality prediction error diagram; Figure 7 , compared with the ICSS-LSTM method (dashed circle), the predicted value of the method of the present invention (solid triangle) is closer to the changing trend of the actual pollutant concentration, showing higher accuracy. In most test samples, the predicted value of the method of the present invention is smoother and has a higher degree of fit with the actual value, while the predicted value of the ICSS-LSTM method has a large deviation in some areas; Figure 8 From the comparison of prediction errors, it can be seen that the prediction error of the proposed method on most samples in the test set is significantly smaller than that of the ICSS-LSTM method, the error fluctuation range is smaller, and the distribution is more concentrated. The error of the ICSS-LSTM method is larger, especially in some test samples, with higher positive and negative deviations. The proposed method shows better robustness and generalization performance, and can handle complex air quality prediction tasks more stably.
Claims
1. A method for predicting air quality in underground building space, characterized in that: The method comprises: S1. Collect multi-source data related to air quality in underground building space, select and process high-feature variables from the multi-source data, and construct a data set using the high-feature variables, wherein the data set includes Q groups of time series data; S2. Constructing a prediction model based on LSTM using a long short-term memory network to model time series data, wherein the time series data includes input feature variables and output target pollutant concentrations, and dividing the time series data in the data set into a test set and a training set according to a certain ratio; S3, input the training set into the LSTM prediction model, and use the improved individual and collective learning balance strategy to adjust the learning rate r and the number of hidden units h of the LSTM prediction model, train the LSTM prediction model, and obtain a high-performance air quality prediction model; the improved individual and collective learning balance strategy includes: first, through the guiding factor and directional disturbance factor Combined with the historical optimal solution , optimize the directionality of agent individual position updates in the individual learning phase; secondly, introduce a diversity maintenance mechanism and a distance-based penalty term in the collective learning phase to punish agents that are too close to the global optimal solution. The agent individuals are punished, forcing the corresponding agent individuals to deviate from the current solution, and improving the optimization mathematical model in the collective learning stage; the guiding factor The mathematical model is: ; In the formula, is the maximum value of the bootstrap factor, which is 0.
8. is the current iteration number, is the maximum number of iterations, is the global optimal solution of the kth iteration, is the global optimal solution of the k-1th iteration, that is, the historical optimal solution, is the fitness calculation function; The directional disturbance factor The mathematical model is: ; In the formula, is the maximum value of the directional disturbance factor, which is 0.
5. is the population size, is the global optimal solution, is the position of the i-th agent at the k-th iteration; S4. Input high-feature variables in the test set into a high-performance air quality prediction model, output accurate target pollutant concentrations, and obtain the air quality of the underground building space.
2. The air quality prediction method applicable to underground building space according to claim 1, characterized in that: The method for processing the high-characteristic variables, including removing outliers from the time series data of the high-characteristic variables, is as follows: Assume that the time series data set of the cth characteristic variable is , for each data point, the average distance between it and its k nearest neighbor data points is calculated, and the average neighborhood distance of all data points is stored as an array , define a dynamic threshold based on the average neighborhood distance and the average neighborhood distance standard deviation , for each data point , comparing their average neighborhood distance With dynamic threshold, if Greater than ,but The outliers are removed.
3. The air quality prediction method applicable to underground building space as claimed in claim 2, characterized in that: The data set constructed by the high-feature variables includes input feature variables and output feature variables, wherein the input feature variables include temperature, humidity, wind speed, vehicle flow, and space volume; The output characteristic variable is the actual pollutant concentration. The input characteristic variables are in the order of time series, with the first 70 percent of the data as the training set and the remaining 30 percent of the data as the test set.
4. The air quality prediction method applicable to underground building space according to claim 1, characterized in that: The learning rate r and the number of hidden units h of the LSTM prediction model are adjusted, including: the agent individual position of the improved individual and collective learning balance strategy is a two-dimensional vector, that is, each agent individual position for , each agent's individual position With a set of learning rate r and number of hidden units h Mapping, that is ; The number of proxy individuals is the set number of learning rate r and hidden unit number h. The improved individual and collective learning balance strategy is used to update the proxy individual position. At the same time, the fitness function is used to evaluate the proxy individual position, and the update direction of the improved individual and collective learning balance strategy for the proxy individual position is adjusted to obtain the optimal proxy individual position. The optimal proxy individual position is resolved to be the optimal learning rate r and hidden unit number h value in the training process of the air quality prediction model for underground building space.
5. The air quality prediction method applicable to underground building space as claimed in claim 4, characterized in that: The fitness function combines the trade-off between prediction accuracy and complexity and is defined as: ; In the formula, is the fitness value of each agent's individual position, that is, ; is the weight coefficient of model complexity, is the weight coefficient of the prediction error, + =1; is the pollutant concentration of the qth time series predicted by the model, is the actual pollutant concentration of the qth time series, is the number of hidden units corresponding to the position of the i-th agent.
6. The air quality prediction method applicable to underground building space according to claim 1, characterized in that: The improved individual and collective learning balance strategy is used to adjust the learning rate r and the number of hidden units h of the LSTM prediction model. The specific steps are: S301. Randomly initialize the position of each agent individual, use the fitness function to calculate the fitness value of each agent individual position, record the agent individual position corresponding to the current minimum fitness value, and record it as the global optimal solution of the kth iteration. ; S302: Whether the current number of iterations is greater than the maximum number of iterations, if so, the position of the agent is updated, and the agent position corresponding to the current minimum fitness value, i.e., the global optimal solution, is updated. Parse to the learning rate and number of hidden units of the LSTM prediction model; otherwise, perform an update of the agent's individual position; S303, using an improved individual and collective learning balance strategy to update the position of the proxy individual, including using an improved optimization mathematical model in the individual learning stage and an improved optimization mathematical model in the collective learning stage to update the position of the proxy individual; The improved optimization mathematical model of the individual learning stage is: ; In the formula, is the position of the i-th agent at the k+1th iteration, is the position of the i-th agent at the k-th iteration, is the optimal solution found by the ith agent in its search history, A random perturbation follows a Gaussian distribution, is the position standard deviation of the ith agent, is the guiding factor, controlling the degree of approach to the historical optimal solution; is the directional perturbation factor, which controls the intensity of random exploration; The optimization mathematical model of the improved collective learning stage is: ; In the formula, is the position of the i-th agent at the k+1th iteration, is the position of the i-th agent at the k-th iteration, is the position of the jth agent at the kth iteration, j≠i, is the global optimal solution, is the population size, is the square of the standard deviation of the Gaussian function; The dynamic switching factor is used to control the switching between the individual learning stage and the collective learning stage; If P ≥ 0.5, the individual learning phase is executed, otherwise the collective learning phase is executed; ; In the formula, is the dynamic switching factor, is the ranking of the current agent in the fitness positive order distribution, is the mean of the fitness rankings in the agent population; S304: Calculate the updated agent individual position fitness value using the fitness function, record the agent individual position corresponding to the minimum fitness value again, compare the agent individual position best solution of the kth iteration and the k-1th iteration, and take the smaller fitness value of the two as the global optimal solution of the kth iteration. ; S305. Increase the current number of iterations by one, and return to execute S302.
Citation Information
Patent Citations
MSDBA-LSTM pollutant concentration prediction method based on self-attention
CN118629531A
Multi-factor-driven method for predicting concentration of multi-source harmful gas in underground cavern construction
CN118939936A