Dissertation Research | Part Recognition Based on MPL Classifier

Recently, I have been working on target detection projects, and I have seen many papers on optimization algorithms, so I will share one today.

0 Preface

slightly.

1 Image acquisition

Based on the classification and identification of product components in the intelligent production process of 3C products, an image acquisition system is built. In order to improve the detection range, the system moves left and right through the camera brought by the motion module. The system mainly includes industrial computer, motion control module and camera module, as shown in Figure 1. The motion control module mainly includes Googol motion board GTS-400-PG-VB-PCI, Inovance servo motor ISMH1-10B30CB and servo driver IS620PS1R61-AB. The camera module mainly includes an industrial camera, light source, lens, etc. The industrial camera uses a 12-megapixel USB3.0 Hikvision MVCE120-10UC color camera, and the lens uses a Hikvision MVL-MF1628M-8MP lens with a focal length of 12 mm. The light source selects ring white light source. The industrial camera is connected with the industrial camera through the USB interface to realize image collection.

During the image acquisition during the experiment, the 3C parts are randomly placed on the test bench, and the camera can move on the screw to ensure that all 3C components appear within the field of view of the camera. The images collected by the system are divided into sample 1 image, sample 2 image and image to be classified. The image collected by the system is shown in Figure 2.

 2 Image preprocessing

The positions and angles of 3C product components are random, and the background is complex. Direct feature extraction increases the amount of calculation and reduces the classification speed. It is necessary to preprocess the image first, complete the segmentation of the target, remove the interference information in the image background, and quickly and accurately extract the image features of the component. Different types of 3C product components have different contour shapes. In this paper, the shape features of 3C product components are used as classification features to create a multi-layer perceptron neural network model. The trained multi-layer perceptron neural network model realizes automatic classification and recognition of 3C components. The classification recognition process is mainly divided into image preprocessing, feature extraction and classification.

Image preprocessing Image preprocessing includes image grayscale, enhancement, smoothing, sharpening, segmentation, denoising, restoration, etc., which are used to improve image quality and facilitate the classification and identification of parts. Blob analysis is to binarize the image, segment the target and background, and then detect connected regions [6]. BLOB analysis mainly includes image acquisition, image segmentation, morphological processing and feature extraction, etc., which can be realized quickly and easily with Halcon image processing software.

Halcon contains a camera driver, and the camera can be directly connected by selecting the driver corresponding to the camera. Halcon asynchronous acquisition operators mainly include: asynchronous acquisition start operator grab_image_start and read asynchronous acquisition image grab_image_async. Use the rgb1_to_gray operator to convert an RGB image to a grayscale image. The three channels of the RGB image are passed as the first three channels of the input image. Images are transformed according to formula (1). The conversion map and gray histogram are shown in Fig.3.

Threshold segmentation is realized by threshold operator. The gray value g of the region satisfies MinGray≤g≤MaxGray. The connection operator is used to divide the connected parts of the region, and the select_shape operator is used to select the region with the specified shape feature. This paper realizes the selection of the specified feature through the area feature. The threshold segmentation and feature selection diagram is shown in Figure 4.

This paper classifies according to the circularity feature, and circularity obtains the circularity feature of the part. Shape factor C=F/(π*R2), F is the area of ​​the region, R is the maximum distance from the center to all contour pixels, the circularity value of sample 1 is less than 0.5, and the circularity value of sample 2 is greater than 0.8.

 3 MLP classification model

The MLP multi-layer perceptual neural network model is a dynamic classifier based on neural networks, and the neural network directly determines the segmentation hyperplane between classes. The typical structure of a multilayer neural network is a layer of input units, one or more layers of hidden nodes, and a layer of output units. In this paper, the MLP neural network model is selected as the classifier to realize the classification of 3C product components, and the built-in function of Halcon18.0 software is used to realize the training and testing of the MLP neural network model.

Use the create_class_mlp operator to create an mlp classifier based on the neural network, the number of features is 1, the output class is 2, and the output method selects "softmax" for classification. The classifier includes three layers, an input layer, a hidden unit layer, and an output layer. The prototype of the create_class_mlp operator is as follows: create_class_mlp (::NumInput, NumHidden, NumOutput, OutputFunction, Preprocessing, NumComponents, RandSeed: MLPHandle).

Among them, NumInput is used for training and classification of the dimension of the feature space, NumHidden represents the number of hidden layer units in the neural network, NumOutput represents the number of output classifications, OutputFunction represents the function used by the output unit of the neural network, optional softmax, logistic , linear.

Use the for loop to read the training samples to extract features, and use the add_sample_class_mlp operator to add the roundness features of each part to the MPL classifier.

Use the train_class_mlp operator to train samples. The prototype of the operator is as follows: train_class_mlp (::MLPHandle, MaxIterations, WeightTolerance:ErrorTolerance, Error, ErrorLog) where MaxIterations represents the maximum number of iterations of the optimization algorithm, and ErrorTolerance represents the difference between two iterations of the optimization algorithm. The threshold of the error mean between.

Use the classify_class_mlp operator to classify unknown objects. The operator model is as follows: classify_class_mlp (::MLPHandle, Features, Num: Class, Confidence)

Features The input feature vector to be evaluated, Num the number of best classifications to find.

4 Validation Analysis

In this paper, 100 (40 sample 1, 40 sample 2, and 20 mixed images) 3C component images are collected as a data set, and 80 images of 40 sample 1 and 40 sample 2 are used as a training set. Take 10 pictures for product classification recognition, and the classification effect diagram is shown in Figure 5. The results of 20 classification experiments show that the classification accuracy is 99.8%, and the classification time of each component is less than 20 ms. Experimental results prove that the method proposed in this paper can quickly realize 3C product classification and location detection.

 5 Conclusion

This paper proposes a part recognition method based on the MPL classifier based on actual needs. The MPL classifier model is trained by extracting the roundness of 3C components, and the automatic classification of 3C components is realized by using the trained MPL classifier model. The identification and detection of more different parts can be realized by changing the shape features.


Article source: Wan Songfeng . Parts recognition based on MPL classifier[J]. Industrial Control Computer, 2022,35(11)


In fact, with regard to the parts recognition of 3C products, there are many large and small machine vision companies on the market. They don’t even need to understand algorithms, and there are professional machine vision engineers to carry out modeling. If you are interested, you can take a look at the Coovally platform. Compared with other platforms, the biggest advantage should be that it is cheaper. Instead of selling a single model, it is a package of "software platform + hardware equipment + ecological services" ", which is still very fragrant.

Guess you like

Origin blog.csdn.net/Bella_zhang0701/article/details/128205128