A federated air quality prediction method and system fusing dual-graph structure

By integrating a federated air quality forecasting method with a dual-graph structure, the problem of characterizing multi-period time dependence and complex spatial propagation relationships in air quality forecasting is solved. This enables multi-site collaborative forecasting without sharing data, thereby improving the robustness of forecasting and data privacy protection.

CN123158554APending Publication Date: 2026-11-24FUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611475507.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively characterize the multi-period time dependence and complex spatial propagation relationships of air quality sequences without sharing raw air quality data, and to adapt to different change patterns, resulting in insufficient robustness of multi-step air quality forecasts.

Method used

A federated air quality prediction method employing a dual-graph structure is proposed. This method utilizes a multi-period temporal modeling module and adaptive graph spatial modeling, combined with a federated learning framework, to achieve collaborative prediction across multiple sites. Specific steps include: the client extracts and compresses multi-period temporal features; the server constructs a predefined graph and an adaptive graph for spatial modeling; the client fuses spatiotemporal features; and a multi-branch prediction structure is used to generate prediction results.

Benefits of technology

It improves the multi-step forecasting robustness of air quality forecasts, takes into account multi-scale time dependence, complex spatial propagation relationships and different change patterns, protects data privacy and reduces communication overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123158554A_ABST
    Figure CN123158554A_ABST
Patent Text Reader

Abstract

The application discloses a kind of federal air quality prediction method and system of fusion double graph structure, the method includes: multiple clients obtain local air quality historical observation sequence, utilize multiple cycle time modeling module to generate compressed local time hidden representation, only upload model parameter and local time hidden representation, do not upload original data;Server constructs pre-defined graph according to site geographical position, and learns adaptive graph according to local time hidden representation, obtains spatial enhancement features by double graph space modeling and returns client;Client fuses time features and spatial enhancement features, generates future multi-step AQI prediction by using trend prediction, residual prediction and direct prediction branch and gate fusion;Server federated aggregation model parameters and synchronously updates double graph module.The application protects data privacy, reduces communication overhead while taking into account multi-cycle time dependence and dynamic spatial propagation relationship, adapts to different air quality change patterns, improves multi-step prediction accuracy and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of air quality prediction technology, specifically relating to a federal air quality prediction method and system that integrates a dual-graph structure. Background Technology

[0002] With the continuous advancement of urbanization, air pollution has become an increasingly prominent problem. Air quality has become a key factor affecting urban ecology, public health, and social governance. As an important indicator comprehensively reflecting the degree of air pollution, the Air Quality Index (AQI) intuitively describes the regional air pollution level and its changing trends. Accurate prediction of the AQI not only helps to identify pollution risks in advance and provides a reference for public travel and health protection, but also provides support for pollution early warning, environmental governance, and public decision-making. Therefore, constructing accurate and reliable air quality prediction models has significant research significance and application value.

[0003] Air quality forecasting is essentially a complex multivariate spatiotemporal series forecasting problem. On the one hand, air quality series are influenced by various factors such as traffic emissions, industrial production, meteorological conditions, and human activities, typically exhibiting short-term trends and sudden fluctuations. On the other hand, different air quality monitoring stations are not independent of each other; pollutants may spread between different regions through atmospheric diffusion, regional transport, and local emission changes, resulting in complex spatial dependencies between stations. Therefore, simultaneously characterizing the temporal evolution and spatial propagation relationships in air quality data is a key factor in improving forecast accuracy. In recent years, deep learning-based methods have achieved good results in air quality forecasting tasks. Compared to classical statistical models and machine learning-based methods, deep learning models can automatically learn complex nonlinear relationships from historical observation data, thereby reducing reliance on manual feature engineering. However, air quality forecasting in real-world scenarios still faces the following key challenges.

[0004] (1) Multi-scale time dependence and sudden fluctuations are difficult to characterize. Air quality series usually contain multi-scale time patterns such as short-term continuous changes, daily cycles, weekly cycles and long-term trends, and there may be complex coupling relationships between different cycles. When pollution accumulation, meteorological changes or local emission anomalies occur, AQI series will also show obvious non-stationarity and suddenness. Classical time modeling methods are difficult to capture the characteristics of periodicity, long-term dependence and local changes at the same time, which leads to excessive error accumulation in multi-step prediction.

[0005] (2) Complex spatial propagation relationships are difficult to model accurately. Air pollution has obvious spatial diffusion characteristics. The spatial correlation of air quality between monitoring stations is affected not only by geographical distance, but also by dynamic factors such as wind direction, meteorological conditions, industrial structure, and distribution of pollution sources. Constructing a fixed graph structure based solely on geographical distance is insufficient to capture long-distance pollution transmission and dynamic potential correlations; while relying solely on adaptive graph learning may lack stable spatial prior constraints and is easily affected by local noise and abnormal fluctuations.

[0006] (3) Cross-site collaboration and privacy protection are difficult to balance in federated scenarios. Faced with the ever-increasing requirements for data security and privacy protection, centralized processing methods face problems such as difficulty in sharing raw data and high risk of privacy leakage in air quality prediction. The emerging federated learning (FL) can achieve multi-site collaborative training without sharing raw data, but most existing federated learning-based prediction methods focus on local time modeling and parameter aggregation, usually ignoring the spatial propagation information between different monitoring stations, making it difficult to make full use of cross-site pollution diffusion relationships to improve global prediction performance.

[0007] (4) Different air quality change patterns affect forecast stability. Air quality changes can manifest as steady increases or decreases, or as rapid fluctuations and sudden changes. A single forecasting strategy is difficult to adapt to short-term continuous changes, trend shifts, and complex nonlinear fluctuations simultaneously. For example, extrapolating using recent trends is beneficial for maintaining short-term stability, but its adaptability is limited when facing sudden changes; while directly outputting future forecasts based on historical spatiotemporal characteristics can learn complex mapping relationships, but may lack trend constraints in steady-change scenarios. Therefore, how to adaptively adjust the forecasting strategy according to different change patterns is the key to improving the robustness of multi-step forecasts.

[0008] Therefore, there is an urgent need for a multi-site collaborative forecasting method that can simultaneously characterize multi-period time dependence and dynamic spatial propagation relationships without sharing raw data, and adapt to different air quality change patterns. Summary of the Invention

[0009] The purpose of this invention is to overcome the shortcomings of the prior art and provide a federated air quality prediction method and system that integrates a dual-graph structure. This addresses the technical challenges of how to achieve multi-site collaborative prediction without sharing raw air quality data, simultaneously characterize the multi-period time dependence and complex spatial propagation relationship of air quality sequences, and adaptively adjust prediction strategies according to different air quality change patterns to improve the robustness of multi-step prediction.

[0010] To achieve the above objectives, the present invention adopts the following technical solution: a federal air quality prediction method integrating a dual-map structure, comprising the following steps:

[0011] S1. Multiple clients respectively obtain historical observation sequences from local air quality monitoring stations. The historical observation sequences include air quality indicators, air pollutant variables, and time period characteristics.

[0012] S2. Each client uses the multi-period time modeling module to extract time features from the local historical observation sequence, generates a compressed local time implicit representation, and uploads the local model parameters and the local time implicit representation to the server, without uploading the original historical observation sequence.

[0013] S3. The server constructs a predefined map based on the geographical location of each monitoring station, and learns an adaptive map based on the local temporal implicit representation uploaded by each client. The predefined map is used to describe the stable geographical proximity relationship between monitoring stations, and the adaptive map is used to describe the dynamic potential association relationship between monitoring stations.

[0014] S4. The server performs bi-graph spatial modeling on the local temporal latent representation based on the predefined graph and the adaptive graph to obtain spatially enhanced features, and returns the spatially enhanced features to the corresponding client;

[0015] S5. Each client fuses local time features with spatial enhancement features returned by the server to perform spatiotemporal feature fusion, and uses a multi-branch prediction structure to generate air quality prediction results for multiple future time steps.

[0016] S6. The server performs federated aggregation of the local model parameters uploaded by each client, updates the global model, and synchronously updates the dual-graph space modeling module. The above steps are repeated until the training stopping condition is met.

[0017] Further, in step S2, the multi-period time modeling module includes:

[0018] A linear mapping is performed on the input historical observation sequence to project the original features into a high-dimensional space;

[0019] Perform a Fast Fourier Transform on the projected high-dimensional time series to obtain its frequency domain representation and calculate its frequency domain amplitude.

[0020] Select the k main frequencies with the largest amplitudes, and calculate the corresponding period lengths based on the main frequencies;

[0021] For each period, the time series is reorganized into a two-dimensional periodic structure, and the time features corresponding to that period are extracted using two-dimensional convolution.

