Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 9, No. 1, 2024 101 Research on Algorithm of Light Strip Center Extraction Based on Deep Learning Xiangwen Zheng, Jun Li, Chen He College of Mechanical Engineering, Sichuan University of Science & Engineering, Zigong 64300, Sichuan, China Abstract: 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. Keywords: Complex surface; Strip center; Deep learning; pre-segmtioned. 1. 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 sub- pixel accuracy extraction.but these methods often have problems such as low extraction accuracy and poor anti- interference 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. 2. 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 pre- segment 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. 3. Research on Light Strip Center Algorithm Based on Deep Learning 3.1. 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. 102 Stage1 Stage2 Stage3 Stage4 Stage5 Stage6 Stage7 Stage8 Stage9 Input Out Figure 1. Unet deep learning algorithm network structure 0, 0 ( ) { , 0 x f x x x    (1) 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 0, T { , Tueij ij f f    (2) 1 1 0 1 1 n i ij i j m j m n i i j x f x f        (3) 1 1 0 1 1 m n j ij i j n n ij i j y f y f        (4) 3.2. 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. 3.3. Image data set production 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 (a) (b) (c) Figure 2. Under exposure, normal, noise interference light strips and labels: (a); (b); (c). 3.4. 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 103 calculation formula is shown in eq.(5). 2 | | | | | | Mask Prediction Dice Mask Prediction   ∩ (5) Where:Mask 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). 2 | | 1 | | | | Mask Prediction Dice loss Mask Prediction     ∩ (6) 3.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. Gray- scale 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. Table 1. Segmentation index Dice Training set Dice loss Validation set Dice loss 98.2 0.027 0.027 Underexposed light strip Normal strip Noise interferes with the light strip presegmentation presegmentation presegmentation Centerline extraction Centerline extraction Centerline extraction (a) (b) (c) Figure 3. Underexposure, normal, noise interference light strip presegmentation and center line extraction results: (a); (b); (c). 4. Conclusion (1) In this paper, the deep learning algorithm is used to pre- segment 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 References [1] A.A.Al-Temeemy, S.A. Al-Saqal Laser-based structured light technique for 3D reconstruction using extreme laser stripes extraction method with global information extraction Opt. Laser Technol., 138 (2021), Article 106897, 10.1016/j.optlastec.2020.106897 [2] S. Pang, H. Yang, An algorithm for extracting the center of linear structured light fringe based on directional template, in: 2021 4th International Conference on Advanced Electronic Materials, Computers and Software Engineering (AEMCSE). IEEE, 2021, pp. 203-207. [3] T.Y. Zhang, C.Y. Suen A fast parallel algorithm for thinning digital patterns Commun. ACM, 27 (3) (1984), pp. 236-239. [4] C. Steger An unbiased detector of curvilinear structures IEEE Trans. Pattern Anal. Mach. Intell., 20 (2) (1998), pp. 113-125.