Search method for weld area in water-cooled wall pipe based on YOLO detection network

Focused on the defects that the traditional target detection algorithm has low detection precision and is greatly affected by the industrial imaging environment, YOLO algorithm of computer vision is proposed, the features of the image through the deep convolutional neural network are extracted, and the automatic detection function of the weld area is realized. Firstly, the detected image is preprocessed, and the image inversion, k-nearest median filtering, CLAHE image enhancement, gamma image correction and other algorithms are used to improve the contrast of the weld area in the whole picture. Secondly, the data enhancement algorithm is used to increase the number of training samples and diversity. Finally, the YOLO target detection network is trained by using the training samples obtained from the data enhancement, and the performance of the network is evaluated through test samples. In experiments, 500 images of 50 ray-detected image data are used to train the YOLO target detection network, and the test results are tested in a test set consisting of 50 additional images. The experimental results demonstrate that the accuracy of weld inspection is 96%, it is much better than the accuracy of traditional target detection algorithms, and has guiding value for industrial application.


Introduction
With the development of supercritical and ultra-supercritical boiler power generation technology, the temperature and pressure of the unit are further improved [1]. The water wall tube is the core component for absorbing the heat of the furnace, which is of great significance for the safe and stable operation of the boiler. When the water wall tube is welded, the liquid metal is agglomerated by gravity to the inside of the tube, which inevitably causes a weld bead. The generation of the weld tumor will make the cross-sectional area of the water flow in the pipe smaller, affecting the flow velocity and circulation of the water flow, and the ability of the water-cooled wall pipe to carry heat will be greatly weakened [2]. Therefore, it is necessary to regularly inspect the weld zone of the water-cooled wall pipe, evaluate the influence of the weld bead on the water flow in the weld, and prevent the partial pressure of the water-cooled wall pipe from causing the pipe to burst.
In the industry, the double-wall double-shadow transillumination method is generally adopted, so that the radiation emitted by the point ray source penetrates the water wall tube at a certain angle, and the energy attenuation caused by the penetration of the ray in the water wall tube is used to estimate the thickness of the weld [3]. Through the double-wall double-shadow transillumination, the upper and lower welds can be imaged in the same image, while improving the efficiency of radiation detection and image evaluation. The most commonly used traditional target detection problem is the normalized correlation coefficient method. The algorithm extracts a fixed size subgraph from the picture, calculates the normalized correlation coefficient between the subgraph and the pixel gray level in the template, and selects the largest correlation coefficient. The subgraph is used as the target detection result [4]. The method is simple in principle, but because the judgment is based on a single, the detection accuracy is low.
The local adaptive threshold method selects the optimal segmentation threshold for each window based on the maximum principle of the variance between the weld zone and the background zone in the local window, thereby automatically separating the weld zone [5][6][7][8][9]. This method does not require any pre-processing and can adaptively segment the weld area with uniform brightness distribution, but the area is not good for areas with uneven brightness distribution or low contrast.
In this paper, YOLO is introduced into the testing of water-cooled wall tube weld zone. Firstly, the image pre-processing algorithm is used to process 100 water-cooled wall tube ray detection images collected in the industrial environment, and the weld area is highlighted; then the data set obtained by image pre-processing is followed. The ratio of 4:1:5 is divided into training set, verification set and test set. The 50 images composed of training set and verification set are enhanced by data to obtain 500 pictures, and the new training set and verification set are obtained according to the original proportion. Using the new training set and verification set to train the YOLO network, the optimal weld zone detection model is obtained, which lays a foundation for the detection of the weld. Test the performance of the model on the test set and found that the target detection model based on the YOLO network can exhibit excellent detection performance in a complex industrial background.

Image preprocessing
According to the principle of radiography, the water-cooled wall tube area in the image is bright and the background area is dark, which is not conducive to the observation of the water-cooled wall tube area. To further highlight the water-cooled wall tube area, the ray detection picture is reversed to reduce the saliency of the background area. The original image (R, G, B) is an image composed of three colors, and the inverted image can be obtained by are the gray value of the corresponding three channels B, G, and R at the transformed image, and are the gray value corresponding to the three channels of the original image.
In the X-ray imaging process, noise is inevitably introduced. The sources of noise mainly include: (1) noise caused by the film itself; (2) noise caused by system equipment circuits; (3) noise caused by basic properties of light and electricity [10][11][12]. The introduction of noise has a certain influence on the quality of the image and needs to be suppressed. In the water-cooled wall tube ray image, the noise points are mostly isolated points, and the isolated noise points in the image can be extracted by the near-neighbor median filtering. Near-neighbor median filtering is a common nonlinear filter that achieves image denoising by replacing isolated points with the median of neighbors [13]. If the pixel to be processed is a noise point, the effect of noise is reduced by the averaging operation; if the pixel to be processed is a non-noise point, the effective pixel value is selected. After the neighbor median filtering, the image can be denoised while retaining the edge information of the image.
The intensity of the ray emitted by the ray source remains constant during the ray detection process. Therefore, the gradation distribution of the ray detection image is mostly concentrated in a small gradation area, and the contrast is low, which is not conducive to the detection of the weld zone of the water wall tube. The commonly used method to improve image contrast is histogram equalization, but histogram equalization adjusts the global image, which can not achieve the purpose of improving local contrast [14]. To effectively improve the contrast of the weld area, the Contrast-limited Histogram Equalization (CLAHE) method is used to enhance the contrast of the weld area. CLAHE can reduce the contrast of the image during the equalization process by calculating the local histogram of the image and redistributing the brightness to change the contrast of the image. The histogram equalization steps to limit contrast are as follows: 1) Divide the image into rectangles of the same size of S S u , calculate the histogram of each rectangle, and normalize it; 2) Set the threshold T , count the higher part of the normalized histogram, and set the sum of this part total ; 3) The average is assigned to all gray levels, and each gray level is divided to 256 L total , calculate the height of the histogram Upper T L ; 4) The histogram is processed is given by is the probability of occurrence of a pixel whose gray value is limited after contrast.
After CLAHE-based image enhancement, the grayscale values of the image are evenly distributed throughout the grayscale interval. To distinguish between the background area and the water wall tube weld area, the gamma transformation can be used to further enhance the contrast of the image.
Gamma transform makes the output image gray value exponentially related to the input image gray value by nonlinear transformation of the input image gray value, and enhances the contrast of different regions of the image. The expression of the Gamma transform is obtained by where the compensation coefficient is a γ coefficient. Adjust the compensation coefficient and gamma coefficient, the image will get different enhancement effects.

