Traffic data interpolation method based on space-time diffusion model

By employing the two-stage training and dynamic guided scale adjustment of the FENCE method, the problem of unsuitable guided scale in traffic data missing value imputation is solved, achieving higher accuracy and robustness, and making it suitable for data prediction and recovery in intelligent transportation systems.

CN121597982APending Publication Date: 2026-03-03BEIJING JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511586937.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-03
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing methods for imputing missing values ​​in traffic data have flaws in the definition of the guiding scale, making it difficult to balance the diversity and accuracy of the generated results. Manually set guiding scales cannot adapt to complex traffic data scenarios.

Method used

The FENCE method based on a spatiotemporal feedback diffusion model is adopted. A conditional network and a denoising network are constructed through a two-stage training strategy, the guidance scale is dynamically adjusted, and the generation process of traffic data is optimized by combining spatiotemporal feedback mechanism and clustering perception mechanism.

Benefits of technology

It significantly improves the accuracy and robustness of missing value imputation in traffic data, enhances the effectiveness of data prediction, and provides more reliable data support for intelligent transportation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121597982A_ABST
    Figure CN121597982A_ABST
Patent Text Reader

Abstract

The invention relates to a traffic data interpolation method based on a space-time diffusion model. The method comprises the following steps: acquiring traffic observation data to be interpolated, a node embedding vector and a time embedding vector; generating a condition vector based on the traffic observation data, the node embedding vector and the time embedding vector by using a trained condition network, and generating an unconditional vector based on the node embedding vector and the time embedding vector; obtaining initial noisy data corresponding to the traffic observation data to be interpolated; a multi-step reverse diffusion process is executed, denoising is carried out step by step from the initial noisy data until a final interpolation result is obtained, and each step of denoising comprises the steps that conditional prediction noise and unconditional prediction noise are generated through a trained denoising network; obtaining the posterior probability of the current step, and calculating the guide scale of the current step based on the posterior probability; and calculating noise-containing data of the next step according to the conditional prediction noise, the unconditional prediction noise and the guide scale.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the technical field of traffic system data processing, and in particular to a method for filling missing values ​​in traffic data based on a spatiotemporal feedback diffusion model. Background Technology

[0002] Existing methods for imputing missing values ​​in spatiotemporal traffic data can be broadly categorized into two paradigms: discriminative models and generative models. The core idea of ​​discriminative models is to learn a deterministic mapping function from observed data to missing data, achieving imputation by directly modeling the "observation value → missing value" mapping relationship. These models typically rely on deep learning architectures to capture the dependencies between spatiotemporal data. Typical techniques include architecture-driven models that utilize recurrent neural networks (RNNs), graph neural networks (GNNs), and Transformers to model spatiotemporal correlations, such as ASTGNN, SAITS, and ImputeFormer. These models employ attention mechanisms to model the dependencies between data. However, despite their effectiveness, these models cannot explicitly model the uncertainty or potential distribution of the data.

[0003] Generative models aim to learn the latent distribution of data and treat the imputation task as a conditional sampling problem: given the observed data, they generate reasonable values ​​for missing items. The core idea of ​​generative models is to learn the latent probability distribution of traffic data and generate missing values ​​consistent with the observed data from the learned sampling distribution. Fraction-based diffusion models are a class of powerful imputation generative models. These models learn a fractional function, which is the gradient of the log-likelihood of the data distribution. During imputation, they use the fractions of the conditional distribution to estimate missing values. Models like CSDI and MIDM constrain the diffusion process with available observed data. Summary of the Invention

[0004] Although generative models can use observed data as conditions to achieve high-fidelity missing value imputation, there are still shortcomings in the definition of the guiding scale λ. The guiding scale λ affects how well the generated data fits the observed data; a higher λ means that the generated traffic data will be closer to the observed conditional information. The size of the guiding scale directly affects the diversity and quality of the generated results. While a higher guiding scale can make the generated results more consistent with the conditional information, it may limit the model's creativity, leading to a lack of diversity in the generated results, and ultimately affecting the quality of the generated traffic data. A lower guiding scale can increase the diversity of the generated results, but it may lead to a lower degree of matching between the generated results and the conditional information, or even results that do not meet expectations. However, the λ in existing models is a manually set hyperparameter, which means that for nodes without observed data in a certain time period, the sampled conditional information is not accurate. Assigning λ to incorrect conditional information will lead to deviations in the final generated results. Therefore, it is necessary to design a new conditional guidance strategy that can dynamically adjust the guiding scale throughout the entire traffic data imputation generation process.

[0005] This disclosure provides a method for imputing missing values ​​in traffic data based on a spatiotemporal feedback diffusion model, belonging to the field of intelligent transportation system data processing. The imputation method includes: first, collecting historical traffic data and dividing nodes and their time-series data according to spatiotemporal correlation to construct a dataset, and simulating missing values ​​in the dataset to generate different missing value patterns; then, constructing a spatiotemporal feedback diffusion guided (FENCE) model based on deep learning and a diffusion model, learning the prior distribution of traffic data through an unconditional generative model, and finally imputing the missing values ​​through a conditional model.

