A Compact Convolutional Neural Network for Surface Defect Inspection
Abstract
:1. Introduction
- Propose an application-oriented deep neural network for cross-product ASI. Our model obtains the state-of-the-art in both classification and segmentation.
- Modify the residual bottleneck with small kernels and depthwise convolution, build a lightweight backbone and decoder. Our model significantly reduces the number of weights, computation and time cost.
- Obtain ∼5% true positive rate improvement on tiny defect detection, by training our model with gradual training and a fine-tuned strategy.
2. Related Work
2.1. Compact Design
2.2. Transfer Learning
2.3. Model Compression
3. Architecture
3.1. Depthwise Convolution
3.2. LW Bottleneck
3.3. Backbone and Decoder
3.4. Implementation Details
3.4.1. Hyperparameter Settings
3.4.2. Gradual Training
4. Experiments
4.1. Datasets
4.1.1. The Textures Dataset
4.1.2. The Dagm Dataset
4.2. Classification on Textures
4.2.1. Experiment Settings
4.2.2. Impact of Parameter Size
4.2.3. Impact of Fine-Tune
4.3. Classification on NEU
4.4. Segmentation on DAGM
4.4.1. Comparison Models
4.4.2. Proposed Model
4.5. Segmentation on Wood Defects
5. Conclusions
Author Contributions
Funding
Conflicts of Interest
References
- Song, K.; Yan, Y. A noise robust method based on completed local binary patterns for hot-rolled steel strip surface defects. Appl. Surf. Sci. 2013, 285, 858–864. [Google Scholar] [CrossRef]
- Yi, L.; Li, G.; Jiang, M. An End-to-End Steel Strip Surface Defects Recognition System Based on Convolutional Neural Networks. Steel Res. Int. 2017, 88, 1600068. [Google Scholar] [CrossRef]
- Ye, R.; Chang, M.; Pan, C.S.; Chiang, C.A.; Gabayno, J.L. High-resolution optical inspection system for fast detection and classification of surface defects. Int. J. Optomech. 2018, 12, 1–10. [Google Scholar] [CrossRef]
- Cao, J.; Zhang, J.; Wen, Z.; Wang, N.; Liu, X. Fabric defect inspection using prior knowledge guided least squares regression. Multimed. Tools Appl. 2017, 76, 4141–4157. [Google Scholar] [CrossRef]
- Silvén, O.; Niskanen, M.; Kauppinen, H. Wood inspection with non-supervised clustering. Mach. Vis. Appl. 2003, 13, 275–285. [Google Scholar] [CrossRef] [Green Version]
- Chang, Z.; Cao, J.; Zhang, Y. A novel image segmentation approach for wood plate surface defect classification through convex optimization. J. For. Res. 2018, 29, 1789–1795. [Google Scholar] [CrossRef]
- Medina, R.; Gayubo, F.; González-Rodrigo, L.M.; Olmedo, D.; Gómez-García-Bermejo, J.; Zalama, E.; Perán, J.R. Automated visual classification of frequent defects in flat steel coils. Int. J. Adv. Manuf. Technol. 2011, 57, 1087–1097. [Google Scholar] [CrossRef]
- Chu, M.; Gong, R. Invariant Feature Extraction Method Based on Smoothed Local Binary Pattern for Strip Steel Surface Defect. Trans. Iron Steel Inst. Jpn. 2015, 55, 1956–1962. [Google Scholar] [CrossRef] [Green Version]
- Raheja, J.L.; Kumar, S.; Chaudhary, A. Fabric defect detection based on GLCM and Gabor filter: A comparison. Optik 2013, 124, 6469–6474. [Google Scholar] [CrossRef]
- Ding, S.; Liu, Z.; Li, C. AdaBoost learning for fabric defect detection based on HOG and SVM. In Proceedings of the International Conference on Multimedia Technology, Hangzhou, China, 26–28 July 2011; pp. 2903–2906. [Google Scholar]
- Kwon, B.K.; Won, J.S.; Kang, D.J. Fast defect detection for various types of surfaces using random forest with VOV features. Int. J. Precis. Eng. Manuf. 2015, 16, 965–970. [Google Scholar] [CrossRef]
- Sarkar, A.; Padmavathi, S. Image Pyramid for Automatic Segmentation of Fabric Defects; Springer: Cham, Switzerland, 2018. [Google Scholar]
- Weimer, D.; Benggolo, A.Y.; Freitag, M. Context-aware Deep Convolutional Neural Networks for Industrial Inspection. In Proceedings of the Australasian Conference on Artificial Intelligence, Canberra, Australia, 30 November–4 December 2015. [Google Scholar]
- Weimer, D.; Scholz-Reiter, B.; Shpitalni, M. Design of deep convolutional neural network architectures for automated feature extraction in industrial inspection. CIRP Ann. 2016, 65, 417–420. [Google Scholar] [CrossRef]
- Kim, S.; Kim, W.; Noh, Y.K.; Park, F.C. Transfer learning for automated optical inspection. In Proceedings of the International Joint Conference on Neural Networks, Anchorage, AK, USA, 14–19 May 2017; pp. 2517–2524. [Google Scholar]
- Bian, X.; Lim, S.N.; Zhou, N. Multiscale fully convolutional network with application to industrial inspection. In Proceedings of the 2016 IEEE Winter Conference on Applications of Computer Vision (WACV), Lake Placid, NY, USA, 7–10 March 2016; pp. 1–8. [Google Scholar]
- Deng, J.; Dong, W.; Socher, R.; Li, L.J.; Li, K.; Fei-Fei, L. Imagenet: A large-scale hierarchical image database. In Proceedings of the CVPR 2009, IEEE Conference on Ieee Computer Vision and Pattern Recognition, Miami, FL, USA, 20–25 June 2009; pp. 248–255. [Google Scholar]
- Abadi, M.; Barham, P.; Chen, J.; Chen, Z.; Davis, A.; Dean, J.; Devin, M.; Ghemawat, S.; Irving, G.; Isard, M.; et al. Tensorflow: A System for Large-Scale Machine Learning. In Proceedings of the 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI ’16), Savannah, GA, USA, 2–4 November 2016; Volume 16, pp. 265–283. [Google Scholar]
- Szegedy, C.; Ioffe, S.; Vanhoucke, V.; Alemi, A. Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning. In Proceedings of the Thirty-first AAAI Conference on Artificial Intelligence, Phoenix, AZ, USA, 12–17 February 2016. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Identity mappings in deep residual networks. In Proceedings of the European Conference on Computer Vision, Amsterdam, The Netherlands, 8–16 October 2016; pp. 630–645. [Google Scholar]
- Iandola, F.N.; Han, S.; Moskewicz, M.W.; Ashraf, K.; Dally, W.J.; Keutzer, K. Squeezenet: Alexnet-level accuracy with 50x fewer parameters and <0.5 mb model size. arXiv 2016, arXiv:1602.07360. [Google Scholar]
- Wu, C.; Wen, W.; Afzal, T.; Zhang, Y.; Chen, Y.; Li, H. A Compact DNN: Approaching GoogLeNet-Level Accuracy of Classification and Domain Adaptation. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 5668–5677. [Google Scholar]
- Howard, A.G.; Zhu, M.; Chen, B.; Kalenichenko, D.; Wang, W.; Weyand, T.; Andreetto, M.; Adam, H. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv 2017, arXiv:1704.04861. [Google Scholar]
- Zhang, X.; Zhou, X.; Lin, M.; Sun, J. ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 6848–6856. [Google Scholar]
- Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.C. MobileNetV2: Inverted Residuals and Linear Bottlenecks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 4510–4520. [Google Scholar]
- Mullick, K.; Namboodiri, A.M. Learning deep and compact models for gesture recognition. In Proceedings of the 2017 IEEE International Conference on Image Processing (ICIP), Beijing, China, 17–20 September 2017; pp. 3998–4002. [Google Scholar]
- Chen, K.; Tian, L.; Ding, H.; Cai, M.; Sun, L.; Liang, S.; Huo, Q. A Compact CNN-DBLSTM Based Character Model for Online Handwritten Chinese Text Recognition. In Proceedings of the Iapr International Conference on Document Analysis and Recognition, Kyoto, Japan, 9–12 November 2017; pp. 1068–1073. [Google Scholar]
- Wong, A.; Shafiee, M.J.; Jules, M.S. MicronNet: A Highly Compact Deep Convolutional Neural Network Architecture for Real-Time Embedded Traffic Sign Classification. IEEE Access 2018, 6, 59803–59810. [Google Scholar] [CrossRef]
- Racki, D.; Tomazevic, D.; Skocaj, D. A compact convolutional neural network for textured surface anomaly detection. In Proceedings of the 2018 IEEE Winter Conference on Applications of Computer Vision (WACV), Lake Tahoe, NV, USA, 12–15 March 2018; pp. 1331–1339. [Google Scholar]
- Kornblith, S.; Shlens, J.; Le, Q.V. Do Better ImageNet Models Transfer Better? arXiv 2018, arXiv:1805.08974. [Google Scholar]
- Chen, L.C.; Zhu, Y.; Papandreou, G.; Schroff, F.; Adam, H. Encoder-decoder with atrous separable convolution for semantic image segmentation. arXiv 2018, arXiv:1802.02611. [Google Scholar]
- Sun, C.; Shrivastava, A.; Singh, S.; Gupta, A. Revisiting Unreasonable Effectiveness of Data in Deep Learning Era. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 843–852. [Google Scholar]
- Chollet, F. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 1251–1258. [Google Scholar]
- Han, S.; Mao, H.; Dally, W.J. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv 2015, arXiv:1510.00149. [Google Scholar]
- Molchanov, P.; Tyree, S.; Karras, T.; Aila, T.; Kautz, J. Pruning convolutional neural networks for resource efficient inference. arXiv 2016, arXiv:1611.06440. [Google Scholar]
- Gupta, S.; Agrawal, A.; Gopalakrishnan, K.; Narayanan, P. Deep learning with limited numerical precision. In Proceedings of the International Conference on Machine Learning, Lille, France, 6–11 July 2015; pp. 1737–1746. [Google Scholar]
- Xu, T.B.; Yang, P.; Zhang, X.Y.; Liu, C.L. Margin-aware binarized weight networks for image classification. In Proceedings of the International Conference on Image and Graphics, Shanghai, China, 13–15 September 2017; pp. 590–601. [Google Scholar]
- Tai, C.; Xiao, T.; Zhang, Y.; Wang, X. Convolutional neural networks with low-rank regularization. arXiv 2015, arXiv:1511.06067. [Google Scholar]
- Hinton, G.; Vinyals, O.; Dean, J. Distilling the knowledge in a neural network. arXiv 2015, arXiv:1503.02531. [Google Scholar]
- Cheng, Y.; Wang, D.; Zhou, P.; Zhang, T. Model compression and acceleration for deep neural networks: The principles, progress, and challenges. IEEE Signal Process. Mag. 2018, 35, 126–136. [Google Scholar] [CrossRef]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet classification with deep convolutional neural networks. In Proceedings of the International Conference on Neural Information Processing Systems, Sydney, Australia, 12–15 December 2012; pp. 1097–1105. [Google Scholar]
- Simonyan, K.; Zisserman, A. Very Deep Convolutional Networks for Large-Scale Image Recognition. arXiv 2014, arXiv:1409.1556. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
- Peng, C.; Zhang, X.; Yu, G.; Luo, G.; Sun, J. Large kernel matters—improve semantic segmentation by global convolutional network. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 4353–4361. [Google Scholar]
- Chen, L.C.; Papandreou, G.; Kokkinos, I.; Murphy, K.; Yuille, A.L. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. IEEE Trans. Pattern Anal. Mach. Intell. 2018, 40, 834–848. [Google Scholar] [CrossRef] [PubMed]
- Krizhevsky, A.; Hinton, G. Convolutional deep belief networks on cifar-10. Unpubl. Manuscr. 2010, 40, 1–9. [Google Scholar]
- Springenberg, J.T.; Dosovitskiy, A.; Brox, T.; Riedmiller, M. Striving for simplicity: The all convolutional net. arXiv 2014, arXiv:1412.6806. [Google Scholar]
- Caputo, B.; Hayman, E.; Mallikarjuna, P. Class-Specific Material Categorisation. In Proceedings of the Tenth IEEE International Conference on Computer Vision, Beijing, China, 17–21 October 2005; Volume 2, pp. 1597–1604. [Google Scholar]
- Kylberg, G. The Kylberg Texture Dataset v. 1.0. In External Report (Blue Series) 35, Centre for Image Analysis; Swedish University of Agricultural Sciences and Uppsala University: Uppsala, Sweden, 2011. [Google Scholar]
- Lazebnik, S.; Schmid, C.; Ponce, J. A sparse texture representation using local affine regions. IEEE Trans. Pattern Anal. Mach. Intell. 2005, 27, 1265–1278. [Google Scholar] [CrossRef] [Green Version]
- DAGM. Weakly Supervised Learning for Industrial Optical Inspection. DAGM Dataset. 2013. Available online: https://hci.iwr.uni-heidelberg.de/node/3616 (accessed on 26 March 2020).
- Jung, A.B.; Wada, K.; Crall, J.; Tanaka, S.; Graving, J.; Yadav, S.; Banerjee, J.; Vecsei, G.; Kraft, A.; Borovec, J.; et al. Imgaug. Available online: https://github.com/aleju/imgaug (accessed on 25 September 2019).
- Nilsback, M.E.; Zisserman, A. Automated Flower Classification over a Large Number of Classes. In Proceedings of the 2018 Sixth Indian Conference on Computer Vision, Graphics & Image Processing, Bhubaneswar, India, 16–19 December 2008; pp. 722–729. [Google Scholar]
- Ren, R.; Hung, T.; Tan, K.C. A Generic Deep-Learning-Based Approach for Automated Surface Inspection. IEEE Trans. Cybern. 2017, 5, 1–12. [Google Scholar] [CrossRef] [PubMed]
- Donahue, J.; Jia, Y.; Vinyals, O.; Hoffman, J.; Zhang, N.; Tzeng, E.; Darrell, T. DeCAF: A deep convolutional activation feature for generic visual recognition. In Proceedings of the 31st International Conference on Machine Learning, Beijing, China, 21–26 June 2014; pp. 647–655. [Google Scholar]
- Chen, W.; Gao, Y.; Gao, L.; Li, X. A New Ensemble Approach based on Deep Convolutional Neural Networks for Steel Surface Defect classification. Procedia CIRP 2018, 72, 1069–1072. [Google Scholar] [CrossRef]
- Zagoruyko, S.; Komodakis, N. Wide residual networks. arXiv 2016, arXiv:1605.07146. [Google Scholar]
- Yu, Z.; Wu, X.; Gu, X. Fully convolutional networks for surface defect inspection in industrial environment. In Proceedings of the International Conference on Computer Vision Systems, Shenzhen, China, 10–13 July 2017; pp. 417–426. [Google Scholar]
Model | Layers | F (M) | W (M) | Top-1 (%) |
---|---|---|---|---|
AlexNet | 8 | 1386 | 49.43 | 57.2 |
VGG-16 | 16 | 9040 | 138.35 | 71.5 |
ResNetV2 | 50 | 7105 | 25.57 | 75.6 |
ResNetV2 | 101 | 14,631 | 44.58 | 77.0 |
ResNetV2 | 200 | 29,165 | 64.73 | 79.9 |
Inception-V4 | - | 12,479 | 42.65 | 80.2 |
MobileNetV2@1.4 | 53 | 1189 | 6.11 | 75.0 |
Input | Operator | S | N | Block | |
---|---|---|---|---|---|
Conv2d | 32 | 2 | 1 | 1 | |
Conv2d | 16 | 1 | 1 | 2 | |
LW bottleneck | 24 | 2 | 2 | 3–4 | |
LW bottleneck | 32 | 2 | 2 | 5–6 | |
LW bottleneck | 32 | 2 | 1 | 7 | |
LW bottleneck | 64 | 2 | 4 | 8–11 | |
Conv2d | 320 | 1 | 1 | 12 |
Model | Pretrain | F (M) | W (M) | t (ms) | (%) |
---|---|---|---|---|---|
ShuffleNet@0.25 | - | 196 | 0.19 | 254 | 97.02 |
MobileNetV2@0.35 | - | 267 | 0.48 | 259 | 97.72 |
MobileNetV2@1.4 | - | 2684 | 4.43 | 695 | 97.56 |
ResNetV2-50 | - | 16082 | 23.65 | 893 | 99.03 |
ours@0.35 | - | 76 | 0.06 | 75 | 97.51 |
ours@0.75 | - | 246 | 0.14 | 140 | 98.71 |
ShuffleNet@0.25 | ImageNet | 196 | 0.19 | 254 | 99.33 |
MobileNetV2@0.35 | ImageNet | 267 | 0.48 | 259 | 99.63 |
MobileNetV2@1.4 | ImageNet | 2684 | 4.43 | 695 | 99.93 |
ResNetV2-50 | ImageNet | 16082 | 23.65 | 893 | 99.60 |
ours@0.35 | ImageNet | 76 | 0.06 | 75 | 99.29 |
ours@0.75 | ImageNet | 246 | 0.14 | 140 | 99.52 |
ShuffleNet@0.25 | Flower102 | 196 | 0.19 | 254 | 99.27 |
MobileNetV2@0.35 | Flower102 | 267 | 0.48 | 259 | 99.50 |
MobileNetV2@1.4 | Flower102 | 2684 | 4.43 | 695 | 99.73 |
ResNetV2-50 | Flower102 | 16082 | 23.65 | 893 | 99.58 |
ours@0.35 | Flower102 | 76 | 0.06 | 75 | 98.48 |
ours@0.75 | Flower102 | 246 | 0.14 | 140 | 99.33 |
Model | Pretrain | F (M) | W (M) | t (ms) | (%) |
---|---|---|---|---|---|
SCN + SVM | - | - | - | - | 98.60 |
CNN(Yi Li) | - | 400 | 0.46 | - | 99.05 |
Decaf + MLR | ImageNet | 1078 | 28.58 | - | 99.27 |
WRN | - | 115557 | 144.8 | - | 99.89 |
ShuffleNet@0.25 | - | 52 | 0.19 | 126 | 99.89 |
MobileNetV2@0.35 | - | 102 | 0.40 | 116 | 99.89 |
ours@0.35 | - | 28 | 0.04 | 29 | 100 |
ShuffleNet@0.25 | ImageNet | 52 | 0.19 | 126 | 99.89 |
MobileNetV2@0.35 | ImageNet | 102 | 0.40 | 116 | 100 |
ours@0.35 | ImageNet | 28 | 0.04 | 29 | 100 |
Model | Pretrain | F (M) | W (M) | t (ms) | (%) |
---|---|---|---|---|---|
FCN + CNN | - | - | - | - | 95.99 |
CA-CNN | - | - | - | - | 96.44 |
CNN + SW | - | - | - | - | 99.20 |
C-CNN | - | 2280 | 1.27 | - | 99.43 |
VGG | ImageNet | 9024 | 134.31 | - | 99.93 |
ShuffleNet@0.25 + ours decoder | - | 1126 | 0.64 | 371 | 98.99 |
MobileNetV2@0.35 + ours decoder | - | 1630 | 1.40 | 591 | 98.99 |
ours@0.35 | - | 923 | 0.55 | 217 | 98.86 |
ours@0.75 | - | 1312 | 0.60 | 369 | 99.46 |
ShuffleNet@0.25 + ours decoder | ImageNet | 1126 | 0.64 | 371 | 99.40 |
MobileNetV2@0.35 + ours decoder | ImageNet | 1630 | 1.40 | 591 | 99.90 |
ours@0.35 | Textures | 923 | 0.55 | 217 | 99.40 |
ours@0.35 | ImageNet | 923 | 0.55 | 217 | 99.43 |
ours@0.75 | Textures | 1312 | 0.60 | 369 | 99.79 |
ours@0.75 | ImageNet | 1312 | 0.60 | 369 | 99.67 |
Model | Gradual Training | Pretrain | ||
---|---|---|---|---|
ours@0.35 | 90.47 | 98.82 | ||
ours@0.35 | ✓ | 94.05 | 98.86 | |
ours@0.35 | ✓ | ✓ | 95.24 | 99.43 |
© 2020 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 (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Huang, Y.; Qiu, C.; Wang, X.; Wang, S.; Yuan, K. A Compact Convolutional Neural Network for Surface Defect Inspection. Sensors 2020, 20, 1974. https://doi.org/10.3390/s20071974
Huang Y, Qiu C, Wang X, Wang S, Yuan K. A Compact Convolutional Neural Network for Surface Defect Inspection. Sensors. 2020; 20(7):1974. https://doi.org/10.3390/s20071974
Chicago/Turabian StyleHuang, Yibin, Congying Qiu, Xiaonan Wang, Shijun Wang, and Kui Yuan. 2020. "A Compact Convolutional Neural Network for Surface Defect Inspection" Sensors 20, no. 7: 1974. https://doi.org/10.3390/s20071974
APA StyleHuang, Y., Qiu, C., Wang, X., Wang, S., & Yuan, K. (2020). A Compact Convolutional Neural Network for Surface Defect Inspection. Sensors, 20(7), 1974. https://doi.org/10.3390/s20071974