An air quality prediction method, system, device and computer program product
Through dynamic adjacency matrix and condition generation adversarial network model, combined with multi-layer loss function and confidence interval calculation, the air quality prediction problem under sparse conditions of monitoring sites is solved, and high-precision and high-applicability air quality prediction is achieved.
Patent Information
- Application Number
- CN202411634027.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2044-11-15
AI Technical Summary
The existing air quality prediction technology cannot achieve high-precision and comprehensive air quality prediction when the monitoring stations are sparse or the data is incomplete, resulting in insufficient prediction accuracy.
A dynamic adjacency matrix is used to generate an adversarial network (cGAN) model, and dynamically adjust the spatiotemporal correlation characteristics and environmental conditions of multiple data sources are used to build an air quality prediction model, and the characteristics are extracted using the conditional convolution network and attention time series encoding module, and training is combined with multi-layer loss functions, prediction results are output and confidence intervals are calculated.
High-precision air quality prediction is achieved in sparse monitoring areas, reducing prediction errors caused by insufficient data and improving prediction accuracy and applicability.
Smart Images

Figure CN119577444B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of air quality prediction, and particularly relates to an air quality prediction method, system, device, and computer program product. Background Art
[0002] At present, the existing air quality prediction technology has insufficient prediction accuracy in areas with sparse monitoring data. For example, existing methods usually rely on dense monitoring stations and sufficient historical data to build prediction models. In the case of sparse distribution of monitoring stations or incomplete data, the prediction effect significantly decreases, and it is difficult to accurately reflect the changing trend of air quality. The existing technology cannot fully meet the demand for high-precision air quality prediction in areas with imperfect monitoring networks or complex environments. Therefore, there is an urgent need for a method that can still achieve high-precision air quality prediction in the case of sparse monitoring stations or missing data, so as to improve the applicability of the air quality monitoring system and the accuracy of prediction. Summary of the Invention
[0003] Aiming at the above-mentioned technical deficiencies, the purpose of the present invention is to propose an air quality prediction method, aiming to solve the technical problem that the existing technology only relies on dense monitoring stations for data collection and prediction, especially in the case of sparse monitoring stations, it is impossible to achieve high-precision and comprehensive air quality prediction.
[0004] To solve the above technical problems, the present invention adopts the following technical solutions: The present invention provides an air quality prediction method,
[0005] The air quality prediction method includes:
[0006] Step S10: Collect historical data from multiple data sources. The multiple data sources include the air quality index A, temperature data T, and traffic flow TRA of the monitoring stations. Use the normalization method to standardize the features of the multiple data sources to obtain the spatio-temporal correlation features X between stations;
[0007] Step S20: Based on the spatio-temporal correlation features X obtained in step S10, construct a dynamic adjacency matrix between the monitoring stations, where the weight W t (i,j) is calculated by the following formula:
[0008]
[0009] where i is the i-th station, j is the j-th station, and W t(i, j) is the dynamic weight between monitoring stations i and j at time t, δ is the distance decay factor, d(i, j) is the geographical distance between stations i and j, ρ is the similarity weight factor, X(i, t) is the spatio-temporal correlation feature of station i at time t, X(j, t) is the spatio-temporal correlation feature of station j at time t, and ‖X(i, t)‖ and ‖X(j, t)‖ are the norms of the spatio-temporal correlation features of stations i and j respectively;
[0010] Step S30: Establish a conditional generative adversarial network cGAN model. The generator adopted in the cGAN model includes a conditional convolutional network module and an attention time series encoding module. The conditional convolutional network module extracts spatial features by dynamically adjusting the convolutional kernel parameters according to different environmental conditions; the attention time series encoding module extracts the long-term dependencies of the time series by means of multi-head attention to capture the time trend of air quality changes;
[0011] Step S40: Train the conditional generative adversarial network model in Step S30. The input data is the dynamic adjacency matrix between stations obtained by processing the standard sample data through Steps S10 to S20, and the output data is the actual result of the standard sample air quality. The multi-layer loss function adopted in the training process includes contrast loss, mean square error loss, and uncertainty loss. The expression of the multi-layer loss function is:
[0012] L = λ1·L contrast + λ2·L mse + λ3·L uncertainty
[0013] where L contrast is the contrast loss term, L mse is the mean square error loss, L uncertainty is the uncertainty loss term, and λ1, λ2, and λ3 are the weight coefficients of each loss term;
[0014] Step S50: Use the trained conditional generative adversarial network model to predict the air quality of the unmonitored area and output the prediction result. The input data is the dynamic adjacency matrix between stations in the area to be measured, and the prediction result includes the prediction report of the air quality and the calculation result of the corresponding confidence interval.
[0015] Preferably, in Step S10, the spatio-temporal correlation feature X between stations is specifically obtained by using the formula:
[0016]
[0017] Among them, X is the comprehensive spatio-temporal correlation feature between site i and site j at time t, α, β, and γ are weight coefficients, A(i,t) and A(j,t) are the air quality indices of site i and site j at time t respectively, ‖A(i,t)‖ and ‖A(j,t)‖ are the norms of the air quality indices of site i and site j at time t respectively; T(i,t) and T(j,t) are the temperature data of site i and site j at time t respectively, ‖T(i,t)‖ and ‖T(j,t)‖ are the norms of the corresponding temperature data respectively; TRA(i,t) and TRA(j,t) are the traffic flow data of site i and site j at time t respectively, ‖TRA(i,t)‖ and ‖TRA(j,t)‖ are the norms of the corresponding traffic flow data respectively.
[0018] Preferably, in step S40, the contrastive loss is measured by cosine similarity.
[0019] Preferably, in step S50, the calculation formula for the confidence interval is:
[0020]
[0021] Among them, is the predicted air quality value output by the model, z is the confidence interval coefficient, and σ is the standard deviation generated by the uncertainty estimation network.
[0022] Preferably, the standard deviation σ generated by the uncertainty estimation network is generated by a Bayesian neural network.
[0023] Preferably, the discriminator of the conditional generative adversarial network described in step S30 prevents overfitting by adding a regularization term.
[0024] Preferably, the default value of the confidence interval coefficient z in step S50 is 1.96, and it is supported to be set according to actual needs.
[0025] The present invention also provides an air quality prediction system, including:
[0026] A data collection and feature calculation module, which is used to collect historical data from multiple data sources. The multiple data sources include the air quality index A, temperature data T, and traffic flow TRA of the monitoring stations, and use the normalization method to standardize the features of the multiple data sources to obtain the spatio-temporal correlation feature X between sites;
[0027] A dynamic adjacency matrix construction module, which is used to construct a dynamic adjacency matrix between monitoring sites based on the spatio-temporal correlation feature X obtained in step S10, where the weight W t (i,j) is calculated by the following formula:
[0028]
[0029] Among them, i represents the i-th station, j represents the j-th station, and W t (i, j) is the dynamic weight between monitoring stations i and j at time t, δ is the distance decay factor, d(i, j) is the geographical distance between stations i and j, ρ is the similarity weight factor, X(i, t) is the spatio-temporal correlation feature of station i at time t, X(j, t) is the spatio-temporal correlation feature of station j at time t, and ‖X(i, t)‖ and ‖X(j, t)‖ are the norms of the spatio-temporal correlation features of stations i and j respectively;
[0030] The conditional generative adversarial network model construction module is used to establish a conditional generative adversarial network cGAN model. The generator adopted in the cGAN model includes a conditional convolutional network module and an attention time series encoding module. The conditional convolutional network module extracts spatial features by dynamically adjusting the convolutional kernel parameters according to different environmental conditions; the attention time series encoding module extracts the long-term dependencies of the time series through the multi-head attention method to capture the time trend of air quality changes;
[0031] The model training and loss optimization module is used to train the conditional generative adversarial network model in step S30. The input data is the dynamic adjacency matrix between stations obtained by processing the standard sample data through steps S10 to S20, and the output data is the actual result of the standard sample air quality. The multi-layer loss function adopted in the training process includes contrast loss, mean square error loss, and uncertainty loss. The expression of the multi-layer loss function is:
[0032] L = λ1·L contrast + λ2·L mse + λ3·L uncertainty
[0033] Among them, L contrast is the contrast loss term, L mse is the mean square error loss, L uncertainty is the uncertainty loss term, and λ1, λ2, and λ3 are the weight coefficients of each loss term;
[0034] The prediction and confidence interval calculation module is used to predict the air quality of the unmonitored area using the trained conditional generative adversarial network model and output the prediction result. The input data is the dynamic adjacency matrix between stations in the area to be measured, and the prediction result includes the prediction report of the air quality and the calculation result of the corresponding confidence interval.
[0035] The present invention also provides an air quality prediction device, including a memory, a processor, and an air quality prediction program stored on the memory and executable on the processor. When the air quality prediction program is executed by the processor, the air quality prediction method described above is implemented.
[0036] The present invention also provides a computer program product, including an air quality prediction program, which implements the air quality prediction method when executed by a processor.
[0037] The beneficial effects of the present invention are as follows: Compared with the prior art that only relies on dense monitoring stations for data collection and prediction, especially under the condition of sparse monitoring stations, it is impossible to achieve high-precision and comprehensive air quality prediction. Since the method of combining a dynamic adjacency matrix with a conditional generative adversarial network is adopted in this application, air quality prediction in sparse monitoring areas is realized, thereby avoiding the problem of large prediction errors caused by insufficient data and improving the accuracy and applicability of prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0039] Figure 1 It is a schematic flowchart of the first embodiment of an air quality prediction method of the present invention.
[0040] Figure 2 It is a schematic diagram of the device for an air quality prediction method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.
[0042] Embodiment 1: As Figure 1 shown, it is a schematic flowchart of the first embodiment of the air quality prediction method of the present invention, presenting the first embodiment of the air quality prediction method of the present invention.
[0043] In the first embodiment, the air quality prediction method includes:
[0044] Step S10: Collect historical data from multiple data sources. The multiple data sources include the air quality index A, temperature data T, and traffic flow TRA of the monitoring stations. Use the normalization method to standardize the features of different data sources, and calculate the spatio-temporal correlation features X between the stations;
[0045] It should be noted that the air quality index, temperature data T, and traffic flow TRA are important factors affecting air quality and can reflect the distribution and transmission trends of pollutants in the air. Therefore, extracting spatio-temporal features from these data sources helps improve the accuracy of the prediction model.
[0046] It can be understood that since there are differences in the value ranges and physical meanings of different data sources, before calculating the spatio-temporal correlation features between stations, it is necessary to normalize the features of each data source to ensure the scale consistency of the feature data, thereby avoiding an improper impact of a certain feature on the overall prediction result.
[0047] It should be understood that the spatio-temporal correlation feature X between stations is calculated using the formula:
[0048]
[0049] where X is the comprehensive spatio-temporal correlation feature between station i and station j at time t, α, β, and γ are weight coefficients, A(i,t) and A(j,t) are the air quality indices of station i and station j at time t respectively, ‖A(i,t)‖ and ‖A(j,t)‖ are the norms of the air quality indices of station i and station j respectively; T(i,t) and T(j,t) are the temperature data of station i and station j at time t respectively, ‖T(i,t)‖ and ‖T(j,t)‖ are the norms of the corresponding temperature data respectively; TRA(i,t) and TRA(j,t) are the traffic flow data of station i and station j at time t respectively, and ‖TRA(i,t)‖ and ‖TRA(j,t)‖ are the norms of the corresponding traffic flow data respectively.
[0050] In this way, the spatio-temporal correlation feature X synthesizes the data of air quality, temperature, and traffic flow, helping to construct a dynamic adjacency matrix in the subsequent steps for input into the air quality prediction model.
[0051] Step S20: Based on the spatio-temporal correlation feature X calculated in step S10, construct a dynamic adjacency matrix between the monitoring stations, where the weight W t (i,j) is calculated by the following formula:
[0052]
[0053] where i is the i-th station, j is the j-th station, W t(i, j) is the dynamic weight between monitoring site i and site j at time t, δ is the distance decay factor, d(i, j) is the geographical distance between site i and site j, ρ is the similarity weight factor, X(i, t) is the spatio-temporal correlation feature of site i at time t, X(j, t) is the spatio-temporal correlation feature of site j at time t, and ‖X(i, t)‖ and ‖X(j, t)‖ are the norms of the spatio-temporal correlation features of site i and site j respectively;
[0054] It should be noted that the weight W of the dynamic adjacency matrix t (i, j) is used to represent the spatio-temporal correlation between site i and site j at a specific time t. By introducing the distance decay factor δ and the similarity weight factor ρ, the impacts of spatial distance and feature similarity can be comprehensively considered, so as to accurately reflect the actual correlation between monitoring sites.
[0055] It should be understood that the function of the distance decay factor δ is to reduce the influence of sites with a relatively large spatial distance on the weight. In this way, when calculating the weight, the contribution of pairs of sites with a greater distance is smaller, thus being more in line with the actual situation of spatial correlation.
[0056] Step S30: Establish a conditional generative adversarial network cGAN model, where the generator includes a conditional convolutional network module and an attention time series encoding module. The conditional convolutional network module extracts spatial features according to different environmental conditions by dynamically adjusting the convolutional kernel parameters; the attention time series encoding module extracts the long-term dependencies of the time series through the multi-head attention mechanism to capture the time trend of air quality changes;
[0057] It should be noted that the conditional generative adversarial network (cGAN) model is a network structure that generates prediction results based on conditional inputs (such as meteorological data, air quality index, etc.). The generator and the discriminator are optimized through a mutually competitive manner to improve the authenticity of the generated data. The generator generates data that conforms to the real air quality change trend, and the discriminator differentiates between the generated data and the real data.
[0058] It can be understood that the function of the conditional convolutional network module is to extract the spatial features between monitoring sites to help the model accurately predict air quality spatially. This module dynamically adjusts the convolutional kernel parameters, enabling the model to adapt to different environmental conditions and thus more precisely extract the features related to air quality.
[0059] It should be understood that the attention time series encoding module extracts the long-term dependencies in the time series through the multi-head attention mechanism, which helps the model capture the trend of air quality changes over time. This mechanism can identify important temporal patterns in a relatively long time series, thereby improving the accuracy and timeliness of the model in predicting air quality changes.
[0060] Step S40: Train the conditional generative adversarial network model in Step S30. The input data is the dynamic adjacency matrix between stations obtained by processing the standard samples through Steps S10 to S20, and the output data is the air quality prediction result of the standard samples. The multi-layer loss function includes contrast loss, mean squared error loss, and uncertainty loss. The total expression of the loss function is:
[0061] L = λ1·L contrast + λ2·L mse + λ3·L uncertainty
[0062] where L contrast is the contrast loss term, L mse is the mean squared error loss, L uncertainty is the uncertainty loss term, and λ1, λ2, λ3 are the weight coefficients of each loss term;
[0063] It should be noted that the role of the contrast loss term is to make the generator gradually generate prediction data that more conforms to the actual air quality change by increasing the distinguishability between the generated data and the real data. This loss term helps the model learn the distribution of the real data; the mean squared error loss is a regression loss function used to measure the numerical deviation between the generated data and the real data. By minimizing this loss term, the prediction error of the model can be effectively reduced, thereby improving the accuracy of the generated data; the role of the uncertainty loss is to introduce an additional constraint in the model optimization process, enabling the model to reasonably process uncertain prediction results. This loss term helps the model more robustly handle data noise or anomalies by punishing data points with high uncertainty during training, thereby enhancing the stability of the prediction results.
[0064] Step S50: Use the trained conditional generative adversarial network model to predict the air quality of the unmonitored area. The input data is the dynamic adjacency matrix between stations in the area to be measured, and the confidence interval of the prediction result is calculated through the following formula:
[0065]
[0066] where is the air quality prediction value output by the model, z is the confidence interval coefficient, and σ is the standard deviation generated by the uncertainty estimation network.
[0067] It should be noted that the calculation of the confidence interval aims to provide a credibility measure for the prediction result of the model. By introducing the standard deviation and the confidence interval coefficient, a range can be set for the prediction value, thereby reflecting the uncertainty of the model prediction, especially in cases where the data is sparse or the environment is complex.
[0068] It can be understood that the value of the confidence interval coefficient z depends on the required confidence level. Usually, at a 95% confidence level, the z value is taken as 1.96, which means that the probability that the prediction result falls within this interval is 95%. The appropriate confidence level can be adjusted according to the actual application requirements.
[0069] It should be understood that the standard deviation is part of the uncertainty estimate and is used to measure the prediction error of the model under given conditions. The larger the standard deviation, the lower the confidence of the model in this prediction and the wider the confidence interval; the smaller the standard deviation, the more reliable the prediction of the model and the narrower the confidence interval. Therefore, the width of the confidence interval can effectively reflect the reliability of the prediction result.
[0070] In addition, an air quality prediction system provided by the present invention adopts an air quality prediction method in the above-mentioned embodiment, and can solve the technical problem of air quality prediction. Compared with the prior art, the beneficial effects of the air quality prediction system provided by the present invention are the same as those of the air quality prediction method provided by the above-mentioned embodiment, and other technical features in the air quality prediction system are the same as the features disclosed in the above-mentioned embodiment method, which will not be elaborated here.
[0071] The present invention provides an air quality prediction device. Please refer to Figure 2, an air quality prediction device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute an air quality prediction method in the first embodiment above. An air quality prediction device in an embodiment of the present invention may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. An air quality prediction device is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention. An air quality prediction device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of an air quality prediction device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow an air quality prediction device to communicate with other devices wirelessly or wiredly to exchange data. Although an air quality prediction device with various systems is shown in the figure, it should be understood that it is not required to implement or include all the shown systems. More or fewer systems may be implemented or included alternatively.
[0072] The present invention also provides a computer program product, including a computer program which, when executed by a processor, implements the steps of an air quality prediction method as described above. The computer program product provided by the present invention can solve the technical problem of air quality prediction. Compared with the prior art, the beneficial effects of the computer program product provided by the present invention are the same as those of the air quality prediction method provided by the above embodiments, and will not be elaborated herein.
[0073] Specifically, according to the embodiments disclosed by the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment disclosed by the present invention includes a computer program product which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by a processing device 1001, it executes the above functions defined in the methods of the embodiments disclosed by the present invention.
[0074] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0075] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these changes and modifications.
Claims
1. An air quality prediction method, characterized in that, The air quality prediction method includes: Step S10: Collect historical data from multiple data sources. The multiple data sources include the air quality index A, temperature data T, and traffic flow TRA of the monitoring stations. Use the normalization method to standardize the features of the multiple data sources to obtain the spatio-temporal correlation features X between stations; Step S20: Based on the spatio-temporal correlation feature X obtained in Step S10, construct a dynamic adjacency matrix between monitoring stations, where the weight W t (i, j) is calculated by the following formula: where \(i\) is the \(i\)-th site, \(j\) is the \(j\)-th site, and \(W\) t (i, j) is the dynamic weight between monitoring sites \(i\) and \(j\) at time \(t\), \(\delta\) is the distance decay factor, \(d(i, j)\) is the geographical distance between sites \(i\) and \(j\), \(\rho\) is the similarity weight factor, \(X(i, t)\) is the spatio-temporal correlation feature of site \(i\) at time \(t\), \(X(j, t)\) is the spatio-temporal correlation feature of site \(j\) at time \(t\), \(\|X(i, t)\|\) and \(\|X(j, t)\|\) are the norms of the spatio-temporal correlation features of sites \(i\) and \(j\) respectively; Step S30: Establish a conditional generative adversarial network cGAN model. The generator adopted in the cGAN model includes a conditional convolutional network module and an attention time series encoding module. The conditional convolutional network module extracts spatial features by dynamically adjusting the convolutional kernel parameters according to different environmental conditions; the attention time series encoding module extracts the dependencies of the time series through the multi-head attention method to capture the time trend of air quality changes; Step S40: Train the conditional generative adversarial network model in Step S30. The input data is the dynamic adjacency matrix between stations obtained by processing the standard sample data through Steps S10 to S20, and the output data is the actual result of the standard sample air quality. The multi-layer loss function adopted in the training process includes contrast loss, mean square error loss, and uncertainty loss. The expression of the multi-layer loss function is: L = λ1·L contrast + λ2·L mse + λ3·L uncertainty Among them, L contrast is the contrast loss term, L mse is the mean square error loss, L uncertainty is the uncertainty loss term, and λ1, λ2, and λ3 are the weight coefficients of each loss term; Step S50: Use the trained conditional generative adversarial network model to predict the air quality of the unmonitored area and output the prediction result. The input data is the dynamic adjacency matrix between stations in the area to be measured, and the prediction result includes the prediction report of the air quality and the calculation result of the corresponding confidence interval.
2. The air quality prediction method according to claim 1, characterized in that, In Step S10, the formula specifically used to obtain the spatio-temporal correlation features X between stations is: where X is the comprehensive spatio-temporal correlation feature between station i and station j at time t, α, β, and γ are weight coefficients, A(i,t) and A(j,t) are the air quality indices of station i and station j at time t respectively, ‖A(i,t)‖ and ‖A(j,t)‖ are the norms of the air quality indices of station i and station j at time t respectively; T(i,t) and T(j,t) are the temperature data of station i and station j at time t respectively, ‖T(i,t)‖ and ‖T(j,t)‖ are the norms of the corresponding temperature data respectively; TRA(i,t) and TRA(j,t) are the traffic flow data of station i and station j at time t respectively, ‖TRA(i,t)‖ and ‖TRA(j,t)‖ are the norms of the corresponding traffic flow data respectively.
3. The air quality prediction method according to claim 1, wherein In Step S40, the contrast loss uses the cosine similarity metric.
4. The air quality prediction method according to claim 1, characterized in that In Step S50, the calculation formula of the confidence interval is: where, is the predicted air quality value output by the model, z is the confidence interval coefficient, and σ is the standard deviation generated by the uncertainty estimation network.
5. The method for predicting air quality according to claim 4, characterized in that, The standard deviation σ generated by the uncertainty estimation network is generated by the Bayesian neural network.
6. The air quality prediction method according to claim 1, characterized in that, The discriminator of the conditional generative adversarial network described in Step S30 prevents overfitting by adding a regularization term.
7. The air quality prediction method according to claim 1, characterized in that, The default value of the confidence interval coefficient z in Step S50 is 1.96, and it supports being set according to actual needs.
8. An air quality prediction system, characterized in that, The air quality prediction system includes: A data collection and feature calculation module, which is used to collect historical data from multiple data sources. The multiple data sources include the air quality index A, temperature data T, and traffic flow TRA of the monitoring stations. Use the normalization method to standardize the features of the multiple data sources to obtain the spatio-temporal correlation features X between stations; A dynamic adjacency matrix construction module, which is used to construct a dynamic adjacency matrix between monitoring stations based on the spatio-temporal correlation feature X obtained in step S10, where the weight W of the dynamic adjacency matrix t (i, j) is calculated by the following formula: where \(i\) is the \(i\)-th site, \(j\) is the \(j\)-th site, \(W\) t (i, j) is the dynamic weight between monitoring site \(i\) and site \(j\) at time \(t\), \(\delta\) is the distance decay factor, \(d(i, j)\) is the geographical distance between site \(i\) and site \(j\), \(\rho\) is the similarity weight factor, \(X(i, t)\) is the spatio-temporal correlation feature of site \(i\) at time \(t\), \(X(j, t)\) is the spatio-temporal correlation feature of site \(j\) at time \(t\), \(\|X(i, t)\|\) and \(\|X(j, t)\|\) are the norms of the spatio-temporal correlation features of site \(i\) and site \(j\) respectively; A conditional generative adversarial network model construction module is used to establish a conditional generative adversarial network (cGAN) model. The generator adopted in the cGAN model includes a conditional convolutional network module and an attention time series encoding module. The conditional convolutional network module extracts spatial features by dynamically adjusting the convolutional kernel parameters according to different environmental conditions. The attention time series encoding module extracts the long-term dependencies of the time series through the multi-head attention method to capture the time trend of air quality changes. A model training and loss optimization module is used to train the conditional generative adversarial network model in step S30. The input data is the dynamic adjacency matrix between stations obtained by processing the standard sample data through steps S10 to S20, and the output data is the actual air quality result of the standard sample. The multi-layer loss function adopted in the training process includes contrastive loss, mean square error loss, and uncertainty loss. The expression of the multi-layer loss function is: L = λ1·L contrast + λ2·L mse + λ3·L uncertainty Among them, L contrast is the contrastive loss term, L mse is the mean square error loss, L uncertainty is the uncertainty loss term, and λ1, λ2, and λ3 are the weight coefficients of each loss term; A prediction and confidence interval calculation module is used to predict the air quality of the unmonitored area using the trained conditional generative adversarial network model and output the prediction result. The input data is the dynamic adjacency matrix between stations in the area to be measured. The prediction result includes the prediction report of the air quality and the calculation result of the corresponding confidence interval.
9. An air quality prediction device, characterized in that, The air quality prediction device includes: A memory, a processor, and an air quality prediction program stored on the memory and executable on the processor. When the air quality prediction program is executed by the processor, it implements the air quality prediction method according to any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes an air quality prediction program. When the air quality prediction program is executed by a processor, it implements the air quality prediction method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Air quality prediction method
CN118072873A
Air quality prediction method based on deep spatiotemporal similarity
WO2022217839A1