Intelligent air quality monitoring method and system
By combining the spatial and temporal dynamic network model and graph convolutional network, the parameters are dynamically adjusted to adapt to different environments, and combined with the hierarchical Gaussian hybrid model to dynamically learn typical models of air quality levels, the problem that traditional air quality monitoring methods cannot capture multi-scale timing modes and nonlinear relationships is solved, achieving more accurate air quality monitoring and classification effects.
Patent Information
- Application Number
- CN202510414302.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-06-27
Smart Images

Figure CN120216882A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of air quality data processing, and specifically refers to an intelligent air quality monitoring method and system. Background Art
[0002] Intelligent air quality monitoring is to monitor environmental parameters such as pollutant concentration, temperature, humidity, and air pressure in the air in real time through advanced sensing technologies and big data analysis, etc., so as to achieve the purpose of evaluating air quality; it can provide accurate air quality data, help to understand the air pollution situation in a timely manner, effectively warn of air quality changes, and reduce the harm of air pollution to health.
[0003] However, traditional air quality monitoring methods usually rely on statistics of fixed time windows, cannot capture multi-scale time series patterns, have static spatial modeling, ignore dynamic influences such as wind direction and terrain, resulting in distorted pollution diffusion modeling, and the parameters are fixed and difficult to adapt to different environments; traditional air quality monitoring methods have technical problems in that it is difficult to handle the non-linear and multi-modal relationships between air quality characteristics and grades, and when directly using original characteristics for modeling, there is a lack of explicit alignment with the typical patterns of grades, resulting in the classification boundary deviating from the actual standard. Summary of the Invention
[0004] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides an intelligent air quality monitoring method and system. Aiming at the technical problems that traditional air quality monitoring methods usually rely on statistics of fixed time windows, cannot capture multi-scale time series patterns, have static spatial modeling, ignore dynamic influences such as wind direction and terrain, resulting in distorted pollution diffusion modeling, and the parameters are fixed and difficult to adapt to different environments, this solution creatively adopts a spatio-temporal dynamic network model to extract quality monitoring features, can capture the complex time series changes of air pollution, combines a graph convolutional network to accurately depict the spatial correlation of pollution diffusion, and dynamically adjusts parameters to adapt to different geographical and meteorological environments, enhancing the generalization ability of the model; aiming at the technical problems that traditional air quality monitoring methods have difficulty in dealing with the non-linear and multi-modal relationships between air quality characteristics and grades, and when directly using original characteristics for modeling, there is a lack of explicit alignment with the typical patterns of grades, resulting in the classification boundary deviating from the actual standard, this solution creatively adopts a hierarchical Gaussian mixture model as the quality monitoring model, and by dynamically learning the typical patterns of air quality grades, while enabling the model to capture non-linear distribution characteristics, it fits the grade boundaries defined by environmental standards, and more clearly distinguishes the boundaries between grades through hierarchical clustering, improving the classification accuracy.
[0005] The technical solution adopted by the present invention is as follows: An intelligent air quality monitoring method provided by the present invention, the method includes the following steps:
[0006] Step S1: Acquisition of air quality data;
[0007] Step S2: Optimization of raw data;
[0008] Step S3: Extraction of quality monitoring features;
[0009] Step S4: Construction of quality monitoring model;
[0010] Step S5: Air quality monitoring.
[0011] Furthermore, in Step S1, the acquisition of air quality data is used to obtain the raw data required for monitoring air quality. Specifically, by obtaining data from multiple different data collection points, a raw dataset for quality monitoring is obtained. The raw dataset for quality monitoring specifically includes a historical monitoring raw dataset and a real-time monitoring raw dataset. The historical monitoring raw dataset and the real-time monitoring raw dataset specifically include air pollution data, meteorological data, and geospatial data. The historical monitoring raw dataset also includes historical quality grade label data.
[0012] Furthermore, in Step S2, the optimization of raw data is used to preprocess the collected raw data for quality monitoring to optimize the data. Specifically, it includes the following steps:
[0013] Step S21: Missing value processing, which is used to remove missing values. Specifically, remove the missing values in the historical monitoring raw dataset and the real-time monitoring raw dataset to obtain a roughly processed historical dataset and a roughly processed real-time dataset;
[0014] Step S22: Spatiotemporal data alignment, which is used to align spatiotemporal data. Specifically, convert the spatial data in the roughly processed historical dataset and the roughly processed real-time dataset into a unified coordinate system and synchronize the time data to obtain an aligned historical dataset and an aligned real-time dataset;
[0015] Step S23: Data standardization, which is used to standardize the aligned data. Specifically, use the min-max standardization method to process the aligned historical dataset and the aligned real-time dataset to obtain a standardized historical dataset and a standardized real-time dataset;
[0016] Step S24: Grade boundary alignment, which is used to strengthen the grade boundary for the concentration data in the standardized data. Specifically, define the grade thresholds for the concentration data based on the ambient air quality standard and strengthen the concentration data to obtain a strengthened historical dataset and a strengthened real-time dataset;
[0017] Step S25: Dataset segmentation, which is used to segment the dataset. Specifically, segment the strengthened historical dataset into a model training set and a model test set.
[0018] Further, in step S3, the quality monitoring feature extraction is used to extract quality monitoring features. Specifically, a spatio-temporal dynamic network model is constructed and quality monitoring features are extracted. The spatio-temporal dynamic network model specifically includes a time branch, a space branch, a causal intervention module, and a dynamic parameter adjustment module;
[0019] The quality monitoring feature extraction specifically includes the following steps:
[0020] Step S31: Construct a time branch for extracting time series features at multiple scales. Specifically, the time series features in the air pollution data are decomposed into daily cycle features, weekly trend features, and hourly mutation features at multiple granularities;
[0021] Step S32: Construct a space branch for extracting spatial dimension features. Specifically, a graph convolutional network is used to extract spatial dimension features from the air pollution data. The steps include:
[0022] Step S321: Design an activation function for designing the activation function of the graph convolutional network. The formula used is as follows:
[0023] ;
[0024] In the formula, represents the activation function of the graph convolutional network, x represents the independent variable of the activation function, represents the learnable gain parameter in the positive region, represents the learnable gain parameter in the negative region, represents the learnable slope parameter in the positive region, represents the learnable slope parameter in the negative region, represents the learnable dynamic threshold of the activation function;
[0025] Step S322: Design an adjacency matrix for designing the adjacency matrix of the graph convolutional network based on the data collection points. Specifically, the data collection points are used as nodes, and the adjacency matrix of the graph convolutional network is obtained by combining geographical proximity and wind direction drivability. The formula used is as follows:
[0026] ;
[0027] In the formula, represents the geographical adjacency matrix, represents the wind direction adjacency matrix, represents the comprehensive adjacency matrix, represents the straight-line distance from data collection point i to data collection point j, represents the reference straight-line distance, represents the angle between the line connecting data collection point i to data collection point j and the wind direction, represents the calculation weight of the comprehensive adjacency matrix;
[0028] Step S323: Perform graph convolution;
[0029] Step S324: Design a level attention mechanism for introducing the air quality level into the attention mechanism. The formula used is as follows:
[0030] ;
[0031] In the formula, represents the attention weight from data collection point i to data collection point j, represents the softmax function, represents the hidden state of data collection point i, represents the hidden state of data collection point j, represents the transformation matrix from the hidden state to the query, represents the transformation matrix from the hidden state to the key, and T represents the transpose operation, represents the dimension of the key, represents the level difference mask from data collection point i to data collection point j. When the air quality levels of data collection point i and data collection point j are the same, its value is 0. When the air quality levels of data collection point i and data collection point j are different, its value is ;
[0032] Step S325: Obtain the output of the spatial branch. The formula used is as follows:
[0033] ;
[0034] In the formula, represents the output feature of the spatial branch, represents the layer normalization function, J represents the total number of data collection points, represents the transformation matrix from the hidden state to the value;
[0035] Step S33: Construct a causal intervention module to eliminate the confounding effect of meteorological data on air pollution characteristics. The steps include:
[0036] Step S331: Extract confounding factors to obtain the confounding effect of meteorological data on air pollution characteristics;
[0037] Step S332: Purify features to eliminate the interference of meteorological data. The formula used is as follows:
[0038] ;
[0039] In the formula, cf represents the confounding factor, represents the expected value of air pollution characteristics under meteorological data conditions, P represents the number of independent samplings, represents the random noise of the p-th independent sampling, Represents a conditional generator function, Represents the purified air pollution characteristics, Represents the output characteristics of the time branch, Represents a splicing operation function;
[0040] Step S34: Construction of a dynamic parameter adjustment module, which is used to realize the dynamic environment adaptation of the model parameters of the spatio-temporal dynamic network model. Specifically, a hypernetwork constructed by a multi-layer perceptron is used to dynamically adjust the model parameters of the spatio-temporal dynamic network model;
[0041] Step S35: Extract quality monitoring features. Specifically, through the construction of the time branch, the construction of the space branch, the construction of the causal intervention module, and the construction of the dynamic parameter adjustment module, a spatio-temporal dynamic network model is constructed. The model is trained based on the model training set, and the model performance is verified based on the model test set to obtain a spatio-temporal dynamic network model. The purified air pollution characteristics are obtained as quality monitoring features based on the reinforcement real-time data set by using the spatio-temporal dynamic network model, and a quality monitoring feature set is obtained.
[0042] Furthermore, in step S4, the construction of the quality monitoring model is used to construct the model required for air quality monitoring. Specifically, a hierarchical Gaussian mixture model is constructed as the quality monitoring model;
[0043] The construction of the quality monitoring model specifically includes the following steps:
[0044] Step S41: Typical feature enhancement, which is used to enhance the feature representation based on the typical patterns of air quality levels. The steps include:
[0045] Step S411: Initialize the typical pattern. Specifically, the air quality level typical patterns corresponding to the air quality level labels are set based on the ambient air quality standards;
[0046] Step S412: Update the typical pattern. Specifically, during the training process, the air quality level typical pattern is dynamically adjusted based on the current training data. The formula used is as follows:
[0047] ;
[0048] In the formula, Represents a similarity calculation function, Represents the typical pattern of the kth air quality level, Represents the nth training sample, Represents the temperature parameter, K represents the number of air quality levels, Represents the typical pattern of the mth air quality level, Represents the updated typical pattern of the kth air quality level, represents the update control weight, and N represents the number of training samples;
[0049] Step S413: Synthesize enhanced features, and the formula used is as follows:
[0050] ;
[0051] In the formula, represents the enhanced feature, represents the input feature of the typical feature enhancement;
[0052] Step S42: Construct a Gaussian mixture model. The steps for constructing the Gaussian mixture model include:
[0053] Step S421: Model initialization. Specifically, pre-cluster the training data after typical feature enhancement through the K-means algorithm, take the cluster centers of 4K clusters as the initial means, calculate the within-cluster sample covariance matrix of each selected cluster as the initial covariance, and initialize 4K Gaussian components based on the initial means and the initial covariance;
[0054] Step S422: Design the expectation step, which is used to calculate the posterior probability that the nth training sample belongs to the lth Gaussian component;
[0055] Step S423: Design the maximization step, which is used to update the parameters;
[0056] Step S43: Hierarchical clustering, which is used to gradually merge the 4K clusters after the Gaussian mixture model iteration is completed into K clusters. Specifically, calculate the KL divergence between cluster pairs to measure the similarity between cluster pairs, iteratively merge the most similar cluster pairs to obtain the final K clusters, and map the final K clusters to K air quality levels;
[0057] Step S44: Construct and train the model. Specifically, through the typical feature enhancement, the construction of the Gaussian mixture model, and the hierarchical clustering, construct a hierarchical Gaussian mixture model, train the model based on the model training set, verify the model performance based on the model test set, and obtain a hierarchical Gaussian mixture model, which is used as the quality monitoring model.
[0058] Further, in step S5, the air quality monitoring specifically uses the quality monitoring model to perform air quality monitoring based on the quality monitoring feature set, obtain air quality level reference data, and realize the monitoring of air quality based on the air quality level reference data.
[0059] An intelligent air quality monitoring system provided by the present invention includes an air quality data acquisition module, an original data optimization module, a quality monitoring feature extraction module, a quality monitoring model construction module, and an air quality monitoring module;
[0060] The air quality data acquisition module is used for acquiring air quality data. By collecting air quality data, an original dataset for quality monitoring is obtained, and the original dataset for quality monitoring is sent to the original data optimization module;
[0061] The original data optimization module is used for optimizing the original data. Through optimizing the original data, a strengthened real-time dataset, a model training set, and a model test set are obtained, and the strengthened real-time dataset is sent to the quality monitoring feature extraction module, and the model training set and the model test set are sent to the quality monitoring feature extraction module and the quality monitoring model construction module;
[0062] The quality monitoring feature extraction module is used for extracting quality monitoring features. By constructing a spatio-temporal dynamic network model to extract quality monitoring features, a quality monitoring feature set is obtained, and the quality monitoring feature set is sent to the air quality monitoring module;
[0063] The quality monitoring model construction module is used for constructing a quality monitoring model. By constructing a hierarchical Gaussian mixture model, a quality monitoring model is obtained, and the quality monitoring model is sent to the air quality monitoring module;
[0064] The air quality monitoring module is used for air quality monitoring. By using the quality monitoring model for air quality monitoring, air quality grade reference data is obtained.
[0065] The beneficial effects achieved by the present invention using the above solution are as follows:
[0066] (1) Aiming at the technical problems of traditional air quality monitoring methods, which usually rely on statistics of fixed time windows, cannot capture multi-scale time series patterns, have static spatial modeling, ignore dynamic influences such as wind direction and terrain, resulting in distorted pollution diffusion modeling, and have fixed parameters and are difficult to adapt to different environments. This solution creatively uses a spatio-temporal dynamic network model to extract quality monitoring features, can capture the complex time series changes of air pollution, accurately depict the spatial correlation of pollution diffusion in combination with a graph convolutional network, and adapt to different geographical and meteorological environments by dynamically adjusting parameters, enhancing the generalization ability of the model.
[0067] (2) Aiming at the technical problems of traditional air quality monitoring methods, which are difficult to handle the non-linear and multi-modal relationships between air quality features and grades, and when directly using original features for modeling, lack explicit alignment with the typical patterns of grades, resulting in the classification boundary deviating from the actual standard. This solution creatively uses a hierarchical Gaussian mixture model as the quality monitoring model. By dynamically learning the typical patterns of air quality grades, while enabling the model to capture non-linear distribution characteristics, it fits the grade boundaries defined by environmental standards, and more clearly distinguishes the boundaries between grades through hierarchical clustering, improving the classification accuracy. Brief Description of the Drawings
[0068] Figure 1 It is a schematic flowchart of an intelligent air quality monitoring method provided by the present invention;
[0069] Figure 2 It is a schematic module diagram of an intelligent air quality monitoring system provided by the present invention;
[0070] Figure 3 It is a schematic flowchart of the optimization of the original data in step S2;
[0071] Figure 4 It is a schematic flowchart of the extraction of quality monitoring features in step S3;
[0072] Figure 5 It is a schematic flowchart of the construction of the quality monitoring model in step S4.
[0073] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention, and do not constitute a limitation to the present invention. Detailed Embodiments
[0074] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments; based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0075] In the description of the present invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", etc. indicating the orientation or positional relationship are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to the present invention.
[0076] Embodiment 1, refer to Figure 1 , the technical solution adopted by the present invention is as follows: An intelligent air quality monitoring method provided by the present invention, the method includes the following steps:
[0077] Step S1: Acquisition of air quality data;
[0078] Step S2: Optimization of the original data;
[0079] Step S3: Extraction of quality monitoring features;
[0080] Step S4: Construction of the air quality monitoring model;
[0081] Step S5: Air quality monitoring.
[0082] Example 2. Refer to Figure 1 and Figure 2 In step S1, the acquisition of air quality data is used to obtain the original data required for monitoring air quality. Specifically, data is obtained from multiple different data collection points to obtain the original dataset for quality monitoring. The original dataset for quality monitoring specifically includes the historical monitoring original dataset and the real-time monitoring original dataset. The historical monitoring original dataset and the real-time monitoring original dataset specifically include air pollution data, meteorological data, and geospatial data. The historical monitoring original dataset also includes historical quality grade label data. The air pollution data specifically includes PM2.5 data, PM10 data, sulfur dioxide concentration data, nitrogen dioxide concentration data, carbon monoxide concentration data, and ozone concentration data. The meteorological data specifically includes environmental temperature and humidity, wind direction and speed data, air pressure data, and weather condition data. The geospatial data specifically includes the longitude and latitude data of the data collection points, the altitude data of the data collection points, and the terrain data of the data collection points. The historical quality grade label data is specifically the air quality grade label, including excellent, good, poor, and bad.
[0083] Example 3. Refer to Figure 1 、 Figure 2 and Figure 3 Based on the above example, in step S2, the optimization of the original data is used to preprocess the collected original data for quality monitoring to optimize the data. It specifically includes the following steps:
[0084] Step S21: Missing value processing, which is used to remove missing values. Specifically, the missing values in the historical monitoring original dataset and the real-time monitoring original dataset are removed to obtain the roughly processed historical dataset and the roughly processed real-time dataset;
[0085] Step S22: Spatiotemporal data alignment, which is used to align spatiotemporal data. Specifically, the spatial data in the roughly processed historical dataset and the roughly processed real-time dataset is converted into a unified coordinate system, and the time data is clock-synchronized to obtain the aligned historical dataset and the aligned real-time dataset;
[0086] Step S23: Data standardization, which is used to standardize the aligned data. Specifically, the minimum-maximum standardization method is used to process the aligned historical dataset and the aligned real-time dataset to obtain the standardized historical dataset and the standardized real-time dataset;
[0087] Step S24: Alignment of grade boundaries, which is used to enhance the grade boundaries of concentration data in the standardized data. Specifically, the grade thresholds of the concentration data are defined based on the ambient air quality standards, and the concentration data is enhanced to obtain an enhanced historical data set and an enhanced real-time data set. The formula used is as follows:
[0088] ;
[0089] In the formula, represents the enhanced concentration data, Cd represents the concentration data, represents the enhancement coefficient, represents the sign function, represents the preset grade threshold of level k, and Bd represents the boundary buffer value;
[0090] Step S25: Dataset segmentation, which is used to segment the dataset. Specifically, the enhanced historical data set is segmented into a model training set and a model test set.
[0091] Example 4, refer to Figure 1 , Figure 2 and Figure 4 , based on the above example, in step S3, the quality monitoring feature extraction is used to extract quality monitoring features. Specifically, a spatio-temporal dynamic network model is constructed and quality monitoring features are extracted. The spatio-temporal dynamic network model specifically includes a time branch, a space branch, a causal intervention module, and a dynamic parameter adjustment module;
[0092] The quality monitoring feature extraction specifically includes the following steps:
[0093] Step S31: Construct a time branch, which is used to extract time series features at multiple scales. Specifically, the time series features in the air pollution data are decomposed into daily cycle features, weekly trend features, and hourly mutation features at multiple granularities. The formula used is as follows:
[0094] ;
[0095] In the formula, represents the daily cycle feature, represents the weekly trend feature, represents the hourly mutation feature, represents the deformable convolution offset, represents the output feature of the time branch, represents the dilated convolution function, represents the dilation rate of 24, represents the convolution function with a kernel size of 168, represents the strided convolution function, represents the stride of 6, represents the multi-layer perceptron function, Represents the multi-layer perceptron weight parameters for generating deformable convolution offsets, represents the deformable convolution, and Z represents the input time series features;
[0096] Step S32: Construct a spatial branch for extracting spatial dimension features. Specifically, use a graph convolutional network to extract the spatial dimension features in the air pollution data. The steps include:
[0097] Step S321: Design an activation function for designing the activation function of the graph convolutional network. The formula used is as follows:
[0098] ;
[0099] In the formula, represents the activation function of the graph convolutional network, x represents the independent variable of the activation function, represents the learnable gain parameter in the positive region, represents the learnable gain parameter in the negative region, represents the learnable slope parameter in the positive region, represents the learnable slope parameter in the negative region, represents the learnable dynamic threshold of the activation function;
[0100] Step S322: Design an adjacency matrix for designing the adjacency matrix of the graph convolutional network based on data collection points. Specifically, use the data collection points as nodes and combine geographical proximity and wind direction drivability to obtain the adjacency matrix of the graph convolutional network. The formula used is as follows:
[0101] ;
[0102] In the formula, represents the geographical adjacency matrix, represents the wind direction adjacency matrix, represents the comprehensive adjacency matrix, represents the straight-line distance from data collection point i to data collection point j, represents the reference straight-line distance, represents the angle between the line connecting data collection point i and data collection point j and the wind direction, represents the calculation weight of the comprehensive adjacency matrix;
[0103] Step S323: Perform graph convolution. The formula used is as follows:
[0104] ;
[0105] In the formula, H represents the hidden state of the data collection point, represents the normalized comprehensive adjacency matrix, X represents the input of the graph convolutional network, Indicates the learnable weight parameters of the graph convolutional network;
[0106] Step S324: Design a hierarchical attention mechanism for introducing air quality levels into the attention mechanism. The formula used is as follows:
[0107] ;
[0108] In the formula, represents the attention weight from data collection point i to data collection point j, represents the softmax function, represents the hidden state of data collection point i, represents the hidden state of data collection point j, represents the transformation matrix from the hidden state to the query, represents the transformation matrix from the hidden state to the key, where T represents the transpose operation, represents the dimension of the key, represents the level difference mask from data collection point i to data collection point j. When the air quality levels of data collection point i and data collection point j are the same, its value is 0. When the air quality levels of data collection point i and data collection point j are different, its value is ;
[0109] Step S325: Obtain the output of the spatial branch. The formula used is as follows:
[0110] ;
[0111] In the formula, represents the output feature of the spatial branch, represents the layer normalization function, J represents the total number of data collection points, represents the transformation matrix from the hidden state to the value;
[0112] Step S33: Construct a causal intervention module to eliminate the confounding effect of meteorological data on air pollution features. The steps include:
[0113] Step S331: Extract confounding factors to obtain the confounding effect of meteorological data on air pollution features. The formula used is as follows:
[0114] ;
[0115] In the formula, cf represents the confounding factor, represents the meteorological feature, represents the weight parameters of the multi-layer perceptron used to generate the confounding factor;
[0116] Step S332: Purify features to eliminate the interference of meteorological data. The formula used is as follows:
[0117] ;
[0118] In the formula, represents the expected value of the air pollution characteristics under meteorological data conditions, P represents the number of independent samplings, represents the random noise of the p-th independent sampling, represents the conditional generator function, represents the purified air pollution characteristics, represents the splicing operation function;
[0119] Step S34: Construction of the dynamic parameter adjustment module, which is used to realize the dynamic environment adaptation of the model parameters of the spatio-temporal dynamic network model. Specifically, a hypernetwork constructed by a multi-layer perceptron is used to dynamically adjust the model parameters of the spatio-temporal dynamic network model. The formula used is as follows:
[0120] ;
[0121] In the formula, represents the adjusted model parameters of the spatio-temporal dynamic network model, represents the hypernetwork function, represents the geospatial characteristics, represents the model parameters of the spatio-temporal dynamic network model, represents element-wise multiplication;
[0122] Step S35: Extract quality monitoring features. Specifically, through the construction of the time branch, the construction of the space branch, the construction of the causal intervention module, and the construction of the dynamic parameter adjustment module, a spatio-temporal dynamic network model is constructed. The model is trained based on the model training set, and the model performance is verified based on the model test set to obtain the spatio-temporal dynamic network model. The purified air pollution characteristics are obtained as quality monitoring features based on the reinforcement real-time data set by using the spatio-temporal dynamic network model, and a quality monitoring feature set is obtained.
[0123] By performing the above operations, for the technical problems of the traditional air quality monitoring method that usually relies on the statistics of a fixed time window, cannot capture multi-scale time series patterns, has static spatial modeling, ignores dynamic influences such as wind direction and terrain, resulting in distorted pollution diffusion modeling, and has fixed parameters and is difficult to adapt to different environments, this solution creatively uses a spatio-temporal dynamic network model to extract quality monitoring features, can capture the complex time series changes of air pollution, accurately depict the spatial correlation of pollution diffusion in combination with the graph convolutional network, and adapt to different geographical and meteorological environments by dynamically adjusting parameters, enhancing the generalization ability of the model.
[0124] Example Five, refer to Figure 1 , Figure 2 and Figure 5, based on the above embodiment, in step S4, the quality monitoring model construction is used to construct the model required for air quality monitoring, specifically, a hierarchical Gaussian mixture model is constructed as the quality monitoring model;
[0125] The construction of the quality monitoring model specifically includes the following steps:
[0126] Step S41: Typical feature enhancement, which is used to enhance the feature representation based on the typical patterns of air quality levels. The steps include:
[0127] Step S411: Initialize the typical pattern, specifically, set the typical pattern of air quality levels corresponding to the air quality level labels based on the ambient air quality standards;
[0128] Step S412: Update the typical pattern, specifically, during the training process, dynamically adjust the typical pattern of air quality levels based on the current training data. The formula used is as follows:
[0129] ;
[0130] In the formula, represents the similarity calculation function, represents the typical pattern of the k-th air quality level, represents the n-th training sample, represents the temperature parameter, K represents the number of air quality levels, represents the typical pattern of the m-th air quality level, represents the updated typical pattern of the k-th air quality level, represents the update control weight, and N represents the number of training samples;
[0131] Step S413: Synthesize enhanced features. The formula used is as follows:
[0132] ;
[0133] In the formula, represents the enhanced feature, represents the input feature of the typical feature enhancement;
[0134] Step S42: Construct a Gaussian mixture model, which is used to construct a Gaussian mixture model. The steps include:
[0135] Step S421: Model initialization, specifically, pre-cluster the training data after typical feature enhancement through the K-means algorithm, take the cluster centers of 4K clusters as the initial means, calculate the within-cluster sample covariance matrix of each selected cluster as the initial covariance, and initialize 4K Gaussian components based on the initial means and the initial covariance;
[0136] Step S422: Design the expectation step, which is used to calculate the posterior probability that the nth training sample belongs to the lth Gaussian component. The formula used is as follows:
[0137] ;
[0138] In the formula, represents the posterior probability that the nth training sample belongs to the lth Gaussian component, represents the mixing coefficient of the lth Gaussian component, represents the probability density function, represents the lth Gaussian component, represents the mixing coefficient of the qth Gaussian component, represents the qth Gaussian component;
[0139] Step S423: Design the maximization step, which is used to update the parameters. The formula used is as follows:
[0140] ;
[0141] In the formula, represents the mean of the updated lth Gaussian component, represents the covariance of the updated lth Gaussian component, represents the mixing coefficient of the updated lth Gaussian component, represents the mean of the lth Gaussian component;
[0142] Step S43: Hierarchical clustering is used to gradually merge the 4K clusters after the Gaussian mixture model iteration is completed into K clusters. Specifically, by calculating the KL divergence between cluster pairs, the similarity between cluster pairs is measured, the most similar cluster pairs are iteratively merged to obtain the final K clusters, and the final K clusters are mapped to K air quality levels;
[0143] Step S44: Construct and train the model. Specifically, through the typical feature enhancement, the construction of the Gaussian mixture model, and the hierarchical clustering, the hierarchical Gaussian mixture model is constructed, the model is trained based on the model training set, the model performance is verified based on the model test set, and the hierarchical Gaussian mixture model is obtained and used as the quality monitoring model.
[0144] By performing the above operations, aiming at the technical problems existing in traditional air quality monitoring methods, such as the difficulty in dealing with the non-linear and multi-modal relationships between air quality characteristics and grades, and the lack of explicit alignment with the typical patterns of grades when directly using the original characteristics for modeling, resulting in the classification boundary deviating from the actual standard, this solution creatively adopts the construction of a hierarchical Gaussian mixture model as the quality monitoring model. By dynamically learning the typical patterns of air quality grades, the model can capture the non-linear distribution characteristics while fitting the grade boundaries defined by environmental standards, and more clearly distinguish the boundaries between grades through hierarchical clustering, improving the classification accuracy.
[0145] Example 6, refer to Figure 1 and Figure 2 , based on the above example, in step S5, the air quality monitoring specifically refers to using the quality monitoring model to perform air quality monitoring based on the quality monitoring feature set, obtaining air quality grade reference data, and realizing the monitoring of air quality based on the air quality grade reference data.
[0146] Example 7, refer to Figure 1 and Figure 2 , based on the above example, an intelligent air quality monitoring system provided by the present invention includes an air quality data acquisition module, an original data optimization module, a quality monitoring feature extraction module, a quality monitoring model construction module, and an air quality monitoring module;
[0147] The air quality data acquisition module is used for air quality data acquisition. By collecting air quality data, a quality monitoring original data set is obtained, and the quality monitoring original data set is sent to the original data optimization module;
[0148] The original data optimization module is used for original data optimization. Through original data optimization, an enhanced real-time data set, a model training set, and a model test set are obtained, and the enhanced real-time data set is sent to the quality monitoring feature extraction module, and the model training set and the model test set are sent to the quality monitoring feature extraction module and the quality monitoring model construction module;
[0149] The quality monitoring feature extraction module is used for quality monitoring feature extraction. By constructing a spatio-temporal dynamic network model to extract quality monitoring features, a quality monitoring feature set is obtained, and the quality monitoring feature set is sent to the air quality monitoring module;
[0150] The quality monitoring model construction module is used for quality monitoring model construction. By constructing a hierarchical Gaussian mixture model, a quality monitoring model is obtained, and the quality monitoring model is sent to the air quality monitoring module;
[0151] The air quality monitoring module is used for air quality monitoring. By adopting the quality monitoring model for air quality monitoring, reference data on air quality grades is obtained.
[0152] It should be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device.
[0153] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention.
[0154] The above describes the present invention and its embodiments. Such description is not restrictive. What is shown in the drawings is only one of the embodiments of the present invention, and the actual structure is not limited thereto. Generally speaking, if those of ordinary skill in the art are inspired by it and, without departing from the purpose of the present invention, design similar structural forms and embodiments to this technical solution without creative efforts, they shall fall within the protection scope of the present invention.
Claims
1. An intelligent air quality monitoring method, characterized in that: The method comprises the following steps: S1: air quality data acquisition, by acquiring data from multiple different data collection points to obtain a quality monitoring original data set, the quality monitoring original data set specifically includes a historical monitoring original data set and a real-time monitoring original data set; S2: Raw data optimization: preprocessing the collected raw data to optimize the data, and obtain enhanced real-time data sets, model training sets, and model test sets; S3: Quality monitoring feature extraction, used to extract quality monitoring features, specifically to build a spatiotemporal dynamic network model and extract quality monitoring features, the spatiotemporal dynamic network model specifically includes a time branch, a space branch, a causal intervention module and a dynamic parameter adjustment module; The causal intervention module is used to eliminate the confounding effects of meteorological data on air pollution characteristics. The causal intervention module is constructed, and the steps include: Step S331: extracting confounding factors to obtain the confounding effects of meteorological data on air pollution characteristics; Step S332: Feature purification is used to eliminate the interference of meteorological data. The formula used is as follows: ; In the formula, cf represents the confounding factor, represents the expected value of air pollution characteristics under the conditions of meteorological data, P represents the number of independent sampling times, represents the random noise of the pth independent sampling, represents a conditional generator function, Represents the characteristics of purified air pollution, represents the output characteristics of the time branch, Represents the splicing operation function; S4: Quality monitoring model construction, which is used to build the model required for air quality monitoring, specifically to build a hierarchical Gaussian mixture model as a quality monitoring model; S5: Air quality monitoring, by using the quality monitoring model to perform air quality monitoring to obtain air quality level reference data.
2. An intelligent air quality monitoring method according to claim 1, characterized in that: The quality monitoring feature extraction specifically includes the following steps: Step S31: constructing a time branch for extracting time series features at multiple scales, specifically decomposing the time series features in the air pollution data into daily cycle features, weekly trend features, and hourly mutation features at multiple granularities; Step S32: constructing a spatial branch for extracting spatial dimensional features, specifically using a graph convolutional network to extract spatial dimensional features in air pollution data, the steps include: Step S321: Design an activation function for designing a graph convolutional network activation function. The formula used is as follows: ; In the formula, represents the activation function of the graph convolutional network, x represents the independent variable of the activation function, represents the learnable gain parameter in the positive region, represents the learnable gain parameter in the negative region, represents the learnable slope parameter in the positive region, represents the learnable slope parameter in the negative region, Indicates that the activation function can learn dynamic thresholds; Step S322: Design an adjacency matrix for designing a graph convolution network adjacency matrix based on the data collection points. Specifically, the data collection points are used as nodes, and the graph convolution network adjacency matrix is obtained by combining geographic proximity and wind direction drive. The formula used is as follows: ; In the formula, represents the geographic adjacency matrix, represents the wind direction adjacency matrix, represents the comprehensive adjacency matrix, represents the straight-line distance from data collection point i to data collection point j, represents the reference straight line distance, It represents the angle between the line from data collection point i to data collection point j and the wind direction. Indicates the weight calculated by the comprehensive adjacency matrix; Step S323: performing graph convolution; Step S324: Design a grade attention mechanism to introduce the air quality grade into the attention mechanism. The formula used is as follows: ; In the formula, represents the attention weight from data collection point i to data collection point j, represents the softmax function, represents the hidden state of data collection point i, represents the hidden state of data collection point j, represents the hidden state to query transformation matrix, represents the hidden state to key transformation matrix, T represents the transpose operation, represents the dimension of the key, Represents the level difference mask from data collection point i to data collection point j. When the air quality level of data collection point i is the same as that of data collection point j, its value is 0. When the air quality level of data collection point i is different from that of data collection point j, its value is ; Step S325: Obtain spatial branch output, the formula used is as follows: ; In the formula, represents the output feature of the spatial branch, represents the layer normalization function, J represents the total number of data collection points, Represents the hidden state to value transformation matrix; Step S33: constructing a causal intervention module; Step S34: constructing a dynamic parameter adjustment module, which is used to realize dynamic environment adaptation of the model parameters of the spatiotemporal dynamic network model, specifically, dynamically adjusting the model parameters of the spatiotemporal dynamic network model using a hypernetwork constructed by a multi-layer perceptron; Step S35: extracting quality monitoring features, specifically constructing a spatiotemporal dynamic network model by constructing the time branch, the space branch, the causal intervention module construction and the dynamic parameter adjustment module construction, training the model based on the model training set, verifying the model performance based on the model test set, and obtaining the spatiotemporal dynamic network model; and using the spatiotemporal dynamic network model to obtain purified air pollution features as quality monitoring features based on the enhanced real-time data set to obtain a quality monitoring feature set.
3. An intelligent air quality monitoring method according to claim 1, characterized in that: The quality monitoring model construction specifically includes the following steps: Step S41: typical feature enhancement, for enhancing feature representation based on typical modes of air quality levels, comprising: Step S411: Initializing a typical mode, specifically setting an air quality level typical mode corresponding to an air quality level label based on an ambient air quality standard; Step S412: Typical mode update, specifically, dynamically adjusting the typical mode of air quality level based on current training data during the training process, the formula used is as follows: ; In the formula, represents the similarity calculation function, represents the typical pattern of the kth air quality level, represents the nth training sample, represents the temperature parameter, K represents the number of air quality levels, represents the typical pattern of the mth air quality level, represents the typical pattern of the kth air quality level after update, represents the update control weight, and N represents the number of training samples; Step S413: synthesize enhanced features, the formula used is as follows: ; In the formula, Represents enhanced features, represents the input features of typical feature enhancement; Step S42: constructing a Gaussian mixture model, which is used to construct a Gaussian mixture model. The steps include: Step S421: model initialization, specifically, pre-clustering the training data after typical feature enhancement by using the K-means algorithm, taking the cluster centers of 4K clusters as the initial mean, calculating the covariance matrix of the cluster samples of each selected cluster as the initial covariance, and initializing 4K Gaussian components based on the initial mean and the initial covariance; Step S422: designing an expectation step for calculating the posterior probability that the nth training sample belongs to the lth Gaussian component; Step S423: designing a maximization step for updating parameters; Step S43: hierarchical clustering, which is used to gradually merge the 4K clusters after the Gaussian mixture model iteration into K clusters, specifically by calculating the KL divergence between cluster pairs, measuring the similarity between cluster pairs, iteratively merging the most similar cluster pairs, obtaining the final K clusters, and corresponding the final K clusters to K air quality levels; Step S44: construct and train the model, specifically, construct a hierarchical Gaussian mixture model through the typical feature enhancement, the construction of the Gaussian mixture model and the hierarchical clustering, train the model based on the model training set, verify the model performance based on the model test set, obtain the hierarchical Gaussian mixture model, and use it as a quality monitoring model.
4. The intelligent air quality monitoring method according to claim 1, characterized in that: The historical monitoring original data set and the real-time monitoring original data set specifically include air pollution data, meteorological data and geographic space data. The historical monitoring original data set also includes historical quality grade label data.
5. The intelligent air quality monitoring method according to claim 1, characterized in that: The raw data optimization is used to preprocess the collected quality monitoring raw data to optimize the data, and specifically includes the following steps: Step S21: missing value processing, for removing missing values, specifically removing missing values in the historical monitoring original data set and the real-time monitoring original data set to obtain a roughly processed historical data set and a roughly processed real-time data set; Step S22: aligning spatiotemporal data, which is used to align spatiotemporal data, specifically converting the spatial data in the rough-processed historical data set and the rough-processed real-time data set into a unified coordinate system, performing clock synchronization on the time data, and obtaining an aligned historical data set and an aligned real-time data set; Step S23: data standardization, which is used to standardize the aligned data, specifically, using a minimum-maximum standardization method to process the aligned historical data set and the aligned real-time data set to obtain a standardized historical data set and a standardized real-time data set; Step S24: level boundary alignment, which is used to add level boundary reinforcement to the concentration data in the standardized data, specifically, to define the level threshold of the concentration data based on the ambient air quality standard, and to reinforce the concentration data to obtain an enhanced historical data set and an enhanced real-time data set; Step S25: Dataset segmentation, which is used to segment the data set, specifically, segmenting the enhanced historical data set into a model training set and a model test set.
6. An intelligent air quality monitoring method according to claim 1, characterized in that: The air quality monitoring specifically includes adopting the quality monitoring model to perform air quality monitoring based on the quality monitoring feature set, obtaining air quality level reference data, and implementing air quality monitoring based on the air quality level reference data.
7. An intelligent air quality monitoring system, used to implement an intelligent air quality monitoring method as claimed in any one of claims 1 to 6, characterized in that: It includes an air quality data acquisition module, a raw data optimization module, a quality monitoring feature extraction module, a quality monitoring model construction module and an air quality monitoring module.
8. An intelligent air quality monitoring system according to claim 7, characterized in that: The air quality data acquisition module is used to acquire air quality data, obtain a quality monitoring original data set by collecting air quality data, and send the quality monitoring original data set to the original data optimization module; The raw data optimization module is used for raw data optimization, and obtains a reinforced real-time data set, a model training set and a model test set through raw data optimization, and sends the reinforced real-time data set to the quality monitoring feature extraction module, and sends the model training set and the model test set to the quality monitoring feature extraction module and the quality monitoring model construction module; The quality monitoring feature extraction module is used for quality monitoring feature extraction, extracts quality monitoring features by constructing a spatiotemporal dynamic network model, obtains a quality monitoring feature set, and sends the quality monitoring feature set to the air quality monitoring module; The quality monitoring model building module is used for building a quality monitoring model, obtaining a quality monitoring model by building a hierarchical Gaussian mixture model, and sending the quality monitoring model to the air quality monitoring module; The air quality monitoring module is used for air quality monitoring, and obtains air quality grade reference data by using the quality monitoring model to perform air quality monitoring.