A multivariate time series imputation method based on a granularity-aware diffusion model
By using a granularity-aware diffusion model, multi-granularity collaborative modeling and frequency domain enhancement processing are achieved, solving the problems of multi-granularity collaborative modeling and cross-scale consistency in time series interpolation, improving the accuracy and stability of interpolation results, and making it applicable to multiple application fields.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN TECH UNIV
- Filing Date
- 2026-03-23
- Publication Date
- 2026-06-05
AI Technical Summary
Existing time series interpolation methods have shortcomings in multi-granularity collaborative modeling, cross-scale consistency constraints, frequency-aware modeling, and robustness against high missing rates. They are difficult to coordinate the diffusion process of different time granularities within a single generation framework, resulting in insufficient stability, detail fidelity, and boundary consistency of the interpolation results.
A granularity-aware diffusion model is adopted, which generates multi-scale sequence representations through a multi-granularity sequence generator. By combining differentiated diffusion time steps and noise scheduling weights, a multi-granularity cross-attention module is used to achieve hierarchical reconstruction from coarse to fine. In the reverse denoising process, frequency domain enhancement processing is introduced to ensure information interaction and consistency between different granularities.
It significantly improves the accuracy and stability of imputation results, and can maintain global trend consistency and accuracy of local details in scenarios with high missing rates and long-span continuous missing data. It is applicable to fields such as medical monitoring, industrial control, energy dispatch and financial analysis.
Smart Images

