Machine learning-based ambient air monitoring data AQI grading early warning method and system

CN122946733APending Publication Date: 2026-10-20PINBIAO ENVIRONMENTAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611136801.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-10-20

AI Technical Summary

Benefits of technology

[0046]1.本发明通过对原始多源空气监测数据进行异常值裁剪、时间对齐、缺失值补全以及基于历史均值和历史标准差的滑动窗口标准化处理,构建了统一尺度的窗口数据表示,能够有效解决多站点空气监测中时序同步困难、数据缺失和量纲不一致的问题,从而提高了连续监测数据进入后续分析链路时的规范性与可比性;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure SMS_7
    Figure SMS_7
Patent Text Reader

Abstract

This invention relates to the field of environmental monitoring and machine learning applications, specifically to a machine learning-based method and system for AQI-level early warning of ambient air quality monitoring data. The method includes: acquiring multi-source air monitoring data and performing outlier pruning, time alignment, and missing value completion; performing sliding window slicing and standardization based on historical mean and standard deviation; calculating the current feature distribution and comparing it with a historical stable window benchmark distribution; updating model parameters and obtaining updated weights when the distribution change exceeds a threshold; extracting monitoring station node embeddings, calculating station importance, and pruning spatiotemporal heterogeneous graphs to generate a spatiotemporal aggregated feature input graph aggregation model, obtaining AQI level prediction results and predicted AQI values; performing confidence correction and calculating the early warning trigger probability when the predicted AQI value exceeds a preset level boundary, and outputting an AQI-level early warning notification. This invention improves the standardization and comparability of continuous monitoring data when it enters subsequent analysis links.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of environmental monitoring and machine learning applications, specifically to a machine learning-based method and system for classifying and issuing early warnings based on ambient air quality (AQI) monitoring data. Background Technology

[0002] In ambient air quality monitoring, monitoring centers typically need to continuously collect particulate matter, gaseous pollutants, and meteorological elements from multiple stations to determine air quality levels and the timing of early warnings. As the number of stations increases and the sampling frequency rises, the processing pressure on monitoring data in terms of time synchronization, missing data completion, abnormal fluctuation identification, and multi-station joint analysis also increases. Therefore, a processing method that can adapt to continuously changing environments and output early warning results in a timely manner is needed.

[0003] In existing technologies, air quality warnings often rely on fixed rules or inferences based directly on historical models. When monitoring data undergoes sudden changes, it is often difficult to reflect the current distribution drift in a timely manner. At the same time, if all station data is uniformly modeled and fully inferred, the consumption of computing resources will exceed the set threshold, data processing will be delayed, and the feature information of edge stations will not be fully extracted. Therefore, how to ensure the accuracy of prediction while taking into account the efficiency of model update, the computational efficiency of graph structure, and the stability of warning output has become an urgent problem to be solved. Summary of the Invention

[0004] The purpose of this invention is to provide a machine learning-based method and system for graded early warning of ambient air quality (AQI) monitoring data. This method avoids the difficulty in reflecting distribution drift during sudden data changes and the heavy computational burden and high latency caused by full-data inference, while also more easily balancing prediction accuracy, computational efficiency, and early warning output stability. This invention is achieved using the following technical solution:

[0005] A machine learning-based AQI-based graded early warning method for ambient air monitoring data includes:

[0006] A spatiotemporal heterogeneous graph and graph aggregation model are pre-constructed to obtain raw multi-source air monitoring data and complete outlier pruning, time alignment and missing value completion. Sliding window slicing and standardization are performed based on historical mean and historical standard deviation to obtain window data representation.

[0007] The current feature distribution is calculated based on the window data representation and compared with the baseline distribution formed by historical stable windows selected from historical sliding windows to obtain the distribution change value.

[0008] Determine whether the distribution change value exceeds the preset threshold. If so, update the model parameters of the pre-built graph aggregation model to obtain the updated weights; otherwise, use the pre-frozen backbone weights in the graph aggregation model as the updated weights.

[0009] Based on the updated weights, the node embedding vectors of the monitoring sites are extracted, the site importance score is calculated, and the pre-constructed spatiotemporal heterogeneous graph is cropped according to the site importance score to obtain the retained subgraph structure.

[0010] Spatiotemporal aggregated feature vectors are generated based on the retained subgraph structure and input into a pre-built graph aggregation model to obtain AQI level prediction results, corresponding category probabilities, and predicted AQI values;

[0011] When the predicted AQI value is higher than the preset level boundary, the confidence level of the category probability is corrected and the warning trigger probability is calculated. The corresponding warning level result is generated and the AQI level warning notification is output.

[0012] Optionally, a spatiotemporal heterogeneous graph and graph aggregation model are pre-constructed to obtain raw multi-source air monitoring data and complete outlier pruning, time alignment, and missing value completion. Sliding window slicing and standardization are performed based on historical mean and historical standard deviation to obtain a windowed data representation, including:

[0013] Outlier pruning and time alignment are performed on the raw multi-source air monitoring data to generate a valid air monitoring dataset.

[0014] Missing values ​​were filled in based on the valid air monitoring dataset to obtain a regularized air monitoring dataset.

[0015] The regular air monitoring dataset is sliced ​​into sliding time windows and standardized based on historical mean and historical standard deviation to generate a windowed data representation.

[0016] Optionally, the current feature distribution is calculated based on the window data representation and compared with the baseline distribution formed by historical stable windows selected from historical sliding windows to obtain the distribution change value, including:

[0017] Extract the normalized proportion vector of current window features from the window data representation;

[0018] Select historical windows with stable distribution and continuous occurrence from the historical windows as historical stable windows, and extract the normalized proportion vector of historical stable windows;

[0019] The difference between the current window feature normalized proportion vector and the historical stable window normalized proportion vector is calculated to obtain the feature distribution difference value; the distribution change value is determined based on the feature distribution difference value.

[0020] Optionally, it is determined whether the distribution change value exceeds a preset threshold. If so, the model parameters of the pre-built graph aggregation model are updated to obtain updated weights; if not, the pre-frozen backbone weights in the graph aggregation model are used as updated weights, including:

[0021] Obtain the historical feature subspace basis matrix extracted from historical training data;

[0022] When the distribution change value exceeds the preset threshold, the model parameters are updated based on the online update loss composed of the unsupervised orthogonal feature reconstruction error and the supervised prediction error, so as to obtain the updated parameters used to compensate for the current change.

[0023] The updated parameters are then combined with the frozen backbone weights to obtain the updated weights.

[0024] Optionally, the node embedding vectors of monitoring sites are extracted based on the updated weights, the site importance score is calculated, and the pre-constructed spatiotemporal heterogeneous graph is pruned according to the site importance score to obtain a retained subgraph structure, including:

[0025] Based on the window data representation and update weights, node embedding vectors for each monitoring station are generated through a spatiotemporal heterogeneous graph encoder.

[0026] The site importance score is calculated based on node embedding vectors, node attention information, cache expiration information, and node change response information.

[0027] When a site's importance score is lower than a preset retention threshold, the corresponding node is determined to be a redundant node.

[0028] Redundant nodes and their associated edges are removed from the spatiotemporal heterogeneous graph to obtain a subgraph structure that is preserved.

[0029] Optionally, a spatiotemporal aggregated feature vector is generated based on the preserved subgraph structure and input into a pre-built graph aggregation model to obtain the AQI level prediction result, the corresponding category probability, and the predicted AQI value, including:

[0030] The node embedding vectors in the retained subgraph structure are concatenated and mapped with the associated edge features to construct a spatiotemporal aggregated feature vector;

[0031] The weight coefficients corresponding to each feature are determined based on the spatiotemporal aggregated feature vector and input into the pre-constructed graph aggregation model to obtain the global feature vector representation;

[0032] The AQI level prediction result and the predicted AQI value are obtained based on the global feature vector representation.

[0033] Optionally, when the predicted AQI value is higher than the preset level boundary, confidence correction is applied to the category probability and the warning trigger probability is calculated, including:

[0034] Extract the category probability output value that matches the current prediction level;

[0035] The confidence level of the category probability output value that matches the current prediction level is corrected based on the preset correction rules to obtain the corrected prediction result;

[0036] When the corrected prediction results maintain the same warning level for consecutive preset prediction periods, the warning trigger probability is obtained based on the corrected category probability and the trigger threshold; when the corrected prediction results do not maintain the same warning level for consecutive preset prediction periods, the warning trigger probability is recorded as 0.

[0037] An ambient air quality (AQI) tiered early warning system based on machine learning data includes:

[0038] The data acquisition module is used to acquire raw multi-source air monitoring data and obtain a windowed data representation;

[0039] The feature calculation module is used to calculate the current feature distribution and obtain the distribution change value;

[0040] The parameter update module is used to update the model parameters and obtain updated weights when the distribution change value exceeds a preset threshold.

[0041] The node embedding and subgraph pruning module is used to generate node embedding vectors for monitoring sites, calculate site importance scores, and obtain the preserved subgraph structure.

[0042] The graph aggregation prediction module is used to obtain AQI level prediction results and predicted AQI values ​​based on the retained subgraph structure;

[0043] The confidence level assessment module is used to perform confidence correction on the predicted AQI value that is higher than the preset level boundary and obtain the early warning trigger probability.

[0044] The early warning output module is used to output AQI-level early warning notifications based on the early warning trigger probability.

[0045] As can be seen from the above solutions, the advantages of the present invention are:

[0046] 1. This invention constructs a window data representation with a unified scale by performing outlier clipping, time alignment, missing value completion, and sliding window standardization based on historical mean and historical standard deviation on the original multi-source air monitoring data. This can effectively solve the problems of time-series synchronization difficulties, data missingness, and inconsistent dimensions in multi-site air monitoring, thereby improving the standardization and comparability of continuous monitoring data when it enters the subsequent analysis link.

[0047] 2. This invention extracts the normalized proportion vector of the current window features from the window data representation and calculates the difference between it and the normalized proportion vector of the historical stable windows obtained by filtering according to fixed rules. This enables timely identification of the distribution drift of ambient air monitoring data and enhances the system's ability to perceive sudden emissions and extreme weather changes.

[0048] 3. This invention introduces an online parameter update mechanism based on historical feature subspace constraints when the distribution change value exceeds a preset threshold, and integrates the updated parameters with the frozen backbone weights. This can not only compensate for the model offset caused by the current change, but also avoid the problems of excessive consumption of computing resources and the overwriting of historical patterns caused by full retraining, thus balancing model update efficiency and prediction stability. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of this application and the prior art, the following is a brief introduction to the drawings used in the description of the embodiments and the prior art:

[0050] Figure 1 This is a flowchart of the AQI-based graded early warning method for ambient air monitoring data based on machine learning, according to an embodiment of the present invention.