[0006] During training, a two-stage training strategy is employed: first, an unconditional generative model is trained, then the model is fine-tuned to adapt for conditional imputation. Real-world observation data is used for training, and the trained model is tested using a test set. During inference, the FENCE model dynamically adjusts the guidance scale, relying on a feedback loop to evaluate the alignment between generated and observed values, ensuring that the generated imputed data is as close as possible to the actual observed values, while also considering the spatial-temporal correlations between nodes. Finally, the model is used to impute unobserved traffic data, generating the imputation results. This disclosure significantly improves the accuracy of missing value imputation in traffic data through a spatiotemporal feedback mechanism, optimizes the effect of traffic data prediction, and provides an effective solution to the challenges of data prediction and data recovery in intelligent transportation systems.

[0007] This disclosure provides a traffic data interpolation method based on a spatiotemporal diffusion model, comprising: acquiring traffic observation data to be interpolated, node embedding vectors, and temporal embedding vectors; generating conditional vectors using a trained conditional network based on the traffic observation data to be interpolated, node embedding vectors, and temporal embedding vectors, and generating unconditional vectors based on the node embedding vectors and temporal embedding vectors; acquiring initial noisy data corresponding to the traffic observation data to be interpolated; and performing a multi-step reverse diffusion process, starting from the initial noisy data and gradually denoising until the final interpolation result is obtained. Each denoising step includes: generating conditional prediction noise using a trained denoising network based on the noisy data of the current step, the current time step, and the conditional vectors, and generating unconditional prediction noise using the denoising network based on the noisy data of the current step, the current time step, and the unconditional vectors; acquiring the posterior probability of the current step, and calculating the guiding scale of the current step based on the posterior probability; and calculating the noisy data of the next step based on the conditional prediction noise, the unconditional prediction noise, and the guiding scale.

[0008] In an exemplary embodiment, the posterior probability of the current step is obtained through an update step in the previous denoising step, wherein the update step includes: calculating the denoised data corresponding to the step based on the noisy data, conditional prediction noise, and unconditional prediction noise from the previous denoising step; calculating the conditional mean and unconditional mean corresponding to the conditional prediction noise and unconditional prediction noise, respectively; and updating the calculated posterior probability of the current step by comparing the distance between the denoised data and the conditional mean and the unconditional mean.

[0009] In an exemplary embodiment, calculating the guidance scale for the current step based on the posterior probability includes: calculating the guidance scale according to the following formula:

[0010]

[0011] in, Represents the posterior probability at the cluster level. The guiding scale is represented by π, which is a preset hyperparameter in the range [0,1], such as 0.9, 0.95, etc. Its function is to set the "prior confidence" of the model's learning ability and thereby control the activation threshold of the feedback guiding mechanism.

[0012] π is a hyperparameter preset in the interval [0,1], such as 0.9, 0.95, etc. Its function is to set the "prior confidence" of the model's learning ability and thereby control the activation threshold of the feedback guidance mechanism.

[0013] In an exemplary embodiment, the cluster-level posterior probability is calculated by: clustering all nodes using the spatial attention matrix output by the conditional network to form multiple node clusters; and calculating the average of the logarithmic posterior probabilities of all nodes within each node cluster as the cluster-level posterior probability.

[0014] In an exemplary embodiment, calculating the next noisy data based on the predicted noise and the guided scale includes: calculating the guided score function based on the conditional score function and the unconditional score function corresponding to the conditional and unconditional predicted noise, using the following formula:

[0015]

[0016] Among them, s θ (x k ) represents the unconditional scoring function, s θ (x k c) represents the conditional score function, λ(x) k ,k) represents the guiding scale; and

[0017] Using the guided scoring function, the noisy data for the next step is calculated from the noisy data of the current step through the sampling algorithm of the diffusion model.

[0018] In an exemplary embodiment, the scoring function is calculated using the following formula:

[0019]

[0020] ∈θ(x k ,k) represents the noise at the k-th step of the prediction, σ k This represents the standard deviation of the noise at step k. This represents the scoring function.

[0021] In an exemplary embodiment, generating a condition vector includes: capturing the temporal correlation of each node at different time steps through a temporal attention mechanism, and aggregating the spatial correlation between different nodes at each time step through a spatial attention mechanism.

[0022] In an exemplary embodiment, the trained conditional network and the denoising network are trained by: inputting null or zero values ​​into the conditional network to generate an unconditional vector; inputting the unconditional vector, noisy samples, and time steps into the denoising network to train the denoising network until convergence; inputting traffic observation data, node embedding vectors, and time embedding vectors into the conditional network to generate a conditional vector; and inputting the conditional vectors, noisy samples, and time steps into the denoising network to fine-tune the denoising network.

