Automated Single-Pole Double-Throw Toggle Switch Pin Inspection using Image Processing and Convolutional Neural Network Techniques

Main Article Content

Tamnuwat Valeeprakhon
Penpun Chaihuadjaroen
Chakapan Chanpilom
Chakapan Chanpilom
Pairat Sroytong


The single-pole double-throw toggle switch bent pin inspection is an indispensable step in the switch production process. However, the traditional inspection process is conducted in manual work, and this may result in misunderstanding and reduces the manufacturing efficiency due to exhausted humans. To overcome these problems, the automated single pole-double throw toggle switch bent pin inspection method by using image processing and convolutional neural networks is proposed. Our proposed method can be achieved to inspect whether normal or abnormal bent pin of these toggle switches without sorting and no positioning arrangement. Our proposed method consists of five main steps: The first step, the HSV color segmentation is used for background extraction. Next step, the
morphological opening, and closing operation are applied for handling noise and holes that
conspicuously affect the system’s ability to identify the extracted object accurately. Next step, the
minimal enclosing rectangle and angle of rotation are calculated for identifying the positions of the
disorder toggle switch. Next step, the CNN is used for locating pins in order to extract only the pins
out from the binary switch image. In the final step, the average summation of the white pixel is
calculated for classifying normal and abnormal bent pins. The experimental results obtained by
our proposed method are statistically described as accurate compared to many different methods
based on the single pole-double throw toggle switch bent pin inspection. Results show that our
proposed method provides high accuracy than other comparative methods with a mean accuracy of 0.9940 from 6,270 images and uses mean time-consuming 0.3385 seconds.


Article Details

How to Cite
Valeeprakhon, T., Chaihuadjaroen, P. ., Chanpilom, C. ., Chanpilom, C. ., & Sroytong, P. . (2022). Automated Single-Pole Double-Throw Toggle Switch Pin Inspection using Image Processing and Convolutional Neural Network Techniques. INTERNATIONAL SCIENTIFIC JOURNAL OF ENGINEERING AND TECHNOLOGY (ISJET), 6(1), 16–27. Retrieved from
Research Article


F. Zhong, X. Shao, and C. Quan, “3D Digital Image Correlation Using a Single 3CCD Colour Camera and Dichroic Filter,” International Journal of Measurement Science and Technology, vol. 29, no. 4, pp. 1-9, Apr. 2018.

F. Zhong, R. Kumar, and C. Quan, “A Cost-Effective SingleShot Structured Light System for 3D Shape Measurement,” IEEE Sensors Journal, vol. 19, no. 17, pp. 7335-7346, May. 2019.

Y. Shu, B. Li, and H. Lin, “Quality Safety Monitoring of LED Chips Using Deep Learning-Based Vision Inspection Methods,” Journal of the International Measurement Confederation, vol. 168, pp. 1-10, Jan. 2020.

O. Celik, C. ZhiDong, and F. N. Catbas, “A Computer Vision Approach for the Load Time History Estimation of Lively Individuals and Crowds,” An International Journal of Computers & Structures, vol. 200, pp. 32-52, Apr. 2018.

Y. Xiao, Z. Li, D. Zhang et al., “Detection of Pin Defects in Aerial Images Based on Cascaded Convolutional Neural Network,” IEEE Access, vol. 9, pp. 73071-73082, May. 2021.

W. Wu and Q. Li, “Machine Vision Inspection of Electrical Connectors Based on Improved Yolo v3,” IEEE Access, vol. 8, pp. 166184-166196, Sep. 2020.

L. Jiayu, “Research on Technologies of Pin’s Detection for Avionics Electronic Connector Based on Machine Vision,” Ph.D. dissertation, Harbin Institute of Technology, Harbin, China, 2017.

G. Pallabi, B. Aritra, F. Domenic et al., “Automated Defective Pin Detection for Recycled Microelectronics Identification,” Journal of Hardware and Systems Security, vol. 3, pp. 250-

, May. 2019.

D. Fu-Zhou and Z. De-long, “Research on Multi-Type Electrical Connectors Detection Based on Binocular Vision,” Aviation Precision Manufacturing Technology, vol. 52, no. 5, pp. 23-28, May. 2016.

S. Kaitwanidvilai, A. Saenthon, and A. Kunakorn, “Pattern Recognition Technique for Integrated Circuit (IC) Pins Inspection Using Wavelet Transform with Chain CodeDiscrete Fourier Transform and Signal Correlation,” International Journal of Physical Sciences, vol. 7, no. 9, pp. 1326-1332, Feb. 2012.

F. G. Lamont, J. Cervantes, A. López et al., “Segmentation of Images by Color Features: A Survey,” Neurocomputing, vol. 292, pp. 1-27, Mar. 2018.

R. C. Gonzalez and R. E. Woods, “Digital Image Processing,” London: Person Prentice, 2009, pp. 1-976.

F. P. Preparata and M. I. Shamos, Computational Geometry: An Introduction. New York, USA: Springer Verlag, 1985, pp. 1-390.

J. O’Rourke, “Finding Minimal Enclosing Boxes,” International Journal of Computer & Information Sciences, vol. 14, pp. 183-199, Jul. 1985.

S. Albawi, T. A. Mohammed, and S. Al-Zawi, “Understanding of a Convolutional Neural Network,” International Conference on Engineering and Technology, pp. 21-23,

Aug. 2017.

R. Yamashita, M. Nishio, R. K. G. Do et al., “Convolutional Neural Networks: An Overview and Application in Radiology,” Journal of Insights into Imaging, vol. 9, pp. 611-629, Jul. 2018.

M. Sokolova, N. Japkowicz, and S. Szpakowicz, “Beyond Accuracy, F-Score and ROC: A Family of Discriminant Measures for Performance Evaluation,” Advances in Artificial Intelligence, vol. 4304, pp. 1015-1021, Jan. 2006.

C. Liu, M. White, and G. Newell, “Measuring and Comparing the Accuracy of Species Distribution Models with Presenceabsence data,” Ecography, vol. 34, no. 2, pp. 232-243, Mar. 2010.

J. Qiu, Q. Wu, G. Ding et al., “Survey of Machine Learning for Big Data Processing,” EURASIP Journal on Advances in Signal Processing, vol. 67, pp. 1-16, May. 2016.

K. Weiss, T. M. Khoshgoftaar, and D. D. Wang, “A Survey of Transfer Learning,” Journal of Big Data, vol. 3, no. 9, pp. 1-40, May. 2016.

T. Mahalakshmi, R. Muthaiah, and P. Swaminathan, “An Overview of Template Matching Technique in Image Processing,” Journal of Applied Sciences, Engineering and Technology, vol. 4, no. 24, pp. 5469-5473, Jan. 2012.

C. Leng, H. Zhang, B. Li et al., “Local Feature Descriptor for Image Matching: A Survey,” IEEE Access, vol. 7, pp. 6424-6434, Dec. 2018.

S. Sehgal, H. Singh, M. Agarwal et al., “Data Analysis Using Principal Component Analysis,” in Proc. International Conference on Medical Imaging, m-Health and Emerging Communication Systems (MedCom), pp. 45-48, Nov. 2014.