[0051] Figure 2 This is a structural diagram of the AQI-based graded early warning system for ambient air monitoring data provided in an embodiment of the present invention. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.

[0053] Please see Figure 1 A machine learning-based AQI-based graded early warning method for ambient air monitoring data includes:

[0054] A spatiotemporal heterogeneous graph and graph aggregation model are pre-constructed to obtain raw multi-source air monitoring data and complete outlier pruning, time alignment and missing value completion. Sliding window slicing and standardization are performed based on historical mean and historical standard deviation to obtain window data representation.

[0055] The current feature distribution is calculated based on the window data representation and compared with the baseline distribution formed by historical stable windows selected from historical sliding windows to obtain the distribution change value.

[0056] Determine whether the distribution change value exceeds the preset threshold. If so, update the model parameters of the pre-built graph aggregation model to obtain the updated weights; otherwise, use the pre-frozen backbone weights in the graph aggregation model as the updated weights.

[0057] Based on the updated weights, the node embedding vectors of the monitoring sites are extracted, the site importance score is calculated, and the pre-constructed spatiotemporal heterogeneous graph is cropped according to the site importance score to obtain the retained subgraph structure.

[0058] Spatiotemporal aggregated feature vectors are generated based on the retained subgraph structure and input into a pre-built graph aggregation model to obtain AQI level prediction results, corresponding category probabilities, and predicted AQI values;

[0059] When the predicted AQI value is higher than the preset level boundary, the confidence level of the category probability is corrected and the warning trigger probability is calculated. The corresponding warning level result is generated and the AQI graded warning notification is output.

[0060] A spatiotemporal heterogeneous graph and graph aggregation model are pre-constructed. Raw multi-source air monitoring data are acquired, and outlier pruning, time alignment, and missing value completion are performed. Sliding window slicing and standardization are conducted based on historical mean and historical standard deviation to obtain windowed data representations, including:

[0061] Outlier pruning and time alignment are performed on the raw multi-source air monitoring data to generate a valid air monitoring dataset.

[0062] Missing values ​​were filled in based on the valid air monitoring dataset to obtain a regularized air monitoring dataset.

[0063] The regular air monitoring dataset is sliced ​​into sliding time windows and standardized based on historical mean and historical standard deviation to generate a windowed data representation;

[0064] The current feature distribution is calculated based on window data representation and compared with the baseline distribution formed by historical stable windows selected from historical sliding windows to obtain the distribution change values, including:

[0065] Extract the normalized proportion vector of current window features from the window data representation;

[0066] Select historical windows with stable distribution and continuous occurrence from the historical windows as historical stable windows, and extract the normalized proportion vector of historical stable windows;

[0067] The difference between the current window feature normalized proportion vector and the historical stable window normalized proportion vector is calculated to obtain the feature distribution difference value; the distribution change value is determined based on the feature distribution difference value.

[0068] A municipal environmental monitoring center has deployed a multi-site real-time air quality monitoring network covering the main urban area and surrounding industrial parks. The system continuously acquires raw multi-source air monitoring data from each monitoring station through data access ports, such as particulate matter concentration, gaseous pollutant concentration, wind speed and direction.

[0069] The system fixes the original features of a single site at each moment into a nine-dimensional vector, which includes fine particulate matter, inhalable particulate matter, sulfur dioxide, nitrogen dioxide, carbon monoxide, ozone, wind speed, wind direction sine and wind direction cosine. The wind direction angle is first converted to 0 to 360 degrees, and its sine and cosine values ​​are taken respectively.

[0070] If only the wind direction angle is transmitted on-site, the system will complete the binary expansion after time alignment; for The number of monitoring stations and the length are A sliding window, where the window data is represented by a shape of A three-dimensional array, wherein the order of the third dimension in the array remains consistent during the training and inference phases and is not allowed to be changed;

[0071] Since the hardware reporting frequencies of each sensor differ and network transmission is delayed or unstable, the primary task of the system is to perform time alignment on the raw multi-source air monitoring data, mapping it to a unified system clock cycle. At the same time, outliers exceeding the physical range of the sensors are truncated to generate an effective air monitoring dataset.

[0072] During the data flow process, if a monitoring station loses data due to communication interruption in the current sampling period, the system does not interrupt the overall processing link. Instead, it reads the stable observation record of the previous valid period of the station as the substitute value for the current period and adds a data estimation label to it to complete the missing value and finally construct a complete regular air monitoring dataset. The system slices the regular air monitoring dataset into sliding time windows of a preset length.

[0073] The system calls the historical mean and historical standard deviation pre-stored in the configuration library to standardize the sliced ​​data, generate a window data representation with a uniform scale, and write it into the shared memory buffer for subsequent decision modules to call; the window length L can be set to 12 consecutive sampling periods; when the system sampling period is 5 minutes, each window corresponds to the most recent 60 minutes of continuous observation sequence, and the window slides forward one period each time it reaches a new sampling period;

[0074] After generating the window data representation, the system needs to assess whether there is a significant distribution drift in the current environmental data. Since positive, zero, or negative values ​​are allowed in the standardized window data representation, the system does not directly calculate the proportion of the standardized values ​​themselves, but first counts the non-negative representation values ​​of each monitoring quantity in the current window according to the feature dimension.