[0023] However, the aspects of this disclosure are not limited to those set forth herein. These and other aspects of the disclosure will become apparent to those skilled in the art upon reference to the detailed description of the disclosure given below.

[0024] Furthermore, the effects of this disclosure include not only those set forth herein, but also other effects that will be apparent to those skilled in the art upon reference to the claims, the specification, and the accompanying drawings. Attached Figure Description

[0025] These and / or other aspects will become apparent and more readily understood from the following description of embodiments taken in conjunction with the accompanying drawings, in which:

[0026] Figure 1 This is a flowchart of a traffic data interpolation method based on a spatiotemporal diffusion model according to an embodiment of the present disclosure;

[0027] Figure 2 This is a schematic diagram of a model architecture for traffic data interpolation based on a spatiotemporal diffusion model according to embodiments of the present disclosure; and

[0028] Figure 3 This is a table comparing the overall performance of models according to embodiments of this disclosure. Detailed Implementation

[0029] This disclosure will now be described more fully below with reference to the accompanying drawings, in which embodiments of the disclosure are illustrated. However, this disclosure may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be more detailed and thorough, and will fully convey the scope of this disclosure to those skilled in the art.

[0030] It will be understood that the numerical values ​​or ranges mentioned herein are merely examples, and the numerical values ​​or ranges can be any other values ​​or ranges, as long as they do not affect the implementation of the technical solution of this application.

[0031] It will also be understood that throughout the specification, the same reference numerals denote the same parts. Each of the features of the various embodiments of this disclosure can be combined partially or entirely with each other, and various technical associations and drives are possible. Each embodiment can be implemented independently of each other or can be implemented together in association.

[0032] Unless otherwise defined or implied herein, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains. It will be further understood that terms such as those defined in common dictionaries shall be interpreted as having a meaning consistent with their meaning in the context of the relevant field and in this disclosure, and shall not be interpreted in an idealized or overly formal sense unless expressly so defined herein.

[0033] This disclosure provides a spatiotemporal traffic data completion method based on a diffusion model. This method optimizes the guidance scale of the diffusion model through dynamic feedback and cluster perception mechanism to achieve accurate interpolation of missing spatiotemporal traffic data. The overall process of the method includes data preparation, model construction, two-stage training, and inference interpolation.

[0034] This disclosure processes the traffic observation data to be interpolated using a pre-trained conditional network to generate a conditional vector containing spatiotemporal context; then, the conditional vector is input into a pre-trained denoising network to guide it to perform collaborative inference and iterative denoising throughout the backdiffusion process; finally, accurate interpolation results are obtained for the original incomplete traffic data.

[0035] like Figure 1 As shown, this disclosure provides a traffic data interpolation method based on a spatiotemporal diffusion model, including: acquiring traffic observation data to be interpolated, node embedding vectors, and temporal embedding vectors (S101); using a trained conditional network to generate conditional vectors based on the traffic observation data to be interpolated, node embedding vectors, and temporal embedding vectors, and generating unconditional vectors based on the node embedding vectors and temporal embedding vectors (S102); acquiring initial noisy data corresponding to the traffic observation data to be interpolated (S103); and performing a multi-step reverse diffusion process to obtain the initial noisy data from the traffic observation data to be interpolated. Starting from the beginning, the noise is gradually reduced until the final interpolation result is obtained. Each step of the noise reduction includes: using a trained denoising network to generate conditional prediction noise based on the noisy data of the current step, the current time step, and the conditional vector; and using the denoising network to generate unconditional prediction noise based on the noisy data of the current step, the current time step, and the unconditional vector; obtaining the posterior probability of the current step; and calculating the guiding scale of the current step based on the posterior probability; and calculating the noisy data of the next step based on the conditional prediction noise, the unconditional prediction noise, and the guiding scale (S104).

[0036] As an example, a multi-step reverse diffusion process is performed, starting with the initial noisy data and gradually denoising until the final imputation result is obtained. Before performing the first step of denoising, the initial log-posterior likelihood value of all nodes is set to zero. Each denoising step includes: obtaining the log-posterior likelihood value of the current step; using a trained denoising network, generating conditional and unconditional scores based on the noisy data of the current step, the current time step, the conditional vector (from S102), and the unconditional vector (from S102); obtaining the spatial attention score of the denoising network and dividing nodes into clusters based on the score; aggregating the posterior likelihoods of nodes within a cluster to calculate the cluster-level posterior likelihood, and dynamically calculating the cluster-level guidance scale accordingly; calculating the final guidance score based on the guidance scale, conditional score, and unconditional score; calculating the noisy data for the next step based on the guidance score; and preparing the posterior likelihood for the next step: calculating the conditional mean and unconditional mean corresponding to the conditional and unconditional scores respectively, and updating the log-posterior likelihood of the next step by comparing the distance between the denoising result and the conditional mean and unconditional mean.