[0022] The time features corresponding to multiple periods are weighted and fused. The weights of the weighted fusion are determined according to the importance of each period feature to the prediction task, so as to highlight the main periodic structure and suppress weak periods and noise.

[0023] Multi-period fusion features are input into the temporal attention layer. Attention weights for different time steps are determined based on the similarity between the query matrix and the key matrix. This makes the model pay more attention to historical segments that have a significant impact on future air quality changes, resulting in enhanced temporal features that serve as local temporal latent representations.

[0024] Furthermore, the client retains only the periodic pattern information corresponding to the k main frequencies with the largest amplitudes after frequency domain analysis, and generates a compressed local time implicit representation through a time coding network. The local time implicit representation does not contain complete time series details, and the dimension of the local time implicit representation is lower than that of the original historical observation sequence, so as to reduce the communication overhead between the client and the server and reduce the risk of leakage of the original air quality data.

[0025] Further, in step S3, the construction of the predefined graph includes:

[0026] The Haversine formula was used to calculate the geographical distance between monitoring stations;

[0027] The adjacency weight between stations is calculated based on the geographical distance and the distance decay coefficient, and the adjacency weight decreases as the geographical distance between stations increases;

[0028] The adjacency weights are normalized to obtain the normalized adjacency matrix of the predefined graph. The normalized adjacency matrix is ​​used for spatial propagation to reflect the stable prior of pollutant diffusion along geographical proximity.

[0029] Based on the normalized adjacency matrix, spatial propagation of the local temporal implicit representation is performed to obtain predefined graph propagation features.

[0030] Further, in step S3, the learned adaptive graph includes:

[0031] Calculate the query matrix and key matrix based on the local temporal implicit representations uploaded by each client;

[0032] Calculate the attention score between nodes based on the query matrix and the key matrix;

[0033] The attention score is Softmax normalized to obtain the adjacency matrix of the adaptive graph;

[0034] Based on the adjacency matrix of the adaptive graph, the local temporal implicit representation is spatially propagated to obtain the adaptive graph propagation features;

[0035] The adaptive graph dynamically constructs an adjacency matrix based on the attention relationship between the local temporal latent representations of each site, in order to capture potential correlations such as long-distance pollution transmission or regional synchronous changes in pollution beyond geographical relationships.

[0036] Further, in step S4, the dual-graph space modeling includes:

[0037] Obtain predefined graph propagation features and adaptive graph propagation features respectively;

[0038] The predefined graph propagation features and the adaptive graph propagation features are weighted and fused to obtain dual-graph fusion features;

[0039] The dual-graph fusion features are sequentially subjected to linear transformation, residual connection, and layer normalization to obtain spatial enhancement features;

[0040] The dual-graph fusion uses learnable weights to weight predefined graph propagation features and adaptive graph propagation features, making stable geographical priors and dynamic potential associations complementary, and enhances training stability through residual connections and layer normalization.

[0041] Further, in step S5, the spatiotemporal feature fusion includes:

[0042] Local temporal features and spatial augmentation features are weighted and fused to obtain preliminary fused features;

[0043] The local temporal features and spatial augmented features are concatenated, and temporal feature weights and spatial feature weights are generated through a gating network.

[0044] Based on the time feature weights and spatial feature weights, the local time features and spatial enhanced features are gated and weighted to obtain gated fusion features;

[0045] The preliminary fusion feature and the gated fusion feature are fused and layer-normalized to obtain the spatiotemporal fusion feature;

[0046] The spatiotemporal feature fusion employs both static weighted fusion and dynamic gating fusion, and adaptively adjusts the contribution ratio of temporal and spatial features according to different temporal and spatial conditions.

[0047] Furthermore, in step S5, the multi-branch prediction structure includes a trend prediction branch, a residual prediction branch, and a direct prediction branch;

[0048] The trend prediction branch constructs a short-term trend prior based on the change and direction of the most recent time step. Based on the change of air quality index in the two most recent time steps in the historical observation sequence, and taking the current air quality index as a benchmark, it extends to the future according to the prediction step length to obtain the trend prediction result.

[0049] The residual prediction branch uses the current air quality index as a reference benchmark, learns the increment or decrement of each future time step relative to the current state, predicts the change of each future time step relative to the current air quality index based on the spatiotemporal fusion characteristics, and adds the change to the current air quality index to obtain the residual prediction result.

[0050] The direct prediction branch does not explicitly rely on the current air quality index as a benchmark. Instead, it directly learns the nonlinear mapping relationship between historical sequences and future air quality based on deep spatiotemporal fusion features. Based on the spatiotemporal fusion features, it directly outputs the absolute prediction values ​​of air quality indexes for multiple future time steps, thus obtaining the direct prediction result.

[0051] The trend prediction results, residual prediction results, and direct prediction results are adaptively fused through a gating mechanism to obtain the final air quality prediction result.

[0052] Furthermore, the gating mechanism calculates the fusion weights corresponding to the three prediction branches based on the spatiotemporal fusion characteristics. After being normalized by Softmax, the fusion weights are weighted and summed with the trend prediction result, residual prediction result, and direct prediction result to obtain the final air quality prediction result. The gating mechanism adaptively adjusts the importance of the trend prediction branch, residual prediction branch, and direct prediction branch according to the air quality change pattern, strengthening the weight of the trend prediction branch during stable changes and strengthening the weight of the direct prediction branch during sudden fluctuations.

[0053] Further, in step S6, the federated aggregation includes:

[0054] The server sends the current global model parameters to each client.

[0055] Each client uses local historical observation sequences for local training, updates local model parameters, and generates corresponding local temporal latent representations;

[0056] The server collects local model parameters uploaded by each client, and uses a federated average algorithm to aggregate them weighted according to the number of training samples of each client to obtain updated global model parameters. The more samples a client has, the greater its contribution to the global model update.

[0057] The server synchronously updates the adaptive graph and dual-graph spatial modeling module based on the local temporal implicit representations uploaded by each client.

[0058] Furthermore, the method assigns higher weight to the loss of the short-term prediction step during training and constrains the magnitude of adjacent changes in the first two prediction steps to enhance the model's ability to characterize short-term trends.

[0059] Furthermore, the method can be used for air quality forecasting, pollution early warning, regional pollution transmission analysis, environmental governance decision-making, or public health protection.

[0060] This invention also provides a federal air quality forecasting system that integrates a dual-graph structure to implement the above-described method, comprising:

[0061] Multiple clients, each corresponding to an air quality monitoring station, are configured to acquire local historical observation sequences, generate compressed local temporal latent representations using a multi-period time modeling module, upload local model parameters and the local temporal latent representations to the server, without uploading the original historical observation sequences; and are configured to perform spatiotemporal feature fusion of local time features and spatial enhancement features returned by the server, and generate air quality prediction results for multiple future time steps using a multi-branch prediction structure.

[0062] The server is configured to construct a predefined map based on the geographical location of each monitoring station, learn an adaptive map based on the local temporal latent representation uploaded by each client, perform dual-graph spatial modeling on the local temporal latent representation based on the predefined map and the adaptive map, obtain spatially enhanced features and return them to the corresponding client; and perform federated aggregation on the local model parameters uploaded by each client, update the global model and synchronously update the dual-graph spatial modeling module.

[0063] Compared with the prior art, the present invention has the following beneficial effects:

[0064] 1. This invention uses a multi-period time modeling module to automatically identify the main periodic structures through frequency domain analysis. Combined with two-dimensional convolution and time attention, it can adaptively extract multi-scale time dependencies, enhance the ability to express periodic patterns, long-term trends and local mutations, thereby alleviating the problem of error accumulation in multi-step prediction.

[0065] 2. This invention uses a dual-graph spatial modeling approach, which combines a predefined graph and an adaptive graph. It utilizes geographical distance to construct stable spatial priors and dynamically learns potential associations based on local temporal implicit representations. This approach can more comprehensively characterize pollutant propagation relationships while taking into account both the stability and dynamism of spatial relationships.

[0066] 3. This invention utilizes a federated learning framework, where the client only uploads the compressed local temporal latent representation and model parameters, without uploading the original air quality data. This achieves multi-site collaborative training while protecting data privacy and reducing communication overhead.

[0067] 4. This invention, through a multi-branch structure and gating fusion of trend prediction, residual prediction and direct prediction, can adaptively adjust the weights of each branch according to the air quality change pattern, taking into account stable trends, trend deviations and sudden fluctuations, and improving the robustness of multi-step prediction. Attached Figure Description

[0068] Figure 1 This is a schematic diagram of the framework of the Federal Air Quality Forecasting Method (FedDGAQ) with fused dual-graph structure provided in an embodiment of the present invention.