[0075] The average absolute value of the standardized results of each monitoring quantity within the current window can be taken, or the entire quantity can be shifted to a non-negative interval within the same window before being summarized, thereby forming the window intensity statistics of each feature; the system divides the window intensity statistics of each feature by the sum of the intensity statistics of all features;

[0076] During calculation, a preset smoothing constant is uniformly added to the denominator to ensure that the normalization result is strictly limited to the [0,1] interval, thus obtaining the current window feature normalization ratio vector; the same caliber is also used for historical stable windows to ensure that the comparison benchmark between the current window and the historical stable windows is consistent.

[0077] The minimum smoothing constant can be fixed at 0.000001, and the dimension of the current window feature normalization proportion vector is consistent with the aforementioned single-site feature dimension, which is a nine-dimensional vector. When the system needs to uniformly evaluate the distribution of the entire network, it first averages the corresponding feature intensity statistics of all sites at the same time, and then performs the above normalization process to avoid the change in the number of sites directly affecting the proportion result.

[0078] The system extracts the normalized proportion vector of the current window features from the window data representation in the buffer; at the same time, the system selects historical windows with stable distribution and continuous occurrence from the historical operation records as historical stable windows, and extracts the corresponding normalized proportion vector of historical stable windows as a comparison benchmark.

[0079] The system filters according to the following fixed rules: trace back the most recent 30 days from the current time and select historical windows that are in the same time period as the current window; calculate the feature distribution difference value between two adjacent historical windows in chronological order; and mark the segment whose difference value of 12 consecutive historical windows is less than a preset threshold of 20% as a candidate stable segment.

[0080] In the candidate stable segment, select the segment closest to the current time, and combine the normalized proportion vectors of the 12 historical windows in the segment into a normalized proportion vector of historical stable windows by averaging the dimensions one by one; if there are no consecutive 12 windows that meet the conditions in the last 30 days, then reduce the number of consecutive windows to 10 and then 8 for backtracking.

[0081] If the conditions are still not met, the system directly uses the median vector of all windows in the same time period over the past 7 days as the comparison benchmark and writes the benchmark rollback flag in the status record; the system calculates the difference between the normalized proportion vector of the current window features and the normalized proportion vector of the historical stable windows to obtain the feature distribution difference value. The system can calculate the Jensen-Shannon divergence or Euclidean distance between the two as the feature distribution difference value; and determine the distribution change value accordingly. Specifically, the calculated feature distribution difference value can be directly used as the distribution change value.

[0082] The calibration basis for the preset threshold is as follows: the system collects observation records of the stable period without mutation within a continuous historical year in advance, calculates the characteristic distribution difference value between all historical stable windows, and takes the average value plus three times the standard deviation as the preset threshold.

[0083] When the change value of the distribution does not exceed the preset threshold, the system determines that the current environment is in a stable state, continues to use the frozen backbone weight as the current effective inference weight, and directly passes the current effective inference weight to the subsequent node embedding extraction and graph pruning stage to ensure that the input weight object in the subsequent processing link remains unique.

[0084] When the distribution change value exceeds the preset threshold, the system determines that a sudden change has occurred in the environment, and then updates the status flag to the sudden change mode, triggering subsequent incremental updates of model parameters and allocation of computing resources.

[0085] In one embodiment, it is determined whether the distribution change value exceeds a preset threshold. If so, the model parameters of the pre-constructed graph aggregation model are updated to obtain updated weights; if not, the pre-frozen backbone weights in the graph aggregation model are used as updated weights, including:

[0086] Obtain the historical feature subspace basis matrix extracted from historical training data;

[0087] When the distribution change value exceeds the preset threshold, the model parameters are updated based on the online update loss composed of the unsupervised orthogonal feature reconstruction error and the supervised prediction error, so as to obtain the updated parameters used to compensate for the current change.

[0088] The updated parameters are then combined with the frozen backbone weights to obtain the updated weights.

[0089] Based on the updated weights, the node embedding vectors of the monitoring sites are extracted, the site importance score is calculated, and the pre-constructed spatiotemporal heterogeneous graph is pruned according to the site importance score to obtain a retained subgraph structure, including:

[0090] Based on the window data representation and update weights, node embedding vectors for each monitoring station are generated through a spatiotemporal heterogeneous graph encoder.

[0091] The site importance score is calculated based on node embedding vectors, node attention information, cache expiration information, and node change response information.

[0092] When a site's importance score is lower than a preset retention threshold, the corresponding node is determined to be a redundant node.

[0093] Redundant nodes and their associated edges are removed from the spatiotemporal heterogeneous graph to obtain a subgraph structure that is preserved.

[0094] Based on the retained subgraph structure, a spatiotemporal aggregated feature vector is generated and input into a pre-built graph aggregation model to obtain the AQI level prediction result, the corresponding category probability, and the predicted AQI value, including:

[0095] The node embedding vectors in the retained subgraph structure are concatenated and mapped with the associated edge features to construct a spatiotemporal aggregated feature vector;

[0096] The weight coefficients corresponding to each feature are determined based on the spatiotemporal aggregated feature vector and input into the pre-constructed graph aggregation model to obtain the global feature vector representation;

[0097] The AQI level prediction result and the predicted AQI value are obtained based on the global feature vector representation;

[0098] When the predicted AQI value is higher than the preset level boundary, confidence correction is applied to the category probability and the warning trigger probability is calculated, including:

[0099] Extract the category probability output value that matches the current prediction level;

[0100] The confidence level of the category probability output value that matches the current prediction level is corrected based on the preset correction rules to obtain the corrected prediction result;