[0037] Data preparation involves acquiring observational data, node embedding vectors, and temporal embedding vectors for traffic data. Observational data can also be represented by a data matrix x. o Together with a binary mask matrix M, the data matrix x is represented, where the mask matrix M identifies the data matrix x. o Location of valid data. Node embedding vectors and temporal embedding vectors can represent the spatial attributes of traffic sensor nodes and the temporal attributes of time series, respectively.

[0038] Traffic data collection and preprocessing can be performed to construct the original dataset. This step requires collecting spatiotemporal traffic data and performing preprocessing such as feature extraction and missing data labeling to provide foundational data for subsequent model training and inference. The data collection scope includes historical and real-time data from the traffic sensor network, at least including observation data from traffic sensors (nodes) within the target area over continuous time slices, ensuring the data's representativeness of the traffic scenario. For example, historical and real-time data can be collected from a traffic sensor network in one area. Each sensor is considered a "node," recording data at fixed time intervals (e.g., every 5 minutes) to form a spatiotemporal data grid.

[0039] As an example, during training, the dataset used can be the PEMS04, PEMS07, and PEMS08 datasets provided by the California Department of Transportation's Performance Measurement System. The data is divided into 5-minute time intervals, covering regional scenarios with different traffic flow characteristics. Furthermore, meaningful features, such as traffic volume, average speed, and occupancy, are extracted from the raw dataset, and the locations of missing values ​​in the data are clearly identified.

[0040] Acquire initial noisy data corresponding to the traffic observation data to be interpolated. For example, sample initial noise from a Gaussian distribution as initial noisy data. It is understood that the starting point of the reverse diffusion process of this disclosure is not limited to starting from pure Gaussian noise. In order to accelerate sampling or utilize prior information, it is also possible to start from data that has undergone preliminary interpolation, and perturb it to an intermediate noise step through a forward diffusion process, and then perform the reverse diffusion process of this disclosure from this step.

[0041] Model Building: The core objective of model building in this stage is to create a denoising network ∈ θ and a conditional network F cond F cond Its function is to generate conditional information c that guides back diffusion. The network input is the observed data x. o Nodes embedded in E represent the physical location or type of the sensor, etc. node and the time slice embedding E representing a time point time This model can capture the temporal correlation of a single node in different time slices through a temporal attention mechanism, and aggregate the spatial correlation between different nodes through a spatial attention mechanism, ultimately outputting a conditional vector c.

[0042] In an exemplary embodiment, generating a condition vector includes: capturing the temporal correlation of each node at different time steps through a temporal attention mechanism, and aggregating the spatial correlation between different nodes at each time step through a spatial attention mechanism.

[0043] For example, using observation data x o Node embedding E node and time slice embedding E time For a single node, the analysis examines how its data interacts at different time points (e.g., the various 5-minute intervals within the past hour) to capture temporal correlations (e.g., congestion at one time point typically affects congestion at the next). Furthermore, at the same time point, the analysis examines how data from different nodes (sensors) interact to capture spatial correlations (e.g., congestion at an upstream intersection can lead to congestion at a downstream intersection). After this spatiotemporal dual attention analysis, the network outputs a conditional vector c containing known information and spatiotemporal relationships.

[0044] Denoising networks can predict the noise contained in current data based on the current noisy data, step information, and conditional guidance. For example, a denoising network ∈ θ The input can be a noisy sample x k Given a time step k and a conditional vector c (or an unconditional vector), the output can be a predicted value ∈ ... θThen, sampling is performed based on probability to obtain the final traffic data.

[0045] In an exemplary embodiment, the posterior probability of the current step is obtained through an update step in the previous denoising step, wherein the update step includes: calculating the denoised data corresponding to the step based on the noisy data, conditional prediction noise, and unconditional prediction noise from the previous denoising step; calculating the conditional mean and unconditional mean corresponding to the conditional prediction noise and unconditional prediction noise, respectively; and updating the calculated posterior probability of the current step by comparing the distance between the denoised data and the conditional mean and the unconditional mean.

[0046] In an exemplary embodiment, calculating the guidance scale for the current step includes: calculating the denoised data corresponding to the current step based on the noisy data and the predicted noise of the current step; calculating the alignment error between the denoised data corresponding to the current step and the traffic observation data; calculating the posterior probability based on the alignment error; and calculating the guidance scale for the current step based on the posterior probability.

[0047] Since the output of the trained unconditional denoising network is a negative correlation estimate of the unconditional score, and the output of the trained conditional denoising network is a negative correlation estimate of the conditional score, the score function is calculated in the exemplary embodiment as follows:

[0048]

[0049] ∈θ(x k ,k) represents the noise at the k-th step of the prediction, σ k This represents the standard deviation of the noise at step k. This represents the scoring function.

[0050] like Figure 2 As shown, the model architecture trains two denoising networks to generate the unconditional probability distribution p. θ (x k ) and conditional probability distribution p θ (x k |c).

[0051] The core of this disclosure lies in the design of a dynamic conditional guidance mechanism. This mechanism, based on the evaluation of posterior probabilities, adjusts the guidance scale λ(x). k The parameters (k) are dynamically adjusted to ensure that the generated samples better follow the given conditional information.

