A Novel Method to Inspect 3D Ball Joint Socket Products Using 2D Convolutional Neural Network with Spatial and Channel Attention
<p>An overview of the proposed defect inspection framework. (<b>a</b>) Inspection surface acquisition, (<b>b</b>) image preprocessing, (<b>c</b>) proposed CNN model with the spatial and channel attention (SCA). FEB—feature extraction block. GAP—global average pooling, FV—feature vector, FC—fully connected layer.</p> "> Figure 2
<p>The 3D representation of the 3D ball joint socket defect inspection hardware system. LED—light-emitting diode.</p> "> Figure 3
<p>Demonstration of 3D ball joint socket product defects and defect sizes. (<b>a</b>) Small defects—1.5–3 mm, (<b>b</b>) medium defects—3–6 mm, (<b>c</b>) big defects—6–10 mm.</p> "> Figure 4
<p>Classification performance comparison of our developed CNN models. All CNN models were trained to classify the 3D ball joint socket product into defective and non-defective categories.</p> "> Figure 5
<p>Confusion matrix of the proposed model for the 3D ball joint socket test dataset with 98% average accuracy score. OK and NG indicate the non-defective and defective samples, respectively.</p> "> Figure 6
<p>Illustration of light reflection issue of 3D ball joint socket object. (<b>a</b>) Light reflected, (<b>b</b>) before gamma correction, (<b>c</b>) gamma applied image.</p> "> Figure 7
<p>The impact of image size in small defects of the product in resizing of original image. (<b>a</b>) A resized image with 224 × 224 image size, (<b>b</b>) a resized image with 380 × 380 image size.</p> "> Figure 8
<p>Proposed model performance comparison with existing methods. Squeeze-and-excitation networks (SEB) [<a href="#B40-sensors-22-04192" class="html-bibr">40</a>], self-attention generative adversarial networks (Self-A) [<a href="#B41-sensors-22-04192" class="html-bibr">41</a>].</p> "> Figure 9
<p>Illustration of the comparison of the proposed model performance in terms of processing time (<b>a</b>) and number of model parameters (<b>b</b>).</p> "> Figure 10
<p>A demonstration of the 3D ball socket defect inspection system installed at the factory. (<b>a</b>) Outside view of the inspection system, (<b>b</b>) inside view of the inspection system.</p> ">
Abstract
:1. Introduction
- We developed, tested, and deployed a defect inspection system for efficient classification of defective and non-defective 3D ball joint socket products using a 2D convolutional neural network (CNN) with channel and spatial attention mechanisms.
- We proposed a novel method to inspect 3D objects using 2D cameras. Our system uses five industrial cameras to capture all inspection parts of the 3D ball joint socket product. Acquired 2D images are processed to detect defect products using 2D CNN with channel and spatial attention.
- Some parts of the product reflect light more than other parts and it leads to different light reflection issue. To solve this problem, first we reduced the light intensity to a certain value to make sure that there is no light reflection from the shiny parts of the product. Thereafter, we applied a gamma correction method to increase the brightness of the acquired image.
- We proposed a convolutional neural network with channel and spatial attention for accurate detection of defects of the 3D ball joint socket product. Our proposed CNN model with channel and spatial attention extracts useful features from the input image using a feature extraction block (FEB), and then channel attention detects the most relevant feature maps for the target while spatial attention finds the most important regions in the extracted feature map for the target. Both attention features are combined to make robust feature maps and are fed to the fully connected network to process and make final prediction.
- We experimentally proved the effectiveness of the proposed CNN model with channel and spatial attention by developing and analyzing the results of four different CNN models. Our proposed model achieved 98% average accuracy rate which was 18% higher compared to the CNN model without channel and spatial attention mechanisms.
2. Literature Review
2.1. Handcrafted Features with Traditional Machine Learning Methods
2.2. Deep Learning-Based Methods
2.3. Handcrafted Features with Manifold-Valued Neural Network
3. Proposed Method
3.1. Data Acquisition
3.2. Gamma Correction
3.3. Feature Extraction Block
3.4. Proposed Spatial and Channel Attention
4. Data Collection and Dataset Information
4.1. Ball Joint Socket Product Inspection System
4.2. Dataset Description
5. Experiments and Results
5.1. Experimental Setup
5.2. Evaluation of Model Testing Performance
5.3. Experimental Results
6. Discussion and Comparative Analysis
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Sin, B.-S.; Kim, S.-U.; Kim, J.-K.; Lee, K.-H. Robust Design of an Automobile Ball Joint Considering the Worst-Case Analysis. Korean Soc. Manuf. Process Eng. 2017, 16, 102–111. [Google Scholar] [CrossRef]
- Sin, B.-S.; Lee, K.-H. Process design of a ball joint, considering caulking and pull-out strength. Sci. World J. 2014, 2014, 971679. [Google Scholar] [CrossRef] [PubMed]
- Bordon, W.; Zucchini, M.; Simião, G.; Cichoski, B.W. High performance ball joint. In Proceedings of the SAE Brasil 2003 Congress and Exhibit, Sao Paulo, Brazil, 18–20 November 2003. [Google Scholar]
- Yun, J.P.; Shin, W.C.; Koo, G.; Kim, M.S.; Lee, C.; Lee, S.J. Automated defect inspection system for metal surfaces based on deep learning and data augmentation. J. Manuf. Syst. 2020, 55, 317–324. [Google Scholar] [CrossRef]
- Ha, H.; Jeong, J. CNN-Based Defect Inspection for Injection Molding Using Edge Computing and Industrial IoT Systems. Appl. Sci. 2021, 11, 6378. [Google Scholar] [CrossRef]
- Raheja, J.L.; Ajay, B.; Chaudhary, A. Real time fabric defect detection system on an embedded DSP platform. Optik 2013, 124, 5280–5284. [Google Scholar] [CrossRef] [Green Version]
- Tong, L.; Wong, W.K.; Kwong, C. Fabric defect detection for apparel industry: A nonlocal sparse representation approach. IEEE Access 2017, 5, 5947–5964. [Google Scholar] [CrossRef]
- Wang, J.; Fu, P.; Gao, R.X. Machine vision intelligence for product defect inspection based on deep learning and Hough transform. J. Manuf. Syst. 2019, 51, 52–60. [Google Scholar] [CrossRef]
- Arnal, L.; Solanes, J.E.; Molina, J.; Tornero, J. Detecting dings and dents on specular car body surfaces based on optical flow. J. Manuf. Syst. 2017, 45, 306–321. [Google Scholar] [CrossRef] [Green Version]
- Tootooni, M.S.; Liu, C.; Roberson, D.; Donovan, R.; Rao, P.K.; Kong, Z.J.; Bukkapatnam, S.T. Online non-contact surface finish measurement in machining using graph theory-based image analysis. J. Manuf. Syst. 2016, 41, 266–276. [Google Scholar] [CrossRef]
- Huang, S.; Xu, K.; Li, M.; Wu, M. Improved visual inspection through 3D image reconstruction of defects based on the photometric stereo technique. Sensors 2019, 19, 4970. [Google Scholar] [CrossRef] [Green Version]
- Wang, L.; Xu, K.; Zhou, P. Online detection technique of 3D defects for steel strips based on photometric stereo. In Proceedings of the 2016 Eighth International Conference on Measuring Technology and Mechatronics Automation (ICMTMA), Macau, China, 11–12 March 2016; IEEE: Piscataway Township, NJ, USA, 2016; pp. 428–432. [Google Scholar]
- Chen, Y.; Ding, Y.; Zhao, F.; Zhang, E.; Wu, Z.; Shao, L. Surface Defect Detection Methods for Industrial Products: A Review. Appl. Sci. 2021, 11, 7657. [Google Scholar] [CrossRef]
- Liu, Y.; Xu, K.; Xu, J. An improved MB-LBP defect recognition approach for the surface of steel plates. Appl. Sci. 2019, 9, 4222. [Google Scholar] [CrossRef] [Green Version]
- Song, W.; Chen, T.; Gu, Z.; Gai, W.; Huang, W.; Wang, B. Wood materials defects detection using image block percentile color histogram and eigenvector texture feature. In Proceedings of the First International Conference on Information Sciences, Machinery, Materials and Energy, Chongqing, China, 11–13 April 2015; pp. 2022–2026. [Google Scholar]
- Ren, R.; Hung, T.; Tan, K.C. A generic deep-learning-based approach for automated surface inspection. IEEE Trans. Cybern. 2017, 48, 929–940. [Google Scholar] [CrossRef] [PubMed]
- Mery, D. Aluminum casting inspection using deep learning: A method based on convolutional neural networks. J. Nondestruct. Eval. 2020, 39, 1–12. [Google Scholar] [CrossRef]
- Zheng, X.; Wang, H.; Chen, J.; Kong, Y.; Zheng, S. A generic semi-supervised deep learning-based approach for automated surface inspection. IEEE Access 2020, 8, 114088–114099. [Google Scholar] [CrossRef]
- Berthelot, D.; Carlini, N.; Goodfellow, I.; Papernot, N.; Oliver, A.; Raffel, C.A. Mixmatch: A holistic approach to semi-supervised learning. Adv. Neural Inf. Process. Syst. 2019, 32, 5050–5060. [Google Scholar]
- Zhang, H.; Cisse, M.; Dauphin, Y.N.; Lopez-Paz, D.J. mixup: Beyond empirical risk minimization. arXiv 2017, arXiv:1710.09412. [Google Scholar]
- Chakraborty, R.; Bouza, J.; Manton, J.; Vemuri, B.C.; Intelligence, M. Manifoldnet: A deep neural network for manifold-valued data with applications. IEEE Trans. Pattern Anal. Mach. Intell. 2020, 44, 799–810. [Google Scholar] [CrossRef]
- Huang, Z.; Van Gool, L. A riemannian network for spd matrix learning. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, San Francisco, CA, USA, 4–9 February 2017. [Google Scholar]
- Hua, X.; Ono, Y.; Peng, L.; Cheng, Y.; Wang, H. Target detection within nonhomogeneous clutter via total bregman divergence-based matrix information geometry detectors. IEEE Trans. Signal Process. 2021, 69, 4326–4340. [Google Scholar] [CrossRef]
- Wang, Q.; Lu, X.; Li, P.; Gao, Z.; Piao, Y.; Technology, S. An information geometry-based distance between high-dimensional covariances for scalable classification. IEEE Trans. Circuits Syst. Video Technol. 2017, 28, 2449–2459. [Google Scholar] [CrossRef]
- Basser, P.J.; Mattiello, J.; LeBihan, D. MR diffusion tensor spectroscopy and imaging. Biophys. J. 1994, 66, 259–267. [Google Scholar] [CrossRef] [Green Version]
- Tuch, D.S.; Reese, T.G.; Wiegell, M.R.; Wedeen, V.J. Diffusion MRI of complex neural architecture. Neuron 2003, 40, 885–895. [Google Scholar] [CrossRef] [Green Version]
- Shi, Y.; Yang, J.; Wu, R. Reducing illumination based on nonlinear gamma correction. In Proceedings of the 2007 IEEE International Conference on Image Processing, San Antonio, TX, USA, 16–19 September 2007; IEEE: Piscataway Township, NJ, USA, 2007; pp. I-529–I-532. [Google Scholar]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. Imagenet classification with deep convolutional neural networks. NIPS 2012, 25. [Google Scholar] [CrossRef]
- Tabernik, D.; Šela, S.; Skvarč, J.; Skočaj, D. Segmentation-based deep-learning approach for surface-defect detection. J. Intell. Manuf. 2020, 31, 759–776. [Google Scholar] [CrossRef] [Green Version]
- Zaidi, S.S.A.; Ansari, M.S.; Aslam, A.; Kanwal, N.; Asghar, M.; Lee, B. A survey of modern deep learning based object detection models. Digit. Signal Process. 2022, 126, 103514. [Google Scholar] [CrossRef]
- Liu, G.; Guo, J. Bidirectional LSTM with attention mechanism and convolutional layer for text classification. Neurocomputing 2019, 337, 325–338. [Google Scholar] [CrossRef]
- Bakarola, V.; Nasriwala, J. Attention based Neural Machine Translation with Sequence to Sequence Learning on Low Resourced Indic Languages. In Proceedings of the 2021 2nd International Conference on Advances in Computing, Communication, Embedded and Secure Systems (ACCESS), Ernakulum, India, 2–4 September 2021; IEEE: Piscataway Township, NJ, USA, 2021; pp. 178–182. [Google Scholar]
- Karmakar, P.; Teng, S.W.; Lu, G. Thank you for attention: A survey on attention-based artificial neural networks for automatic speech recognition. arXiv 2021, arXiv:2102.07259. [Google Scholar]
- Pang, B.; Nijkamp, E.; Wu, Y.N.; Statistics, B. Deep learning with tensorflow: A review. J. Educ. Behav. Stat. 2020, 45, 227–248. [Google Scholar] [CrossRef]
- Raschka, S.; Patterson, J.; Nolet, C. Machine learning in python: Main developments and technology trends in data science, machine learning, and artificial intelligence. Information 2020, 11, 193. [Google Scholar] [CrossRef] [Green Version]
- Zheng, X.; Zheng, S.; Kong, Y.; Chen, J. Recent advances in surface defect inspection of industrial products using deep learning techniques. Int. J. Adv. Manuf. Technol. 2021, 113, 35–58. [Google Scholar] [CrossRef]
- Zheng, X.; Chen, J.; Wang, H.; Zheng, S.; Kong, Y. A deep learning-based approach for the automated surface inspection of copper clad laminate images. Appl. Intell. 2021, 51, 1262–1279. [Google Scholar] [CrossRef]
- Kim, B.; Yuvaraj, N.; Sri Preethaa, K.; Arun Pandian, R. Applications, Surface crack detection using deep learning with shallow CNN architecture for enhanced computation. Neural Comput. Appl. 2021, 33, 9289–9305. [Google Scholar] [CrossRef]
- Lin, H.-I.; Wibowo, F.S. Image data assessment approach for deep learning-based metal surface defect-detection systems. IEEE Access 2021, 9, 47621–47638. [Google Scholar] [CrossRef]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 7132–7141. [Google Scholar]
- Zhang, H.; Goodfellow, I.; Metaxas, D.; Odena, A. Self-attention generative adversarial networks. In Proceedings of the International Conference on Machine Learning, Long Beach, CA, USA, 10–15 June 2019; pp. 7354–7363. [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]
- Tan, M.; Le, Q. Efficientnet: Rethinking model scaling for convolutional neural networks. In Proceedings of the International Conference on Machine Learning, Long Beach, CA, USA, 9–15 June 2019; pp. 6105–6114. [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 2009 IEEE Conference on Computer Vision and Pattern Recognition, Miami, FL, USA, 20–25 June 2009; IEEE: Piscataway Township, NJ, USA, 2009; pp. 248–255. [Google Scholar]
Name of Layers | Input Tensor Shape | Output Tensor Shape | Kernel Size | Stride | Activation Function | Number of Parameters |
---|---|---|---|---|---|---|
FEB | ||||||
Conv2D_1 | 380 × 380 × 3 | 378 × 378 × 32 | 3 × 3 | 1 × 1 | ReLU | 896 |
MP_1 | 378 × 378 × 32 | 189 × 189 × 32 | 2 × 2 | 2 × 2 | - | 0 |
Conv2D_2 | 189 × 189 × 32 | 187 × 187 × 64 | 3 × 3 | 1 × 1 | ReLU | 18,496 |
MP_2 | 187 × 187 × 64 | 93 × 93 × 64 | 2 × 2 | 2 × 2 | - | 0 |
Conv2D_3 | 93 × 93 × 64 | 91 × 91 × 64 | 3 × 3 | 1 × 1 | ReLU | 36,928 |
MP_3 | 91 × 91 × 64 | 45 × 45 × 64 | 2 × 2 | 2 × 2 | - | 0 |
Conv2D_4 | 45 × 45 × 64 | 43 × 43 × 64 | 3 × 3 | 1 × 1 | ReLU | 36,928 |
MP_4 | 43 × 43 × 64 | 21 × 21 × 64 | 2 × 2 | 2 × 2 | - | 0 |
Conv2D_5 | 21 × 21 × 64 | 19 × 19 × 64 | 3 × 3 | 1 × 1 | ReLU | 36,928 |
MP_5 | 19 × 19 × 64 | 9 × 9 × 64 | 2 × 2 | 2 × 2 | - | 0 |
Conv2D_6 | 9 × 9 × 64 | 9 × 9 × 128 | 3 × 3 | 1 × 1 | ReLU | 73,856 |
MP_6 | 9 × 9 × 128 | 4 × 4 × 128 | 2 × 2 | 2 × 2 | - | 0 |
Conv2D_7 | 4 × 4 × 128 | 4 × 4 × 128 | 3 × 3 | 1 × 1 | ReLU | 147,584 |
MP_7 | 4 × 4 × 128 | 2 × 2 × 128 | 2 × 2 | 2 × 2 | - | 0 |
GAP_1 | 2 × 2 × 128 | 128 | - | - | - | 0 |
SA | ||||||
Conv2D_8 | 2 × 2 × 128 | 2 × 2 × 64 | 1 × 1 | 1 × 1 | ReLU | 8256 |
Conv2D_9 | 2 × 2 × 64 | 2 × 2 × 64 | 3 × 3 | 1 × 1 | ReLU | 36,928 |
Conv2D_10 | 2 × 2 × 64 | 2 × 2 × 64 | 1 × 1 | 1 × 1 | ReLU | 4160 |
GAP_2 | 2 × 2 × 64 | 64 | - | - | - | 0 |
CA | ||||||
GAP_3 | 2 × 2 × 128 | 128 | - | - | - | 0 |
FC_1 | 128 | 128 | - | - | ReLU | 16,512 |
FC_2 | 128 | 64 | ReLU | 8256 | ||
Con_1 | 128, 64, 64 | 256 | - | - | - | 0 |
FCN | ||||||
FC_3 | 256 | 128 | - | - | ReLU | 32,896 |
FC_4 | 128 | 64 | - | - | ReLU | 8256 |
FC_5 | 64 | 2 | - | - | SoftMax | 130 |
Total parameters = 467,010 |
Dataset Folders | Class Names and Number of Images | |
---|---|---|
OK | NG | |
Train set | 1014 | 734 |
Test set | 255 | 150 |
Total | 1269 | 884 |
Software Specifications | Hardware Specifications |
---|---|
OS: Windows 11 Pro | CPU: Intel Core i7-9700CPU @ 3.00 GHz RAM: 32 GB |
Tools: TensorFlow 2.6, Python 3.8 | GPU: NVIDIA GeForce RTX 3090 |
Class Category | Precision | Recall | F1-Score | Number of Images |
---|---|---|---|---|
OK | 0.98 | 0.99 | 0.99 | 255 |
NG | 0.98 | 0.97 | 0.98 | 150 |
Accuracy | 0.98 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Mustafaev, B.; Tursunov, A.; Kim, S.; Kim, E. A Novel Method to Inspect 3D Ball Joint Socket Products Using 2D Convolutional Neural Network with Spatial and Channel Attention. Sensors 2022, 22, 4192. https://doi.org/10.3390/s22114192
Mustafaev B, Tursunov A, Kim S, Kim E. A Novel Method to Inspect 3D Ball Joint Socket Products Using 2D Convolutional Neural Network with Spatial and Channel Attention. Sensors. 2022; 22(11):4192. https://doi.org/10.3390/s22114192
Chicago/Turabian StyleMustafaev, Bekhzod, Anvarjon Tursunov, Sungwon Kim, and Eungsoo Kim. 2022. "A Novel Method to Inspect 3D Ball Joint Socket Products Using 2D Convolutional Neural Network with Spatial and Channel Attention" Sensors 22, no. 11: 4192. https://doi.org/10.3390/s22114192
APA StyleMustafaev, B., Tursunov, A., Kim, S., & Kim, E. (2022). A Novel Method to Inspect 3D Ball Joint Socket Products Using 2D Convolutional Neural Network with Spatial and Channel Attention. Sensors, 22(11), 4192. https://doi.org/10.3390/s22114192