[0069] Figure 2 This is an ablation experiment diagram of FedDGAQ on the A city dataset in an embodiment of the present invention.

[0070] Figure 3 This is an ablation experiment diagram of FedDGAQ on the B city dataset in an embodiment of the present invention.

[0071] Figure 4 This is a visualization of AQI predictions for the monitoring station in City A's botanical garden, as shown in this embodiment of the invention.

[0072] Figure 5 This is a sensitivity analysis diagram of the number of main cycles in an embodiment of the present invention.

[0073] Figure 6 This is a sensitivity analysis diagram of the number of neighboring graphs in an embodiment of the present invention. Detailed Implementation

[0074] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0075] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0076] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0077] I. Technical Solution

[0078] 1.1 Problem Definition

[0079] Air quality forecasting typically involves multiple monitoring stations and various environmental variables. Its changes are influenced by factors such as the cumulative effect of historical pollutants, inter-regional pollution diffusion, and meteorological changes. Therefore, it can be modeled as a multivariate spatiotemporal series forecasting problem.

[0080] This invention considers an air quality monitoring network comprising N monitoring stations, each of which can be viewed as a client. For the... Each station, in time step The observed environmental variables can be represented as:

[0081] (1)

[0082] in, This indicates the input feature dimension, including AQI and PM. 2.5 PM 10 Air pollutant variables such as NO2, CO, O3, and SO2, as well as time period characteristics such as hours and days of the week.

[0083] Given a historical time window length of The i-th station at time The historical input sequence can be represented as:

[0084] (2)

[0085] The objective of this invention is to predict the future based on historical observation sequences. AQI changes at each time step. The prediction target for each site is defined as:

[0086] (3)

[0087] in, This indicates that the i-th station will be in the future. The actual AQI at each time step, This indicates the prediction step size.

[0088] For all monitoring stations, the historical input sequence can be represented as:

[0089] (4)

[0090] Accordingly, the prediction target is defined as:

[0091] (5)

[0092] Therefore, the multi-site air quality prediction task can be formally represented as learning a mapping function. It can predict future multi-step AQI based on historical multivariate observation sequences, and is defined as:

[0093] (6)

[0094] in, Indicates the prediction result. Indicates model parameters.

[0095] The goal of model training is to minimize the error between the predicted and true values, which is defined as:

[0096] (7)

[0097] in, This represents the prediction loss function.

[0098] 1.2 Method Overview

[0099] like Figure 1 As shown, to address the complex time dependencies, spatial propagation relationships, and data privacy protection issues in air quality prediction, this invention proposes a novel Federated Dual-Graph Air Quality prediction method (FedDGAQ) that integrates a dual-graph structure. It adopts a client-server collaborative architecture and mainly includes client-side temporal feature extraction, server-side dual-graph spatial modeling, spatiotemporal feature fusion, prediction output, and federated aggregation.

[0100] Specifically, the federal air quality prediction method that integrates a dual-graph structure includes the following steps:

[0101] S1. Multiple clients respectively obtain historical observation sequences from local air quality monitoring stations. The historical observation sequences include air quality indicators, air pollutant variables, and time period characteristics.

[0102] S2. Each client uses the multi-period time modeling module to extract time features from the local historical observation sequence, generates a compressed local time implicit representation, and uploads the local model parameters and the local time implicit representation to the server, without uploading the original historical observation sequence.

[0103] S3. The server constructs a predefined map based on the geographical location of each monitoring station, and learns an adaptive map based on the local temporal implicit representation uploaded by each client. The predefined map is used to describe the stable geographical proximity relationship between monitoring stations, and the adaptive map is used to describe the dynamic potential association relationship between monitoring stations.

[0104] S4. The server performs bi-graph spatial modeling on the local temporal latent representation based on the predefined graph and the adaptive graph to obtain spatially enhanced features, and returns the spatially enhanced features to the corresponding client;

[0105] S5. Each client fuses local time features with spatial enhancement features returned by the server to perform spatiotemporal feature fusion, and uses a multi-branch prediction structure to generate air quality prediction results for multiple future time steps.

[0106] S6. The server performs federated aggregation of the local model parameters uploaded by each client, updates the global model, and synchronously updates the dual-graph space modeling module. The above steps are repeated until the training stopping condition is met.

[0107] The specific implementation of FedDGAQ proposed in this invention is shown in Algorithm 1.

[0108]

[0109]

[0110] 1.3 Client-side time feature extraction

[0111] Air quality series typically exhibit significant periodic variations. Examples include diurnal variations caused by traffic emissions and weekly variations resulting from industrial production. Furthermore, multi-scale coupling relationships exist between different pollutants, giving time series complex nonlinear characteristics. Referring to the multi-period modeling concept of TimesBlock in TimesNet, a multi-period time modeling module is designed to automatically identify the main periodic structures in the series and extract multi-scale time-dependent features. Specifically, the input series is linearly mapped, projecting the original features into a high-dimensional space. This process is defined as follows:

[0112] (8)

[0113] in, This represents the input mapping weight matrix. This is the bias vector.

[0114] 1.3.1 Periodic Testing

[0115] To automatically identify periodic structures in time series, the high-dimensional time series is first processed. Performing a Fast Fourier Transform (FFT) yields the corresponding frequency domain representation, which is defined as follows:

[0116] (9)

[0117] Furthermore, the frequency domain amplitude is calculated, and it is defined as:

[0118] (10)

[0119] in, For frequency The corresponding amplitude, For operations involving the modulus of complex numbers.

[0120] Next, select the one with the largest amplitude. The primary frequency can be expressed as:

[0121] (11)

[0122] Finally, the corresponding cycle length is calculated based on the main frequency, and it is defined as follows:

[0123] (12)

[0124] in, Indicates the first The length of each main cycle Indicates the corresponding main frequency. This indicates the length of the input time series.

[0125] It should be noted that the client does not upload the original air quality time series; it only retains the data with the largest amplitude after frequency domain analysis. The periodic pattern information corresponding to each main frequency is used to generate a local temporal latent representation through a time-coding network. Since the uploaded information only contains the main periodic features and is encoded and compressed, but does not contain complete time series details, the server cannot directly recover the original air quality data, thus avoiding potential privacy risks.

[0126] 1.3.2 Periodic Rearrangement and Convolution Modeling

[0127] For each cycle The time series is reorganized into a two-dimensional periodic structure, which is defined as:

[0128] (13)

[0129] in, Indicates the length of a single cycle.

[0130] Subsequently, periodic features are extracted using two-dimensional convolution, which are defined as follows:

[0131] (14)

[0132] in, This represents a two-dimensional convolution operation. This represents the time characteristic corresponding to the j-th period.

[0133] This process can simultaneously capture intra-cycle dependencies and long-term correlations between cycles. Furthermore, multiple cycle features are weighted and fused, defined as follows:

[0134] (15)

[0135] in, For the first Weights of periodic features The number of main cycles.

[0136] 1.3.3 Temporal Attention Modeling

[0137] To further enhance the modeling capability for long-term dependencies, this invention introduces a lightweight temporal attention layer after the multi-period modeling module. First, the temporal features H output by the multi-period modeling module are mapped to a query matrix, a key matrix, and a value matrix, which are defined as follows:

[0138] (16)

[0139] (17)

[0140] (18)

[0141] in, For querying the matrix, The key matrix, It is a value matrix. , and This represents the learnable mapping parameters.

[0142] Next, the correlation weights between different time steps are calculated based on scaled dot product attention, and are defined as follows:

[0143] (19)

[0144] in, This represents the time attention matrix. This is a scaling factor used to stabilize the training process.

[0145] Finally, the value matrix is ​​weighted and summed using attention weights to obtain the enhanced temporal features, defined as follows:

[0146] (20)

[0147] The above design can adaptively allocate attention weights based on the correlation between different time steps, making the model pay more attention to historical segments that have an important impact on future AQI changes, thereby enhancing its ability to express long-term dependencies, local trend changes and cyclical fluctuations.

[0148] 1.4 Server Dual-Graph Space Modeling

[0149] Air pollution exhibits significant spatial propagation characteristics. For example, pollutants may spread along wind directions and create correlations across multiple regions. Therefore, relying solely on time-series modeling is insufficient to fully capture the patterns of air quality variation. Existing studies typically rely on predefined maps for spatial feature modeling, easily overlooking dynamic relationships formed by factors such as meteorological conditions, regional industrial activities, and cross-regional pollution diffusion. While adaptive graphs can dynamically model node relationships, they are susceptible to local noise interference due to the lack of stable spatial prior constraints. Therefore, this invention employs a collaborative modeling approach using both predefined and adaptive graphs to balance the stability and dynamism of spatial relationships.