3.Weld area detection based on YOLO algorithm
The position and inclination angle of the water wall tube will change in different ray detection images, and the shape of the water wall tube weld area is variable. The gray scale distribution is similar to the image quality meter area. It takes a lot of time to use the traditional target detection method. And the correct rate is low, it is difficult to detect the complete water wall tube weld area. To improve the accuracy of the detection of the weld zone of the water wall tube, this paper uses the YOLO algorithm to detect the target area. The YOLO algorithm uses a single convolutional neural network model to achieve end-to-end target area detection. The YOLO algorithm can make full use of the entire picture information to avoid false detection of the target, and at the same time achieve faster detection speed, and has strong practicability. The YOLO network uses a convolutional network to extract features and uses a fully connected layer to derive predicted values. The YOLO network structure is shown in Figure 1.
In Figure 1, the entire YOLO network structure consists of the Darknet53 network layer and three scale feature interaction layers. Among them, the Darknet53 network layer extracts the image features through 52-layer convolutional neural network, and obtains the feature maps of different scales. The three-level feature interaction layer realizes the local feature interaction between the feature maps by means of convolution kernels. Target detection and position regression are performed on the feature maps of the scales, and finally the output of the coordinates and category results is obtained. The loss function chosen by YOLO is as follows: indicates that there is an object in the th i window of the th j grid; ] noob [ j ij x k indicates that there is no object in the th i window of the th j grid. Fig.2 shows the images with enhanced contrast. It can be seen that the saliency of the weld zone of the water-cooled wall tube is enhanced after the image is reversed, which is more favorable for the observation of image features. The filter operator used performs a Gaussian smoothing operation on the inverted image, and the obtained image is as shown in Fig. 2(b). Comparing Fig. 2(a) and Fig. 2(b), it can be found that the image becomes smooth and the noise is suppressed. In Fig. 2(b), the gray value is concentrated in a small area, and the contrast is low. To improve the contrast of the whole image, the image enhancement is implemented by using the CLAHE algorithm. The enhanced picture is shown in Fig. 2(c). It can be found that the grayscale distribution range of the image is expanded to the entire grayscale space, and the image contrast is significantly enhanced. To further enhance the characteristics of the weld zone, the gradation of the compression weld zone is corrected using Gamma to obtain Fig. 2(d). It can be seen from Fig. 2(d) that the low-gray weld area is compressed to a lower range, and the contrast with the background area is more pronounced. After image preprocessing, the noise in the image of water wall tube is suppressed, and the contrast between the weld area and the background area is enhanced. Use LabelImg software to mark the weld area manually. In the 100 images preprocessed and labeled, 50 images are randomly selected as the test set, and the rest are composed of training set and verification set. To increase the diversity of the samples in the data set, the training set and the verification set are enhanced.

4.Experiments
The picture enhanced by different ways are shown in Figure 3. Fig. 3 shows that the position, gray scale and other information of the water-cooled wall tube weld area in the radiographic image are randomly changed, and the sample data amount is increased and the diversity is enhanced after data enhancement.
The performance of the target detection network is verified in the test set composed of 50 pictures, input the test pictures, and output the results as shown in Figure 4. In Fig.4, the red box is the detection result of the YOLO target detection network, and the number at the upper left of the box indicates the category to which the object in the box belongs and the confidence level belonging to the category. The test results of the statistical test set images are shown in Table 1.  In Table 1, the number of defects refers to the number of samples that can detect the general position of the weld area but cannot completely mark the entire weld. The number of misjudgment refers to the number of samples whose detection result is far from the center of the weld. The traditional method uses the normalized correlation coefficient method commonly used in the industry to search the image for the region with the largest correlation coefficient with the weld template as the detection result. Comparing the traditional algorithm with the YOLO algorithm, it can be found that the YOLO algorithm can effectively avoid the incomplete inspection of the weld seam, and the number of false detections is greatly reduced. Using a small number of training samples to train the network, the accuracy rate can reach 96%, to meet the needs of industrial production.

5.Conclusions
Aiming at the irregular distribution of the weld zone of the ray sheet, the operation of the whole picture takes a long time and the processing precision is low. This paper proposes a method based on the improved YOLO network to detect the weld area. The picture weld portion obtained in this paper has a low degree of recognition, so the image inversion, k-nearest median filtering, CLAHE image enhancement and gamma image correction are used to enhance and improve the contrast of the image, which improves the accuracy of object detection. The processed image is input into the network, and the position of the weld zone is obtained according to the input-output mapping relationship. Compared with the traditional methods based on shape and contour edge, it has higher accuracy and universality, and achieves the purpose of searching the weld zone of water wall tube.