|
|
|
| Anomaly detection algorithm based on multi-task contrastive constraints and controllable anomaly synthesis |
Yuxuan LIU1( ),Enqi SU1,Peiguang JING1,Hongbo SUN2,*( ),Yuting SU1 |
1. School of Electrical and Information Engineering, Tianjin University, Tianjin 300072, China 2. China Telecom Artificial Intelligence Technology (Beijing) Co., Ltd., Beijing 100027, China |
|
|
|
Abstract A multi-task, contrastive-constraint-based algorithm was proposed to address the challenge of ambiguous boundaries between normal and anomalous features in unsupervised visual anomaly detection. First, highly realistic anomalous images were generated by a controllable anomaly synthesis module and used as multi-task supervisory signals to train the projection layer. Second, in the feature compactness aggregation task, the distances between normal sample feature embeddings were minimized to guide the projection layer toward a compact representation of normal features. In the anomaly sensitivity task, contrastive loss was minimized to increase the projection layer’s focus on anomaly-sensitive regions. In the anomaly feature suppression task, feature similarity loss was minimized to suppress anomalous features during feature propagation. Finally, multi-scale features extracted by the projection layer were fused by an adaptive fusion reconstruction module to enable accurate anomaly detection and localization. Effectiveness validation experiments were performed on multiple public datasets for the proposed algorithm. Results showed that the proposed algorithm achieved an image-level area under the receiver operating characteristic curve (AUROC) of 99.3% on the MVTec dataset.
|
|
Received: 08 October 2025
Published: 16 October 2026
|
|
|
| Fund: 国家自然科学基金资助项目(62361002). |
|
Corresponding Authors:
Hongbo SUN
E-mail: liuyx2@tju.edu.cn;sunhb3@chinatelecom.cn
|
基于多任务对比约束与可控缺陷生成的异常检测算法
针对无监督视觉异常检测中正常与异常特征边界区分模糊的问题,提出基于多任务对比约束的算法. 通过可控异常生成模块生成高拟真的异常图像,作为训练投影层的多任务监督信号;在特征紧凑聚合任务中,通过最小化正常样本特征嵌入之间的距离,指导投影层将正常特征紧密聚集;在异常敏感任务中,通过最小化对比度损失,提高投影层对异常敏感区域的关注. 在异常特征抑制任务中,通过最小化特征相似度损失,抑制特征传递过程中的异常特征;通过自适应融合重建模块融合投影层提取的多尺度特征,实现精确的异常检测和定位. 在多个公开数据集上开展算法的有效性验证实验. 结果表明,所提算法在MVTec数据集上的图像级接受者特性曲线下面积(AUROC)为99.3%.
关键词:
异常检测,
动态扩散,
多任务对比约束,
多尺度特征融合,
无监督学习
|
|
| [1] |
张鹏, 田子都, 王浩 基于改进生成对抗网络的飞参数据异常检测方法[J]. 浙江大学学报: 工学版, 2022, 56 (10): 1967- 1976 ZHANG Peng, TIAN Zidu, WANG Hao Flight parameter data anomaly detection method based on improved generative adversarial network[J]. Journal of Zhejiang University: Engineering Science, 2022, 56 (10): 1967- 1976
doi: 10.3785/j.issn.1008-973X.2022.10.008
|
|
|
| [2] |
YE F, HUANG C, CAO J, et al Attribute restoration framework for anomaly detection[J]. IEEE Transactions on Multimedia, 2022, 24: 116- 127
doi: 10.1109/TMM.2020.3046884
|
|
|
| [3] |
SALEHI M, EFTEKHAR A, SADJADI N, et al. Puzzle-AE: novelty detection in images through solving puzzles [EB/OL]. (2022–02–10)[2025–10–08]. https://arxiv.org/pdf/2008.12959.
|
|
|
| [4] |
LI C L, SOHN K, YOON J, et al. CutPaste: self-supervised learning for anomaly detection and localization [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Nashville: IEEE, 2021: 9659–9669.
|
|
|
| [5] |
SCHLÜTER H M, TAN J, HOU B, et al. Self-supervised out-of-distribution detection and localization with natural synthetic anomalies (NSA) [EB/OL]. (2021–09–30)[2025–10–08]. https://arxiv.org/pdf/2109.15222v1.
|
|
|
| [6] |
ZAVRTANIK V, KRISTAN M, SKOČAJ D. DRÆM: a discriminatively trained reconstruction embedding for surface anomaly detection [C]// Proceedings of the IEEE/CVF International Conference on Computer Vision. Montreal: IEEE, 2022: 8310–8319.
|
|
|
| [7] |
ZHANG F, ZHU H, CEN Y, et al Low-shot unsupervised visual anomaly detection via sparse feature representation[J]. IEEE Transactions on Neural Networks and Learning Systems, 2025, 36 (5): 7903- 7917
doi: 10.1109/TNNLS.2024.3420818
|
|
|
| [8] |
CAI Y, LIANG D, LUO D, et al A discrepancy aware framework for robust anomaly detection[J]. IEEE Transactions on Industrial Informatics, 2024, 20 (3): 3986- 3995
doi: 10.1109/TII.2023.3318302
|
|
|
| [9] |
ZHANG F, KAN S, ZHANG D, et al A graph model-based multiscale feature fitting method for unsupervised anomaly detection[J]. Pattern Recognition, 2023, 138: 109373
doi: 10.1016/j.patcog.2023.109373
|
|
|
| [10] |
IULIANO A, LIÒ P, MANFREDI G, et al. Denoising probabilistic diffusion models for synthetic healthcare image generation [C]// Proceedings of the IEEE International Workshop on Metrology for Living Environment. Chania: IEEE, 2024: 415–420.
|
|
|
| [11] |
HO J, JAIN A, ABBEEL P. Denoising diffusion probabilistic models [EB/OL]. (2020–12–16)[2025–10–08]. https://arxiv.org/pdf/2006.11239.
|
|
|
| [12] |
ZAGORUYKO S, KOMODAKIS N. Wide residual networks [EB/OL]. (2017–06–14)[2025–10–08]. https://arxiv.org/pdf/1605.07146.
|
|
|
| [13] |
DEFARD T, SETKOV A, LOESCH A, et al. PaDiM: a patch distribution modeling framework for anomaly detection and localization [C]// Pattern Recognition. ICPR International Workshops and Challenges. Cham: Springer, 2021: 475–489.
|
|
|
| [14] |
JOYCE J M. Kullback-Leibler divergence [M]// LOVRIC M. International encyclopedia of statistical science. [S.l.]: Springer, 2011: 720–722.
|
|
|
| [15] |
BERGMANN P, FAUSER M, SATTLEGGER D, et al. MVTec AD: a comprehensive real-world dataset for unsupervised anomaly detection [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Long Beach: IEEE, 2020: 9584–9592.
|
|
|
| [16] |
MISHRA P, VERK R, FORNASIER D, et al. VT-ADL: a vision transformer network for image anomaly detection and localization [C]// Proceedings of the IEEE 30th International Symposium on Industrial Electronics. Kyoto: IEEE, 2021: 1–6.
|
|
|
| [17] |
YI J, YOON S. Patch SVDD: patch-level SVDD for anomaly detection and segmentation [C]// Computer Vision – ACCV 2020. Cham: Springer, 2021: 375–390.
|
|
|
| [18] |
ZAVRTANIK V, KRISTAN M, SKOČAJ D Reconstruction by inpainting for visual anomaly detection[J]. Pattern Recognition, 2021, 112: 107706
doi: 10.1016/j.patcog.2020.107706
|
|
|
| [19] |
COHEN N, HOSHEN Y. Sub-image anomaly detection with deep pyramid correspondences [EB/OL]. (2021–02–03)[2025–10–08]. https://arxiv.org/pdf/2005.02357.
|
|
|
| [20] |
DENG H, LI X. Anomaly detection via reverse distillation from one-class embedding [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. New Orleans: IEEE, 2022: 9727–9736.
|
|
|
| [21] |
XING P, SUN Y, ZENG D, et al Normal image guided segmentation framework for unsupervised anomaly detection[J]. IEEE Transactions on Circuits and Systems for Video Technology, 2024, 34 (6): 4639- 4652
doi: 10.1109/TCSVT.2023.3327448
|
|
|
| [22] |
ROTH K, PEMULA L, ZEPEDA J, et al. Towards total recall in industrial anomaly detection [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. New Orleans: IEEE, 2022: 14298–14308.
|
|
|
| [23] |
DE PAULA MONTEIRO R, LOZADA M C, MENDIETA D R C, et al A hybrid prototype selection-based deep learning approach for anomaly detection in industrial machines[J]. Expert Systems with Applications, 2022, 204: 117528
doi: 10.1016/j.eswa.2022.117528
|
|
|
|
Viewed |
|
|
|
Full text
|
|
|
|
|
Abstract
|
|
|
|
|
Cited |
|
|
|
|
| |
Shared |
|
|
|
|
| |
Discussed |
|
|
|
|