[0150] 1.4.1 Predefined Graph Construction

[0151] A predefined map is used to depict the physical spatial relationships between monitoring stations. This invention uses the Haversine formula to calculate the great circle distance between stations. Specifically, the stations... and The geographical distance between them is defined as:

[0152] (twenty one)

[0153] (twenty two)

[0154] in, and Representing the sites Latitude and longitude.

[0155] Next, the adjacency weight is defined as:

[0156] (twenty three)

[0157] in, For the adjacency weights of a predefined graph, This is the distance attenuation coefficient.

[0158] Subsequently, the adjacency matrix is ​​normalized, and it is defined as follows:

[0159] (twenty four)

[0160] Finally, the spatial propagation process can be represented as:

[0161] (25)

[0162] in, Indicates time characteristics, This represents the spatial characteristics after propagation of a predefined graph. This represents the spatial propagation mapping matrix.

[0163] The constructed predefined map can effectively reflect the physical diffusion process of pollutants in space, enabling the model to establish stable spatial dependencies using real geographic information.

[0164] 1.4.2 Adaptive Graph Learning

[0165] While predefined graphs can represent geospatial relationships, actual air pollution propagation is influenced by various factors such as meteorological conditions, industrial emissions, and traffic flow. Therefore, relying solely on a fixed spatial structure is insufficient to accurately reflect highly dynamic relationships. To address this, referencing the adaptive modeling concept of dynamic graphs, this invention introduces an adaptive graph learning mechanism to dynamically construct an adjacency matrix based on node characteristics. Specifically, the query matrix and key matrix are first calculated, defined as follows:

[0166] (26)

[0167] (27)

[0168] in, and These represent the learnable parameter matrices.

[0169] Next, the attention score is defined as:

[0170] (28)

[0171] in, Represents a node and The strength of the association.

[0172] Subsequently, the adjacency matrix is ​​defined as:

[0173] (29)

[0174] Finally, spatial propagation is performed to obtain the adaptive graph propagation features, which are defined as:

[0175] (30)

[0176] This mechanism can capture potential connections beyond traditional geographical relationships (such as long-distance pollution transport or synchronous changes in regional pollution), thereby improving the model's ability to model complex spatial relationships.

[0177] 1.4.3 Dual-image fusion

[0178] In obtaining the propagation characteristics of the predefined graph With adaptive graph propagation features Then, these two types of spatial information need to be fused. Specifically, dual-image fusion is defined as:

[0179] (31)

[0180] in, and This represents the learnable fusion weights.

[0181] Subsequently, a linear transformation and residual connection are introduced, which enhances model training stability and avoids the gradient vanishing problem. This process is defined as follows:

[0182] (32)

[0183] in, For linear mapping, For layer normalization.

[0184] 1.5 Spatiotemporal Feature Fusion

[0185] In obtaining time characteristics Spatial features Subsequently, these two types of features need to be effectively fused. Since air quality changes are influenced by time dependence and spatial diffusion factors to varying degrees across different time periods, a fixed fusion method is insufficient to adapt to complex air quality evolution patterns. Therefore, this invention further designs a dynamic gating fusion mechanism. Specifically, a weighted fusion is first performed, defined as:

[0186] (33)

[0187] in, and This represents the learnable fusion weights.

[0188] Subsequently, the input features for gated fusion are constructed, defined as follows:

[0189] (34)

[0190] in, This represents the feature splicing operation.

[0191] Next, the weights are calculated using a gating network, and they are defined as follows:

[0192] (35)

[0193] in, This represents the weight vector generated by the gating network. and These represent the gating weights corresponding to temporal and spatial features, respectively.

[0194] Furthermore, gating fusion can be represented as:

[0195] (36)

[0196] Finally, the spatiotemporal fusion feature is defined as:

[0197] (37)

[0198] The above design combines static weight fusion and dynamic gating fusion, enabling the model to adaptively adjust the feature contribution ratio according to different time and space conditions, thereby improving the stability and generalization ability of the prediction model.

[0199] 1.6 Predicted Output

[0200] After obtaining the spatiotemporal characteristics of the fusion Subsequently, air quality needs to be predicted for multiple future time steps based on this feature. Air quality changes exhibit both short-term continuity and can be abruptly altered by factors such as meteorological conditions, traffic flow, and industrial emissions. Therefore, using only a single prediction structure is insufficient to simultaneously account for stable trends and complex nonlinear changes. To address this, this invention designs a multi-branch prediction structure on the client side, consisting of a trend prediction branch, a residual prediction branch, and a direct prediction branch. A gating mechanism is used to adaptively fuse different prediction results, thereby improving the model's prediction stability and robustness. Specifically, the nonlinear mapping of the fused features can be expressed as:

[0201] (38)

[0202] in, For the mapping weight matrix, For bias vectors, This represents the Gaussian error linear activation function.

[0203] 1.6.1 Trend Forecasting

[0204] Air quality series typically exhibit strong short-term continuity, meaning that AQI changes between adjacent time steps are not entirely random but maintain a similar direction of change over a short period. For example, if the current AQI is trending upward compared to the previous time step, it may continue to rise in the near future; conversely, if the current AQI is trending downward, it may continue this trend in the near future. Therefore, this invention first constructs a trend prediction branch to characterize the short-term inertial changes in the air quality series. Specifically, the trend of the most recent time step can be expressed as:

[0205] (39)

[0206] in, and These are the AQI values ​​for the current time and the previous time, respectively. It represents the change in AQI between the two most recent time steps, reflecting the direction and magnitude of short-term changes in current air quality.

[0207] Based on this, the trend prediction branch uses the current AQI value Based on the most recent change Extending the predicted step size forward to the future, thus obtaining the future number... The trend prediction result at each time step is defined as follows:

[0208] (40)

[0209] in, Indicates the future prediction step size. This represents the AQI value at the last time step of the input sequence.

[0210] The trend prediction branch is not directly used to fit complex nonlinear relationships. Instead, it constructs a short-term trend prior based on local changes in AQI at adjacent time steps, providing a stable baseline prediction result for future multi-step predictions. This branch can explicitly characterize the continuity and inertia of air quality series changes over short time scales, enabling the model to maintain good trend consistency in scenarios such as steady fluctuations, slow increases, or decreases. In subsequent gating fusion processes, the contribution of the trend prediction branch can be adaptively adjusted according to spatiotemporal characteristics. When air quality changes are relatively stable, increasing the weight of the trend branch can enhance prediction stability; when sudden fluctuations or complex nonlinear changes occur, more reliance is placed on residual prediction and direct prediction branches to dynamically correct the baseline prediction result.

[0211] 1.6.2 Residual Prediction

[0212] The trend forecasting branch extrapolates future AQI based on the direction of change in the most recent time step, making it suitable for situations where changes are relatively consistent in the short term. However, air quality changes are typically influenced by multiple factors, including pollutant dispersion, changes in meteorological conditions, regional emission fluctuations, and traffic activities. Therefore, future AQI may not always follow the recent linear trend. Thus, relying solely on the trend forecasting branch is insufficient to fully characterize potential trend shifts and nonlinear changes that may occur over multiple forecast steps.

[0213] To this end, this invention further designs a residual prediction branch to learn the change in future AQI relative to the current state. Unlike directly predicting the absolute value of future AQI, the residual prediction branch uses the current AQI as a reference benchmark, focusing on predicting the increment or decrease at each future time step relative to the current state. This allows the model to pay more attention to the direction and magnitude of air quality changes. Specifically, the residual prediction branch is based on the fused spatiotemporal features. To predict the change in AQI at each future time step relative to the current AQI, it is defined as:

[0214] (41)

[0215] in, This is the residual prediction weight matrix. This is the bias vector.

[0216] Therefore, the residual prediction results It can be represented as:

[0217] (42)

[0218] The role of the residual prediction branch is to dynamically correct the current AQI benchmark. When future air quality improves, the model learns positive residuals; when future air quality declines, the model learns negative residuals; when future air quality changes are relatively stable, the model learns a near-zero residual correction term, ensuring that the prediction results mainly remain near the current AQI benchmark. Therefore, this branch can intuitively depict the rise, fall, and shift of AQI within the future prediction window. Furthermore, because the absolute values ​​of AQI vary significantly across different stations and time periods, it is difficult to directly predict future values. Residual prediction shifts the modeling focus to relative changes, reducing the impact of absolute numerical scale differences on model training and allowing the model to learn air quality change patterns more stably.

[0219] 1.6.3 Direct Prediction