[0052] Unconditional probability distributions are the basic knowledge about traffic data learned by the model without considering any specific observation conditions. Conditional probability distributions, on the other hand, are the probability distributions of missing data given the observation conditions (i.e., known data).

[0053] In an exemplary embodiment, calculating the next noisy data based on the predicted noise and the guided scale includes: calculating the guided score function based on the conditional score function and the unconditional score function corresponding to the conditional and unconditional predicted noise, using the following formula:

[0054]

[0055] Among them, s θ (x k ) represents the unconditional scoring function, s θ (x k c) represents the conditional score function, λ(x) k ,k) represents the guiding scale; and

[0056] Using the guided scoring function, the noisy data for the next step is calculated from the noisy data of the current step through the sampling algorithm of the diffusion model.

[0057] The above formula also represents the proportion of influence between the unconditional probability distribution and the conditional probability distribution. Wherein, The unconditional score reflects the prior distribution of the data without introducing conditional information. These are conditional scores, reflecting the distribution guided by observations. They can be calculated based on the scoring function formula above.

[0058] A high posterior probability indicates a high degree of alignment between the sample and the observation conditions; in this case, λ(x) k ,k) decrease to avoid overcorrection; when the posterior probability is low, it indicates that the sample deviates from the observation, λ(x) k Increase λ(x,k) to enhance the guidance of observation conditions. Dynamically adjust the guidance scale λ(x) k The addition of k enables the model to perform self-evaluation and real-time correction, thereby significantly improving the robustness and accuracy of data imputation in complex real-world scenarios (especially when there is a high missing rate and the data is unreliable).

[0059] Two-stage training: This step requires two-stage training: "unconditional pre-training - conditional fine-tuning". Unconditional pre-training enables the model to generate the prior distribution of data. Then, conditional fine-tuning is performed on the model to obtain the conditional imputation capability, thereby generating a probability distribution that combines the two.

[0060] In an exemplary embodiment, the trained conditional network and the denoising network are trained by: inputting null or zero values ​​into the conditional network to generate an unconditional vector; inputting the unconditional vector, noisy samples, and time steps into the denoising network to train the denoising network until convergence; inputting traffic observation data, node embedding vectors, and time embedding vectors into the conditional network to generate a conditional vector; and inputting the conditional vectors, noisy samples, and time steps into the denoising network to fine-tune the denoising network.

[0061] The training objective of unconditional generative model pre-training is to learn an unconditional prior distribution p(x) independent of observed data. During this stage, the denoising network ∈ θ Input contains only data embedding E node Embedded E with timing time Conditional information is replaced by empty observations, generating an unconditional vector c. uncond The training objective of the model is to minimize the difference between the predicted noise and the actual noise, for the denoising network ∈ θ Training continues until the model converges. The Adam optimizer is used to adjust the model parameters during training optimization. The learning rate is set to an empirical value that adapts to traffic data. During training, the model performance is monitored by the interpolation error of the validation set (such as MAPE, MAE). When the validation set error no longer decreases for several consecutive rounds, training is stopped and the final model parameters are saved.

[0062] The training objective of fine-tuning a conditional generative model is to enable the model to learn based on observed data x. o The conditional distribution p(x|c) enables the model to have accurate interpolation capabilities by incorporating conditional information. The input at this stage includes the observed data c, the mask matrix M, and the structural prior E. node E time Through conditional network F cond Generate the conditional vector c. In this stage, training is based on the model weights saved from the unconditional training stage, and the denoising network is fine-tuned. θ Simultaneously, a validation set is used to monitor training effectiveness and avoid overfitting; after fine-tuning, the model will simultaneously output the conditional denoising result. cond =∈ θ (x k ,k,c) and unconditional denoising results ∈ uncond =∈ θ (x k ,k,c uncond ), which serves as the input for guiding the scale calculation.

[0063] In the inference interpolation step, this disclosure utilizes a trained model (e.g., the FENCE model) to interpolate missing traffic data in the test set or real-world scenarios, outputting a complete data matrix. The specific steps are as follows:

[0064] Input preparation: Obtain incomplete traffic data to be interpolated (including x) o M, E node E time ), through conditional network F cond Generate a conditional vector c, and simultaneously generate an unconditional vector c with the same shape as c. uncond ;

[0065] Noise initialization: Following the general form of the diffusion model, the FENCE model samples initial Gaussian noise x. K ~N(0,I) serves as the starting point for back diffusion; subsequently, the noisy sample x is... k Time step k, conditional vector c, and unconditional vector c uncond Input the trained denoising network respectively ∈ θ The conditional denoising result is obtained ∈ cond and unconditional denoising results ∈ uncond .