[0101] When the corrected prediction results maintain the same warning level for consecutive preset prediction periods, the warning trigger probability is obtained based on the corrected category probability and the trigger threshold; when the corrected prediction results do not maintain the same warning level for consecutive preset prediction periods, the warning trigger probability is recorded as 0.

[0102] When the distribution change value exceeds the preset threshold, the system executes the parameter update mechanism; the system obtains the historical feature subspace basis matrix extracted from the historical training data from the persistent storage unit. The historical feature subspace basis matrix can be obtained by stacking the node embedding vectors corresponding to the historical stable window column by column and then performing orthogonalization processing, which is used to limit the model update direction to fall only in the complement space of the historical feature subspace;

[0103] The historical feature subspace basis matrix is ​​directly embedded into the feature space at the node during construction. Perform singular value decomposition within the core and extract the initial value. Each principal component serves as an orthogonal basis. This is to ensure matrix compatibility in subsequent residual projection calculations;

[0104] Offline training samples are constructed by uniformly aligning the site monitoring records for a continuous year to a 5-minute sampling frequency that is completely consistent with the online inference environment through spline interpolation or resampling techniques, and then matching them with the corresponding AQI release results.

[0105] The input end uses the sequence data of the aforementioned nine-dimensional features of each station within a time window of length 12, and the output end includes six levels of AQI level labels and one continuous AQI numerical label.

[0106] To address the temporal logic conflict caused by the physical delay between the arrival of environmental monitoring data and the write-back of tags from the regulatory platform in scenarios of sudden changes, which prevents the synchronous calculation of truth deviations, the system further generates a hybrid online update loss. The online update loss is composed of the unsupervised orthogonal feature reconstruction error corresponding to the current window and the supervised prediction error of historical cached samples, weighted and summed according to a preset ratio. The preset ratio can be fixed according to the emphasis on sudden change response and maintenance of historical patterns in the actual scenario. For example, the weight ratio of unsupervised orthogonal feature reconstruction error to supervised prediction error can be set to 0.7:0.3.

[0107] Specifically, for the current mutation window where the real label has not yet been issued, the system directly extracts the orthogonal residuals whose nodes are embedded outside the historical feature subspace, and calculates the squared L2 norm of these orthogonal residuals as the unsupervised orthogonal feature reconstruction error to capture sudden changes in real time. The specific calculation formula is as follows:

[0108]

[0109] in, Let be the embedding vector of the current node. The basis matrix of the historical feature subspace;

[0110] Simultaneously, the most recently completed label write-back valid historical sample sequence is retrieved from the buffer queue and re-input into the currently updated model to perform forward propagation. The prediction level cross-entropy classification error and the prediction AQI numerical mean square error of the sample are recalculated as supervised prediction error gradient terms. The iteration is completed by combining historical data replay with real-time unsupervised compensation, and incremental iterative updates are only performed for the most recent consecutive windows.

[0111] In this process, the system strictly restricts the gradient update direction to the complement space orthogonal to the historical feature subspace through the complement space projection matrix, thereby obtaining update parameters that are only used to compensate for the current changes.

[0112] For a given layer's backbone weight matrix, the system updates the parameters using a low-rank matrix, specifically by multiplying a d×r matrix A and an r×d matrix B to form a d×d update increment matrix with the same dimension as the layer weights. The weights are then superimposed and merged with the frozen backbone weights, using a preset fusion coefficient during the superposition process. Rank of a low-rank matrix Calculate scaling ratio The updated parameters are scaled and then written to the corresponding positions of the backbone weights to obtain the final updated weights; this preset fusion coefficient It can be a constant with a value between 1.0 and 2.0, for example, taking... ;

[0113] Correspondingly, in a stable scenario where the distribution change value does not exceed the preset threshold, the system does not initiate online parameter updates. Instead, it directly uses the frozen backbone weights as the effective weights at the current moment for subsequent node embedding, subgraph pruning, and graph aggregation prediction. This ensures that the updated weights obtained when the threshold is exceeded and the backbone weights used when the threshold is not exceeded are unified as the same type of downstream input object in the engineering implementation, avoiding branch ambiguity in subsequent processing links due to different weight sources.

[0114] After obtaining the updated weights, the system generates node embedding vectors for each monitoring station based on the window data representation and the updated weights through a spatiotemporal heterogeneous graph encoder. The node embedding vectors are used to characterize the pollution status, spatial adjacency, and temporal continuity of the stations.

[0115] The spatiotemporal heterogeneous graph encoder adopts a two-stage structure cascaded together: the first stage is the time series encoding unit, which inputs a 12×9 window matrix of each station into a single-layer gated recurrent unit in chronological order, with a fixed number of hidden units of 32, and takes the hidden state of one time step as the time representation of the station; the second stage is the spatial graph encoding unit, which takes the time representation as the node input, and performs a layer of graph attention propagation in combination with edge features, and outputs a 16-dimensional node embedding vector for each station.

[0116] The edge features are fixed in three dimensions, namely the normalized value of geographical distance between stations, the binary indicator of whether it is upwind, and the correlation coefficient of pollution change in the past 24 hours; the upwind indicator is determined by whether the angle between the current prevailing wind direction and the line connecting the stations falls within the preset angle range, and the correlation coefficient is calculated from the PM2.5 sequence of the two stations in the past 24 hours;

