计算机科学 ›› 2026, Vol. 53 ›› Issue (7): 45-53.doi: 10.11896/jsjkx.250900131

• 计算机图形学 & 多媒体 • 上一篇    下一篇

基于掩码卷积核的图像异常检测

陈羿帆, 丁聪, 曹敏   

  1. 苏州大学计算机科学与技术学院 江苏 苏州 215006
  • 收稿日期:2025-09-21 修回日期:2025-12-09 出版日期:2026-07-15 发布日期:2026-07-10
  • 通讯作者: 曹敏(mcao@suda.edu.cn)
  • 作者简介:(1402637455@qq.com)
  • 基金资助:
    国家自然科学基金青年基金(62476188)

Image Anomaly Detection Based on Masked Convolutional Kernel

CHEN Yifan, DING Cong, CAO Min   

  1. School of Computer Science and Technology,Soochow University,Suzhou,Jiangsu 215006,China
  • Received:2025-09-21 Revised:2025-12-09 Published:2026-07-15 Online:2026-07-10
  • About author:CHEN Yifan,born in 2003,undergra-duate.His main research interests include anomaly detection,and so on.
    CAO Min,born in 1992,Ph.D,associate professor,is a member of CCF(No.D0909M).Her main research interests include anomaly detection,visual language multimodal learning,and so on.
  • Supported by:
    National Natural Science Foundation of China(62476188).

摘要: 图像异常检测通过挖掘正常图像的模式来检测不符合正常模式的异常图像,在工业生产领域具有重要作用。目前,一类成功的方法是对正常图像构造掩码(Mask)并利用重构网络预测掩码,将预测误差作为图像异常检测的判别。然而,这类方法在构造掩码时会显著增加模型的复杂度,影响图像正常区域的重构。针对该问题,提出了一种基于掩码卷积核的轻量级图像异常检测方法。该方法在卷积核中心区域施加掩码,通过掩码卷积与通道注意力机制预测被掩盖信息,有效降低了传统掩码方法带来的复杂度;引入修正损失以约束掩码预测特征的重构过程,提升正常区域的重构质量。该方法在MVTec,BTAD和VISA这3个工业数据集上验证了有效性,AUROC分别达到99.0%,93.7%和93.4%,在几乎不增加模型复杂度的情况下,能够与现有的多种重构方法相结合,有效提升模型性能。

关键词: 异常检测, 掩码卷积核, 无监督学习, 重构网络, 通道注意力

Abstract: Image anomaly detection,which exploits patterns in normal images to detect abnormal images that do not conform to these patterns,plays a vital role in industrial production.Currently,one successful approach constructs a mask for normal images and uses a reconstruction network to predict the mask.The prediction error serves as the discriminant for image anomaly detection.However,this approach significantly increases model complexity when constructing the mask,compromising the reconstruction of normal image regions.To address this issue,this paper proposes a lightweight image anomaly detection method based on masked convolution kernels.This method applies a mask to the center of the convolution kernel and predicts the masked information through masked convolution and a channel-wise attention mechanism,effectively reducing the complexity of traditionalmas-king methods.A correction loss is introduced to constrain the reconstruction process of the masked predicted features,improving the reconstruction quality of normal regions.This method is validated on three industrial datasets MVTec,BTAD,and VISA,achieving AUROCs of 99.0%,93.7%,and 93.4%,respectively.This method can be combined with various existing reconstruction methods to effectively improve model performance without increasing model complexity.

Key words: Anomaly detection, Masked convolutional kernel, Unsupervised learning, Reconstruction network, Channel attention

中图分类号: 

  • TP391.41
