Spatial-temporal prediction method and system for regional air quality based on state modulation attention mechanism
By introducing discrete physical state embedding and state modulation spatial attention mechanisms into the deep learning model, the problem of insufficient perception of physical mechanisms in air quality prediction is solved, achieving high-precision spatiotemporal prediction of air quality and improving the ability to capture extreme pollution processes and the adaptability of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU PONY TECHNOLOGY CO LTD
- Filing Date
- 2026-05-06
- Publication Date
- 2026-06-02
AI Technical Summary
Existing air quality forecasting technologies lack physical mechanism perception and cannot accurately simulate dynamic spatial transport characteristics, resulting in insufficient ability to capture extreme pollution processes. Furthermore, the static spatial interaction modeling cannot adapt to the dynamic directionality and state dependence of atmospheric pollution transport.
By introducing discrete physical state embedding and state modulation spatial attention mechanisms, the physical state perception capability of air pollution is explicitly injected into the deep learning model. The spatial influence weights are dynamically adjusted through the state modulation spatial attention module to achieve collaborative prediction.
It significantly improves the accuracy of regional air quality forecasting and the ability to capture extreme events, reduces computational resource consumption, adapts to different regions and pollution scenarios, and enhances the robustness and real-time performance of the model.
Smart Images

Figure CN122133113A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the interdisciplinary field of atmospheric environment monitoring and artificial intelligence prediction, specifically to a spatiotemporal prediction method and system for regional air quality that integrates physical state constraints and dynamic spatial attention mechanisms. Background Technology
[0002] With the acceleration of urbanization, regional joint prevention and control of air pollution has become a core requirement for environmental governance. Accurate and real-time air quality forecasting is crucial for formulating control measures and protecting public health. Existing air quality forecasting technologies are mainly divided into two categories:
[0003] One type is numerical models based on physicochemical equations. Their core advantage lies in their ability to simulate atmospheric physical transport and chemical reaction processes. However, this type of method is extremely sensitive to initial fields and boundary conditions, and it suffers from the drawbacks of consuming huge computational resources and having long computation time, making it difficult to meet the requirements of high-resolution, real-time forecasting.
[0004] Another type is data-driven models based on statistics or deep learning, which are widely used to overcome the limitations of numerical models. Their technical optimization mainly focuses on two directions: First, optimizing the model framework, such as fusing graph convolution and long short-term memory networks to extract spatiotemporal features, using bidirectional gated recurrent units to learn temporal coherence, and using dual attention mechanisms combined with boosting trees for regression; Second, optimizing input information, such as introducing multi-source data such as meteorology, aerosols, and traffic flow to construct a unified spatiotemporal dataset, or generating gridded data through spatial interpolation to adapt to scenarios with uneven distribution of monitoring stations.
[0005] However, existing data-driven models still have significant technical bottlenecks: on the one hand, they lack physical mechanism perception, treating pollutant concentrations as purely numerical sequences and ignoring the physical state transitions during the pollution process (such as static accumulation and cold air clearance), causing the models to tend to predict the "average state" and lack the ability to capture the start and end times and extreme concentrations of extreme pollution processes; on the other hand, spatial interaction modeling is static, mostly based on building fixed adjacency matrices based on geographical distance, which cannot adapt to the dynamic directionality (dominated by real-time wind fields) and state dependence (high-concentration source areas have a stronger impact on transmission), resulting in limited accuracy of regional collaborative prediction.
[0006] Therefore, there is an urgent need for a high-precision spatiotemporal prediction technology that integrates physical constraints and dynamic spatial interaction features. Summary of the Invention
[0007] This invention provides a spatiotemporal prediction method and system for regional air quality based on a state modulation attention mechanism. It addresses the problems of traditional deep learning models lacking explicit perception of the physical processes of atmospheric pollution, being unable to distinguish between different dynamic states such as "static accumulation" and "cold air clearance", resulting in insufficient ability to capture explosive pollution and rapid clearance processes, and the inability of static graph structures to characterize the spatial transport characteristics that dynamically change with meteorological conditions.
[0008] The core technology of this invention is to explicitly inject the physical state perception capability of air pollution into the deep learning model by introducing discrete physical state embedding and state modulation spatial attention mechanism, so as to achieve collaborative prediction of dynamically adjusting spatial influence weights according to the pollution status of source sites.
[0009] In a first aspect, the present invention provides a spatiotemporal prediction method for regional air quality based on a state modulation attention mechanism, the method comprising the following steps: S1. Data Construction: Obtain historical monitoring data and meteorological forecast data from multiple monitoring stations within the target area, and construct spatiotemporal characteristic data; S2, State Mapping: Based on pollutant concentration data and meteorological data from monitoring stations, determine the physical state labels corresponding to each historical moment, and map the physical state labels into state embedding vectors; S3. Temporal Coding and State Injection: The time encoder is used to extract long-range temporal dependency features from historical monitoring data to generate historical context features, and the state embedding vector corresponding to the last frame of the historical moment is injected into the decoder initialization process as the initial physical state feature. S4. Spatiotemporal Decoding and State Modulation: Autoregressive prediction is performed by combining the decoder with meteorological forecast data. At each time step of the prediction, the spatial interaction characteristics between monitoring stations in the region are calculated through the state modulation spatial attention module. S5. Multi-task prediction: Based on the output features of the decoder, it simultaneously generates predicted values of pollutant concentrations at future times and the corresponding probability distributions of physical states. In step S4, when calculating spatial interaction features, the spatial attention weights are modulated using the state embedding vector of the source station, so that the physical state of the source station directly affects its attention contribution to the target station.
[0010] Furthermore, the state modulation spatial attention module calculates spatial attention weights in the following ways: Calculate the content matching score between the query vector of the query site and the key vector of the source site; The state bias term is calculated based on the state embedding vector of the source site and the learnable state modulation matrix. Calculate geomask items based on geographical distance between sites; The content matching score, state bias, and geomask are superimposed and normalized to obtain the final spatial attention weight.
[0011] Furthermore, the physical state labels include at least the clean state, the outbreak state, the accumulation state, the dissipation state, and the oscillation state; The specific steps of state mapping include: Set a cleanliness threshold, a pollution threshold, a concentration change rate threshold, and a wind speed threshold; based on whether the pollutant concentration exceeds the cleanliness threshold, the change rate of the first-order difference of the pollutant concentration, and the wind speed conditions, discretize the continuous monitoring values into the above physical state labels.
[0012] Furthermore, the time encoder adopts a Transformer structure based on a self-attention mechanism to process data within the historical time window in parallel; the decoder adopts a gated recurrent unit structure. The specific method of state injection is as follows: Extract the state embedding vector corresponding to the physical state label at the last moment of the historical time window, and add it to the historical context features output by the time encoder after linear projection, as the initial hidden state of the gated loop unit.
[0013] Furthermore, in step S5, multi-task prediction includes: Regression task: Use the regression head to predict the mean and logarithmic variance of pollutant concentrations, assuming that the prediction error follows a Gaussian distribution; Classification task: Use the classification head to predict the probability distribution of the current station belonging to each physical state.
[0014] Furthermore, it also includes a model training step, in which the model is optimized using a joint loss function, which is obtained by weighted summation of regression loss, state classification loss, knowledge distillation loss, and physical trend loss.
[0015] Furthermore, the calculation process for knowledge distillation loss includes: Construct a teacher model with the same structure as the student model used for prediction, and update its parameters by an exponential moving average of the student model parameters. The KL divergence between the softened state probability distribution output by the teacher model and the softened state probability distribution output by the student model is calculated and used as the knowledge distillation loss.
[0016] Furthermore, the physical trend loss is used in the constraint dissipation process, and its calculation method is as follows: Only when the true physical state label of the sample is dissipation state, the mean square error between the predicted pollutant concentration and the actual observed value is calculated and used as the physical trend loss.
[0017] Furthermore, in the data construction step, the input data of the decoder only includes meteorological data and time and location codes from the numerical model forecast data, and does not include the actual values of pollutant concentrations at future times; the numerical model forecast data includes boundary layer height, temperature and humidity.
[0018] Secondly, the present invention provides a regional air quality spatiotemporal prediction system based on a state modulation attention mechanism, comprising: The data construction module is used to acquire historical monitoring data and meteorological forecast data from multiple monitoring stations within the target area to construct spatiotemporal characteristic data; The state mapping module is used to determine the physical state label corresponding to each historical moment based on pollutant concentration data and meteorological data from monitoring stations, and to map the physical state label into a state embedding vector. The temporal coding module is used to extract long-range temporal dependency features of historical monitoring data using the time encoder to generate historical context features, and inject the state embedding vector corresponding to the last frame of the historical moment into the decoder to initialize the hidden state. The spatiotemporal decoding module is used to perform autoregressive prediction using the decoder and includes a state-modulated spatial attention unit. The unit dynamically modulates the spatial attention weights using the state embedding vector of the source site to calculate spatial interaction features. The multi-task prediction module is used to simultaneously output the predicted pollutant concentration and the probability distribution of physical states at future time steps based on the output features of the decoder.
[0019] The main contributions and innovations of this invention are as follows: 1. Significantly enhanced physical interpretability: By explicitly defining the physical states of pollution (outbreak, accumulation, dissipation, etc.) and the state injection mechanism, the model can perceive atmospheric dynamic stages, avoiding the blindness of purely data-driven models; 2. More accurate spatial transport modeling: The state modulation attention mechanism can dynamically amplify the weight of high-impact factors according to the pollution status of the source site, which is in line with the physical laws of atmospheric transport and greatly improves the accuracy of regional collaborative prediction; 3. Outstanding ability to capture extreme events: Multi-task learning and hybrid architecture overcome the smoothing effect of prediction curves, significantly improving the prediction accuracy of the start and end times and extreme concentrations of heavy pollution processes; 4. Excellent real-time performance and generalization: Compared with numerical models, it significantly reduces the consumption of computing resources, while adapting to different regions and different pollution scenarios, and has a wide range of applications; 5. Enhanced model robustness: By employing knowledge distillation and physical trend constraint loss, the model's learning of state transition information is strengthened, thereby improving the prediction stability under complex weather conditions.
[0020] Details of one or more embodiments of the present invention are set forth in the following drawings and description, so that other features, objects and advantages of the invention will be more readily understood. Attached Figure Description
[0021] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart of the overall process architecture of the method of the present invention (corresponding to step S1). Figure 2 This is a flowchart of the logical determination process for the physical state definition in this invention (corresponding to step S2). Figure 3 This is a schematic diagram of the time encoder in the present invention (corresponding to step S3). Figure 4 This is a schematic diagram of the state injection and initialization module in the present invention (corresponding to step S4). Figure 5 This is a flowchart of the single-step update of the decoder in this invention (corresponding to step S5); Figure 6 This is a schematic diagram of the computational principle of the core component of the present invention, the "state modulation spatial attention module" (corresponding to step S5). Figure 7 This is a schematic diagram of the teacher-student knowledge distillation training strategy in this invention (corresponding to step S7). Figure 8 This is a schematic diagram of the multi-task joint loss function calculation principle in this invention (corresponding to step S7). Detailed Implementation
[0022] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0023] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0024] Example 1 This embodiment provides a spatiotemporal prediction method for regional air quality based on a state modulation attention mechanism. This method primarily addresses the problem that existing data-driven models lack physical sensing mechanisms and cannot accurately simulate dynamic spatial transmission. For example... Figure 1 As shown, the overall process of this method includes data construction, encoding and state injection, spatiotemporal decoding core processing, and multi-task prediction output.
[0025] I. Data Construction and Preprocessing S1. Data Construction: First, acquire multi-source data from N air quality monitoring stations within the target area. Data sources include: 1. Historical monitoring data: Pollutant observation values (such as PM2.5), wind speed and wind direction observation values over a period of time (such as the past 120 hours).
[0026] 2. Numerical model forecast data: Numerical weather forecast (NWP) data for the corresponding time period and future forecast periods (such as the next 168 hours), including boundary layer height, temperature and humidity, etc.
[0027] 3. Geographic topology data: Latitude and longitude coordinates of each monitoring station, used to calculate the spherical distance between stations.
[0028] Next, define the history backtracking window. (This example uses 120 hours) and future prediction window (This example uses 168 hours), and then two core tensors are constructed: Encoder input tensor It includes historical observations and historical meteorological data.
[0029] Decoder input tensor .
[0030] in: Represents the set of real numbers; Indicates batch size; Indicates the number of monitoring stations; This indicates the input feature dimension, which includes observed values, simulated values, and their deviation features. This represents the feature dimension of the decoder.
[0031] It should be noted that, in order to prevent information leakage, It should only include future numerical weather forecast data and time location codes, and is strictly prohibited from including future actual pollutant concentrations.
[0032] II. Physical State Mapping and Vectorization S2. State Mapping: To enable the neural network to perceive physical processes, this embodiment is based on... Figure 2 The logic shown discretizes continuous monitoring values into physical state tags. A set of states is defined. , respectively corresponding to: (Clean): Concentration less than the clean threshold (like ).
[0033] (Breakout Onset): Concentration exceeds the cleanup threshold. And the concentration rises rapidly (rate of change) ).
[0034] (Accumulated concentration): The concentration is at a high level. Furthermore, the changes are gradual, indicating static and steady accumulation.
[0035] (Decay dissipates): Concentration drops rapidly ( If the wind speed is greater than the threshold and the concentration decreases, it indicates a cold air clearance or strong wind process.
[0036] (Trans): A transition state that does not meet the above conditions.
[0037] in: , These are the cleaning threshold and the contamination threshold (e.g.) and ); , , These are the threshold values for the rate of change when the rate of change is increasing, stabilizing, or dissipating, respectively. Wind speed threshold (e.g.) ).
[0038] The calculated discrete state index is used in the embedding layer. Mapped to dense state embedding vectors:
[0039] in: For state embedding vectors, As an embedding dimension, this vector is used to characterize the implicit physical properties of different pollution states.
[0040] III. Timing Coding and State Injection S3, Timing Coding: such as Figure 3As shown, a time encoder based on a Transformer structure is used to process historical input tensors. Long-range temporal dependencies are captured using a multi-head self-attention mechanism. The last frame of the encoder output sequence is extracted as the historical context feature matrix. .
[0041] In this embodiment, the last frame of the encoder output sequence is taken as the historical context feature matrix. :
[0042] in: As the hidden layer dimension of the model, this matrix condenses historical pollution evolution information over the past 120 hours.
[0043] S4. State Injection: such as Figure 4 As shown, in order to introduce physical priors at the prediction starting point, this embodiment performs a state injection operation.
[0044] 1. Extract the physical state label at the last moment of the history window (T=0). Generate the corresponding state vector .
[0045] 2. For example Figure 4 As shown, the state vector is linearly projected and then superimposed onto the history context matrix. Generate the initial hidden state of the decoder :
[0046] in: This is a linear projection matrix used to align the feature dimensions. This step ensures that the decoder explicitly utilizes the information from the current physical contamination stage at the starting point of generation.
[0047] This step ensures that the decoder "knows" the current physical state from the beginning (e.g., it is currently in the midst of a pollution outbreak).
[0048] IV. Spatiotemporal Decoding and State Modulation (Core Steps) This step uses a gated recurrent unit for autoregressive generation, and introduces the core of this invention—the state modulation spatial attention mechanism—at each step.
[0049] S5. Spatiotemporal Decoding and State Modulation: A gated cyclic unit (GRU) is used as the decoder skeleton for time-by-time autoregressive prediction. For example... Figure 5 As shown, at each time step t of decoding, in addition to the timing update of the GRU itself, a "state modulation spatial attention module" is introduced. Figure 6 To aggregate spatial information.
[0050] Among them, in the future In each prediction step, the gated loop unit receives the weather forecast features at the current moment. and the implicit state of the previous moment Update to obtain the current implicit state .
[0051] The core of this module lies in calculating the attention weight between the target site i and the source site j. The calculation formula proposed in this embodiment is as follows: ,
[0052]
[0053] in: These are the query vector and key vector generated based on the current implicit state, respectively. , This is the corresponding weight matrix.
[0054] Scaling factor, usually taken as... The square root of.
[0055] The physical state embedding vector of source site j represents the physical state of pollution at the source. This is the key innovation of this invention.
[0056] The physical meaning of the state modulation projection matrix is that if the station In a "burst state" The output will have a larger positive bias, thus increasing its weight in the attention it receives.
[0057] Technical effect: Item As a bias term, the attention score is dynamically adjusted. For example, when the source site j is in a "burst state", this term outputs a large positive value, causing the downstream site i to automatically give site j a higher attention weight, thereby simulating the transmission impact of a high-concentration pollution cloud.
[0058] Geographical distance attenuation factor, defined as . The geographic masking term, based on geographic distance decay, forces the model to ignore sites that are too far away. (Tending towards negative infinity). Finally, the weights are obtained through Softmax normalization. :
[0059] in: Spatial attention weight. Represents the source site. For the target site The degree of influence coefficient. If Larger, indicating the source site Pollution transmission to target sites It has made significant contributions.
[0060] Normalized exponential function. This represents the unnormalized attention score. Convert to a probability distribution form to ensure that the sum of the weights of all source sites is 1.
[0061] Based on this, a weighted sum is performed to obtain the spatial context features, and the implicit state of the current step is updated. .
[0062] In this embodiment, spatial information is aggregated according to weights: .
[0063] Update the hidden state using residual connections and layer normalization:
[0064] in: Source site In the The intermediate implicit states of the prediction step. These are initially updated by the gated loop unit in step S51 and have not yet incorporated spatial interaction information; Value vector projection matrix. Maps the latent state of the source site to the feature space, used for the actual transmission and aggregation of information; : Spatial context vector, representing the comprehensive pollution transmission information received by the station from the entire region at the current moment; Local implicit state, i.e., target site Its own evolutionary characteristics (e.g., local emission accumulation); The updated final implicit state, which integrates local evolution information and external transmission information, is used for final prediction; Layer normalization is used to improve numerical stability.
[0065] V. Multi-task prediction and joint optimization S6, Multi-task prediction: The decoder's output layer contains two branches (e.g., ... Figure 1 (As shown at the bottom) 1. Regression head: Using the regression head from The mean of predicted pollutant concentrations Sum of logarithmic variance This invention assumes that the prediction error follows a Gaussian distribution.
[0066] 2. Classification Head: Use the classification head to predict the probability distribution of the site belonging to one of the five physical states at the current moment. .
[0067] S7. Joint Optimization: To train the above model, this embodiment constructs a joint loss function (such as...). Figure 8 (as shown)
[0068] in: (Gaussian regression loss, global regression loss): Optimize the accuracy of numerical prediction and estimate uncertainty.
[0069] (Multi-class cross-entropy loss): Ensures that the model can correctly classify physical states.
[0070] (Knowledge distillation loss): such as Figure 7 As shown, a "teacher model" is introduced whose parameters are not updated via backpropagation but only by the exponential moving average (EMA) of the student model parameters. The KL divergence between the student and teacher output probability distributions is calculated. This helps to uncover fuzzy boundary information (hidden knowledge) between states.
[0071] (Physical Trend Loss): This is a conditional constraint loss. The mean squared error between the predicted and actual values is calculated only when the true label is "Decay". This forces the model to pay more attention to the downward trend of the values during the contamination cleanup phase (which is often the most difficult part of prediction).
[0072] In this embodiment, global regression loss This value is used to optimize the accuracy of numerical predictions of pollutant concentrations. The smaller the value, the more accurate the model's predictions and the more reasonable the estimate of the error range. The calculation formula is as follows:
[0073] in: The value refers to the actual observed concentration at that specific moment and station. The mean concentration predicted by the model, i.e., the value that the model considers most likely; The variance of the concentration predicted by the model represents the degree of uncertainty the model has about its predictions.
[0074] In this embodiment, multi-class cross-entropy loss This is used to optimize the classification accuracy of physical states. It measures the difference between the state probability distribution predicted by the model and the actual physical state labels (discrete integer indices). The calculation formula is:
[0075] in: This is the label for the actual state. It is a discrete integer index. The probability distribution of the state predicted by the model.
[0076] In this embodiment, knowledge distillation loss See also Figure 7 The introduction of a knowledge distillation mechanism aims to utilize teacher models to uncover implicit "hidden knowledge" in the data, such as fuzzy transition information between states.
[0077] Teacher Model Construction: Construct a teacher model with the same structure as the student model (the current model to be trained). Parameters of the teacher model. Instead of updating via backpropagation, it updates via student model parameters. The exponential moving average is updated using the following formula:
[0078] in: This is the smoothing coefficient (e.g., 0.999). To train the number of steps.
[0079] The loss calculation formula is as follows:
[0080] in: The raw Logits outputs are the classification header outputs for the student model and the teacher model, respectively. (Temperature) is a temperature parameter. ), used to soften the probability distribution; This is the Kullback-Leibler divergence function, used to measure the difference between two probability distributions; This is the gradient scaling factor.
[0081] In this embodiment, physical trend loss : Represents a conditional constraint loss, specifically designed to enhance the model's ability to fit the pollutant "dissipation / removal" process. Its calculation formula is as follows:
[0082] in: This indicates an indicator function that takes the value 1 when the condition within the parentheses is met, and 0 otherwise; the condition... This indicates that the sample is included in the calculation only if its true state is a "dissipated state"; The mean squared error between the predicted and actual values; To prevent the minimum value where the denominator is zero.
[0083] Example 2 To verify the effectiveness of the regional air quality spatiotemporal prediction method based on state modulation attention mechanism proposed in this invention, this embodiment selected real environmental data for simulation experiments and compared it with a variety of mainstream benchmark models.
[0084] 1. Experimental setup Dataset: The study area is a basin-like urban cluster in southwestern China.
[0085] Training set duration: January 1, 2023 to November 30, 2025; The test set spans from December 1, 2025 to December 31, 2025 (with a focus on the period of frequent heavy pollution in winter).
[0086] Input configuration: History backtracking window Hours, future forecast window Hours (7 days).
[0087] Evaluation indicators: NME (Normalized Mean Error): Measures the overall bias of numerical predictions; the lower the value, the better. CSI (Critical Success Index): Measures the success rate of capturing critical physical processes such as "Onset" and "Decay" states; a higher value is better.
[0088] 2. Comparison Model (Baselines) To demonstrate the superiority of this invention, the following three models were selected as benchmarks for comparison: LSTM: A traditional long short-term memory network that uses only time-series observation data for end-to-end prediction; Transformer: A standard self-attention mechanism model, which does not include the state injection and state modulation modules of this invention; GC-LSTM: A spatiotemporal prediction model that combines graph convolution (based on static distance graphs) with LSTM.
[0089] 3. Analysis of Experimental Results (1) Comparison of numerical accuracy Table 1 shows the PM values for each model in the next 24 hours (short-term) and 168 hours (long-term). 2.5 Comparison of Nominal Estimation Error (NME). As the prediction step size increases, the errors of all models rise. However, the model of this invention exhibits an error of only 31.2% in the long-term prediction of 168 hours, significantly outperforming the static graph-based GC-LSTM (42.5%). This is mainly attributed to the state-modulated spatial attention mechanism of this invention, which dynamically adjusts the transport weights according to the "outbreak" state of upstream cities, thereby more accurately simulating the advection transport process of the pollution plume in long-term predictions.
[0090] Table 1. Comparison of prediction errors of different models (NME %)
[0091] (2) Comparison of physical state capture capabilities For predicting the "onset and end times" of heavy pollution events, the focus is on examining the model's classification accuracy for the "onset" and "decay" states. This invention achieves a CSI index of 0.71 for the "decay" state, significantly exceeding that of the comparative models. This demonstrates the effectiveness of the loss function strategy employed in this invention. Traditional models often suffer from overly smooth prediction curves due to their "regression to the mean" characteristic, making them unable to predict the sharp drops in concentration during cold air intrusions. This invention, however, successfully enhances the model's ability to predict significant concentration fluctuations through explicit physical state constraints.
[0092] Table 2 Comparison of Extreme Process Capability (CSI Index)
[0093] (3) Analysis of ablation experiments on physical state mapping mechanism To further verify the effectiveness of the core innovation of this invention—the "physical state mapping and injection mechanism"—this embodiment constructs a variant model (stateless) for ablation experiments.
[0094] This invention (complete model): adopts the complete scheme proposed in this invention, including physical state discretization, state vector injection, and state modulation spatial attention mechanism.
[0095] Variant Model (Stateless): The physical state mapping module is removed. Specifically, historical data is not discretized into states, and no state embedding vectors are generated; the decoder initialization depends only on the output of the temporal encoder; the spatial attention module degenerates into standard dot product attention (without state bias terms). ).
[0096] Table 3 shows a performance comparison between the present invention and the variant model under different pollution scenarios. Experimental results show that the model's predictive performance significantly decreased after the physical state mapping mechanism was removed. Firstly, the ability to capture extreme values deteriorated drastically. Without explicit state vectors (such as "outburst" and "dissipation"), the variant model struggled to distinguish the physical nature of "slow concentration fluctuations" from "drastic concentration changes." Its outburst state capture decreased from 0.68 to 0.46, and its dissipation state capture decreased from 0.71 to 0.41, indicating that the model degenerated into a smooth model that tends to predict average values, losing sensitivity to extreme pollution events. Secondly, long-term errors increased. The overall NME error increased from 31.2% to 39.4%. This confirms the crucial role of the present invention's "state modulation attention mechanism" in regional transport modeling—without state vectors as bias terms to dynamically amplify the weight of upstream high-pollution sources, the model cannot accurately simulate the directional transport process of polluted air masses.
[0097] Table 3 Performance Ablation Comparison with and without Physical State Mapping
[0098] 4. Conclusion Experimental results show that the method proposed in this invention not only outperforms existing mainstream models in terms of conventional numerical prediction accuracy, but more importantly, it has significant advantages in the process forecasting (start and end times, extreme points) of heavy pollution weather. It verifies the effectiveness of the physical state injection and state modulation attention mechanism, which is a necessary means to endow deep learning models with "physical perception ability". It plays a decisive role in improving the forecasting success rate of turning point weather and has important engineering application value.
[0099] Example 3 This embodiment also provides a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including the regional air quality spatiotemporal prediction method based on a state modulation attention mechanism according to Embodiment 1.
[0100] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0101] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0102] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 1 Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.
[0103] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0104] The above embodiments are merely illustrative of several implementations of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the appended claims.
Claims
1. A spatiotemporal prediction method for regional air quality based on a state modulation attention mechanism, characterized in that, Includes the following steps: S1. Data Construction: Obtain historical monitoring data and meteorological forecast data from multiple monitoring stations within the target area, and construct spatiotemporal characteristic data; S2. State Mapping: Based on pollutant concentration data and meteorological data from monitoring stations, determine the physical state labels corresponding to each historical moment, and map the physical state labels into state embedding vectors; S3. Temporal Coding and State Injection: The time encoder is used to extract long-range temporal dependency features from historical monitoring data to generate historical context features, and the state embedding vector corresponding to the last frame of the historical moment is injected into the decoder initialization process as the initial physical state feature. S4. Spatiotemporal Decoding and State Modulation: Autoregressive prediction is performed by combining the decoder with meteorological forecast data. At each time step of the prediction, the spatial interaction characteristics between monitoring stations in the region are calculated through the state modulation spatial attention module. S5. Multi-task prediction: Based on the output features of the decoder, it simultaneously generates predicted values of pollutant concentrations at future times and the corresponding probability distributions of physical states. In step S4, when calculating spatial interaction features, the spatial attention weights are modulated using the state embedding vector of the source station, so that the physical state of the source station directly affects its attention contribution to the target station.
2. The regional air quality spatiotemporal prediction method as described in claim 1, characterized in that, The state modulation spatial attention module calculates spatial attention weights in the following ways: Calculate the content matching score between the query vector of the query site and the key vector of the source site; The state bias term is calculated based on the state embedding vector of the source site and the learnable state modulation matrix. Calculate geomask items based on geographical distance between sites; The content matching score, the state bias term, and the geographic mask term are superimposed and normalized to obtain the final spatial attention weight.
3. The regional air quality spatiotemporal prediction method as described in claim 2, characterized in that, The physical state labels include at least the clean state, the outbreak state, the accumulation state, the dissipation state, and the oscillation state; The specific steps of the state mapping include: Set a cleanliness threshold, a pollution threshold, a concentration change rate threshold, and a wind speed threshold; based on whether the pollutant concentration exceeds the cleanliness threshold, the change rate of the first-order difference of the pollutant concentration, and the wind speed conditions, discretize the continuous monitoring values into the above physical state labels.
4. The regional air quality spatiotemporal prediction method as described in claim 1, characterized in that, The time encoder adopts a Transformer structure based on a self-attention mechanism to process data within the historical time window in parallel; the decoder adopts a gated loop unit structure. The specific method of state injection is as follows: Extract the state embedding vector corresponding to the physical state label at the last moment of the historical time window, and add it to the historical context features output by the time encoder after linear projection, as the initial hidden state of the gated loop unit.
5. The regional air quality spatiotemporal prediction method as described in claim 1, characterized in that, In step S5, multi-task prediction includes: Regression task: Use the regression head to predict the mean and logarithmic variance of pollutant concentrations, assuming that the prediction error follows a Gaussian distribution; Classification task: Use the classification head to predict the probability distribution of the current station belonging to each physical state.
6. The regional air quality spatiotemporal prediction method as described in claim 5, characterized in that, It also includes a model training step, in which a joint loss function is used to optimize the model. The joint loss function is obtained by weighted summation of regression loss, state classification loss, knowledge distillation loss and physical trend loss.
7. The regional air quality spatiotemporal prediction method as described in claim 6, characterized in that, The calculation process for knowledge distillation loss includes: Construct a teacher model, the structure of which is the same as that of the student model used for prediction, and update its parameters by an exponential moving average of the student model parameters; The KL divergence between the softened state probability distribution output by the teacher model and the softened state probability distribution output by the student model is calculated and used as the knowledge distillation loss.
8. The regional air quality spatiotemporal prediction method as described in claim 6, characterized in that, The physical trend loss is used to constrain the dissipation process, and its calculation method is as follows: Only when the true physical state label of the sample is dissipation state, the mean square error between the predicted pollutant concentration and the actual observed value is calculated and used as the physical trend loss.
9. The regional air quality spatiotemporal prediction method as described in claim 6, characterized in that, In the data construction step, the input data of the decoder only includes meteorological data and time location codes from the numerical model forecast data, and does not include the actual values of pollutant concentrations at future times; the numerical model forecast data includes boundary layer height, temperature and humidity.
10. A spatiotemporal prediction system for regional air quality based on a state modulation attention mechanism, characterized in that, include: The data construction module is used to acquire historical monitoring data and meteorological forecast data from multiple monitoring stations within the target area to construct spatiotemporal characteristic data; The state mapping module is used to determine the physical state label corresponding to each historical moment based on pollutant concentration data and meteorological data from monitoring stations, and to map the physical state label into a state embedding vector. The temporal coding module is used to extract long-range temporal dependency features of historical monitoring data using the time encoder to generate historical context features, and inject the state embedding vector corresponding to the last frame of the historical moment into the decoder to initialize the hidden state. The spatiotemporal decoding module is used to perform autoregressive prediction using the decoder and includes a state-modulated spatial attention unit, which dynamically modulates spatial attention weights using the state embedding vector of the source site to calculate spatial interaction features. The multi-task prediction module is used to simultaneously output the predicted pollutant concentration and the probability distribution of physical states at future time steps based on the output features of the decoder.