[0117] The system performs structured computation based on node embedding vectors, combined with current node attention information, cache expiration information, and node response information to changes in the current environment. Among them, node attention information is directly obtained from the adjacent edge attention coefficients output by the encoder, which is used to reflect the spatial association strength of the node in the current graph structure.

[0118] The cache expiration information is obtained based on the interval between the time of the node's most recent valid participation in inference and the current time. If the interval is less than the preset dormancy limit period, it is used as a lag penalty term after linear normalization to limit the amount of computing resources allocated to edge sites. The preset dormancy limit period can be set to a specific duration according to the dynamic update needs of the monitoring network, such as 24h or 48h.

[0119] If the interval reaches or exceeds the dormancy limit period, the system triggers the node connectivity restoration mechanism to reset the penalty to zero, ensuring that nodes in a long-term dormant state can regain a fair chance to retain the graph structure; the node change response information is obtained based on the difference between the embedding vector of the corresponding node in the current window and the previous window, which is used to reflect the sensitivity of the site to mutations.

[0120] The system assigns differentiated weights based on the physical meaning of different information. It assigns the maximum positive weight to node attention information reflecting the strength of spatial topological associations, a negative penalty weight to cache validity information reflecting historical data redundancy and lag, and a dynamic gain weight to node change response information capturing the latest mutation response. The system then calculates the site importance score for each site by linearly weighting and summing these information items. The specific weighting formula can be expressed as follows:

[0121]

[0122] Among them, by assigning numerical values ​​to node attention information , cache expiration information value and the numerical value of node change response information Each corresponding weight coefficient , , To obtain the site importance score The system first linearly maps the three types of values ​​to the interval between 0 and 1, and then performs the aforementioned summation. , , The values ​​can be 0.5, 0.2, and 0.3 respectively;

[0123] When the site importance score of a certain site is lower than the preset retention threshold issued by the system, the system determines that the corresponding node is a redundant node, which is usually an edge site whose status is stable but whose impact from sudden changes is less than the set range. The preset retention threshold can be set according to the actual map size and the proportion of nodes to be pruned, for example, a fixed value of 0.35.

[0124] The system directly deletes the redundant nodes and their associated edges in the spatiotemporal heterogeneous graph. If all edges of a key node are marked for deletion, the system will forcibly retain its nearest neighbor edge with the highest score to maintain basic connectivity, and finally output the pruned subgraph structure.

[0125] The system will concatenate and map the node embedding vectors and corresponding edge features in the subgraph structure to construct a spatiotemporal aggregated feature vector. The aggregated input vector corresponding to each edge is formed by sequentially concatenating the 16-dimensional node embedding at the starting point, the 16-dimensional node embedding at the ending point, and the three-dimensional edge features to form a 35-dimensional vector, which is then compressed into a 16-dimensional intermediate representation through a feedforward mapping layer.

[0126] Based on the spatiotemporal aggregated feature vector, the system uses a feedforward neural network to map and concatenate the intermediate representations of the center node and its neighboring nodes. Then, it calculates the attention weight coefficients for each feature using a leakage-corrected linear unit activation function and a normalized exponential function. These coefficients are then input into a trained graph attention network model. The system uses these attention weight coefficients to perform a weighted summation attention aggregation operation on the features of the neighboring nodes, resulting in a global feature vector representation. The formula for calculating the attention weight coefficients is as follows:

[0127]

[0128] in, and For node feature vectors, This is a 16-dimensional intermediate representation that incorporates edge feature information. and The weight matrix is ​​a learnable matrix. represents the parameter vector of the feedforward network; These are the attention weight coefficients corresponding to each feature;

[0129] The graph attention network adopts a two-layer structure. The first layer sets up 4 attention heads, each of which outputs 8 dimensions. The second layer outputs a 16-dimensional global feature vector representation of the entire graph. Through parallel mapping layers, it outputs a six-dimensional AQI level probability vector and a one-dimensional predicted AQI value respectively.

[0130] When the predicted AQI value is higher than the preset level boundary, which corresponds to the critical concentration value of each level in the official AQI classification standard, such as 50, 100, 150, etc., the system additionally extracts the category probability output value that matches the current predicted level, and performs confidence correction on the category probability output value that matches the current predicted level based on the preset correction rule. Specifically, the system compares the difference between the output probability of the current category and the probability of the second highest category. If the difference is greater than the reserved safety margin, the current category probability is directly retained.

[0131] If the difference is less than or equal to the reserved safety margin, the historical prediction probabilities of the most recent preset number of predictions are read and the moving average is calculated. Based on the preset smoothing coefficient, the current class probability is weighted and summed with the moving average to smooth and reduce the weight of the current class probability, thus obtaining the corrected prediction result and its class probability. The specific correction formula is as follows:

[0132]

[0133] in, The corrected class probabilities, This represents the probability of the current category. It is the moving average of historical predicted probabilities. The preset smoothing coefficient takes values ​​between (0, 0.5);

[0134] The safety margin can be fixed at 0.08, and the probability of the most recent historical predictions is fixed at the average output probability of the same category in the most recent 3 prediction periods; if the category after smoothing and weighting in the current period is no longer the category with the highest probability, the system will re-register the category with the highest probability as the corrected prediction result;

[0135] When the corrected prediction results maintain the same warning level for two consecutive prediction periods, the system calculates the positive relative difference between the corrected category probability and the preset trigger threshold, and converts it into a continuous probability value in the interval (0,1] using a monotonic mapping method, which is then used as the final warning trigger probability. Specifically:

