# Research on Wear Detection of End Milling Cutter Edge Based on Image Stitching
## 3 Fully Convolutional Neural Network Segmentation of End Mill Side Edge Wear
### Build the FCN Model  
Since the pixels of the spliced graphic obtained by using the model are 9792 \(\times\) 2048 pixels, the image is compressed to reduce the FCN segmentation model's operation time and its calculation amount. The compression method in this paper uses downsampling based on the image pyramid, in which the interpolation algorithm is a bilinear interpolation operation. The purpose is to ensure the zooming speed under the premise of ensuring the zooming accuracy. First, the FCN segmentation model's input image pixels are set to 1070 \(\times\) 224 pixels. Then, the panorama stitched image is compressed to 2140 \(\times\) 448 pixels under the premise of ensuring the segmentation effect of the worn area. After annotating the wear information, it is further compressed to 1070 \(\times\) 224 pixels and finally used as the input image of the FCN model.  
Compared with CNN, FCN has a different approach to recognizing images. After convolution pooling, CNN will connect several fully connected layers and map the feature map generated by the convolution layer into a fixed-length feature vector. FCN converts the fully connected layers in the traditional CNN into multiple convolutional layers and then uses the deconvolution layer to upsample the feature map of the last convolutional base layer. Finally, pixel classification is performed on the upsampled feature map. FCN first extracts the features in the image and generates a feature map, then uses the deconvolution layer to upsample the feature map, outputs a single-channel image with the same pixel size as the input, and completes semantic segmentation by identifying different pixel categories in the image.  
The VGG16 network can be used as the backbone feature extraction network of the FCN model to perform high-dimensional quantitative learning and parameter fitting for information features such as grayscale, key points, and textures in the image. The VGG16 backbone feature network is relatively mature in the classification tasks of many existing datasets. For datasets with different lighting effects, the robustness of the model is superior. Based on VGG16, the FCN model of the holographic image segmentation of the side edge of the end mill is constructed, as shown in Figure 7.  
As shown in Figure 7, the FCN segmentation model contains a total of six convolutional layers. Each convolutional layer has a pooling layer for compressing the convolutional layer, and the ReLu (Rectified Linear Unit) activation function is added after each convolutional layer. The activation function is finally connected to the softmax classifier using three deconvolution layers, the input is a single-channel image of 1070 \(\times\) 224 \(\times\) 1, and the output is a binary image of 1070 \(\times\) 224 \(\times\) 1. Since the parameters of the convolution layer are determined by the parameters of the convolution kernel, the feature information of the  
Figure 7: FCN model for holographic image segmentation of end mill side edge.  
wear area image of the end mill side edge can be extracted by controlling the parameters of the convolution kernel.  
The dropout method is used to randomly select 50% of the convolution kernels to participate in training to reduce the overfitting phenomenon of the convolutional layer conv6. The ReLu function is chosen as the activation function, and the 2 \(\times\) 2 average pooling is selected as the pooling layer to improve the calculation speed and reduce the calculation amount. In order to improve the segmentation accuracy of the end mill side edge wear image, the input and output of the pooling layer and the deconvolution layer are summed, respectively, and the fine output of the convolution layer and the coarse output of the deconvolution layer are fused.