[0220] To some extent, the trend prediction and residual prediction branches still rely on the current AQI state. While this enhances the model's ability to model short-term continuous changes and relative trend changes, it may have limitations when facing sudden pollution events, rapid rises and falls, and complex nonlinear fluctuations, as simply relying on the current state for extrapolation or correction may have certain limitations. To enhance the model's ability to express complex nonlinear changes, this invention further designs a direct prediction branch, which does not explicitly rely on the current AQI as a prediction benchmark, but directly uses the fused spatiotemporal characteristics. Output the predicted values ​​for multiple future time steps, defined as:

[0221] (43)

[0222] in, To directly predict the weight matrix, For bias vectors, This is a direct prediction result.

[0223] Unlike the residual prediction branch, the direct prediction branch outputs the absolute predicted value of the future AQI, rather than the change relative to the current AQI. Therefore, this branch does not require... Instead of using a baseline correction process, this branch fully utilizes deep spatiotemporal fusion features to learn the nonlinear mapping relationship between historical sequences, periodic patterns, spatial propagation relationships, and future air quality. This branch significantly enhances the model's adaptability to sudden changes in pollution and complex nonlinear fluctuations, and effectively complements the trend prediction and residual prediction branches.

[0224] 1.6.4 Predictive Gating Fusion

[0225] Considering the importance of different prediction branches in different scenarios, this invention designs a gating mechanism to dynamically fuse the three types of prediction results. Specifically, the gating weights are first calculated, defined as follows:

[0226] (44)

[0227] in, For the gated weight matrix, These are the fusion weights corresponding to the three prediction branches.

[0228] Therefore, the final prediction result is defined as:

[0229] (45)

[0230] The predicted gating fusion can adaptively adjust the importance of each prediction branch according to different air quality change patterns. Specifically, the trend prediction branch enhances short-term prediction stability, the residual prediction branch models long-term trend changes, and the direct prediction branch captures complex nonlinear changes and sudden pollution events. Through collaborative prediction of these three branches and dynamic gating fusion, the model can balance the modeling of stable trends and complex changes, thereby improving the accuracy and robustness of air quality prediction.

[0231] 1.7 Federal Aggregation

[0232] To protect the privacy of air quality monitoring data, this invention uses the FL framework for model training. Specifically, the air quality monitoring network includes... There are 1 client, and each client corresponds to 1 monitoring station. The client only stores and uses air quality data locally and does not upload the raw observation sequences to the server. In the 1st... Before the first round of federated training, the server first sends global model parameters to each client. Next, each client uses local historical air quality data to perform multi-period time modeling to generate a local temporal implicit representation as follows:

[0233] (46)

[0234] in, Indicates the first Local input sequences of each client, This indicates the client-side time feature extraction network. This indicates that the i-th client is in the i-th position. The temporal characteristics of round generation.

[0235] Next, the client uploads the local time hidden representation after multi-cycle encoding and compression. After collecting the local temporal implicit representations uploaded by all clients, the server uses a predefined graph and an adaptive graph to model spatial relationships, which is defined as follows:

[0236] (47)

[0237] in, This represents the implicit representation of local time uploaded by all clients. This represents the feature representation after the bi-graph space enhancement.

[0238] After the server returns the spatial augmentation features to the corresponding client, the client further fuses the temporal and spatial features to complete the air quality prediction and updates the model parameters based on local data, which is defined as:

[0239] , (48)

[0240] in, Indicates the first The model parameters are updated locally on each client.

[0241] After all clients have completed local training, the server uses the FedAvg algorithm to perform global parameter aggregation, which is defined as:

[0242] (49)

[0243] in, Indicates the first The number of training samples per client. Indicates the first The global model parameters after round aggregation.

[0244] Meanwhile, the server-side dual-graph spatial enhancement module updates synchronously based on the local temporal implicit representation uploaded by the client, thereby continuously optimizing the model's ability to model spatial relationships. Through this federated training mechanism, the model can achieve multi-site collaborative training without sharing raw air quality data, improving air quality prediction performance while protecting data privacy.

[0245] 2. Experimental Evaluation

[0246] Based on real air quality datasets, this embodiment comprehensively evaluates the performance of the proposed FedDGAQ through numerous experiments.

[0247] 2.1 Dataset

[0248] The dataset used in this embodiment comes from the National Urban Air Quality Real-time Release Platform of the China National Environmental Monitoring Centre. The dataset contains hourly air quality observation data from multiple air quality monitoring stations, consisting of AQI and concentration information of various air pollutants, reflecting the temporal dynamics and spatial propagation characteristics of air quality changes. This embodiment selects air quality datasets from two cities, A and B, for experiments, as shown in Table 1. The AQI variance of the A city dataset is high, indicating that its air quality series fluctuates significantly, exhibiting obvious sudden and non-stationary changes. The AQI variance of the B city dataset is relatively low, indicating that its air quality changes are more stable. Therefore, the two datasets can respectively correspond to high-fluctuation, sudden scenarios and relatively stable scenarios. It should be noted that both datasets have significant data quality issues. Both datasets have high row and overall missing rates, and some time periods contain consecutive missing data, synchronous missing data from multiple stations, and abnormal observations caused by sensor malfunctions. These issues increase the difficulty of air quality prediction tasks and provide a basis for verifying the predictive performance and robustness of the model under different fluctuation characteristics and complex data quality conditions. Based on this, the performance of the proposed FedDGAQ can be evaluated from the perspective of different data characteristics.

[0249] Table 1 Air quality datasets for two cities

[0250]

[0251] 2.2 Evaluation Indicators

[0252] This embodiment uses Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE) as the main evaluation metrics. Specifically, MAE measures the average absolute error between the predicted and actual values, intuitively reflecting the overall prediction error level of the model. The smaller the MAE, the more accurate the model's prediction results; it is defined as follows:

[0253] (50)

[0254] RMSE measures the root mean square of the prediction error. Compared to MAE, RMSE is more sensitive to large errors and better reflects the prediction stability of the model under scenarios of abnormal air quality changes. It is defined as follows:

[0255] (51)

[0256] 2.3 Comparison Methods

[0257] To verify the superiority of the proposed FedDGAQ, this embodiment compares it with the following benchmark methods.

[0258] (1) XGBoost: A traditional machine learning model based on gradient boosting trees, which achieves nonlinear regression prediction through ensemble learning.

[0259] (2) LightGBM: An ensemble learning model based on decision trees, which uses a leaf-first growth strategy and histogram algorithm to construct a regression tree.

[0260] (3) LSTM+FedAvg A federated time series prediction model based on LSTM is used, with FedAvg for global parameter aggregation.

[0261] (4) DLinear+FedAvg: A federated time series forecasting model based on a linear decomposition structure, which achieves long-term dependency modeling through trend decomposition.

[0262] (5) DCRNN: Diffusion Convolutional Recurrent Neural Network, which uses graph convolution and recurrent structure to jointly model spatiotemporal dependencies.

[0263] (6) MTGNN: Multivariable Time Graph Neural Network, which learns the potential relationships between variables through a dynamic graph structure.

[0264] (7)ASTGCN: Attention Spatiotemporal Graph Convolutional Network, which jointly models spatiotemporal features through spatial and temporal attention.

[0265] (8) FEDformer: A long sequence prediction model based on frequency domain enhancement and sequence decomposition structure, which can model long-term time dependencies.

[0266] (9) FedGRU: A federated time series prediction model based on GRU, which models time dependencies through GRU and uses FedAvg for global parameter aggregation.

[0267] (10) CNFGNN: Cross-node federated graph neural network, which deploys time and space dependency modeling on the client and server respectively, and adopts an alternating optimization strategy to achieve federated spatiotemporal prediction. (11) FedASTA: Federated adaptive spatiotemporal attention model, extracts time relationships and trend patterns on the client side, and constructs an adaptive spatiotemporal perception graph on the server side to model the spatial dependencies between nodes.

[0268] (12) FedOSTC: Online spatiotemporal related federated prediction model, which uses GRU to extract local time patterns, models the spatial correlation between clients through graph attention network, and uses periodic perception aggregation mechanism to update the global model. (13) FedSTGD: Federated dynamic spatiotemporal graph learning model, which models spatial dependencies between clients through nonlinear computation decomposition and node embedding enhancement mechanism.

[0269] 2.4 Parameter Settings