[0136]

[0137] Among them, the corrected current class probability is used. The trigger threshold corresponding to this warning level Calculate the probability of triggering the early warning Trigger threshold Different settings can be made according to the tolerance of different warning levels. For example, the trigger threshold for a low-level warning can be set to 0.6, and the trigger threshold for a high-level warning can be set to 0.8. If the corrected prediction result does not maintain the same warning level for two consecutive prediction periods, the warning trigger probability is directly recorded as 0.

[0138] The system generates a corresponding warning level result based on the trigger probability and writes the AQI graded warning notification into the message queue for external emergency command platform to retrieve and execute, thereby completing the decoupled transmission of status.

[0139] An ambient air quality (AQI) tiered early warning system based on machine learning data includes:

[0140] The data acquisition module is used to acquire raw multi-source air monitoring data and obtain a windowed data representation;

[0141] The feature calculation module is used to calculate the current feature distribution and obtain the distribution change value;

[0142] The parameter update module is used to update the model parameters and obtain updated weights when the distribution change value exceeds a preset threshold.

[0143] The node embedding and subgraph pruning module is used to generate node embedding vectors for monitoring sites, calculate site importance scores, and obtain the preserved subgraph structure.

[0144] The graph aggregation prediction module is used to obtain AQI level prediction results and predicted AQI values ​​based on the retained subgraph structure;

[0145] The confidence level assessment module is used to perform confidence correction on the predicted AQI value that is higher than the preset level boundary and obtain the early warning trigger probability.

[0146] The early warning output module is used to output AQI-level early warning notifications based on the early warning trigger probability.

[0147] Based on the above method and process, this embodiment provides an ambient air quality (AQI) tiered early warning system based on machine learning data, such as... Figure 2 As shown; the system runs as the core backend processing engine of the municipal environmental monitoring center, and the modules achieve decoupling and collaboration through sharing status records and message queues;

[0148] The system's data acquisition module is responsible for acquiring raw multi-source air monitoring data from each monitoring station in real time. After completing timestamp alignment and replacing missing data with pre-values, it generates a standardized window data representation and writes it into the system data bus.

[0149] To address the normalization ratio required for feature calculation, the data acquisition module or feature calculation module first converts the window data representation into comparable non-negative feature strength statistics, and then performs normalization processing to avoid semantic conflicts caused by directly calculating the ratio of standardized results containing negative values.

[0150] The feature calculation module continuously monitors the data bus, reads the window data representation and calculates the difference between the current feature distribution and the historical baseline distribution, and updates the calculated distribution change value to the state machine. The current feature distribution and the historical baseline distribution are both obtained by normalizing the statistics of each feature intensity, and the calculation order is kept consistent with the method flow.

[0151] When the state machine determines that the distribution change value exceeds the preset threshold, the parameter update module is triggered and started. It generates updated parameters through orthogonal projection operation and merges them with the frozen backbone, and outputs the updated weights to the graph processing calculation unit. When the state machine determines that the distribution change value does not exceed the preset threshold, the parameter update module remains inactive. The system directly registers the frozen backbone weights as the effective weights at the current moment and outputs them to the graph processing calculation unit.

[0152] The node embedding and subgraph pruning module receives updated weights and window data representations, generates node embedding vectors for monitoring sites through a spatiotemporal heterogeneous graph encoder, maps node attention information, cache validity information and node change response information to the same dimension, calculates the site importance score, removes redundant nodes with low response, and outputs the retained subgraph structure, thereby concentrating computing resources on the core mutation region.

[0153] The graph aggregation prediction module performs feature splicing and attention aggregation based on the preserved subgraph structure, and transforms the calculated global feature vector representation into AQI level prediction results and predicted AQI values;

[0154] The confidence judgment module intercepts prediction results that are at the warning boundary. First, it performs confidence correction based on the smoothed results of the current category probability, the second highest category probability, and the most recent historical probability. Then, it calculates the final warning trigger probability based on the relative difference between the corrected category probability and the trigger threshold.

[0155] Finally, the early warning output module generates a structured AQI-level early warning notification based on the trigger probability and pushes it to the business interface of the front-end display platform or emergency system, completing the entire process flow from underlying data access to macro-level early warning issuance.

[0156] The above-described embodiments do not constitute a limitation on the scope of protection of this technical solution; any modifications, equivalent substitutions, and improvements made within the spirit and principles of the above embodiments should be included within the scope of protection of this technical solution.

Claims

1. A machine learning-based method for graded early warning of ambient air quality (AQI) based on ambient air monitoring data, characterized in that, include: A spatiotemporal heterogeneous graph and graph aggregation model are pre-constructed to obtain raw multi-source air monitoring data and complete outlier pruning, time alignment and missing value completion. Sliding window slicing and standardization are performed based on historical mean and historical standard deviation to obtain window data representation. The current feature distribution is calculated based on the window data representation and compared with the benchmark distribution formed by historical stable windows filtered from historical sliding windows to obtain the distribution change value; Determine whether the distribution change value exceeds a preset threshold. If so, update the model parameters of the pre-constructed graph aggregation model to obtain the updated weights. If not, use the pre-frozen backbone weights in the graph aggregation model as the updated weights. Based on the updated weights, the node embedding vectors of the monitoring stations are extracted, the station importance scores are calculated, and the pre-constructed spatiotemporal heterogeneous graph is cropped according to the station importance scores to obtain a retained subgraph structure. Based on the preserved subgraph structure, a spatiotemporal aggregated feature vector is generated and input into the pre-built graph aggregation model to obtain the AQI level prediction result, the corresponding category probability, and the predicted AQI value; When the predicted AQI value is higher than the preset level boundary, the confidence level of the category probability is corrected and the warning trigger probability is calculated to generate the corresponding warning level result and output the AQI level warning notification.

