A Diffusion-Based Time-Frequency Dual-Stream Contrastive Learning Model for Multivariate Time Series Anomaly Detection
Abstract
1. Introduction
- Proposed a novel TFCID framework that integrates diffusion models, imputation, temporal-frequency analysis, and contrastive learning into a unified model framework, providing a new and powerful solution for multivariate time series anomaly detection.
- Designed an adversarial temporal-frequency contrastive learning mechanism for anomaly detection, which effectively mitigates the distribution shift problem by maximizing the distinguishability of representation discrepancies between normal and anomalous samples, thereby enhancing the model’s generalization ability and robustness.
- Employed innovative masking strategies in both the temporal and frequency domains. This effective masking strategy transforms potentially anomalous data into learnable latent space variables, thereby recovering variable features from the correlations of normal samples through diffusion models and neural network architectures.
- Extensive experiments conducted on multiple public datasets demonstrate that TFCID surpasses current mainstream methods in terms of detection accuracy and overall performance.
2. Related Work
2.1. Time Series Anomaly Detection
2.2. Diffusion Models in Time Series Applications
2.3. Contrastive Learning and Temporal-Frequency Analysis
2.4. Transformer-Based Time Series Analysis
2.5. Domain Generalization for Anomaly Detection
3. Methodology
3.1. Problem Definition
3.2. Model Overview
3.3. Temporal Processing Module
3.3.1. Grating Masking Strategy
3.3.2. Unconditional Diffusion Model Imputation
| Algorithm 1 Grating Masking Strategy |
|
3.3.3. Theoretical Justification for Unconditional Diffusion Design
- Anomaly Contamination Avoidance:
- 2.
- Distribution Boundary Learning:
3.3.4. STAD-Net Architecture
3.4. Frequency Domain Processing Module
3.4.1. Amplitude-Based Frequency Domain Masking
3.4.2. Theoretical Justification for Magnitude-Based Frequency Masking
3.4.3. Addressing the Risk of Removing Subtle Signals
- Adaptive Thresholding: The masking ratio is a hyperparameter that is optimized per dataset. In scenarios where subtle signals are known to be critical (e.g., low signal-to-noise ratio environments), the model can automatically converge to a lower value to preserve a wider frequency band [51].
- Learnable Recovery: Crucially, masked components are not simply discarded but are replaced by a learnable vector . This allows the model to recover the contribution of any erroneously masked but informative frequency component during training, transforming the operation from a hard deletion to a soft, data-dependent gating mechanism [51,53].
- Empirical Priority: In anomaly detection, the primary objective is to capture gross deviations in dominant patterns. Over-preserving low-magnitude components to protect against hypothetical subtle faults often leads to increased false positives due to noise amplification [52]. Our approach strikes a balance by prioritizing robustness to common anomalies.
3.4.4. Transformer Autoencoder
3.5. Contrastive Learning and Adversarial Training
3.5.1. Temporal-Frequency Contrastive Learning
3.5.2. Normalization for Distribution Representation
3.5.3. Adversarial Training Mechanism
- Minimization Phase (Update Frequency Encoder): Fix the temporal representation , update the parameters of the frequency encoder to minimize , causing the frequency representation to move closer to the temporal representation.
- Maximization Phase (Update Temporal Encoder): Fix the frequency representation , update the parameters of the temporal encoder to maximize , causing the temporal representation to move away from the current (potentially unoptimized) frequency representation. This step is implemented via a Gradient Reversal Layer (GRL).
Relationship Between Adversarial Training and Contrastive Learning
Convergence Behavior
3.6. Objective Function
3.7. Anomaly Criterion
3.8. Training and Inference Algorithms
| Algorithm 2 TFCID Training Algorithm |
|
| Algorithm 3 TFCID Inference Algorithm |
|
4. Experiments
- RQ1: How does the performance of TFCID compare to current state-of-the-art anomaly detection methods?
- RQ2: What is the generalization capability of the model across different types of datasets (including different anomaly ratios, different sequence lengths, and different data distribution characteristics)?
- RQ3:Whether the model is effective in detecting different types of anomalies?
- RQ4: What is the contribution of each key component in the model (e.g., temporal-frequency contrastive learning, unconditional diffusion, adversarial training) to the final performance?
- RQ5: How sensitive is the model to different hyperparameters (e.g., masking ratio, number of Transformer layers)?
4.1. Experimental Setup
4.1.1. Benchmark Datasets
4.1.2. Evaluation Metrics
4.1.3. Experimental Details
4.2. Experimental Results (RQ1 & RQ2)
4.3. Anomaly Detection Visualization (RQ3)
4.4. Ablation Study (RQ4)
- The imputation task (w/o imputation) causes the most severe performance degradation (19.81% drop), confirming that bidirectional context modeling is fundamental to the framework.
- The masking strategy (w/o masking) leads to a 17.78% drop, indicating that forcing the model to reconstruct from partial observations is essential for learning anomaly-sensitive representations.
- Adversarial training (w/o adversarial training) results in a 10.98% drop, validating its role in mitigating distribution shift.
- The frequency domain module (w/o frequency domain) causes a 10.65% drop, demonstrating the importance of capturing periodic patterns.
- The unconditional diffusion design (w/o unconditional diffusion, i.e., replaced with conditional diffusion) yields a 4.73% drop, confirming its advantage in avoiding anomaly contamination.
4.4.1. Ablation Analysis of Frequency Domain Module
4.4.2. Ablation Analysis of Masking Module
4.4.3. Ablation Analysis of Unconditional vs. Conditional Diffusion
4.4.4. Ablation Analysis of Imputation Module
4.4.5. Ablation Analysis of Adversarial Training Mechanism
4.4.6. Analysis of Component Synergy
4.5. Hyperparameter Analysis (RQ5)
- Frequency Masking Ratio (Figure 7c): The model is more sensitive to the frequency masking ratio because a single frequency contains richer information than a single time point. The optimal ratio is typically between 10–40%.
- Embedding Dimension (Figure 7d): Overall, the model performance remains stable with respect to the embedding dimension. A dimension of 128 provides a good balance between performance and efficiency.
- Number of Diffusion Denoising Steps (Figure 7e): The number of diffusion denoising steps has a significant impact on model performance. As the number of steps increases from 5 to 50, the F1 score continuously improves, indicating that more denoising steps help generate higher-quality imputation results. However, when the number of steps exceeds 50, the performance gain saturates, while the computational cost increases significantly.
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Su, Y.; Zhao, Y.; Niu, C.; Liu, R.; Sun, W.; Pei, D. Robust anomaly detection for multivariate time series through stochastic recurrent neural network. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining; Association for Computing Machinery: New York, NY, USA, 2019; pp. 2828–2837. [Google Scholar]
- Chandola, V.; Banerjee, A.; Kumar, V. Anomaly detection: A survey. ACM Comput. Surv. (CSUR) 2009, 41, 1–58. [Google Scholar] [CrossRef] [Scilit]
- Hundman, K.; Constantinou, V.; Laporte, C.; Colwell, I.; Soderstrom, T. Detecting spacecraft anomalies using lstms and nonparametric dynamic thresholding. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining; Association for Computing Machinery: New York, NY, USA, 2018; pp. 387–395. [Google Scholar]
- Blázquez-García, A.; Conde, A.; Mori, U.; Lozano, J.A. A review on outlier/anomaly detection in time series data. ACM Comput. Surv. (CSUR) 2021, 54, 1–33. [Google Scholar] [CrossRef] [Scilit]
- Pang, G.; Shen, C.; Cao, L.; Hengel, A.V.D. Deep learning for anomaly detection: A review. ACM Comput. Surv. (CSUR) 2021, 54, 1–38. [Google Scholar] [CrossRef] [Scilit]
- Zhao, H.; Wang, Y.; Duan, J.; Huang, C.; Cao, D.; Tong, Y.; Xu, B.; Bai, J.; Tong, J.; Zhang, Q. Multivariate time-series anomaly detection via graph attention network. In 2020 IEEE International Conference on Data Mining (ICDM); IEEE: Piscataway, NJ, USA, 2020; pp. 841–850. [Google Scholar]
- Malhotra, P. LSTM-based Encoder-Decoder for Multi-sensor Anomaly Detection. arXiv 2016, arXiv:1607.00148. [Google Scholar]
- An, J.; Cho, S. Variational autoencoder based anomaly detection using reconstruction probability. In Special Lecture on IE; SNU Data Mining Center, Seoul National University: Seoul, Republic of Korea, 2015; Volume 2, pp. 1–18. [Google Scholar]
- Wang, L.; Xu, S.; Du, X.; Zhu, Q. DACR: Distribution-Augmented Contrastive Reconstruction for Time-Series Anomaly Detection. In ICASSP 2024-2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP); IEEE: Piscataway, NJ, USA, 2024; pp. 7545–7549. [Google Scholar]
- Malhotra, P.; Vig, L.; Shroff, G.; Agarwal, P. Long Short Term Memory Networks for Anomaly Detection in Time Series. In Proceedings; Presses Universitaires de Louvain: Louvain-la-Neuve, Belgium, 2015; Volume 89, p. 94. Available online: https://i6doc.com (accessed on 10 April 2026).
- Hu, S.; Zhao, K.; Qiu, X.; Shu, Y.; Hu, J.; Yang, B.; Guo, C. Multirc: Joint learning for time series anomaly prediction and detection with multi-scale reconstructive contrast. arXiv 2024, arXiv:2410.15997. [Google Scholar]
- Du, W.; Côté, D.; Liu, Y. Saits: Self-attention-based imputation for time series. Expert Syst. Appl. 2023, 219, 119619. [Google Scholar] [CrossRef] [Scilit]
- Tashiro, Y.; Song, J.; Song, Y.; Ermon, S. Csdi: Conditional score-based diffusion models for probabilistic time series imputation. In Advances in Neural Information Processing Systems 34; Curran Associates, Inc.: Red Hook, NY, USA, 2021; pp. 24804–24816. [Google Scholar]
- Zhang, Z.; Han, Y.; Geng, Z. Learning to Detect Industrial Time-Series Anomalies From Imputation Consistency with Sparse Observations. IEEE Trans. Neural Netw. Learn. Syst. 2025, 36, 16648–16660. [Google Scholar] [CrossRef] [Scilit]
- Gong, D.; Liu, L.; Le, V.; Saha, B.; Mansour, M.R.; Venkatesh, S.; Hengel, A.v.d. Memorizing normality to detect anomaly: Memory-augmented deep autoencoder for unsupervised anomaly detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: Piscataway, NJ, USA, 2019; pp. 1705–1714. [Google Scholar]
- Kim, S.; Lee, S.Y.; Bu, F.; Kang, S.; Kim, K.; Yoo, J.; Shin, K. Rethinking reconstruction-based graph-level anomaly detection: Limitations and a simple remedy. In Advances in Neural Information Processing Systems 37; Curran Associates, Inc.: Red Hook, NY, USA, 2024; pp. 95931–95962. [Google Scholar]
- Ren, H.; Xu, B.; Wang, Y.; Yi, C.; Huang, C.; Kou, X.; Xing, T.; Yang, M.; Tong, J.; Zhang, Q. Time-series anomaly detection service at microsoft. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining; Association for Computing Machinery: New York, NY, USA, 2019; pp. 3009–3017. [Google Scholar]
- Wu, X.; Qiu, X.; Li, Z.; Wang, Y.; Hu, J.; Guo, C.; Xiong, H.; Yang, B. Catch: Channel-aware multivariate time series anomaly detection via frequency patching. arXiv 2024, arXiv:2410.12261. [Google Scholar] [CrossRef] [Scilit]
- Yang, L.; Zhang, Z.; Song, Y.; Hong, S.; Xu, R.; Zhao, Y.; Zhang, W.; Cui, B.; Yang, M.H. Diffusion models: A comprehensive survey of methods and applications. ACM Comput. Surv. 2023, 56, 1–39. [Google Scholar] [CrossRef] [Scilit]
- Box, G.E.; Jenkins, G.M.; Reinsel, G.C.; Ljung, G.M. Time Series Analysis: Forecasting and Control; John Wiley & Sons: Hoboken, NJ, USA, 2015. [Google Scholar]
- Ramaswamy, S.; Rastogi, R.; Shim, K. Efficient algorithms for mining outliers from large data sets. In Proceedings of the 2000 ACM SIGMOD International Conference on Management of Data; Association for Computing Machinery: New York, NY, USA, 2000; pp. 427–438. [Google Scholar]
- Liu, F.T.; Ting, K.M.; Zhou, Z.H. Isolation forest. In 2008 Eighth IEEE International Conference on Data Mining; IEEE: Piscataway, NJ, USA, 2008; pp. 413–422. [Google Scholar]
- Chalapathy, R.; Chawla, S. Deep learning for anomaly detection: A survey. arXiv 2019, arXiv:1901.03407. [Google Scholar] [CrossRef] [Scilit]
- Li, D.; Chen, D.; Jin, B.; Shi, L.; Goh, J.; Ng, S.K. MAD-GAN: Multivariate anomaly detection for time series data with generative adversarial networks. In Proceedings of the International Conference on Artificial Neural Networks; Springer: Cham, Switzerland, 2019; pp. 703–716. [Google Scholar]
- Tuli, S.; Casale, G.; Jennings, N.R. Tranad: Deep transformer networks for anomaly detection in multivariate time series data. arXiv 2022, arXiv:2201.07284. [Google Scholar] [CrossRef] [Scilit]
- Goodfellow, I.J.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Courville, A.; Bengio, Y. Generative adversarial nets. In Advances in Neural Information Processing Systems 27; Curran Associates, Inc.: Red Hook, NY, USA, 2014. [Google Scholar]
- Tomczak, J.; Welling, M. VAE with a VampPrior. In Proceedings of the International Conference on Artificial Intelligence and Statistics; PMLR: Cambridge, MA, USA, 2018; pp. 1214–1223. [Google Scholar]
- Biloš, M.; Rasul, K.; Schneider, A.; Nevmyvaka, Y.; Günnemann, S. Modeling temporal data as continuous functions with stochastic process diffusion. In Proceedings of the International Conference on Machine Learning; PMLR: Cambridge, MA, USA, 2023; pp. 2452–2470. [Google Scholar]
- Alcaraz, J.M.L.; Strodthoff, N. Diffusion-based time series imputation and forecasting with structured state space models. arXiv 2022, arXiv:2208.09399. [Google Scholar]
- Li, Y.; Lu, X.; Wang, Y.; Dou, D. Generative time series forecasting with diffusion, denoise, and disentanglement. In Advances in Neural Information Processing Systems 35; Curran Associates, Inc.: Red Hook, NY, USA, 2022; pp. 23009–23022. [Google Scholar]
- Rasul, K.; Seward, C.; Schuster, I.; Vollgraf, R. Autoregressive denoising diffusion models for multivariate probabilistic time series forecasting. In Proceedings of the International Conference on Machine Learning; PMLR: Cambridge, MA, USA, 2021; pp. 8857–8868. [Google Scholar]
- Zhang, H.; Wang, Z.; Zeng, D.; Wu, Z.; Jiang, Y.G. DiffusionAD: Norm-guided one-step denoising diffusion for anomaly detection. IEEE Trans. Pattern Anal. Mach. Intell. 2025, 47, 7140–7152. [Google Scholar] [CrossRef] [Scilit]
- Xiao, C.; Du, X.; Song, X.; Xue, Y.; Wu, M.; Chetty, K. Iterative feedback-based time-series anomaly detection with adaptive diffusion models. Neural Netw. 2025, 196, 108370. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Chen, Y.; Zhang, C.; Ma, M.; Liu, Y.; Ding, R.; Li, B.; He, S.; Rajmohan, S.; Lin, Q.; Zhang, D. ImDiffusion: Imputed Diffusion Models for Multivariate Time Series Anomaly Detection. Proc. VLDB Endow. 2023, 17, 359–372. [Google Scholar] [CrossRef] [Scilit]
- Xiao, C.; Gou, Z.; Tai, W.; Zhang, K.; Zhou, F. Imputation-based time-series anomaly detection with conditional weight-incremental diffusion models. In Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining; Association for Computing Machinery: New York, NY, USA, 2023; pp. 2742–2751. [Google Scholar]
- Kim, H.; Lee, C. Time-Series Anomaly Detection Based on Imputation in the Latent Space. In 2024 15th International Conference on Information and Communication Technology Convergence (ICTC); IEEE: Piscataway, NJ, USA, 2024; pp. 13–18. [Google Scholar]
- Chen, T.; Kornblith, S.; Norouzi, M.; Hinton, G. A simple framework for contrastive learning of visual representations. In Proceedings of the International Conference on Machine Learning; PMLR: Cambridge, MA, USA, 2020; pp. 1597–1607. [Google Scholar]
- Yang, C.; Lan, S.; Huang, W.; Wang, W.; Liu, G.; Yang, H.; Ma, W.; Li, P. A transformer-based gan for anomaly detection. In Proceedings of the International Conference on Artificial Neural Networks; Springer: Cham, Switzerland, 2022; pp. 345–357. [Google Scholar]
- Yang, Y.; Zhang, C.; Zhou, T.; Wen, Q.; Sun, L. Dcdetector: Dual attention contrastive representation learning for time series anomaly detection. In Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining; Association for Computing Machinery: New York, NY, USA, 2023; pp. 3033–3045. [Google Scholar]
- Tian, Y.; Krishnan, D.; Isola, P. Contrastive multiview coding. In Proceedings of the European Conference on Computer Vision; Springer: Cham, Switzerland, 2020; pp. 776–794. [Google Scholar]
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention is all you need. In Advances in Neural Information Processing Systems 30; Curran Associates, Inc.: Red Hook, NY, USA, 2017. [Google Scholar]
- Bao, H.; Dong, L.; Piao, S.; Wei, F. Beit: Bert pre-training of image transformers. arXiv 2021, arXiv:2106.08254. [Google Scholar]
- Dosovitskiy, A. An image is worth 16 × 16 words: Transformers for image recognition at scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
- Xu, J.; Wu, H.; Wang, J.; Long, M. Anomaly transformer: Time series anomaly detection with association discrepancy. arXiv 2021, arXiv:2110.02642. [Google Scholar]
- Jeong, Y.; Yang, E.; Ryu, J.H.; Park, I.; Kang, M. Anomalybert: Self-supervised transformer for time series anomaly detection using data degradation scheme. arXiv 2023, arXiv:2305.04468. [Google Scholar]
- Song, J.; Kim, K.; Oh, J.; Cho, S. Memto: Memory-guided transformer for multivariate time series anomaly detection. In Advances in Neural Information Processing Systems 36; Curran Associates, Inc.: Red Hook, NY, USA, 2023; pp. 57947–57963. [Google Scholar]
- Ma, Y.; Liu, W.; Xu, C.; Bai, L.; Zhang, E.; Wang, J. Multivariate Time Series Anomaly Detection Based on Inverted Transformer with Multivariate Memory Gate. Entropy 2025, 27, 939. [Google Scholar] [CrossRef] [Scilit]
- Gao, T.; Yang, J.; Wang, W.; Fan, X. A domain feature decoupling network for rotating machinery fault diagnosis under unseen operating conditions. Reliab. Eng. Syst. Saf. 2024, 252, 110449. [Google Scholar] [CrossRef] [Scilit]
- Li, Y.; Yang, J.; Wang, W.; Gao, T. A joint collaborative adaptation network for fault diagnosis of rolling bearing under class imbalance and variable operating conditions. Adv. Eng. Inform. 2026, 69, 103931. [Google Scholar] [CrossRef] [Scilit]
- Karras, T.; Aittala, M.; Kynkäänniemi, T.; Lehtinen, J.; Aila, T.; Laine, S. Guiding a diffusion model with a bad version of itself. In Advances in Neural Information Processing Systems 37; Curran Associates, Inc.: Red Hook, NY, USA, 2024; pp. 52996–53021. [Google Scholar]
- Fang, Y.; Xie, J.; Zhao, Y.; Chen, L.; Gao, Y.; Zheng, K. Temporal-frequency masked autoencoders for time series anomaly detection. In 2024 IEEE 40th International Conference on Data Engineering (ICDE); IEEE: Piscataway, NJ, USA, 2024; pp. 1228–1241. [Google Scholar]
- Chen, F.; Zhang, Y.; Qin, Z.; Fan, L.; Jiang, R.; Liang, Y.; Wen, Q.; Deng, S. Learning multi-pattern normalities in the frequency domain for efficient time series anomaly detection. In 2024 IEEE 40th International Conference on Data Engineering (ICDE); IEEE: Piscataway, NJ, USA, 2024; pp. 747–760. [Google Scholar]
- He, K.; Chen, X.; Xie, S.; Li, Y.; Dollár, P.; Girshick, R. Masked autoencoders are scalable vision learners. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2022. [Google Scholar]
- Abdulaal, A.; Liu, Z.; Lancewicki, T. Practical approach to asynchronous multivariate time series anomaly detection and localization. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining; Association for Computing Machinery: New York, NY, USA, 2021; pp. 2485–2494. [Google Scholar]
- Mathur, A.P.; Tippenhauer, N.O. SWaT: A water treatment testbed for research and training on ICS security. In 2016 International Workshop on Cyber-Physical Systems for Smart Water Networks (CySWater); IEEE: Piscataway, NJ, USA, 2016; pp. 31–36. [Google Scholar]
- Wu, M.; Ye, J. A small sphere and large margin approach for novelty detection using training data with outliers. IEEE Trans. Pattern Anal. Mach. Intell. 2009, 31, 2088–2092. [Google Scholar] [CrossRef] [Scilit]
- Maćkiewicz, A.; Ratajczak, W. Principal components analysis (PCA). Comput. Geosci. 1993, 19, 303–342. [Google Scholar] [CrossRef] [Scilit]
- Goldstein, M.; Dengel, A. Histogram-based outlier score (hbos): A fast unsupervised anomaly detection algorithm. In Proceedings of the KI-2012: Poster and Demo Track, Saarbrücken, Germany, 24–27 September 2012; Volume 1, pp. 59–63. [Google Scholar]
- Zhao, X.; Wu, Y.; Lee, D.L.; Cui, W. iforest: Interpreting random forests via visual analytics. IEEE Trans. Vis. Comput. Graph. 2018, 25, 407–416. [Google Scholar] [CrossRef] [Scilit]
- Zong, B.; Song, Q.; Min, M.R.; Cheng, W.; Lumezanu, C.; Cho, D.; Chen, H. Deep autoencoding gaussian mixture model for unsupervised anomaly detection. In Proceedings of the International Conference on Learning Representations, Vancouver, BC, Canada, 30 April–3 May 2018. [Google Scholar]
- Graves, A. Long short-term memory. In Supervised Sequence Labelling with Recurrent Neural Networks; Springer: Berlin/Heidelberg, Germany, 2012; pp. 37–45. [Google Scholar]
- Zhou, B.; Liu, S.; Hooi, B.; Cheng, X.; Ye, J. Beatgan: Anomalous rhythm detection using adversarially generated time series. In Proceedings of the IJCAI, Macao, China, 10–16 August 2019; Volume 2019, pp. 4433–4439. [Google Scholar]
- Gathiaka, S.; Liu, S.; Chiu, M.; Yang, H.; Stuckey, J.A.; Kang, Y.N.; Delproposto, J.; Kubish, G.; Dunbar, J.B., Jr.; Carlson, H.A.; et al. D3R grand challenge 2015: Evaluation of protein–ligand pose and affinity predictions. J. Comput.-Aided Mol. Des. 2016, 30, 651–668. [Google Scholar] [CrossRef] [Scilit] [PubMed]