[1]YAO H,CAO Y,LUO W,et al.Prior Normality Prompt Transformer for Multi-class Industrial Image Anomaly Detection[J].arXiv:2406.11507,2024.
[2]XIANG T,ZHANG Y,LU Y,et al.Squid:Deep feature in-painting for unsupervised anomaly detection[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2023:23890-23901.
[3]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.2022:14318-14328.
[4]TIOSANO L,ABUTBUL R,LENDER R,et al.Anomaly Detection and Biomarkers Localization in Retinal Images[J].Journal of Clinical Medicine,2024,13(11):3093.
[5]THOMINE S,SNOUSSI H.Dual model knowledge distillation for industrial anomaly detection[J].Pattern Analysis and Applications,2024,27(3):77.
[6]DENG H,ZHANG Z,ZOU S,etal.Bi-directional frame interpolation for unsupervised video anomaly detection[C]//Procee-dings of the IEEE/CVF Winter Conference on Applications of Computer Vision.2023:2634-2643.
[7]ZOU Z,CHEN K,SHI Z,et al.Object detection in 20 years:A survey[J].Proceedings of the IEEE,2023,111(3):257-276.
[8]DONG Y F,SUN S Y,WANG Z,et al.Attention Mechanism Based Joint Optimization Algorithm for Defect Detection[J].Journal of Computer-Aided Design & Computer Graphics,2024,36(1):102-111.
[9]RISTEA N C,MADANN,IONESCU R T,et al.Self-supervised predictive convolutional attentive block for anomaly detection[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2022:13576-13586.
[10]ZHANG Z,ZHAO Z,ZHANG X,et al.Industrial anomaly detection with domain shift:A real-world dataset and masked multi-scale reconstruction[J].Computers in Industry,2023,151:103990.
[11]LIANG Y,ZHANG J,ZHAO S,et al.Omni-frequency channel-selection representations for unsupervised anomaly detection[J].IEEE Transactions on Image Processing,2023,32:4327-4340.
[12]MIAO J,TAO H,XIE H,et al.Reconstruction-based anomaly detection for multivariate time series using contrastive generative adversarial networks[J].Information Processing &Mana-gement,2024,61(1):103569.
[13]LI Z,LI N,JIANG K,et al.Superpixel Masking and Inpainting for Self-Supervised Anomaly Detection[C]//BMVC.2020.
[14]HOU J,ZHANG Y,ZHONG Q,et al.Divide-and-assemble:Learning block-wise memory for unsupervised anomalydetection[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision.2021:8791-8800.
[15]WANG S,LU H,YANG F,et al.Superpixel tracking[C]//2011 International Conference on Computer Vision.IEEE,2011:1323-1330.
[16]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 Confe-rence on Computer Vision and Pattern Recognition.2019:9592-9600.
[17]MISHRA P,VERK R,FORNASIER D,et al.VT-ADL:A vision transformer network for image anomaly detection and loca-lization[C]//2021 IEEE 30th International Symposium on Industrial Electronics(ISIE).IEEE,2021:1-6.
[18]ZOU Y,JEONG J,PEMULA L,et al.Spot-the-difference self-supervised pre-training for anomaly detection and segmentation[C]//European Conference on Computer Vision.Cham:Sprin-ger,2022:392-408.
[19]CHEN Y D,CHEN L R,YU W B,et al.Knowledge Distillation Anomaly Detection with Multi-Scale Fea1ure Fusion[J].Journal of Computer-Aided Design & Computer Graphics,2022,34(10):1542-1549.
[20]HE K,ZHANG X,REN S,et al.Deep residual learning forimage recognition[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition.2016:770-778.
[21]RIPPEL O,MERTENS P,MERHOF D.Modeling the distribution of normal data in pre-trained deep features for anomaly detection[C]//2020 25th International Conference on Pattern Recognition(ICPR).IEEE,2021:6726-6733.
[22]ZAVRTANIK V,KRISTAN M,SKOČAJ D.Draem-a discriminatively trained reconstruction embedding for surface anomaly detection[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision.2021:8330-8339.
[23]AKCAY S,ATAPOUR-ABARGHOUEI A,BRECKONT P.Ganomaly:Semi-supervised anomaly detection via adversarial training[C]//Computer Vision-ACCV 2018:14th Asian Conference on Computer Vision.Springer,2019:622-637.
[24]VASWANI A.Attention is all you need[C]//Proceedins of the 31st International Conference on Neural Information Processing Systems.2017.
[25]HU J,SHEN L,SUN G.Squeeze-and-excitation networks[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition.2018:7132-7141.
[26]DEFARD T,SETKOV A,LOESCH A,et al.Padim:a patch distribution modeling framework for anomaly detection and localization[C]//International Conference on Pattern Recognition.Cham:Springer 2021:475-489.
[27]LI C L,SOHN K,YOON J,et al.Cutpaste:Self-supervisedlearning for anomaly detection and localization[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2021:9664-9674.
[28]FAN F Y,ZHANG L,DAI Y.FEGAN:A Feature Extraction Based Approach For GAN Anomaly Detection And Localization[J].IEEE Access,2024,12:76154-76168.
[29]WU D,FAN S,ZHOU X,et al.Unsupervised Anomaly Detection via Masked Diffusion Posterior Sampling[J].arXiv:2404.17900,2024.
[30]JIANG B,LU Y,ZHANG B,et al.AGP-Net:Adaptive graph prior network for image denoising[J].IEEE Transactions on Industrial Informatics,2023,20(3):4753-4764.
[31]YI J,YOON S.Patch svdd:Patch-level svdd for anomaly detection and segmentation[C]//Proceedings of the Asian Conference on Computer Vision.2020.
[32]YU J,ZHENG Y,WANG X,et al.Fastflow:Unsupervisedanomaly detection and localization via 2d normalizing flows[J].arXiv:2111.07677,2021.
[33]GUDOVSKIY D,ISHIZAKA S,KOZUKA K.Cflow-ad:Real-time unsupervised anomaly detection with localization via conditional normalizing flows[C]//Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision.2022:98-107.
[34]JEONG J,ZOU Y,KIM T,et al.Winclip:Zero-/few-shot ano-maly classification and segmentation[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2023:19606-19616.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!