2. The AQI-based graded early warning method for ambient air monitoring data according to claim 1, characterized in that, The pre-constructed spatiotemporal heterogeneous graph and graph aggregation model acquires raw multi-source air monitoring data and performs outlier pruning, time alignment, and missing value completion. Based on historical mean and historical standard deviation, sliding window slicing and standardization are performed to obtain a windowed data representation, including: Outlier pruning and time alignment are performed on the raw multi-source air monitoring data to generate a valid air monitoring dataset. Missing values ​​are filled in based on the effective air monitoring dataset to obtain a regularized air monitoring dataset; The regularized air monitoring dataset is sliced ​​into sliding time windows and standardized based on historical mean and historical standard deviation to generate the windowed data representation.

3. The AQI-based graded early warning method for ambient air quality monitoring data according to claim 1, characterized in that, The current feature distribution is calculated based on the window data representation and compared with the baseline distribution formed by historical stable windows selected from historical sliding windows to obtain the distribution change value, including: Extract the current window feature normalization ratio vector from the window data representation; Select historical windows with stable distribution and continuous occurrence from the historical windows as historical stable windows, and extract the normalized proportion vector of historical stable windows; The difference between the current window feature normalized proportion vector and the historical stable window normalized proportion vector is calculated to obtain the feature distribution difference value; the distribution change value is determined based on the feature distribution difference value.

4. The AQI-based graded early warning method for ambient air monitoring data according to claim 1, characterized in that, Determine whether the distribution change value exceeds a preset threshold. If yes, update the model parameters of the pre-constructed graph aggregation model to obtain updated weights; otherwise, use the pre-frozen backbone weights in the graph aggregation model as the updated weights, including: Obtain the historical feature subspace basis matrix extracted from historical training data; When the distribution change value exceeds a preset threshold, the model parameters are updated based on the online update loss composed of unsupervised orthogonal feature reconstruction error and supervised prediction error, so as to obtain updated parameters to compensate for the current change. The updated parameters are fused with the frozen backbone weights to obtain the updated weights.

5. The AQI-based graded early warning method for ambient air monitoring data according to claim 1, characterized in that, Based on the updated weights, the node embedding vectors of the monitoring sites are extracted, the site importance scores are calculated, and the pre-constructed spatiotemporal heterogeneous graph is pruned according to the site importance scores to obtain a retained subgraph structure, including: Based on the window data representation and the update weight, the node embedding vector of each monitoring station is generated by the spatiotemporal heterogeneous graph encoder; The site importance score is calculated based on the node embedding vector, node attention information, cache expiration information, and node change response information. When a site's importance score is lower than a preset retention threshold, the corresponding node is determined to be a redundant node. The redundant nodes and their associated edges are deleted from the spatiotemporal heterogeneous graph to obtain the retained subgraph structure.

6. The AQI-based graded early warning method for ambient air monitoring data according to claim 1, characterized in that, Based on the preserved subgraph structure, a spatiotemporal aggregated feature vector is generated and input into a pre-constructed graph aggregation model to obtain the AQI level prediction result, the corresponding category probability, and the predicted AQI value, including: The node embedding vectors in the preserved subgraph structure are concatenated and mapped with the associated edge features to construct a spatiotemporal aggregated feature vector; The weight coefficients corresponding to each feature are determined based on the spatiotemporal aggregated feature vector and input into the pre-constructed graph aggregation model to obtain a global feature vector representation; The AQI level prediction result and the predicted AQI value are obtained based on the global feature vector representation.

7. The AQI-based graded early warning method for ambient air monitoring data according to claim 1, characterized in that, When the predicted AQI value is higher than the preset level boundary, the confidence level of the category probability is corrected and the warning trigger probability is calculated, including: Extract the category probability output value that matches the current prediction level; The confidence level of the category probability output value that matches the current prediction level is corrected based on the preset correction rules to obtain the corrected prediction result; When the corrected prediction result maintains the same warning level for a consecutive preset prediction period, the warning trigger probability is obtained based on the corrected category probability and the trigger threshold; when the corrected prediction result does not maintain the same warning level for a consecutive preset prediction period, the warning trigger probability is recorded as 0.

8. An ambient air quality (AQI) tiered early warning system based on machine learning data, used to execute the method as described in any one of claims 1-7, characterized in that, include: The data acquisition module is used to acquire raw multi-source air monitoring data and obtain a windowed data representation; The feature calculation module is used to calculate the current feature distribution and obtain the distribution change value; The parameter update module is used to update the model parameters to obtain updated weights when the distribution change value exceeds a preset threshold. The node embedding and subgraph pruning module is used to generate node embedding vectors for monitoring sites, calculate site importance scores, and obtain the preserved subgraph structure. The graph aggregation prediction module is used to obtain AQI level prediction results and predicted AQI values ​​based on the retained subgraph structure; The confidence level assessment module is used to perform confidence correction on the predicted AQI value that is higher than the preset level boundary and obtain the early warning trigger probability. The early warning output module is used to output AQI graded early warning notifications based on the early warning trigger probability.