[0066] To achieve controllable data imputation, this disclosure introduces a global guidance mechanism. This mechanism treats a traffic data matrix containing data from all nodes across T time slices as a single sample. In each denoising step k, the posterior probability of the corresponding noisy sample x is used as the basis for the denoising step. k A unified guiding scale is dynamically adjusted, denoted as λ(x). k (k). This scale is used to control the guiding vector, which is the difference between the conditional score estimate and the unconditional score estimate.

[0067] Define unconditional scores as Define the conditional score as The resulting formula for the guided score is as follows:

[0068]

[0069] Furthermore, existing global guidance mechanisms adjust the guidance scale between each denoising step and apply this scale uniformly to all nodes, but this approach ignores the differences in the fit between different nodes and the observed data.

[0070] To address this issue, this disclosure proposes a clustering-aware feedback guidance strategy: when grouping nodes, the spatial attention score matrix A output by the conditional denoising network is utilized. attn ∈R N×N (Where N is the total number of nodes). The scores in this matrix quantify the dynamic correlation between all pairs of nodes.

[0071] This attention matrix is ​​treated as a "learned adjacency matrix," and the k-means algorithm is used to divide the node set V into K disjoint clusters, i.e., {C1, C2, ..., C6}. K}

[0072] In each step of the backdiffusion process, for cluster C j For any node i, first calculate the posterior probability of the cluster mean logarithm.

[0073] In an exemplary embodiment, the cluster-level posterior probability is calculated by: clustering all nodes using the spatial attention matrix output by the conditional network to form multiple node clusters; and calculating the average of the logarithmic posterior probabilities of all nodes within each node cluster as the cluster-level posterior probability.

[0074] The computation of a single node can fluctuate due to random noise. Averaging across multiple nodes within a cluster can smooth out these random fluctuations, resulting in a more reliable and stable alignment signal. A "node" can refer to an independent, specific data collection point in a traffic sensor network. "Node clustering" refers to dividing all nodes into K distinct groups based on some similarity criterion. Each group is called a "cluster" or "segmentation," where nodes within a group are highly similar to each other, while nodes in different groups are significantly different. For example, cluster C1 might contain nodes along major highways, cluster C2 might contain nodes in the city center road network, and cluster C3 might contain nodes at city entrances and exits, etc.

[0075] For example, the update rule for the cluster-level log-posterior probability is defined as:

[0076]

[0077] Among them, logp l (c|x k-1 ) is the log-posterior probability calculated individually for node l. By averaging the log-posterior probabilities of all nodes within the cluster, the estimated result is more stable and less affected by the high variance of a single node.

[0078] In an exemplary embodiment, calculating the guidance scale for the current step based on the posterior probability includes: calculating the guidance scale according to the following formula:

[0079]

[0080] in, Represents the posterior probability at the cluster level. The guiding scale, π, is a hyperparameter preset within the interval [0,1], such as 0.9 or 0.95. Its function is to set the "prior confidence" of the model's learning ability and thereby control the activation threshold of the feedback guiding mechanism. For example, using the above formula based on the cluster-level posterior probability... Calculate the shared guiding scale for all nodes within this cluster.

[0081] When the model detects that the alignment of a node or region is consistently low (i.e., low posterior probability), it can automatically increase the guidance scale λ to try to strengthen the guidance, and vice versa. Through the feedback mechanism, the model can eventually realize that these conditions are unreliable, thereby effectively reducing its reliance on these unreliable conditions and instead placing more trust in the general patterns learned from the data (prior distribution), generating more reasonable results.

[0082] Introduce this guiding metric into the original conditional score formula s θ (x k In c), the conditional distribution is obtained, and the final interpolation result x0 of the model is obtained by sampling from the conditional distribution.

[0083] To address the problems of existing methods, such as "poor adaptability of the globally fixed guidance scale," "ignoring node heterogeneity," and "difficulty in balancing prior and conditional distributions," this disclosure introduces a dynamic feedback guidance mechanism driven by posterior probability and a cluster-aware guidance mechanism. This transforms the guidance scale from a manually fixed hyperparameter into an adaptive dynamic value, and uses clustering methods to design the global guidance scale, thus combining efficiency and accuracy. In practice, for example... Figure 3 As shown, this disclosure significantly improves the accuracy of imputation for nodes with high missing rates, reducing the MAPE of nodes without observations from 0.259 to 0.228, enhancing the robustness of imputation under complex missing patterns. On the PEMS series datasets, all indicators surpass mainstream methods such as CSDI and ImputeFormer, providing more reliable data support for intelligent transportation systems and improving overall operational reliability.

[0084] The training process of the FENCE model includes dataset processing and phased model training. First, the collected traffic data is preprocessed using real traffic datasets from the California Department of Transportation's performance measurement system, PEMS04, PEMS07, and PEMS08. The data is aggregated at 5-minute intervals and divided into training set (60%), validation set (20%), and test set (20%) in chronological order. Then, these datasets are segmented into overlapping sequences using a sliding window to generate samples that are adapted to the model input.

