An Automatic Foreign Matter Detection and Sorting System for PVC Powder
Abstract
:1. Introduction
- Manual annotation is a time-consuming process, and the criteria for foreign matter are inconsistent. Before training the model, the collected foreign matter samples need to be manually annotated as the ground truth of the training sample. However, the operators usually do not have enough time to perform time-consuming annotation work in the on-site environment. Additionally, the annotation process varies from person to person due to the variations of foreign objects, inconsistent particle sizes, or similar characteristics between categories.
- Manual feature characterization is time-consuming and a poor adaption: all the methods mentioned earlier utilize the features of the object to identify whether or not the foreign matter is embedded in the powder. Therefore, it takes a significant amount of time for the operator to find the most distinguishing feature combinations, such as the diameter, shape, and color of the foreign matter. The operator has to restart the feature engineering process as long as the particles and foreign objects are being altered. Usually, the manual features are not capable of handling exceptions such as lighting changes, distortion, occlusion, and deformation, leading to a low adaptability of the algorithm.
- Model training takes longer, and finding superior hyper-parameters is less efficient: there are many hyper-parameters that need to be set in training a model. These hyper-parameters are directly related to the elasticity of the model learning and affect the degree of generalization of the model in inference. However, due to the time-consuming nature of training a single deep learning model, finding the best hyper-parameter combination of a deep learning model manually would take a significant amount of time.
- First, the auto-annotation and correction mechanism: before performing supervised learning in defect detection applications, it is often necessary for several operators to manually annotate samples. This is a tedious and time-consuming task. Therefore, most of the annotation work is outsourced to other companies for processing, or existing datasets are purchased, which makes the cost of deep learning research extremely high. There are some tools that can be used to annotate images based on pre-trained models, such as Anno-Mage and easyDL intelligent labeling. These methods are categorized as predictive auto-annotation generation. The general procedures are as follows: First, a preliminary model, trained with a small batch dataset, is used to test a small batch of unlabeled samples. Secondly, after the detection results have been corrected by human intervention, a new model is trained, established with the corrected dataset. Thirdly, the new model is used to detect a larger batch of datasets. Through the repeated calculation of the above steps, the accuracy of the annotation can be gradually refined. In addition, Chandra et al. [14] developed an auto-annotation module for the classification of normal and abnormal brain MRI images. In their study, a gray-scale histogram of an unlabeled image was employed to depict brain MRI image features, and then the most similar labeled image was searched for through image correlation analysis as the category of the unlabeled image. However, they also mentioned that the quality of auto-annotation is still far from desired expectations. Bharara [15] proposed an auto-annotation system for the location of abnormal patterns in 3D visual images. His system used historical data to identify normal and abnormal patterns after the sensor receives the data. The position of the abnormal pattern in the generated visual image is then annotated and exported to the display. There is also another method called generative auto-annotation generation that generates the objects that need to be detected through the help of simulation software or algorithms. Zhang et al. [16] developed a detection mechanism for wild forest fire smoke. A synthetic smoke image is generated by inserting real smoke or virtual smoke generated by Blender into the forest background to solve the problem of lack of fire data. In addition, the problem of annotation is solved because the position of the smoke is identified during the process of inserting the smoke. Li et al. [17] developed a component segmentation mechanism for printed circuit board (PCB) identification. Their training image set is automatically synthesized through rendering based on a 3D model of the PCB. Although the color labeling of components still requires manual intervention, automatic color labeling is realized through CAD secondary development so that the image training in industrial production can be completely automatically generated in the future. On the other hand, there is also research studying generative auto-annotation generation with generated virtual images for the sake of saving annotation time. Chen et al. [18] detected a patch of particle defects on a wafer die using a few manual annotation files, and they used the defect patch after removing the background into the generative adversarial network (GAN) to generate realistic virtual defects. These virtual defects were then randomly pasted onto a die image without defects. Because the size and position of the virtual defects were known, an annotation file could then be automatically generated. Chen and Tasi [19] also expanded the number of virtual images through existing manual annotation files, especially for surface defects of SMD LEDs for image block extraction. The virtual defects were generated through performing random morphological and affine transformations with the defect batches after removing the background. These virtual defects were then randomly sampled and pasted onto defect-free LED chips and automatically annotated. From the literatures mentioned above, auto-annotation can be applied to real or virtual images. Although auto-annotation can greatly reduce the workload, these processes still require human participation. In the present investigation, an automatic annotation program is developed for real defect images, saving the time spent annotating real defects using a series of digital image processing (DIP).
- Foreign matter detection with deep learning model: The convolutional neural network (CNN) in deep learning frameworks is impressive regarding its ability of self-taught feature learning. It is also able to cope, to a certain degree, with the exceptions mentioned earlier. Therefore, CNN has received widespread attention in the field of defect detection because of its application in defect classification, defect detection, and defect segmentation. The most popular application of CNN is defect detection from the perspective of patch level annotation, the time for training the model, and information feedback. Li et al. [20] performed defect detection for four types of defects on the surface of canned containers. After image augmentation, they fed these images into SSD with MobileNet as the backbone. They found that the lightweight MobileNet backbone improved the accuracy and rate of identification. Li et al. [21] performed the surface detection of rails with YOLOv3 using DarkNet53 as the backbone, along with the concept of feature pyramid networks (FPNs) for multi-scale detection in order to detect small defects. Lin et al. [22] employed CNN to identify three types of defect on LED chips and utilized class activation mapping (CAM) to locate the defects. Sun et al. [23] carried out surface detection on a wheel hub with modified Faster R-CNN by using a ZF network as the backbone and replacing the maximum pooling layer with the sliding convolution layer. Dai et al. [24] proposed an integrated inspection framework for the solder joint defects of printed circuit boards. YOLOv3 was used to localize individual solder joints, and an SVM classifier was used based on the small portion of the labeled samples after small joints were transformed into a well-classified representation space. Wang et al. [25] proposed a cloud computing system that used Faster R-CNN to detect defects on the turbine blades of automobile engines. Their method could effectively detect defects in complex product images. It can be clearly seen from the above literature that Faster RCNN, SSD, and YOLO, etc., are popular for defect detection and have all been applied in various fields in recent years. However, it is still rare to see related research on defect detection for powders using deep learning methods. In this investigation, a defect detection algorithm for PCV powder based on YOLOv4 (Bochkovskiy et al. [26]) is proposed. The category, location, and size of defects (iron powder and slag) can be detected without performing feature engineering.
- Model optimization of hyper-parameters through the Taguchi method in the design of experiment (DOE): There are many hyper-parameters in the training foreign matter detection model that need to be set. However, when the number of experimental groups is too large, it will lead to a significant training time. Therefore, some studies have introduced the Taguchi method for the selection and sensitivity test of hyper-parameters, so less experimental combinations are used to obtain the approximate optimal hyper-parameter combinations (Medan et al. [27]). Lin et al. [28] established a two-layer convolutional layer CNN to classify the existence of cancer in lungs using CT images. They used the L36 (24 × 34) Taguchi method to find the hyper-parameter combinations of number of convolution core, kernel size, stride, and padding in the two-layer convolutional layer. Lin et al. [29] proposed a Taguchi-based AlexNet structure for gender classification with face images. They found the optimal hyper-parameter combination with the L18 (21 × 35) Taguchi experiment, including convolution kernel size, stride, and filling hyper-parameters of the first and fifth convolutional layers of AlexNet. Lee et al. [30] used the L16 (45) Taguchi method, including the number of convolutional layers, the number of fully connected layers, the number of convolution kernels, the size, and the number of neurons in the fully connected layer to determine the CNN structure. This CNN structure was applied to handwritten digit recognition. Chen and Tasi [19] used the YOLOv3-dense model for SMD LEDs defect detection. There were several hyper-parameters in the YOLOv3-dense model, including image amplification, size of anchor box determined with k-means, size of the mini-batch, the size of the input image, and the number of frozen layers. They employed the L32 (23 × 32) Taguchi method to determine the hyper-parameters in the YOLOv3-dense model.
2. Methods
2.1. Description of the System Hardware
- Powder delivery device: The powders in the sampling bottle are sent into the cyclone with compressed air. The air flows out from the upper outlet of the cyclone and powders are separated onto the sieving device.
- Sieving device: A stepping motor is employed to produce the periodic motion of a connecting rod, such that the screen moves up and down through the vibration of the built-in spring in order to spread the powder evenly on the circular platform.
- Circular platform: The platform is driven by a stepping motor and rotates counterclockwise with constant speed to transport powders to the image capture device and recycling device. The platform is white so that the PVC powders blend with the background. In addition, the platform is covered with glass, preventing the powders from adhering due to static electricity.
- Image capture device: The image capture device is the integration of an optical module with variable focal length lens and front-end illuminated-ring white light source and is utilized to capture images of PVC powder and foreign matter.
- Recycling device: Two vacuum pipes are installed for recycling foreign matter and powders. The foreign matter vacuum pipe is placed under the lens of the image capture device. As foreign matter is identified by the algorithm, the control unit will send a signal to the solenoid to activate the vacuum to collect the foreign matter. The vacuum pipe collects all the inspected PVC powders.
2.2. Description of Detection Algorithm
2.2.1. Automatic-Annotation
2.2.2. Foreign Matter Detection Model
- CSPDarkNet53 is used as the backbone for feature extraction. There is no pooling, nor a fully connected layer in this feature extractor. In the forward propagation process, the output feature map is reduced to 1/32 times the input image through stride = (2, 2) of the five convolution kernels.
- Spatial pyramid pooling (SPP) and a path aggregation network (PAN) were used as the neck to expand the reception field and establish a multi-level bounding box prediction mechanism. Multi-scale feature sampling detection is utilized to detect foreign matter of different sizes with the help of PAN’s concept of combining up-sampling and down-sampling.
- Yoloblock is used as the head for bounding box prediction. The finer the grid unit, the finer the objects that can be detected. In the prediction, three 3D-tensors of different sizes in each image are considered as dependent variables, and the sizes of the three tensors are 19, 38, and 76, respectively. There are a total number of ((19 × 19) + (38 × 38) + (76 × 76)) × 3 = 22,743 outputs, because it is necessary to output the prediction frame on each grid unit of each scale. The depths of these three tensors are all B × (5 + C), where B represents the number of anchor boxes in each scale. The B value in the present study is 3 because the total number of anchor boxes is 9, and the default size of the anchor box is determined by the default value or through k-means; 5 represents the parameters centroid coordination, width, height, and confidence of the predicted box, and C is the number of predicted classes. C is 2 in this study.Figure 6. Structure of YOLOv4 in the present study.
- The definition of the loss function. The goal is to balance the center coordinate, width, height, confidence, and classification. The first term in Equation (1) represents the location loss; the second and third terms in Equation (1) represent the confidence loss, while the fourth term in Equation (1) represents the classification loss. Comprehensive IoU (CIoU) is used to evaluate the closeness of the predicting boxes to the ground truth boxes. CIoU considers the scale of overlap, center distance, and aspect ratio of the frame on the basis of IoU, which is a more comprehensive measurement. CIoU is adopted for the evaluation of location loss, while binary cross-entropy is employed for the evaluation of confidence loss and classification loss. Basically, the larger the CIoU and negative binary cross-entropy values, the closer the predicted value to the actual value.
2.2.3. Efficiency Improvement of Hyper-Parameter Search with the Taguchi Method
- Mosaic image augmentation: There are four images stitched together with corresponding bounding boxes for each image. After the four images are stitched together, a new image and annotation file are obtained. This is equivalent to delivering four images for learning at the same time. In this way, the model can learn to identify objects at a smaller scale. In addition, the necessary mini-batch size can be reduced significantly in training.
- Class label smoothing: This is a technology that changes the labels that are assigned. Generally, the correct classification for a bounding box is represented as a one-hot vector. However, when a model becomes more arbitrary, with a prediction close to 1.0, the prediction is often wrong, overfit, and overlooks the complexities of other predictions in some way. It is more reasonable to encode the class label representation to evaluate the uncertainty to some degree; therefore, 0.9 was chosen to represent the correct classification. In this way, the real label becomes less extreme, leading to a larger error tolerance in labeling and the improvement in the generalization ability of the model.
- Determination default size of anchor boxes: The default size of the anchor boxes of YOLOv4 may not be suitable for customized image sets. If the size difference between the anchor boxes and the ground truth boxes are large, the effectiveness of model detection will be affected. If the anchor box is replaced by k-mean clustering, the preset size can be used to cluster the bounding box of the training set to automatically generate a set of nine anchors that are more suitable for the image set, which may be helpful for foreign matter detection.
- Loading pre-trained weights: The pre-trained weights, products of the VOC image library, can be loaded when training YOLOv4; therefore, the ability to extract features should have a certain degree of generalization. However, these image libraries are quite different from the foreign matter detection in this study. The weights trained with the customized image collection from the powders would perhaps be helpful for the detection mode.
- Performing warm-up stage: The warm-up learning rate is performed when training YOLOv4 to freeze the weights of the first few layers. Only the weights of the last few layers are adjusted through the Adam algorithm. The learning rate of the Adam algorithm is a small value of 0.001. After a stable loss value is calculated, a usable model is obtained, then the training procedure with the fine-tune stage can be performed. Meanwhile, all the weights of the layers are unfrozen, and the learning rate of the Adam algorithm is adjusted to a smaller value of 0.00001 to continue training to achieve the purpose of fine-tuning the weights.
- Cosine annealing scheduler: The loss function may be in multipeak mode, so there could be multiple regional optimal solutions in addition to the global optimal solution. When YOLOv4 is training, it is easy for the gradient descent method to fall to the local minimum. Therefore, a suddenly increased learning rate could be utilized to jump out of the local minimum and obtain the path to the global minimum.
3. Results and Discussions
3.1. Description of Capture Image Sets
3.2. Combinations of Model Training Strategies with the Taguchi Method
3.3. Demonstration and Accuracy Comparison of Foreign Matter Detection Results
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Fischer, I.; Schmitt, W.F.; Porth, H.C.; Allsopp, M.W.; Vianello, G. Poly (Vinyl Chloride). Ullmann’s Encyclopedia of Industrial Chemistry. 2014, pp. 1–30. Available online: https://doi.org/10.1002/14356007.a21_717.pub2 (accessed on 31 May 2022).
- Kitamura, H.; Takeuchi, M.; Yoshikoshi, H. Method for Detecting Colored Foreign Particles in Light-Colored Powder and System Therefor. U.S. Patent No. 4,976,540, 11 December 1990. [Google Scholar]
- Tokoyama, K. Powder Material Inspection Apparatus. U.S. Patent No. 5,239,358, 24 August 1993. [Google Scholar]
- Tokoyama, K. Powder and Granule Inspection Apparatus. U.S. Patent No. 5,309,773, 10 May 1994. [Google Scholar]
- Shimazu, A.; Morikawa, M. Method and Apparatus for Detecting Colored Foreign Particles in Quartz Powder Material. U.S. Patent No. 8,164,750, 24 April 2012. [Google Scholar]
- Huang, Y.; Min, S.; Duan, J.; Wu, L.; Li, Q. Identification of additive components in powdered milk by NIR imaging methods. Food Chem. 2014, 145, 278–283. [Google Scholar] [CrossRef] [PubMed]
- Prabhu, B.; Mascles, J. Process for Removing Contaminants from Polymeric Powders. U.S. Patent Application No. 13/785,474, 11 September 2014. [Google Scholar]
- Li, F.; Liu, Z.; Sun, T.; Ma, Y.; Ding, X. Confocal three-dimensional micro X-ray scatter imaging for non-destructive detecting foreign bodies with low density and low-Z materials in food products. Food Control 2015, 54, 120–125. [Google Scholar] [CrossRef]
- Mauruschat, D.; Plinke, B.; Aderhold, J.; Gunschera, J.; Meinlschmidt, P.; Salthammer, T. Application of near-infrared spectroscopy for the fast detection and sorting of wood–plastic composites and waste wood treated with wood preservatives. Wood Sci. Technol. 2016, 50, 313–331. [Google Scholar] [CrossRef]
- Ding, J.; Meng, Z.; Yang, Y. Detection and classification of the foreign matter of lyophilized powder based on machine vision. Comput. Digit. Eng. 2017, 7, 29–33. [Google Scholar]
- Zhang, Z.; Luo, Y.; Deng, X.; Luo, W. Digital image technology based on PCA and SVM for detection and recognition of foreign bodies in lyophilized powder. Technol. Health Care 2020, 28, 197–205. [Google Scholar] [CrossRef]
- Zhou, Y.; Dolley, E.; Singhal, A.; Cerrone, A.; Ruscitto, D.; Sampath, R.; Morra, M.; Lesnicki, K.; Roth, P. Alloy Powder Cleanliness Inspection Using Computed Tomography. U.S. Patent Application. No. 11/275,037, 15 March 2022. [Google Scholar]
- Tarrach, L.A.U.R.A. Pellet Scanning in “Free Fall”. Kunstst. Int. 2010, 100, 96–97. [Google Scholar]
- Chandra, N.S.; Srikanth, P.; Ramakrishna, Y. Semantic analysis and representation of medical images using hybrid watershed algorithm. Int. Refereed J. Eng. Sci. 2015, 4, 131–135. [Google Scholar]
- Bharara, A. 3D Image Processing and Visualization with Anomalous Identification and Predictive Auto-Annotation Generation. U.S. Patent Application No. 15/828,676, 6 June 2019. [Google Scholar]
- Zhang, Q.X.; Lin, G.H.; Zhang, Y.M.; Xu, G.; Wang, J.J. Wildland forest fire smoke detection based on faster R-CNN using synthetic smoke images. Procedia Eng. 2018, 211, 441–446. [Google Scholar] [CrossRef]
- Li, D.; Li, C.; Chen, C.; Zhao, Z. Semantic segmentation of a printed circuit board for component recognition based on depth images. Sensors 2020, 20, 5318. [Google Scholar] [CrossRef]
- Chen, S.H.; Kang, C.H.; Perng, D.B. Detecting and measuring defects in wafer die using GAN and YOLOv3. Appl. Sci. 2020, 10, 8725. [Google Scholar] [CrossRef]
- Chen, S.H.; Tsai, C.C. SMD LED chips defect detection using a YOLOv3-dense model. Adv. Eng. Inform. 2021, 47, 101255. [Google Scholar] [CrossRef]
- Li, Y.; Huang, H.; Xie, Q.; Yao, L.; Chen, Q. Research on a surface defect detection algorithm based on MobileNet-SSD. Appl. Sci. 2018, 8, 1678. [Google Scholar] [CrossRef] [Green Version]
- Li, J.; Su, Z.; Geng, J.; Yin, Y. Real-time detection of steel strip surface defects based on improved yolo detection network. IFAC-PapersOnLine 2018, 51, 76–81. [Google Scholar] [CrossRef]
- Lin, H.; Li, B.; Wang, X.; Shu, Y.; Niu, S. Automated defect inspection of LED chip using deep convolutional neural network. J. Intell. Manuf. 2019, 30, 2525–2534. [Google Scholar] [CrossRef]
- Sun, X.; Gu, J.; Huang, R.; Zou, R.; Giron Palomares, B. Surface defects recognition of wheel hub based on improved faster R-CNN. Electronics 2019, 8, 481. [Google Scholar] [CrossRef] [Green Version]
- Dai, W.; Mujeeb, A.; Erdt, M.; Sourin, A. Soldering defect detection in automatic optical inspection. Adv. Eng. Inform. 2020, 43, 101004. [Google Scholar] [CrossRef]
- Wang, Y.; Liu, M.; Zheng, P.; Yang, H.; Zou, J. A smart surface inspection system using faster R-CNN in cloud-edge computing environment. Adv. Eng. Inform. 2020, 43, 101037. [Google Scholar] [CrossRef]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. Yolov4: Optimal speed and accuracy of object detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Medan, N.; Lobontiu, M.; Nagy, S.R.; Dezső, G. Taguchi versus full factorial design to determine the equation of impact forces produced by water jets used in sewer cleaning. In MATEC Web of Conferences; EDP Sciences: Paris, France, 2017; Volume 12, p. 03007. [Google Scholar]
- Lin, C.J.; Jeng, S.Y.; Chen, M.K. Using 2D CNN with Taguchi parametric optimization for lung cancer recognition from CT images. Appl. Sci. 2020, 10, 2591. [Google Scholar] [CrossRef]
- Lin, C.J.; Li, Y.C.; Lin, H.Y. Using convolutional neural networks based on a Taguchi method for face gender recognition. Electronics 2020, 9, 1227. [Google Scholar] [CrossRef]
- Lee, P.C.; Lo, T.P.; Sun, H.; Wen, I. An efficient method for determining the optimal convolutional neural network structure based on Taguchi method. J. Intell. Fuzzy Syst. 2020, 39, 2611–2625. [Google Scholar] [CrossRef]
- Ivanov, A.S.; Nikolaev, K.G.; Novikov, A.S.; Yurchenko, S.O.; Novoselov, K.S.; Andreeva, D.V.; Skorb, E.V. Programmable Soft-Matter Electronics. J. Phys. Chem. Lett. 2021, 12, 2017–2022. [Google Scholar] [CrossRef] [PubMed]
- Adonin, S.A.; Gorokh, I.D.; Novikov, A.S.; Samsonenko, D.G.; Korolkov, I.V.; Sokolov, M.N.; Fedin, V.P. Bromobismuthates: Cation-induced structural diversity and Hirshfeld surface analysis of cation–anion contacts. Polyhedron 2018, 139, 282–288. [Google Scholar] [CrossRef]
Factors | Mosaic Data Augmentation | Label Smoothing | k-Means for Size of Anchor Boxes | Pre-Trained Weights | Warm-Up Stage | Cosine Annealing Scheduler |
---|---|---|---|---|---|---|
Level 1 | off | 0.0 | off | VOC | 0 | off |
Level 2 | on | 0.1 | on | random | 50 | on |
Model | Faster RCNN | Naïve YOLOv4 | Optimized YOLOv4 |
---|---|---|---|
Testing mAP | 0.7999 | 0.8653 | 0.9385 |
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
Chen, S.-H.; Jang, J.-H.; Chang, Y.-R.; Kang, C.-H.; Chen, H.-Y.; Liu, K.F.-R.; Lee, F.-L.; Hsueh, Y.-S.; Youh, M.-J. An Automatic Foreign Matter Detection and Sorting System for PVC Powder. Appl. Sci. 2022, 12, 6276. https://doi.org/10.3390/app12126276
Chen S-H, Jang J-H, Chang Y-R, Kang C-H, Chen H-Y, Liu KF-R, Lee F-L, Hsueh Y-S, Youh M-J. An Automatic Foreign Matter Detection and Sorting System for PVC Powder. Applied Sciences. 2022; 12(12):6276. https://doi.org/10.3390/app12126276
Chicago/Turabian StyleChen, Ssu-Han, Jer-Huan Jang, Yu-Ru Chang, Chih-Hsiang Kang, Hung-Yi Chen, Kevin Fong-Rey Liu, Fong-Lin Lee, Yang-Shen Hsueh, and Meng-Jey Youh. 2022. "An Automatic Foreign Matter Detection and Sorting System for PVC Powder" Applied Sciences 12, no. 12: 6276. https://doi.org/10.3390/app12126276
APA StyleChen, S.-H., Jang, J.-H., Chang, Y.-R., Kang, C.-H., Chen, H.-Y., Liu, K. F.-R., Lee, F.-L., Hsueh, Y.-S., & Youh, M.-J. (2022). An Automatic Foreign Matter Detection and Sorting System for PVC Powder. Applied Sciences, 12(12), 6276. https://doi.org/10.3390/app12126276