Research on Algorithm of Light Strip Center Extraction Based on Deep Learning

: In view of the phenomena such as under-exposure of light strips and noise interference caused by complex surfaces of objects, it is difficult for traditional light strip center extraction algorithm to achieve light strip center extraction. Therefore, this paper studies the extraction of light strip center line based on semantic segmentation network algorithm based on deep learning, uses deep learning algorithm to presegment light strips, and then uses gray prime-core method to extract light strips subpixel. Improve the stability and accuracy of center line extraction.


Introduction
As a non-contact active measurement technology, the line structured light measurement method is widely used in the fields of workpiece size measurement, defect detection, 3D reconstruction, etc [1].At present, there are two main methods for extracting linear structured light centers, namely, the method based on geometric center [1] and the method based on light intensity distribution [2].Geometric center method has a fast operation speed, but poor extraction accuracy, which can only extract pixel accuracy, including skeleton thinning algorithm [3] and threshold algorithm.Methods based on light intensity distribution, including curve fitting, gray gravity center and Steger method [4], can achieve subpixel accuracy extraction.butthese methods often have problems such as low extraction accuracy and poor antiinterference ability when dealing with complex, noisy and unequal lighting scenes.
In recent years, the rapid development of deep learning technology provides a new solution for optical strip center extraction.The light strip center extraction algorithm based on deep learning has strong feature learning and classification ability, and can automatically learn the difference between the feature of the light strip and the background noise, and realize the light strip center extraction with high precision and high anti-interference.In this study, based on deep learning, the center of the light strip image on the surface of complex objects is extracted to ensure the accuracy and stability of the light strip center.

Experimental Design
In this study, industrial cameras were used to shoot 200 images of underexposure, noise interference and normal exposure light strips at different locations on the girth weld, a total of 600 images were taken, and the images were preprocessed.unet deep learning algorithm was used to presegment the light strip images, improve the resolution of the underexposure light strips and the environment, and reduce the noise interference of the images.Then the gray-scale centroid algorithm is used to extract the center point of the pre-segmented image, improve the stability of the center line of the light strip under three conditions, and realize the extraction of the light strip center under different conditions.

Research on Light Strip Center
Algorithm Based on Deep Learning

The theory
For under-exposure and noise interfered images, the geometric center and light intensity distribution method are not easy to achieve the centerline extraction in both cases.In this paper, unet deep learning algorithm is used to segment the light strip according to its shape, and then the light intensity distribution algorithm is used to extract the centerline of the light strip.The UNet network structure is shown in Fig. 1.The decoder and encoder are symmetric in UNet network, and the network structure is U-shaped.There is no fully connected layer in the network, and it is a typical structure of convolutional neural networks in the decoder, which includes two repeated 3*3 convolutional operations.Each convolution is followed by a Relu(Rectifier linear units) activation function and a 2*2 maximum pooling operation.The formula of Relu activation function is shown in eq.( 1).For the input signal, the Relu function takes 0 as the dividing line, and outputs less than 0 are 0. When the input is greater than 0, the output value is equal to the input value.In the downsampling process, the process of pooling is 2 steps, and the depth becomes twice the original after each stage.In the encoder process of the network, a 3*3 transposed convolution with step size 2 is carried out.The convolution process halves the feature depth, concatenates the upsampled image with the feature map from the corresponding position in the decoder, and convolves the concatenated image.Each convolution is followed by a Relu activation function.Because some details will be lost after each operation, the concatenation operation in the corresponding stage in the network can effectively reduce the loss of details in the convolution process.
The gray-level barycentric method can be used to calculate the light power gravity centroid coordinates for the target with uneven brightness according to the target light intensity distribution.For an image f with a pixel size of M*N, if the gray value of a pixel exceeds the threshold value T, it is involved in the gravity center processing as shown in eq.( 2), so the gravity center coordinates are shown in eq.( 3), eq.( 4).

Pixel gray value
Pixel gray val

Image preprocessing
Since the optical strip area only accounts for a small part of the entire image area, in order to improve the segmentation speed of the deep learning algorithm, the area of interest in the weld area is clipped.The original image is 4096 pixel×3000 pixel, and the area where the optical strip is located is clipped, and the image after clipping is 1024 pixel×1024 pixel.The cropped image is then reduced to 512 pixel by 512 pixel using a two-line interpolation algorithm.

Segmentation network optimization and metrics
Adaptive moment estimation (Adam) is used to optimize the network model during the training process.Adam algorithm is an algorithm that performs a step degree optimization of random objective functions, and the learning rate will change during the training process.Adam designs independent adaptive learning rates for different parameters by calculating the first and second moment estimates of the gradient.The initial learning rate η=0.0001, the exponential decay rate η=0.9 for the first-order moment estimation, and the exponential decay rate η=0.999 for the second-order moment estimation.4 light strip images were randomly selected each time as a small batch for training.The segmentation evaluation index is Dice coefficient, and its calculation formula is shown in eq.( 5).

Experimental result
The images of under-exposed light strips, noise-interfered light strips and normal light strips are pre-segmented.The segmentation index results are shown in Table 1 below.Grayscale prime center method was used to extract the light strip results for the pre-segmented light strip.The extraction results are shown in Fig. 3.It can be seen that the method used in this paper can realize the extraction of the centerline of linear structured light under three conditions.The obtained light strip center line trend is basically the same as the light strip trend, which improves the stability of the light strip center extraction.

Conclusion
(1) In this paper, the deep learning algorithm is used to presegment the light strip, which greatly reduces the interference of noise on the light strip.
(2) For the light strip image under under-exposure and noise interference, the center line trend of the light strip is basically the same as that of the light strip, and the stability of the light strip center extraction is improved

Figure 2 .
For under-exposure, normal exposure and noise interference, the image data sets were made respectively, and 200 data were made respectively for the three cases, a total of 600 data.The training set and the test set are divided according to 9:1, and the test set contains 60 images, 20 for each of the three conditions.As shown in Fig.2.The data set annotation software uses Labelme plug-in for annotation to realize pixel-level annotation of the light strip image, and the unlabeled area is the background area.Underexposed light strip Normal strip Noise interferes with the light strip Underexposed light strip label Normal optical strip label Noise interferes with the light strip label (Under exposure, normal, noise interference light strips and labels: (a); (b); (c).
as label; Prediction is the result of prediction.Dice is used to describe the similarity between the result of image segmentation algorithm and its corresponding real defect labeling.Training with Dice loss function can achieve higher Dice value more intuitively.The Dice loss function is shown in eq.(6).