[0085] The model training employs a two-stage strategy to avoid interference between unconditional prior distribution learning and conditional distribution learning. The first stage is unconditional model training, which only trains the denoising network ∈ θ Input structure prior information, including node embeddings E that characterize the inherent properties of traffic sensors. node ∈R N×d Learnable temporal embeddings E with time dimension features time ∈R T×d Conditional data x not included in the observation oThe training objective is to enable the model to learn the global prior distribution p(x) of traffic data, achieve convergence by minimizing the noise prediction loss, and save the weight parameters of the unconditional model after convergence.

[0086] The second stage involves fine-tuning the conditional model, initializing the denoising network with the unconditional model weights saved from the first stage. θ At this point, a conditional vector c containing the observed data is input to the model. This vector is generated by the conditional network F. cond Generation—First, a temporal attention layer is used to capture the temporal dependencies of individual nodes, then a spatial attention layer is used to aggregate the spatial relationships between nodes, and finally, the observed data x is fused. o Node embedding E node and time embedding E time The core objective of the fine-tuning phase is to enable the model to learn the conditional distribution p(x|c). While maintaining the global prior distribution characteristics learned in the first phase, the model optimizes its ability to capture observational conditional information. The noise prediction loss is also optimized. The model is trained continuously until the imputation error on the validation set stabilizes and converges. At this point, the training of the conditional model is complete. Finally, the weights of the trained complete model are saved for subsequent inference and data imputation tasks.

[0087] Figure 2 This paper presents a system architecture for traffic data interpolation based on an adaptive guided diffusion model. The architecture comprises a conditional network and a denoising network. The denoising network receives two types of inputs: an unconditional input for learning the basic distribution patterns of the complete traffic data, whose temporal prior module encodes the time-step information of the diffusion process and the temporal characteristics of the traffic data itself; and a conditional input corresponding to the actually observed known data points, serving as hard constraints for the guided interpolation process. To effectively capture the complex dependencies in the traffic network, the denoising network integrates a dual attention mechanism—a spatial attention module modeling the topological relationships and spatial interactions between different sensor nodes in the road network, and a temporal attention module focusing on mining the dynamic patterns and periodic regularities in each sensor data sequence. These modules work together to ensure that the generated interpolated data conforms to the road network connectivity logic in the spatial dimension and maintains trend continuity in the temporal dimension.

[0088] The system incorporates a sophisticated dynamic guidance and control mechanism. Based on a classifier-driven free-guidance framework, this mechanism guides the denoising direction through a mixture of conditional and unconditional scoring functions. After each denoising sampling step, the system initiates a conditional consistency evaluation procedure: quantifying the deviation of newly generated samples from conditional and unconditional predicted paths to diagnose the appropriateness of the current guidance intensity. When the evaluation finds that the generated samples deviate from the conditional constraints, the system automatically increases the guidance scale for the next step to strengthen the constraints of the observed data; conversely, when the samples fully meet the conditional constraints, the system appropriately reduces the guidance intensity to preserve data diversity. This closed-loop adaptive adjustment strategy ensures that the interpolation process is faithful to the known observations while maintaining the authenticity and rationality of the generated data. The entire system gradually optimizes the interpolation results through this "generation-evaluation-adjustment" cyclical approach. The final interpolated data not only accurately fills in missing values ​​but also maintains the inherent consistency and physical rationality of the entire traffic dataset in the spatiotemporal dimensions, providing a reliable data foundation for downstream traffic analysis and decision-making.

[0089] The denoising network learns the distribution of traffic data and gradually restores the initial state containing noise and missing values ​​to a complete interpolation result. The design of the denoising network fully considers the spatiotemporal characteristics of traffic data. Its internal spatial attention module is responsible for capturing the mutual influence between different sensor nodes in the road network, while the temporal attention module focuses on learning the dynamic patterns of traffic flow changes over time. Together, they ensure the reasonableness of the interpolation result in the spatiotemporal dimension.

