Abstract:Time series imputation aims to restore data integrity by filling in missing values based on existing data. Currently, RNN-based imputation methods suffer from large errors, and increasing the number of network layers often leads to exploding and vanishing gradients. Additionally, GAN-based and VAE-based imputation methods frequently encounter challenges such as training difficulties and pattern collapse. To address these challenges, this study proposes a time series imputation model named diffusion model and time-frequency attention (DTFA), which reconstructs missing data from Gaussian noise through reverse diffusion. Specifically, this study utilizes multi-scale convolutional modules and two-dimensional attention mechanisms to capture temporal dependencies in time-domain data and employs MLPs and two-dimensional attention mechanisms to learn real and imaginary parts of frequency-domain data. This study also implements a linear imputation module to augment the existing observed data, thereby providing better guidance for model imputation. Finally, this study trains a noise estimation network by minimizing the Euclidean distance between real noise and estimated noise and then utilizes reverse diffusion to fill in the missing values in time series data. The experimental results demonstrate that DTFA outperforms mainstream baseline models in terms of imputation effectiveness on three public datasets: ETTm1, WindPower, and Electricity.