[0270] To ensure fairness in the experiment, this embodiment uses the same data partitioning method and prediction settings for all models. Specifically, the input sequence length is 48, and the output sequence length is 6, meaning that air quality monitoring data from the past 48 hours is used to predict AQI changes over the next 6 hours. The dataset is divided into training, validation, and test sets in chronological order, with a ratio of 60%, 20%, and 20%, respectively. All input features are Z-score standardized, and the prediction results are back-normalized to the original AQI scale during the testing phase. For the FedDGAQ proposed in this invention, the hidden feature dimension is 96, the feedforward network dimension is 192, the multi-period time modeling module based on TimesBlock has 1 layer, and the number of main periods is 3. The time attention module uses 8 attention heads with a dropout rate of 0.1. In the dual-graph spatial modeling part, both the predefined graph and the adaptive graph retain the 8 nearest neighboring stations with the highest correlation for each station, with a geographical distance decay coefficient of 100. During training, both the client and server sides use the AdamW optimizer. The client learning rate is... The server-side learning rate is The weight decay coefficient is The batch size is 64. The maximum number of federated training rounds is 40, and an early stopping mechanism is adopted, stopping training when the validation set loss does not decrease for 8 consecutive rounds. In addition, to improve short-term prediction performance, this embodiment adopts a short-term prediction weighting strategy in the loss function and constrains the adjacent change magnitudes of the first two prediction steps to enhance the model's ability to characterize short-term trends.

[0271] 2.5 Comparative Experiment

[0272] This embodiment compares the proposed FedDGAQ with various typical air quality prediction methods on real datasets. Tables 2-5 show the prediction results of different models on two datasets for the 1-6 hour forecast task. Specifically, Tables 2 and 3 compare the MAE and RMSE of different methods on the City A dataset; Tables 4 and 5 compare the MAE and RMSE of different methods on the City B dataset. Overall, as the prediction time step increases from 1 hour to 6 hours, the prediction errors of different methods all show an upward trend, indicating that multi-step air quality prediction has higher uncertainty. Compared to the City B dataset, the overall error of each method is higher on the City A dataset. This is because the AQI variance is larger and the air quality changes more drastically in the City A dataset, indicating that sudden and non-stationary changes significantly increase the difficulty of air quality prediction.

[0273] On the City A dataset, FedDGAQ demonstrates superior prediction performance and stability overall. Specifically, in terms of MAE (Maximum Error Rate), FedDGAQ achieves best results at prediction step sizes of 1h, 2h, 3h, and 4h, respectively, at 11.32, 16.91, 20.90, and 23.79, all corresponding to the best results for their respective step sizes. In the 5h and 6h long-term prediction scenarios, its error levels are also close to the best method. In terms of average performance, FedDGAQ's average MAE is 21.20, outperforming other comparative methods, indicating its advantage in overall absolute error control. Regarding RMSE (Recovery Time Interval), FedDGAQ achieves the best results at prediction step sizes from 1h to 6h, with an average RMSE of 32.80, also superior to other comparative methods. Since RMSE is more sensitive to large prediction deviations, these results demonstrate that FedDGAQ maintains good error stability during multi-step predictions and exhibits stronger suppression of large prediction deviations on datasets like City A, where air quality fluctuates significantly and sudden changes are more pronounced.

[0274] On the City B dataset, FedDGAQ also demonstrated good prediction accuracy and stability. Specifically, in terms of MAE, FedDGAQ achieved MAEs of 2.41, 3.89, 5.16, and 6.01 for prediction step sizes of 1h, 2h, 3h, and 4h, respectively, all of which were the best results for their respective prediction step sizes. The average MAE of FedDGAQ was 5.42, lower than the best comparison method, LightGBM, indicating that FedDGAQ still has a certain advantage in overall absolute error control. Regarding RMSE, FedDGAQ achieved the best results for prediction step sizes from 1h to 5h, with an average RMSE of 9.06, lower than the best comparison method, DCRNN. ​​Since the AQI variance of the City B dataset is relatively low, and the overall air quality series changes more smoothly, the above results show that FedDGAQ can not only adapt to scenarios with complex and sudden air quality changes like City A, but also maintain stable prediction performance in relatively stable data scenarios, demonstrating good cross-scenario adaptability.

[0275] The performance differences among different methods also reflect the modeling characteristics of air quality prediction tasks. Traditional machine learning methods such as XGBoost and LightGBM perform well on the B city dataset, indicating their ability to fit local variations in stationary sequences. However, their prediction errors increase significantly on the A city dataset, suggesting limitations in characterizing complex temporal dependencies and spatial propagation relationships. Federated time-series prediction models such as LSTM+FedAvg and FedGRU can capture some temporal dependencies, but their spatial modeling capabilities are limited, thus still exhibiting performance bottlenecks in multi-site air quality propagation scenarios. Graph neural network methods such as DCRNN, MTGNN, and ASTGCN introduce spatial modeling structures, but most rely on a single graph structure or fixed spatial propagation mechanisms, making it difficult to simultaneously characterize stable geographical proximity relationships and dynamic potential correlations. FEDFormer has strong frequency domain temporal modeling capabilities, but it does not adequately consider site spatial dependencies, therefore its overall performance is inferior to FedDGAQ.

[0276] In summary, FedDGAQ enhances its ability to represent complex temporal variations in air quality sequences through multi-period time modeling. It utilizes predefined and adaptive maps to characterize stable geographical relationships and dynamic potential correlations, respectively, thus achieving superior performance on two datasets with different fluctuation characteristics: city A and city B. Experimental results demonstrate that FedDGAQ possesses excellent prediction accuracy, stability, and cross-scenario adaptability.

[0277] Table 2. Comparison of MAE of different methods on City A dataset

[0278]

[0279] Table 3. Comparison of RMSE of different methods on City A dataset

[0280]

[0281] Table 4. Comparison of MAE of different methods on the City B dataset

[0282]

[0283] Table 5. Comparison of RMSE of different methods on the City B dataset

[0284]

[0285] 2.6 Ablation Experiment

[0286] To further verify the effectiveness of the core modules in the proposed FedDGAQ, this embodiment conducted ablation experiments on two datasets, City A and City B. Different core modules were gradually removed, and the MAE and RMSE of different ablation models in the prediction step size of the next 1-6 hours were compared under the same experimental settings. Specifically, the following ablation model was designed in this embodiment.

[0287] (1) w / o Adaptive Graph: Remove the adaptive graph.

[0288] (2) w / o Predefined Graph: Remove the predefined graph.

[0289] (3) w / o Dual Graph: Remove dual graph space modeling.

[0290] (4) w / o TimesBlock: Remove multi-cycle time modeling.

[0291] like Figure 2 and Figure 3As shown, the complete FedDGAQ achieved the best results in both MAE and RMSE, indicating that each module can effectively improve air quality prediction performance. On the City A dataset, the average MAE and RMSE of the complete FedDGAQ were 21.20 and 32.80, respectively. Compared to w / o Adaptive Graph, w / o Dual Graph, w / o Predefined Graph, and w / o TimesBlock, the complete FedDGAQ reduced the average MAE by 16.87%, 14.70%, 11.59%, and 21.41%, respectively, and the average RMSE by 10.94%, 9.99%, 8.99%, and 15.88%, respectively. The degradation was most significant with w / o TimesBlock, indicating that TimesBlock plays a crucial role in capturing multi-period time dependencies and long-term trends when dealing with datasets like City A, which exhibit strong abrupt changes.

[0292] The spatial modeling ablation results show that removing any graph structure leads to performance degradation. On the City A dataset, the average MAE and RMSE of the w / o Adaptive Graph are 25.50 and 36.83, respectively, while those of the w / o Predefined Graph are 23.98 and 36.05, both significantly higher than the full FedDGAQ (21.20 and 32.80). This indicates that the predefined and adaptive graphs are complementary; the former provides stable geospatial constraints, while the latter can learn dynamic potential spatial relationships. Furthermore, the average MAE and RMSE of the w / o Dual Graph are 24.85 and 36.44, respectively, also higher than the full FedDGAQ, demonstrating that dual-graph spatial augmentation effectively improves the modeling ability of multi-site pollution propagation relationships.

[0293] On the City B dataset, the average MAE and RMSE of the full FedDGAQ were 5.42 and 9.06, respectively. Compared to the four ablation models, the average MAE of the full FedDGAQ decreased by 47.62%, 46.50%, 55.43%, and 47.80%, respectively, and the average RMSE decreased by 33.94%, 32.73%, 41.43%, and 34.13%, respectively. The accuracy degradation of the w / o Predefined Graph was the most significant, with average MAE and RMSE of 12.16 and 15.47, respectively, indicating that stable geospatial constraints are particularly important for maintaining the continuity and reliability of prediction results in the relatively stable City B dataset.

[0294] In summary, TimesBlock enhances FedDGAQ's ability to express multi-period time dependencies, predefined graphs provide stable spatial constraints, adaptive graphs characterize dynamic potential relationships, and the dual-graph fusion mechanism integrates two types of spatial relationships. Ablation experiments validated the effectiveness of each core module in FedDGAQ and further demonstrated that the temporal and spatial modeling modules can complement each other, thereby improving the accuracy and stability of FedDGAQ in different urban air quality prediction scenarios.