Figure CN122154812A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a multivariate time series interpolation method based on a granularity-aware diffusion model. Background Technology
[0002] Multivariate time series data are widely used in fields such as medical monitoring, energy dispatching, industrial control, meteorological observation, and financial analysis, serving as a crucial foundation for anomaly detection, predictive decision-making, and clinical diagnosis. However, in actual data acquisition, missing data is inevitable due to sensor malfunctions, communication interruptions, or human error, severely impacting the accuracy and reliability of subsequent analysis results. Therefore, developing high-precision and robust time series interpolation methods is of great significance.
[0003] Existing time series interpolation methods can be mainly divided into three categories: interpolation-based methods, predictive modeling-based methods, and generative model-based methods. Interpolation-based methods (such as linear interpolation, spline interpolation, and K-nearest neighbor interpolation) usually rely on the assumption of local continuity. They are effective when the missing proportion is low and the sequence changes are gradual, but they are prone to large errors when the missing span is large or there are complex dynamic changes. Predictive modeling-based methods use sequence models such as recurrent neural networks or Transformers to infer missing values based on historical observation information. They can model time dependencies, but they usually assume that the time series is approximately stationary and mostly model on a single time scale. They are difficult to simultaneously characterize long-term trends and short-term fluctuations, and are not adaptable to sudden changes and long-term continuous missing scenarios.
[0004] In recent years, generative methods based on diffusion models have been increasingly applied to time series interpolation tasks, recovering missing data through a reverse generation process and demonstrating advantages in characterizing uncertainty. However, existing generative interpolation methods generally employ a uniform diffusion and reconstruction process, treating time series as a single-granularity structure and ignoring the hierarchical and multi-scale dynamic characteristics prevalent in time series. Some studies have attempted to model components at different time scales through trend decomposition or seasonal separation, but the lack of effective interaction and consistency constraints between different granularities means that fine-grained local reconstructions may deviate from the overall trend determined by coarse-grained methods, thus weakening the global coherence of the interpolation results.
[0005] Furthermore, most existing methods are limited to time-domain modeling and lack the ability to explicitly characterize the frequency features of sequences, making it difficult to simultaneously and accurately recover periodic structures and high-frequency detail signals. This results in challenges in the stability, detail fidelity, and boundary consistency of imputation results in scenarios with high missing rates or long-span continuous missing data.
[0006] In summary, existing time series interpolation techniques still have significant shortcomings in multi-granularity collaborative modeling, cross-scale consistency constraints, frequency-aware modeling, and robustness against high missing rates. Specifically, key issues remain unresolved, such as how to coordinate the diffusion process at different time granularities within a single generation framework, how to ensure the consistency of cross-granularity reconstruction results, and how to integrate time-domain and frequency-domain information to achieve refined reconstruction. Summary of the Invention
[0007] The purpose of this invention is to provide a multivariate time series interpolation method based on a granularity-aware diffusion model to solve the problems mentioned in the background art.
[0008] To achieve the above objectives, this invention provides a multivariate time series interpolation method based on a granularity-aware diffusion model, comprising the following steps: S1. Obtain the multivariate time series to be processed, preprocess the multivariate time series and generate a missing mask to obtain the input data containing missing values and the corresponding mask. S2. Based on the input data, the preprocessed multivariate time series is smoothed at multiple scales using a multi-granularity sequence generator to generate multiple sequence representations with different time granularities on a shared time axis. S3. Assign differentiated diffusion time step ratios or noise scheduling weights to multiple sequence representations with different time granularities, and perform the forward diffusion process. S4. A denoising network is used to perform a reverse denoising process, and hierarchical reconstruction is performed in the order from the coarsest time granularity to the finest time granularity. The reconstruction of the fine-grained sequence takes the current reconstruction results of all coarser-grained sequences as conditional input. Through the multi-granularity cross-attention module in the denoising network, the contextual information guidance and fusion from the coarser-grained sequence to the finer-grained sequence is realized with the finer-grained sequence as the condition. S5. After multiple steps of reverse denoising, the finest-grained reconstructed sequence is output as the final multivariate time series interpolation result.
[0009] Preferably, in S2, the multi-granularity sequence generator performs multi-scale smoothing on the input data based on the missing mask to generate sequences of various granularities, while keeping the missing positions aligned with the original input in each granularity sequence.
[0010] Preferably, the forward diffusion process in S3 is as follows: based on the missing mask, noise is gradually added only to the regions marked as missing in the multi-granularity sequence representation, while the regions marked as observations retain their original values.
[0011] Preferably, the multi-granularity cross-attention module achieves the guidance and fusion of contextual information from coarse-grained to fine-grained in the following way: Let multiple time granularity levels be represented in ascending order from finest to coarsest as follows: ,in This represents the total number of particle size layers. For the finest granularity, This is the coarsest grain size; At the current reverse denoising time step The finer-grained sequence to be reconstructed corresponds to the first... The first granularity level corresponds to the second granularity level; a coarser granularity indicates the third granular Each granularity level, among which ; a. Through a learnable projection matrix shared across all granularities , will the Representation of each granularity level Projecting the query vector, the first... Representation of each granularity level The projection is a key vector and a value vector; b. Calculate the number using the following formula. Granularity for the first Granularity of cross-attention weights and output: ; ; in, This is the cross-attention weight matrix. For feature dimension, For cross-granularity attention output function; c. For the first Granularity, and its fused representation By aggregating all coarser-grained levels The attention output is obtained, and the calculation formula is as follows: ; in, This represents the total number of particle size layers.
[0012] Preferably, the reconstruction of arbitrary granularity sequences in S4 is specifically implemented as follows: based on the features fused by the multi-granularity cross-attention module, a preliminary reconstruction sequence of the granularity sequence is generated; frequency domain enhancement processing is performed on the preliminary reconstruction sequence to obtain the final reconstruction result of the granularity sequence.
[0013] Preferably, the specific steps of frequency domain enhancement processing are as follows: a. Perform multi-level discrete wavelet decomposition on the preliminary reconstructed sequence obtained during the denoising process to obtain low-frequency approximate components and high-frequency detail components; b. Perform adaptive threshold denoising on high-frequency detail components; c. The processed high-frequency detail components and low-frequency approximation components are reconstructed using inverse discrete wavelet transform to obtain the final reconstructed sequence.
[0014] Preferably, the hierarchical conditional denoising and reconstruction of S4 is specifically as follows: at the beginning of the reverse denoising process, i.e., at time step... For each granularity level The initial value of its reconstructed sequence Set to the corresponding state at the end of the forward diffusion process That is, satisfying ; At each time step of reverse denoising First, the coarsest-grained sequence is reconstructed unconditionally; for any finer-grained sequence... Granularity, its reconstructed sequence The generation depends on all those that are more than the first The coarser grain size The current time step of granularity The representation of This conditional dependency is defined by the following expression: ; in, Represents the conditional probability distribution. This represents the total number of particle size layers.
[0015] Preferably, the goal of S5's multi-step inverse denoising is to improve the granularity of each level. Reconstruct its fully denoised sequence, denoted as The final multivariate time series interpolation results This is the final reconstructed sequence at the finest granular level, satisfying... .
[0016] Preferably, it also includes a step of training the denoising network, whose total loss function The construction method is as follows: Calculate each particle size level separately The final reconstruction sequence Corresponding true value Error loss between Defined as ; The total training loss is obtained by weighted summation of the error losses at each granularity level. ; in, For the first The weighting coefficients corresponding to each granularity This represents the total number of particle size layers.
[0017] Therefore, the multivariate time series interpolation method based on a granularity-aware diffusion model described above, as used in this invention, has the following beneficial effects: (1) By constructing a unified framework that integrates multi-granularity sequence generation, differentiated diffusion scheduling, and hierarchical conditional denoising, this invention can collaboratively characterize the long-term trend and short-term dynamics of time series in a coherent generation process. This effectively solves the problem that existing methods are difficult to balance global trend consistency and local detail accuracy when modeling at a single time scale, thus significantly improving the accuracy and stability of imputation in scenarios with high missing rates and long-span continuous missing data.
[0018] (2) By introducing a multi-granularity cross-attention module and enforcing a coarse-to-fine condition generation order during the reverse denoising process, this invention achieves explicit interaction and semantic alignment between features of different temporal granularities. This mechanism constrains the fine-grained local reconstruction to conform to the global trend established by the coarser granularity from the model structure, effectively avoiding the phenomenon of contradiction between local interpolation results and the overall trend commonly found in existing multi-scale methods, and significantly enhancing the overall coherence and physical rationality of the reconstruction sequence.
[0019] (3) By introducing a frequency domain enhancement mechanism based on discrete wavelet transform in the sequence reconstruction stage, this invention adds explicit characterization of multi-scale frequency components on the basis of the powerful time-domain generation capability of the diffusion model. This mechanism can retain key periodic patterns and local fluctuation features while suppressing noise through adaptive threshold processing of high-frequency detail coefficients, thereby effectively improving the performance of interpolation results in terms of periodic recovery and boundary smoothness, and making up for the shortcomings of existing pure time-domain diffusion models.
[0020] (4) The above-mentioned multi-granularity diffusion scheduling, hierarchical conditional denoising, cross-granularity attention fusion, and frequency domain enhancement modules constitute a synergistic system-level solution. Through multi-mechanism linkage, this solution can simultaneously ensure excellent performance in terms of trend consistency, dynamic precision, and robustness to high missing rates when facing complex, non-stationary, multivariate time series. This invention does not rely on domain-specific assumptions and can be widely applied in multiple fields such as medical monitoring, industrial control, energy dispatching, meteorological forecasting, and financial analysis, providing high-quality data support for downstream tasks and possessing good versatility and practical value.
[0021] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0022] Figure 1 This is a flowchart of a multivariate time series interpolation method based on a granularity-aware diffusion model according to the present invention. Figure 2This is an architecture diagram of the granularity-aware diffusion model according to an embodiment of the present invention; Figure 3 This is a comparison curve of the error change trends of each model under different missing proportions in the embodiments of the present invention; Figure 4 This is a comparison chart showing the interpolation performance of the GaDi and CSDI methods on the ETTh1 and Weather datasets in this invention. Detailed Implementation
[0023] The following detailed description of embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely illustrates selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0024] Example like Figure 1 As shown, this invention provides a multivariate time series interpolation method based on a granularity-aware diffusion model, comprising the following steps: This embodiment proposes a granularity-aware diffusion model called GaDi (Granularity-Aware Diffusion for Time Series Imputation), whose core architecture is as follows: Figure 2 As shown, the model is based on multi-granularity collaborative modeling and mainly includes the following components: a multi-granularity sequence generator for generating multi-scale sequence representations; a diffusion and denoising module for performing noise addition and removal, wherein the denoising network adopts an encoder-decoder structure; a sequence representation learning module integrated in the denoising network, the core of which is a multi-granularity cross-attention unit, used to achieve the fusion of features at different scales; and a sequence reconstruction module, which includes a frequency domain enhancement unit based on discrete wavelet transform, used to optimize reconstruction quality.
[0025] like Figure 1 As shown, the specific steps for performing multi-granularity diffusion and reconstruction are as follows: S1. Obtain time series data from a public dataset, simulate missing values in the obtained time series data, generate a binary mask that is precisely aligned with the missing positions in the time series data, and perform preprocessing such as normalization on the time series data (e.g., Min-Max normalization to the [0,1] interval) to obtain preprocessed input data containing missing values and its corresponding mask for subsequent processing.
[0026] S2. Based on the input data and missing mask obtained in step S1, the sequence is processed by a multi-granularity sequence generator. Guided by the missing mask, the multi-granularity sequence generator performs multi-scale smoothing on the input sequence, generating multiple sequence representations with different temporal granularities on the same shared time axis (for example, three levels of representations: coarse-grained, medium-grained, and fine-grained), and ensuring that the missing position identifiers in each level of sequence are completely consistent with the original mask.
[0027] S3. Assign differentiated diffusion time step ratios or noise scheduling weights to multiple sequence representations with different time granularities, so that different granularities bear different weights in the overall diffusion process, and execute the forward diffusion process.
[0028] The forward diffusion process is as follows: based on the missing mask, Gaussian noise is gradually added only to the regions marked as missing in the multi-granularity sequence representation, while the regions marked as observations retain their original values.
[0029] S4. A denoising network is used to perform the reverse denoising process. First, the process proceeds in order from the coarsest time granularity to the finest time granularity. The coarsest granularity sequence is generated unconditionally. For any finer granularity sequence, its reconstruction process takes the current reconstruction results of all coarser granularity sequences as conditional input. This conditional fusion is achieved through the multi-granularity cross-attention module in the denoising network. Subsequently, frequency domain enhancement processing is performed on the preliminary reconstruction sequence of each granularity.
[0030] The multi-granularity cross-attention module achieves the guidance and fusion of contextual information from coarse-grained to fine-grained in the following way: Let multiple time granularity levels be represented in ascending order from finest to coarsest as follows: ,in This represents the total number of particle size layers. For the finest granularity, This is the coarsest grain size; At the current reverse denoising time step The finer-grained sequence to be reconstructed corresponds to the first... The first granularity level corresponds to the second granularity level; a coarser granularity indicates the third granular Each granularity level, among which ; a. Through a learnable projection matrix shared across all granularities , will the Representation of each granularity level Projecting the query vector, the first... Representation of each granularity level The projection is a key vector and a value vector; b. Calculate the number using the following formula. Granularity for the first Granularity of cross-attention weights and output: ; ; in, This is the cross-attention weight matrix. For feature dimension, For cross-granularity attention output function; c. For the first Granularity, and its fused representation By aggregating all coarser-grained levels The attention output is obtained, and the calculation formula is as follows: ; in, This represents the total number of particle size layers.
[0031] The reconstruction of arbitrary granularity sequences is specifically implemented as follows: based on the features fused by multi-granularity cross-attention modules, a preliminary reconstruction sequence of the granularity sequence is generated; frequency domain enhancement processing is performed on the preliminary reconstruction sequence to obtain the final reconstruction result of the granularity sequence.
[0032] The specific steps of frequency domain enhancement processing are as follows: a. Perform multi-level discrete wavelet decomposition on the preliminary reconstructed sequence obtained during the denoising process to obtain low-frequency approximate components and high-frequency detail components; b. Perform adaptive threshold denoising on high-frequency detail components; c. The processed high-frequency detail components and low-frequency approximation components are reconstructed using inverse discrete wavelet transform to obtain the final reconstructed sequence.
[0033] The specific implementation of hierarchical conditional denoising and reconstruction is as follows: at each time step of inverse denoising, the coarsest-grained sequence is first reconstructed unconditionally; for any finer-grained sequence, its reconstruction process is carried out with the current reconstruction results of all coarser-grained sequences as conditional inputs.
[0034] S5. After multiple steps of reverse denoising, the finest-grained reconstructed sequence is output as the final multivariate time series interpolation result.
[0035] The training of the denoising network is accomplished by optimizing a multi-granularity weighted reconstruction loss function. During the training phase, complete time-series data is required, and training samples are simulated by randomly generating masks with different missing proportions. The loss function is constructed as follows: Its total loss function The construction method is as follows: Calculate each particle size level separately The final reconstruction sequence Corresponding true value Error loss between Defined as ; The total training loss is obtained by weighted summation of the error losses at each granularity level. ; in, For the first The weighting coefficients corresponding to each granularity ,satisfy .
[0036] To verify the versatility and robustness of the method in this embodiment, seven typical multivariate time series datasets from fields such as energy monitoring, meteorological observation, power load, and financial markets were selected as test objects, including ETTh1, ETTh2, ETTm1, ETTm2, Weather, Electricity, and Stocks datasets. As shown in Table 1, these datasets cover different numbers of variables, time lengths, and sampling intervals, enabling a comprehensive evaluation of the applicability of the interpolation method under different scales and dynamic characteristics. Table 1. Basic Information of the Dataset
[0037] The hardware environment used in the experiment consisted of an Intel Xeon Gold 6338 CPU (Intel(R) Xeon(R)Silver 4210 CPU @ 2.20GHz), an NVIDIA A100 (40GB) (NVIDIA GeForce RTX 4090 25GB) GPU, and 128GB of memory. The software environment consisted of an Ubuntu 20.04 operating system, a PyTorch 2.0 (2.4.1+cu121) deep learning framework, and a PyWavelets 1.4.1 wavelet transform library. The basic parameters of the model were set as follows: a total diffusion time step of 1000, an initial learning rate of 0.0005, a cosine annealing decay strategy, an AdamW optimizer, 10000 training iterations, and a batch size of 64.
[0038] In the experiment of this embodiment, the publicly available dataset used is itself a complete sequence. In order to simulate a real missing scenario for model training and testing, during the data preprocessing stage, a missing mask with the same dimension as the original sequence is generated by random sampling according to a preset missing ratio (such as 10%, 30%, 50%, 70%), and the complete sequence is masked accordingly to construct a time series sample containing simulated missing values that conforms to the input of step S1.
[0039] S2. Determine the number of granularity levels (2-4 is recommended) based on the sampling interval of the dataset. Taking the ETTm1 dataset (15-minute sampling interval) as an example, fine granularity is the original sampling interval to retain short-term fluctuation details, medium granularity is 4 times that of fine granularity (1 hour) to characterize medium-term cycle features, and coarse granularity is 4 times that of medium granularity (4 hours) to capture long-term trends. Use moving average or Gaussian smoothing to perform multi-scale smoothing on the preprocessed sequence. For example, the medium granularity sequence is obtained by averaging 4 consecutive time steps of fine granularity. At the same time, based on the missing mask, map the missing positions of fine granularity to medium and coarse granular sequences to ensure that the missing positions of each granularity sequence are aligned on the shared time axis to avoid time misalignment in subsequent modeling.
[0040] S3. Differentiated diffusion time step ratios are assigned to different granularities, with a total diffusion time step of 1000. Coarse granularity accounts for 30%-50%, and fine granularity accounts for 50%-70%, so that each granularity bears different weights in the overall diffusion process. Gaussian noise is used to gradually destroy the missing regions of each granularity sequence. Noise is added only to the regions marked as missing by the missing mask, while the observation area retains the original normalized value, thus avoiding the destruction of effective information and realizing collaborative noise modeling of multi-scale information.
[0041] S4. A U-Net-based denoising network is adopted, which includes an encoder, a bottleneck layer, and a decoder. The encoder is used to extract the missing region features of multi-granularity sequences, and the decoder is used to reconstruct the sequences. Reconstruction is performed in a coarse-to-fine order. First, the coarse-granular sequence is reconstructed unconditionally to ensure long-term trend stability. Subsequently, the reconstruction of fine-granular levels takes the current reconstruction results of all coarser-granular levels as conditional inputs, structurally constraining the consistency of results of different granularities. A multi-granularity cross-attention module is embedded in the encoder stage. By calculating the attention weights between the sequence representations of different granularities, the bidirectional semantic dependency between different granularities is modeled to achieve cross-granularity information fusion and semantic alignment. Frequency domain enhancement processing is performed on the preliminary fine-granular reconstructed sequence. First, multi-level discrete wavelet decomposition is performed to obtain low-frequency approximate components and high-frequency detail components. After adaptive threshold denoising processing is performed on the high-frequency detail components, the final fine-granular reconstructed sequence is obtained by inverse discrete wavelet transform, which effectively suppresses noise and preserves periodic structure and local fluctuation information.
[0042] S5. Calculate the error loss between the reconstruction result and the corresponding true value of each granularity level sequence. Summate the error losses of each granularity level with weights ranging from 0 to 1, with the sum of the weights equal to 1, to balance the contribution of different time scales to the final imputation result. Iterate the AdamW optimizer for 10,000 rounds, validating every 1,000 rounds. Set different iteration and validation rounds for different datasets. If the validation set error does not decrease for 20 consecutive rounds, stop early. After training, perform the above steps on the test set to output the fine-grained final reconstructed sequence. Combine this with a missing mask to fill the missing positions of the original sequence with the reconstructed values, obtaining a complete multivariate time series.
[0043] To verify the effectiveness of the method in this embodiment, systematic comparative experiments were conducted on multiple public datasets. Seven representative methods—PSW-T, Diffusion-TS, iTransformer, PatchTST, CSDI, DLinear, and TimesNet—were selected as benchmarks, and Mean Absolute Error (MAE) and Mean Squared Error (MSE) were used as the main evaluation metrics. Quantitative results are shown in Table 2. On the six datasets ETTh1, ETTh2, ETTm1, ETTm2, Weather, and Electricity, under four missing rate (MR) conditions (10%, 30%, 50%, and 70%), the method in this embodiment (GaDi) achieved the best or near-best MSE and MAE in most cases. Especially in high missing rate scenarios such as 50% and 70%, the performance advantage of the method in this embodiment is more significant, with a significantly lower error growth rate than other comparative methods. For example, in the ETTh1 dataset with a 70% missing rate, GaDi's MSE (0.120) is significantly lower than PSW-T (0.194) and Diffusion-TS (0.164); in the Weather dataset with various missing rates, GaDi's MAE (approximately 0.065) consistently remains the lowest. This indicates that the method in this embodiment effectively mitigates performance degradation under high missing rates through multi-granularity collaboration and frequency domain enhancement, demonstrating excellent robustness and accuracy.
[0044] Table 2 Comparison of insertion and removal performance of each model under different missing proportions
[0045] Table 2 shows that the method in this embodiment achieves optimal or near-optimal performance under most dataset and evaluation metric combinations, with an overall error significantly lower than existing comparative methods. For example... Figure 3 The graph shows the comparison of error trends of each model under different missing percentages. The horizontal axis represents the missing percentage, and the vertical axis represents the error value. As the missing percentage increases, the error of all methods increases, but the error of the method in this embodiment is the smallest. At a missing percentage of 70%, the error is reduced by 33.3% compared with the existing best method, showing good stability and robustness. On datasets with strong periodicity and complex dynamic changes, this embodiment performs particularly well in reconstructing periodic structures and local fluctuations.
[0046] To verify the contributions of the multi-granularity diffusion-guided mechanism (MGGD), multi-granularity cross-attention module (CGA), and wavelet enhancement module (DWT) to the overall performance, ablation models with the corresponding modules removed were constructed for comparative experiments. The ablation results (MSE) at 50% missing ratio (MR) are shown in Table 3. Table 3. Results of critical module ablation experiments (MSE) at 50% missing ratio (MR)
[0047] The results show that the GaDi method performs best. After removing any key module, the model error increases significantly, indicating that each module plays an important role in capturing multi-scale temporal structure and frequency features. It also shows the importance of incorporating multi-granular contextual information when capturing complex temporal patterns.
[0048] To further investigate the impact of granularity level on performance, a control experiment was conducted by changing the number of granularities used from 2 to 5. The performance of the GaDi method on the Stocks dataset under different missing ratios (MR) and different granularity levels is shown in Table 4. Table 4. Performance of GaDi on the Stocks dataset under different missing rates and granularity levels.
[0049] Table 4 shows the interpolation errors represented by MAE and MSE on the Stocks dataset. It can be seen that increasing the number of granularities generally improves performance, achieving the best results at four levels, while performance degrades at five granularities due to information redundancy. This indicates that combining richer multi-granularity representations provides more comprehensive contextual guidance for the diffusion process, while also requiring a reasonable setting of the number of multi-granularity levels. This effectively balances information richness and model complexity, improving the stability and accuracy of the diffusion interpolation process. Figure 4The diagram shows a comparison of the interpolation performance of the GaDi and CSDI methods on the ETTh1 and Weather datasets. Red crosses represent observed values, blue dots represent the true values at missing locations, solid green lines represent the interpolated values of the method in this embodiment, and gray dashed lines represent the interpolated values of CSDI. The shaded area represents the prediction range of 5%-95%. It is evident that the interpolation curve of the method in this embodiment closely matches the true values, has a narrower prediction range, and covers a higher proportion of the true values. It can accurately recover fluctuation characteristics in periodic fluctuation segments, reducing interpolation discontinuities at boundaries, and exhibits a smoother and more stable reconstruction effect compared to the comparison methods.
[0050] Therefore, this invention adopts a multivariate time series interpolation method based on a granularity-aware diffusion model. By organically combining multi-granularity collaborative diffusion modeling, cross-granularity condition reconstruction, and frequency domain enhancement mechanism, it effectively solves the problem that existing methods are difficult to balance global trend consistency and local detail accuracy in complex missing scenarios. It significantly improves the accuracy, coherence, and robustness of interpolation and can be widely applied in fields such as medical monitoring, industrial control, and financial analysis.
[0051] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A multivariate time series interpolation method based on a granularity-aware diffusion model, characterized in that, Includes the following steps: S1. Obtain the multivariate time series to be processed, preprocess the multivariate time series and generate a missing mask to obtain the input data containing missing values and the corresponding mask. S2. Based on the input data, the preprocessed multivariate time series is smoothed at multiple scales using a multi-granularity sequence generator to generate multiple sequence representations with different time granularities on a shared time axis. S3. Assign differentiated diffusion time step ratios or noise scheduling weights to multiple sequence representations with different time granularities, and perform the forward diffusion process. S4. A denoising network is used to perform a reverse denoising process, and hierarchical reconstruction is performed in the order from the coarsest time granularity to the finest time granularity. The reconstruction of the fine-grained sequence takes the current reconstruction results of all coarser-grained sequences as conditional input. Through the multi-granularity cross-attention module in the denoising network, the contextual information guidance and fusion from the coarser-grained sequence to the finer-grained sequence is realized with the finer-grained sequence as the condition. S5. After multiple steps of reverse denoising, the finest-grained reconstructed sequence is output as the final multivariate time series interpolation result.
2. The multivariate time series interpolation method based on a granularity-aware diffusion model according to claim 1, characterized in that: In S2, the multi-granularity sequence generator performs multi-scale smoothing on the input data based on the missing mask to generate sequences of various granularities, while keeping the missing positions aligned with the original input in each granularity sequence.
3. The multivariate time series interpolation method based on a granularity-aware diffusion model according to claim 2, characterized in that: The forward diffusion process in S3 is as follows: based on the missing mask, noise is gradually added only to the regions marked as missing in the multi-granularity sequence representation, while the regions marked as observations retain their original values.
4. The multivariate time series interpolation method based on a granularity-aware diffusion model according to claim 1, characterized in that, The multi-granularity cross-attention module achieves the guidance and fusion of contextual information from coarse-grained to fine-grained in the following way: Let multiple time granularity levels be represented in ascending order from finest to coarsest as follows: ,in This represents the total number of particle size layers. For the finest granularity, This is the coarsest grain size; At the current reverse denoising time step The finer-grained sequence to be reconstructed corresponds to the first... The first granularity level corresponds to the second granularity level, and a coarser granularity corresponds to the third granularity level. There are several granularity levels, among which ; a. Through a learnable projection matrix shared across all granularities , will the Representation of each granularity level Projecting the query vector, the first... Representation of each granularity level The projection is a key vector and a value vector; b. Calculate the number using the following formula. Granularity for the first Granularity of cross-attention weights and output: ; ; in, This is the cross-attention weight matrix. For feature dimension, For cross-granularity attention output function; c. For the first Granularity, and its fused representation By aggregating all coarser-grained levels The attention output is obtained, and the calculation formula is as follows: ; in, This represents the total number of particle size layers.
5. The multivariate time series interpolation method based on a granularity-aware diffusion model according to claim 4, characterized in that, The specific implementation of reconstruction of arbitrary granularity sequences in S4 is as follows: based on the features fused by multi-granularity cross-attention modules, a preliminary reconstruction sequence of the granularity sequence is generated; frequency domain enhancement processing is performed on the preliminary reconstruction sequence to obtain the final reconstruction result of the granularity sequence.
6. The multivariate time series interpolation method based on a granularity-aware diffusion model according to claim 5, characterized in that, The specific steps of frequency domain enhancement processing are as follows: a. Perform multi-level discrete wavelet decomposition on the preliminary reconstructed sequence obtained during the denoising process to obtain low-frequency approximate components and high-frequency detail components; b. Perform adaptive threshold denoising on high-frequency detail components; c. The processed high-frequency detail components and low-frequency approximation components are reconstructed using inverse discrete wavelet transform to obtain the final reconstructed sequence.
7. The multivariate time series interpolation method based on a granularity-aware diffusion model according to claim 1, characterized in that, The specific implementation of S4's hierarchical conditional denoising and reconstruction is as follows: at the beginning of the inverse denoising process, i.e., at time step... For each granularity level The initial value of its reconstructed sequence Set to the corresponding state at the end of the forward diffusion process That is, satisfying ; At each time step of reverse denoising First, the coarsest-grained sequence is reconstructed unconditionally; for any finer-grained sequence... Granularity, its reconstructed sequence The generation depends on all those that are more than the first The coarser grain size The current time step of granularity The representation of This conditional dependency is defined by the following expression: ; in, Represents the conditional probability distribution. This represents the total number of particle size layers.
8. The multivariate time series interpolation method based on a granularity-aware diffusion model according to claim 1, characterized in that: The goal of S5's multi-step reverse denoising is to improve the granularity of each level. Reconstruct its fully denoised sequence, denoted as The final multivariate time series interpolation results This is the final reconstructed sequence at the finest granular level, satisfying... .
9. A multivariate time series interpolation method based on a granularity-aware diffusion model according to claim 8, characterized in that, It also includes the step of training the denoising network, whose total loss function The construction method is as follows: Calculate each particle size level separately The final reconstruction sequence Corresponding true value Error loss between Defined as ; The total training loss is obtained by weighted summation of the error losses at each granularity level. ; in, For the first The weighting coefficients corresponding to each granularity This represents the total number of particle size layers.