DefectNet, a defect detection network model for fast and effective defect detection.
@ARTICLE{9381247,
author={F. {Li} and F. {Li} and Q. {Xi}},
journal={IEEE Transactions on Instrumentation and Measurement},
title={DefectNet: Toward Fast and Effective Defect Detection},
year={2021},
volume={70},
number={},
pages={1-9},
doi={10.1109/TIM.2021.3067221}}
The full paper is available at IEEE Transactions on Instrumentation and Measurement
The existing object detection algorithms based on the convolutional neural network (CNN) are always devoted to the detection of natural objects and have achieved admirable detection effects. At present, these detection algorithms have been applied to the detection of defect data. In fact, the detection of defect data is different from the detection of general natural object data and the application of a general object detection algorithm based on CNN may not be perfect in this problem. Therefore, a novel defect detection network (DefectNet) is proposed to solve the problem of defect detection.
There are three methods used to detect defects, which are shown in Fig. 1.
Fig. 1. Three methods of defect detection process. I: input image. DNet: object detection network. P: predicted output results, including boxes, categories and scores. F: filtered boxes, categories and scores by using a score threshold. N: normal images. D: detected defect results. CNet: binary classification network. CDNet: defect network. (a) One-model method. (b) Two-model method. (c) DefectNet method.
-
Defect Finding Network
It resumes the last full connection layer in the backbone network.
Fig. 2. Structure of defect finding network. I: input image. D: defective images. D-SubNet: the rest of the object detection network except the backbone network.
-
Balance Different Network
The loss1 is the task of the bounding box regression, the loss2 is the task of bounding box classification, the loss3 is the task of the defect finding.
There are two methods to set the value of f (w), one is to directly set f (w) as a constant (Const) value, the other is to set f (w) as the change of the number of iterations n.
There are mainly three different types of fundamental functions for variable loss weight strategies: linear (Lin), inverse (Inv) and exponential (Exp) function.
The relationship between the ATT t and the improvement efficiency e changes as the proportion α of the number of normal images in all images is shown in Fig. 3.
Fig. 3. Ideal evaluation results for different proportions α. α is the proportion of the number of normal images in test set. β is the ratio of the ATT_N to the ATT_D. t is the ATT of test set. e is the improvement efficiency of test set.
-
Fabric Defect
Results comparison between DEFECTNET and other SOTA networks in fabric defect dataset is shown in Tab. 1.
-
Bottle Defect
Results comparison between DEFECTNET and other SOTA networks in bottled liquor dataset is shown in Tab. 2.
This project is based on MMDetection. More installation and usage please refer to MMDetection.
git clone https://github.com/li-phone/DefectNet.git
# mirror: https://gitee.com/liphone/DefectNet.git
cd DefectNet
pip install -r requirements.txt
bash setup.sh
-
Fabric Defect Dataset
Baidu Disk: https://pan.baidu.com/s/1b7eFGkrgTm4F0Ww-hATqVw, Password:6oj8
DuBox: https://dubox.com/s/1QhGpKcEDNjwj9vis5iYWzw, Password:vx3h
A detailed introduction to the fabric defect data set:
Total Normal Defective Normal Proportion all 8325 3663 4662 0.44 train 6660 2913 3747 0.44 test 1665 750 915 0.45 -
Bottle Defect Dataset
Baidu Disk: https://pan.baidu.com/s/1RH0-hqGOWa-sgbAUdRQmGg, Password:yd4b
A detailed introduction to the bottle defect data set:
Total Normal Defective Normal Proportion all 4516 1146 3370 0.25 train 3612 921 2691 0.25 test 904 225 679 0.25
cd tools
ln -s {data directory} data
python demo.py
# wait...
This project is released under the Apache 2.0 license.