To address the problem in few-shot industrial anomaly detection where large-scale models are difficult to deploy and lightweight models show limited performance, a lightweight anomaly detection method based on knowledge distillation is proposed. DINOv2 as the teacher model and EfficientViT as the student model, transferring knowledge are used to achieve high detection performance under resource constraints. A feature alignment adapter is designed to reduce the representation gap between the two models, and a multi-objective distillation loss combining Huber loss, cosine similarity loss, and Gram matrix loss guides the student from multiple dimensions of magnitude, direction, and spatial correlation. Experiments on the MVTec AD dataset show that the student model, trained only with normal samples, achieves a 0.170 improvement in image-level AUROC over the baseline model without distillation, while maintaining comparable performance to the teacher model with about 23% fewer parameters and 4 times faster inference. The effectiveness of the proposed framework is confirmed by ablation and visualization studies.
HojjatiH, HoT K K, ArmanfardN. Self-supervised anomaly detection in computer vision and beyond: a survey and outlook[J]. Neural Networks, 2024, 172: 106106.
XieLin, HanYueping, ZhaiQian, et al. PCB surface defect detection based on improved YOLOv7-tiny[J]. Journal of Test and Measurement Technology, 2025, 39(1): 81-87. (in Chinese)
[4]
RenC, LiuD. Anomaly detection and segmentation based on multi-student teacher network[J]. Journal of Measurement Science and Instrumentation, 2022, 13(2): 235-241.
LiShifeng, LuoXi, LiuXiaoru, et al. An end-to-end video anomaly detection method based on transformer architecture[J]. Computer Technology and Development, 2025, 35(6): 49-55. (in Chinese)
[7]
ZhangX, XuM, QiuD, et al. MediCLIP: adapting CLIP for few-shot medical image anomaly detection[C]//Medical Image Computing and Computer Assisted Intervention–MICCAI 2024. Cham: Springer, 2024: 458-468.
JinZehui, ChenKai, TangDunbing, et al. Visual language model based on improved transformer[J/OL]. Journal of Beijing University of Aeronautics and Astronautics, 2025-03-19. in Chinese)
[20]
KaplanJ, Mc CandlishS, HenighanT, et al. Scaling laws for neural language models[PP/OL]. arXiv(2020-01-23)[2025-12-11].
[21]
KhanA, RaufZ, SohailA, et al. A survey of the vision transformers and their CNN-transformer based variants[J]. Artificial Intelligence Review, 2023, 56(3): 2917-2970.
LiuShijie, WangLifang, YuXiaoqing. Medical image fusion based on improved U-Net and cross-modal self-distillation[J]. Journal of Test and Measurement Technology, 2024, 38(6): 686-694. (in Chinese)
[24]
GuoF, WuX, ZhangL, et al. A self-supervised vision transformer approach for dermatological image analysis[EB/OL]. [2025-12-11].
[25]
YangQ, GuoR, YangQ, et al. An unsupervised method for industrial image anomaly detection with vision transformer-based autoencoder[J]. Sensors, 2024, 24(8): 2440.
[26]
IqbalE, KhanS U, JavedS, et al. Multi-scale feature reconstruction network for industrial anomaly detection[J]. Knowledge-Based Systems, 2024, 305: 112650.
ZhangYubo, YangFan, GuoYa, et al. Research on lightweight algorithm for garbage classification based on visual large model[J]. Computer Engineering, 2025, 51(7): 140-151. (in Chinese)
LiTong, YangHongguang, LiuKang, et al. Knowledge distillation methods for large models: a research review[J]. Journal of the Hebei Academy of Sciences, 2025, 42(2): 94-96. (in Chinese)
WangLili, YinShuofeng, MaYe. Research on facial fatigue monitoring algorithm based on lightweight VIT[J]. Computer Simulation, 2025, 42(1): 317-322. (in Chinese)
CuiZhigao, LanYunwei, WangNian, et al. An image dehazing algorithm based on multi-teacher guided knowledge distillation[J]. Journal of Rocket Force University of Engineering, 2024(5): 35-43. (in Chinese)
XieYitao, SuLumei, YangFan, et al. Data-free knowledge distillation for target class classification[J]. Journal of Image and Graphics, 2024, 29(11): 3401-3416. (in Chinese)
[39]
SongL, GongX, ZhouH, et al. Exploring the knowledge transferred by response-based teacher-student distillation[C]//Proceedings of the 31st ACM International Conference on Multimedia, 2023: 2704-2713.
[40]
YangZ, LiZ, ZengA, et al. ViTKD: feature-based knowledge distillation for vision transformers[C]//2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), 2024: 1379-1388.
[41]
SunS, RenW, LiJ, et al. Logit standardization in knowledge distillation[C]//2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2024: 15731-15740.
[42]
YangC, YuX, AnZ, et al. Categories of response-based, feature-based, and relation-based knowledge distillation[M]//Advancements in Knowledge Distillation: Towards New Horizons of Intelligent Systems. Cham: Springer International Publishing, 2023: 1-32.
WangGaihua, LiKehong, LongQian, et al. Object detection of lightweight transformer based on knowledge distillation [J]. Journal of System Simulation, 2024, 36(11): 2517-2527. (in Chinese)
YangWenyin, HuangAiquan, TanZhenlin, et al. Age estimation of face images by fusing similarity cross entropy and knowledge distillation[J]. Computer Technology and Development, 2025, 35(4): 113-120. (in Chinese)
ZhongRui, WangChen, SongYafeng, et al. Face recognition method with few samples based on sample balance distillation[J]. Computer Engineering and Design, 2024, 45(11): 3457-3462. (in Chinese)
[49]
LiuX, PengH, ZhengN, et al. EfficientViT: memory efficient vision transformer with cascaded group attention[C]//2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2023: 14420-14430.
[50]
OquabM, DarcetT, MoutakanniT, et al. Dinov2: learning robust visual features without supervision[PP/OL]. arXiv(2023-04-14)[2025-12-11].
[51]
DammS, LaszkiewiczM, LedererJ, et al. Anomaly DINO: boosting patch-based few-shot anomaly detection with DINOv2[C]//2025 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), 2025: 1319-1329.
[52]
BergmannP, BatznerK, FauserM, et al. The MVTec anomaly detection dataset: a comprehensive real-world dataset for unsupervised anomaly detection[J]. International Journal of Computer Vision, 2021, 129(4): 1038-1059.
[53]
BergmannP, FauserM, SattleggerD, et al. MVTec AD: a comprehensive real-world dataset for unsupervised anomaly detection[C]//2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019: 9584-9592.
[54]
闫佳乐. 基于EIS的退役锂离子电池SOH估计研究[D]. 合肥: 合肥学院, 2023: 22.
[55]
YanJiale. Research on State of health estimation of retired lithium-ion batteries based on EIS[D]. Hefei: Hefei University, 2023: 22. (in Chinese)
ChenWanqiang, LuYonghua, ZhuYun, et al. Research on surface defect detection algorithm of fuel pump regulator based on deep learning image registration[J]. Journal of Test and Measurement Technology, 2024, 38(6): 586-592. (in Chinese)