| Dataset | Dimensions | Training Set | Validation Set | Test Set | Anomaly Rate (%) |
|---|---|---|---|---|---|
| SMD | 38 | 566,724 | 141,681 | 708,420 | 4.2 |
| PSM | 25 | 105,984 | 26,497 | 87,841 | 27.75 |
| SWaT | 51 | 396,000 | 99,000 | 449,919 | 11.98 |
| MSL | 55 | 46,653 | 11,664 | 73,729 | 10.5 |
| SMAP | 25 | 108,146 | 27,037 | 427,617 | 13.13 |
| Dataset | PSM | SMAP | SWaT | SMD | MSL | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Metric | P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 | ||||
| OC-SVM | 62.75 | 80.89 | 70.67 | 53.85 | 59.07 | 56.34 | 45.39 | 49.22 | 47.23 | 66.98 | 82.03 | 73.75 | 50.26 | 99.86 | 66.87 | ||||
| IFOREST | 76.09 | 92.45 | 83.48 | 52.39 | 52.39 | 55.53 | 49.29 | 44.95 | 47.02 | 20.30 | 21.30 | 17.99 | 60.59 | 53.28 | 53.34 | ||||
| DAGMM | 93.49 | 70.03 | 80.08 | 86.45 | 56.73 | 68.51 | 89.92 | 57.84 | 70.40 | 63.57 | 70.83 | 67.00 | 54.07 | 92.11 | 68.14 | ||||
| PCA | 77.44 | 63.68 | 69.89 | 50.62 | 98.48 | 66.87 | 62.32 | 82.96 | 71.18 | 64.42 | 86.06 | 74.01 | 52.69 | 98.33 | 68.61 | ||||
| LSTM | 73.62 | 89.92 | 80.96 | 92.20 | 67.75 | 78.10 | 76.00 | 89.50 | 82.20 | 60.12 | 84.77 | 70.35 | 58.82 | 14.68 | 23.49 | ||||
| OmniAnomaly | 88.39 | 74.46 | 80.83 | 92.49 | 81.99 | 86.92 | 81.42 | 84.30 | 82.83 | 87.51 | 90.52 | 87.75 | 83.21 | 81.25 | 82.21 | ||||
| BeatGAN | 90.30 | 93.84 | 92.04 | 92.38 | 55.85 | 69.61 | 64.01 | 87.46 | 73.92 | 90.13 | 88.94 | 87.97 | 77.82 | 85.12 | 81.02 | ||||
| HBOS | 78.45 | 29.82 | 43.21 | 41.54 | 66.17 | 51.04 | 54.49 | 91.35 | 68.26 | 60.34 | 64.11 | 62.17 | 59.25 | 83.32 | 69.25 | ||||
| D3R | 73.32 | 88.71 | 80.29 | 61.76 | 92.55 | 74.09 | 61.04 | 97.57 | 74.41 | 64.87 | 97.93 | 78.04 | 66.85 | 90.83 | 77.02 | ||||
| DCdetector | 96.62 | 97.32 | 96.97 | 94.44 | 97.80 | 96.09 | 92.53 | 88.59 | 90.52 | 50.93 | 95.57 | 66.45 | 55.94 | 95.53 | 70.56 | ||||
| TFCID (Ours) | 99.24 | 98.59 | 98.22 | 99.71 | 99.12 | 97.86 | 99.69 | 99.06 | 97.88 | 99.28 | 99.98 | 99.64 | 91.25 | 94.06 | 95.85 | ||||
| Method | F1-Score | |||||
|---|---|---|---|---|---|---|
| PSM | SMAP | SWaT | SMD | MSL | Avg. | |
| w/o adversarial training | 88.22 | 87.86 | 87.88 | 85.51 | 85.09 | 86.91 |
| w/o imputation | 79.86 | 78.66 | 78.68 | 76.78 | 76.45 | 78.08 |
| w/o unconditional diffusion | 93.35 | 94.54 | 93.56 | 93.15 | 91.22 | 93.16 |
| w/o masking | 81.23 | 80.93 | 80.95 | 78.99 | 78.43 | 80.11 |
| w/o frequency domain | 88.54 | 88.21 | 88.23 | 86.12 | 85.12 | 87.24 |
| TFCID (ours) | 98.22 | 97.86 | 97.88 | 99.64 | 95.85 | 97.89 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Wu, K.; Xu, C.; Zhang, R.; Lu, W.; Ma, Y.; Zhang, E.; Tan, K. A Diffusion-Based Time-Frequency Dual-Stream Contrastive Learning Model for Multivariate Time Series Anomaly Detection. Entropy 2026, 28, 448. https://doi.org/10.3390/e28040448
Wu K, Xu C, Zhang R, Lu W, Ma Y, Zhang E, Tan K. A Diffusion-Based Time-Frequency Dual-Stream Contrastive Learning Model for Multivariate Time Series Anomaly Detection. Entropy. 2026; 28(4):448. https://doi.org/10.3390/e28040448
Chicago/Turabian StyleWu, Kuo, Changming Xu, Ranran Zhang, Wei Lu, Yuan Ma, Ende Zhang, and Kaiwen Tan. 2026. "A Diffusion-Based Time-Frequency Dual-Stream Contrastive Learning Model for Multivariate Time Series Anomaly Detection" Entropy 28, no. 4: 448. https://doi.org/10.3390/e28040448
APA StyleWu, K., Xu, C., Zhang, R., Lu, W., Ma, Y., Zhang, E., & Tan, K. (2026). A Diffusion-Based Time-Frequency Dual-Stream Contrastive Learning Model for Multivariate Time Series Anomaly Detection. Entropy, 28(4), 448. https://doi.org/10.3390/e28040448