[0090] Guided scoring function s θ (x k c) = s θ (x k )+λ(x k ,k)s θ (x k ,c)-s θ (x k The unconditional generative diversity s is balanced by the dynamic scaling parameter λ. θ (x k ) and condition constraints s θ (x k The weights between c) are used to determine the denoising mean in each denoising sampling step. The system calculates the parameterized denoising mean based on this guided score. And from this, obtain the next noisy sample x. k-1 .

[0091] To ensure the adaptability of the guidance strength, the system performs a conditional consistency assessment after each sampling step. If ||x k-1 -μ θ (x k ,k,c)||2 <||x k-1 -μ θ (x k ,k)|| 2 This indicates that the interpolated sample matches the observation conditions well, and the system will appropriately reduce the guidance scale to maintain data accuracy. Conversely, if the sample deviates from the conditional constraints, the system will increase the guidance scale in the next step to enhance the influence of the conditions. This closed-loop "generation-evaluation-adjustment" mechanism ensures that the final interpolation result strictly follows the known observations while maintaining the inherent spatiotemporal evolution patterns of traffic data.

[0092] This disclosure also provides an apparatus for large-scale model resource optimization based on traffic splitting. The apparatus includes modules for performing the above-described method steps. The various method steps involved in the technical solution of this disclosure have been described in detail in the description of the first aspect of this disclosure; therefore, the above description is applicable to an apparatus for large-scale model resource optimization based on traffic splitting in the second aspect of this disclosure, and accordingly, will not be repeated here.

[0093] This disclosure also provides an electronic device, which includes a memory and a processor. The memory stores a program, and the processor is configured to acquire the program and, when executing the program, execute the above-described traffic data interpolation method based on the spatiotemporal diffusion model.

[0094] The technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-transitory computer-readable storage medium (such as a CD-ROM, USB flash drive, mobile hard drive, etc.) or on a network, including several commands to cause a computing device (such as a personal computer, server, or network device, etc.) to execute the above-described methods according to the embodiments of this disclosure.

[0095] Exemplary embodiments of the present disclosure have been specifically shown and described above. It should be understood that the present disclosure is not limited to the detailed structures, arrangements, or implementation methods described herein; rather, the present disclosure is intended to cover various modifications and equivalent arrangements contained within the spirit and scope of the appended claims.

[0096] Obviously, those skilled in the art can make various modifications and variations to this disclosure without departing from its spirit and scope. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.

Claims

1. A traffic data interpolation method based on a spatiotemporal diffusion model, characterized in that, include: Obtain the traffic observation data to be interpolated, node embedding vector, and time embedding vector; A trained conditional network is used to generate a conditional vector based on the traffic observation data to be interpolated, the node embedding vector, and the time embedding vector, and an unconditional vector is generated based on the node embedding vector and the time embedding vector. Obtain the initial noisy data corresponding to the traffic observation data to be interpolated; as well as A multi-step reverse diffusion process is performed, starting from the initial noisy data and gradually denoising until the final interpolation result is obtained. Each denoising step includes: Conditional prediction noise is generated using a trained denoising network based on the noisy data of the current step, the current time step, and the conditional vector; unconditional prediction noise is also generated using the denoising network based on the noisy data of the current step, the current time step, and the unconditional vector. Obtain the posterior probability of the current step, and calculate the guiding scale of the current step based on the posterior probability; and The next step of noisy data is calculated based on the conditional predicted noise, the unconditional predicted noise, and the guiding scale.

2. The method according to claim 1, characterized in that, The posterior probability of the current step is obtained through an update step in the previous denoising step, wherein the update step includes: Based on the noisy data, conditional prediction noise, and unconditional prediction noise from the previous denoising step, calculate the denoised data corresponding to this step. Calculate the conditional mean and unconditional mean corresponding to the conditional prediction noise and the unconditional prediction noise, respectively; The posterior probability of the current step is updated by comparing the distance between the denoised data and the conditional mean and the unconditional mean.

3. The method according to claim 1, characterized in that, Calculating the guiding scale for the current step based on the posterior probability includes: The guiding scale is calculated using the following formula: in, Represents the posterior probability at the cluster level. The guide scale is represented by π, which is a hyperparameter preset in the interval [0,1].

4. The method according to claim 3, characterized in that, The cluster-level posterior probability is calculated as follows: The spatial attention matrix output by the conditional network is used to cluster all nodes, forming multiple node clusters; and The average of the logarithmic posterior probabilities of all nodes within each node's cluster is calculated as the cluster-level posterior probability.

5. The method according to claim 4, characterized in that, Based on the predicted noise and the guiding scale, the next step of calculating the noisy data includes: Based on the conditional score function and unconditional score function corresponding to the conditional and unconditional prediction noise, the guided score function is calculated using the following formula: Among them, s θ (x k ) represents the unconditional scoring function, s θ (x k c) represents the conditional score function, λ(x) k ,k) represents the guiding scale; and Using the guided scoring function, the noisy data for the next step is calculated from the noisy data of the current step through the sampling algorithm of the diffusion model.

6. The method according to claim 5, characterized in that, The scoring function is calculated using the following formula: ∈ θ (x k ,k) represents the noise at the k-th step of the prediction, σ k This represents the standard deviation of the noise at step k. This represents the scoring function.

7. The method according to claim 6, characterized in that, Generating the condition vector includes: capturing the temporal correlation of each node at different time steps through a temporal attention mechanism, and aggregating the spatial correlation between different nodes at each time step through a spatial attention mechanism to generate the condition vector.

8. The method according to claim 7, characterized in that, The trained conditional network and denoising network were trained in the following way: Input null or zero values ​​into the conditional network to generate unconditional vectors; The unconditional vector, noisy sample, and time step are input into the denoising network, and the denoising network is trained until convergence. Traffic observation data, node embedding vectors, and time embedding vectors are input into the conditional network to generate conditional vectors; as well as The conditional vector, noisy samples, and time steps are input into the denoising network to fine-tune the denoising network.