[0295] 2.7 Visual Analysis

[0296] To further verify the proposed FedDGAQ's good modeling ability for the temporal variation of air quality, this embodiment selected the monitoring station of the botanical garden in City A and performed visualization analysis on its AQI prediction results for 7 consecutive days and 1 month, respectively. Figure 4 As shown, the AQI exhibits a clear periodicity, with the curve displaying similar fluctuation patterns across different time periods. This periodic variation primarily stems from factors such as traffic activity, industrial emissions, and diurnal weather changes. Furthermore, the AQI in the right-hand graph also exhibits strong abruptness and non-stationarity, showing short-term rapid increases or decreases in certain time periods, thus increasing the difficulty of prediction. The prediction results show that FedDGAQ can effectively track the overall trend of AQI changes. In the periodic fluctuation region, the predicted curve shows a high degree of consistency with the actual curve. During periods of rapid AQI change, FedDGAQ can also accurately capture the direction of change and fluctuation trends. This indicates that FedDGAQ can not only learn the periodic patterns in air quality data but also possess the ability to perceive sudden changes.

[0297] 2.8 Hyperparameter Sensitivity Analysis

[0298] This embodiment uses the controlled variable method to examine the number of main cycles. Number of graph neighbors The impact on FedDGAQ prediction performance remains unchanged, with the rest of the model structure, training configuration, and data partitioning remaining the same. The MAE of the prediction task in the next 1–6 hours is used as the evaluation metric. Figure 5 and Figure 6 The performance of FedDGAQ on the prediction tasks of city A and city B datasets under different parameter settings is presented.

[0299] like Figure 5 As shown, the number of principal periods has a significant impact on FedDGAQ's ability to extract time patterns. On the City A dataset, when K=3, the average MAE for the 1–6 h prediction task is 21.28, which is higher than... , , and These figures decreased by 8.28%, 4.31%, 7.19%, and 3.52%, respectively. On the City B dataset, The average MAE is 5.42. Although it is not optimal for some short-term prediction step sizes, it achieves the lowest MAE in the 3–6 h prediction tasks, demonstrating superior overall prediction performance. When the number of main periods is too small, FedDGAQ struggles to fully extract multi-scale periodic information. Conversely, when the number of main periods is too large, it may introduce weak periods and noise, increasing feature redundancy. At that time, a good balance was achieved between the integrity of periodic information and noise suppression.

[0300] The number of graph neighbors determines the spatial information aggregation range for each site. In the City A dataset, when... At that time, the average MAE was 21.18, compared to , , and These figures decreased by 8.98%, 6.52%, 3.39%, and 0.80%, respectively. On the City B dataset, The lowest MAE was achieved across all prediction step sizes, with an average MAE of 5.42. Too few neighbors limit spatial information propagation, while too many neighbors may introduce weakly correlated nodes and redundant information, increasing graph computation overhead. Based on these results, this embodiment sets the number of principal periods and the number of graph neighbors to... and .

[0301] 2.9 Communication and Computing Overhead Analysis

[0302] This embodiment selects four federated spatiotemporal prediction methods: CNFGNN, FedASTA, FedOSTC, and FedSTGD, and sets the number of federated training rounds to 20. Then, it compares them in terms of model size, average single-round communication volume, client computing time, end-to-end latency, and prediction performance. The results are shown in Table 6.

[0303] FedDGAQ's average single-round communication volume on the City A and City B datasets is 3118.97 MB and 1411.55 MB, respectively, significantly lower than CNFGNN, FedOSTC, and FedSTGD. Meanwhile, its corresponding end-to-end latency is 26.06 s and 23.98 s, respectively, the lowest among all methods. This is because FedDGAQ does not directly transmit complete temporal features; instead, the client extracts and uploads compressed temporal latent representations, and the server completes the co-space modeling of the predefined and adaptive graphs, thus reducing redundant data transmission. Furthermore, the client and server model sizes of FedDGAQ are only 0.68 MB and 0.15 MB, respectively, and the total client modeling and local training times are 0.41 s and 0.35 s, respectively, indicating that multi-period feature extraction and dual-graph modeling do not impose significant storage and computational burdens.

[0304] In contrast, CNFGNN and FedOSTC require the transmission of large-scale intermediate temporal representations, leading to a significant increase in communication overhead and end-to-end latency. FedASTA has relatively low communication overhead, but its limited ability to characterize dynamic spatial dependencies between sites results in higher prediction errors than FedDGAQ. While FedSTGD does not have an independent trainable model on the server side, this only means that its server does not need to store and optimize additional neural network parameters; it does not reduce communication and computational overhead. Under the same training epochs, FedSTGD still requires frequent uploading, aggregation, and broadcasting across multiple training batches. The collective approach indicates that, since its main spatiotemporal modeling process is completed by the client, client training time, single-round communication volume, and end-to-end latency are significantly higher than other methods. Because its server primarily performs parameterless representation aggregation, it struggles to learn and correct global spatial dependencies like the bi-graph module in FedDGAQ, thus its high interaction overhead has not translated into better prediction performance.

[0305] FedDGAQ achieved average MAE and RMSE of 21.67 and 35.01 on the City A dataset, respectively, and 6.31 and 10.60 on the City B dataset, respectively, both outperforming other federated spatiotemporal prediction methods. These results indicate that, with the same number of training epochs, FedDGAQ's performance improvement does not depend on a larger model size or higher communication costs, but rather on compressed temporal representation transmission, a reasonable division of functions between the client and server, and collaborative spatial modeling of predefined and adaptive graphs, thus achieving a better balance between prediction accuracy, communication overhead, and computational efficiency.

[0306] Table 6. Comparison of overhead and performance of different federated spatiotemporal prediction methods

[0307]

[0308] This invention provides a FedDGAQ (Federated Air Quality Forecasting) method with a fusion of dual-graph structures, enabling collaborative air quality forecasting across multiple monitoring stations without sharing raw data. FedDGAQ first utilizes a multi-period time modeling module to extract periodic variations, long-term dependencies, and local fluctuations in the air quality sequence. Subsequently, the server models stable geographical proximity relationships and dynamic potential associations between stations using predefined and adaptive graphs, respectively, and fuses these two types of spatial features. In the forecasting phase, the model employs three branches: trend forecasting, residual forecasting, and direct forecasting, and adaptively generates the final forecast result through a gating mechanism, thus adapting to different scenarios such as steady changes, trend shifts, and sudden pollution events. Furthermore, each monitoring station only uploads the compressed temporal implicit representation and local model parameters, without needing to upload the original air quality data, reducing the risk of data leakage while achieving cross-site collaborative forecasting. Experimental results show that FedDGAQ achieves good prediction accuracy on air quality datasets from both City A and City B. The average MAE and RMSE on the City A dataset are 21.20 and 32.80, respectively, and on the City B dataset, they are 5.42 and 9.06, respectively. Meanwhile, FedDGAQ features a smaller model size and lower end-to-end latency, achieving a good balance between prediction accuracy, communication overhead, and computational efficiency. This invention can be applied to scenarios such as urban air quality prediction, pollution early warning, regional pollution propagation analysis, environmental governance decision-making, and public health protection.

[0309] This embodiment also provides a federal air quality forecasting system with a dual-graph structure to implement the above method, including multiple clients and servers.

[0310] Among the multiple clients, each client corresponds to an air quality monitoring station and is configured to acquire local historical observation sequences, generate compressed local temporal latent representations using a multi-period time modeling module, upload local model parameters and the local temporal latent representations to the server, without uploading the original historical observation sequences; and is configured to perform spatiotemporal feature fusion of local time features and spatial enhancement features returned by the server, and generate air quality prediction results for multiple future time steps using a multi-branch prediction structure.

[0311] The server is configured to construct a predefined map based on the geographical location of each monitoring station, learn an adaptive map based on the local temporal latent representation uploaded by each client, perform bi-graph spatial modeling on the local temporal latent representation based on the predefined map and the adaptive map, obtain spatially enhanced features and return them to the corresponding client; and perform federated aggregation on the local model parameters uploaded by each client, update the global model and synchronously update the bi-graph spatial modeling module.

[0312] This embodiment also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described above.

[0313] This embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.

[0314] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0315] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0316] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0317] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0318] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A federal air quality prediction method integrating a dual-graph structure, characterized in that, Includes the following steps: S1. Multiple clients respectively obtain historical observation sequences from local air quality monitoring stations. The historical observation sequences include air quality indicators, air pollutant variables, and time period characteristics. S2. Each client uses the multi-period time modeling module to extract time features from the local historical observation sequence, generates a compressed local time implicit representation, and uploads the local model parameters and the local time implicit representation to the server, without uploading the original historical observation sequence. S3. The server constructs a predefined map based on the geographical location of each monitoring station, and learns an adaptive map based on the local temporal implicit representation uploaded by each client. The predefined map is used to describe the stable geographical proximity relationship between monitoring stations, and the adaptive map is used to describe the dynamic potential association relationship between monitoring stations. S4. The server performs bi-graph spatial modeling on the local temporal latent representation based on the predefined graph and the adaptive graph to obtain spatially enhanced features, and returns the spatially enhanced features to the corresponding client; S5. Each client fuses local time features with spatial enhancement features returned by the server to perform spatiotemporal feature fusion, and uses a multi-branch prediction structure to generate air quality prediction results for multiple future time steps. S6. The server performs federated aggregation of the local model parameters uploaded by each client, updates the global model, and synchronously updates the dual-graph space modeling module. The above steps are repeated until the training stopping condition is met.

2. The federal air quality prediction method with fused dual-graph structure according to claim 1, characterized in that, In step S2, the multi-period time modeling module includes: A linear mapping is performed on the input historical observation sequence to project the original features into a high-dimensional space; Perform a Fast Fourier Transform on the projected high-dimensional time series to obtain its frequency domain representation and calculate its frequency domain amplitude. Select the k main frequencies with the largest amplitudes, and calculate the corresponding period lengths based on the main frequencies; For each period, the time series is reorganized into a two-dimensional periodic structure, and the time features corresponding to that period are extracted using two-dimensional convolution. The time features corresponding to multiple periods are weighted and fused. The weights of the weighted fusion are determined according to the importance of each period feature to the prediction task, so as to highlight the main periodic structure and suppress weak periods and noise. Multi-period fusion features are input into the temporal attention layer. Attention weights for different time steps are determined based on the similarity between the query matrix and the key matrix. This makes the model pay more attention to historical segments that have a significant impact on future air quality changes, resulting in enhanced temporal features that serve as local temporal latent representations.

3. The federal air quality prediction method with fused dual-graph structure according to claim 2, characterized in that, The client retains only the periodic pattern information corresponding to the k main frequencies with the largest amplitudes after frequency domain analysis, and generates a compressed local time implicit representation through a time coding network. The local time implicit representation does not contain complete time series details, and the dimension of the local time implicit representation is lower than that of the original historical observation sequence, so as to reduce the communication overhead between the client and the server and reduce the risk of leakage of the original air quality data.

4. The federal air quality prediction method with fused dual-graph structure according to claim 1, characterized in that, In step S3, constructing the predefined graph includes: The Haversine formula was used to calculate the geographical distance between monitoring stations; The adjacency weight between stations is calculated based on the geographical distance and the distance decay coefficient, and the adjacency weight decreases as the geographical distance between stations increases; The adjacency weights are normalized to obtain the normalized adjacency matrix of the predefined graph. The normalized adjacency matrix is ​​used for spatial propagation to reflect the stable prior of pollutant diffusion along geographical proximity. Based on the normalized adjacency matrix, spatial propagation of the local temporal implicit representation is performed to obtain predefined graph propagation features.

5. The federal air quality prediction method with fused dual-graph structure according to claim 1, characterized in that, In step S3, the learned adaptive graph includes: Calculate the query matrix and key matrix based on the local temporal implicit representations uploaded by each client; Calculate the attention score between nodes based on the query matrix and the key matrix; The attention score is Softmax normalized to obtain the adjacency matrix of the adaptive graph; Based on the adjacency matrix of the adaptive graph, the local temporal implicit representation is spatially propagated to obtain the adaptive graph propagation features; The adaptive graph dynamically constructs an adjacency matrix based on the attention relationship between the local temporal latent representations of each site, in order to capture potential correlations such as long-distance pollution transmission or regional synchronous changes in pollution beyond geographical relationships.

6. The federal air quality prediction method with fused dual-graph structure according to claim 1, characterized in that, In step S4, the dual-graph space modeling includes: Obtain predefined graph propagation features and adaptive graph propagation features respectively; The predefined graph propagation features and the adaptive graph propagation features are weighted and fused to obtain dual-graph fusion features; The dual-graph fusion features are sequentially subjected to linear transformation, residual connection, and layer normalization to obtain spatial enhancement features; The dual-graph fusion uses learnable weights to weight predefined graph propagation features and adaptive graph propagation features, making stable geographical priors and dynamic potential associations complementary, and enhances training stability through residual connections and layer normalization.

7. The federal air quality prediction method with fused dual-graph structure according to claim 1, characterized in that, In step S5, the spatiotemporal feature fusion includes: Local temporal features and spatial augmentation features are weighted and fused to obtain preliminary fused features; The local temporal features and spatial augmented features are concatenated, and temporal feature weights and spatial feature weights are generated through a gating network. Based on the time feature weights and spatial feature weights, the local time features and spatial enhanced features are gated and weighted to obtain gated fusion features; The preliminary fusion feature and the gated fusion feature are fused and layer-normalized to obtain the spatiotemporal fusion feature; The spatiotemporal feature fusion employs both static weighted fusion and dynamic gating fusion, and adaptively adjusts the contribution ratio of temporal and spatial features according to different temporal and spatial conditions.

8. The federal air quality prediction method with fused dual-graph structure according to claim 1, characterized in that, In step S5, the multi-branch prediction structure includes a trend prediction branch, a residual prediction branch, and a direct prediction branch; The trend prediction branch constructs a short-term trend prior based on the change and direction of the most recent time step. Based on the change of air quality index in the two most recent time steps in the historical observation sequence, and taking the current air quality index as a benchmark, it extends to the future according to the prediction step length to obtain the trend prediction result. The residual prediction branch uses the current air quality index as a reference benchmark, learns the increment or decrement of each future time step relative to the current state, predicts the change of each future time step relative to the current air quality index based on the spatiotemporal fusion characteristics, and adds the change to the current air quality index to obtain the residual prediction result. The direct prediction branch does not explicitly rely on the current air quality index as a benchmark. Instead, it directly learns the nonlinear mapping relationship between historical sequences and future air quality based on deep spatiotemporal fusion features. Based on the spatiotemporal fusion features, it directly outputs the absolute prediction values ​​of air quality indexes for multiple future time steps, thus obtaining the direct prediction result. The trend prediction results, residual prediction results and direct prediction results are adaptively fused through a gating mechanism to obtain the final air quality prediction results. The gating mechanism calculates the fusion weights corresponding to the three prediction branches based on the spatiotemporal fusion characteristics. After being normalized by Softmax, the fusion weights are weighted and summed with the trend prediction result, residual prediction result, and direct prediction result to obtain the final air quality prediction result. The gating mechanism adaptively adjusts the importance of the trend prediction branch, residual prediction branch, and direct prediction branch according to the air quality change pattern, strengthening the weight of the trend prediction branch during stable changes and strengthening the weight of the direct prediction branch during sudden fluctuations.

9. The federal air quality prediction method with fused dual-graph structure according to claim 1, characterized in that, In step S6, the federated aggregation includes: The server sends the current global model parameters to each client. Each client uses local historical observation sequences for local training, updates local model parameters, and generates corresponding local temporal latent representations; The server collects local model parameters uploaded by each client, and uses a federated average algorithm to aggregate them weighted according to the number of training samples of each client to obtain updated global model parameters. The more samples a client has, the greater its contribution to the global model update. The server synchronously updates the adaptive graph and dual-graph spatial modeling module based on the local temporal implicit representations uploaded by each client.

10. A federal air quality forecasting system integrating a dual-graph structure, characterized in that, For implementing the method as described in any one of claims 1-9, comprising: Multiple clients, each corresponding to an air quality monitoring station, are configured to acquire local historical observation sequences, generate compressed local temporal latent representations using a multi-period time modeling module, upload local model parameters and the local temporal latent representations to the server, without uploading the original historical observation sequences; and are configured to perform spatiotemporal feature fusion of local time features and spatial enhancement features returned by the server, and generate air quality prediction results for multiple future time steps using a multi-branch prediction structure. The server is configured to construct a predefined map based on the geographical location of each monitoring station, learn an adaptive map based on the local temporal latent representation uploaded by each client, perform dual-graph spatial modeling on the local temporal latent representation based on the predefined map and the adaptive map, obtain spatially enhanced features and return them to the corresponding client; and perform federated aggregation on the local model parameters uploaded by each client, update the global model and synchronously update the dual-graph spatial modeling module.