## 2 Materials and Methods
### Wear Measurement Algorithm for the Contact Strip
#### 2.3.1 Deep-Learning for ROI Detection  
In image processing, deep learning is a CNN (Convolution Neural Network) structure used for object detection, division and classification. In this study, R (Regions)-CNN-based deep learning is applied to automatically extract the ROI of the contact strip. R-CNN is a basic algorithm used to detect objects, and the flow is shown in Figure 8. Searching the entire area of the input image slows down the process, so we apply the Selective Search algorithm to extract a box containing 2000 objects. At this time, the size of the box is \(277\times 227\). Next, a 4096-dimensional feature vector is extracted via a pre-trained CNN (ConvNet) and created to a fixed length. The extracted vector is classified into a bounding box using an SVM (Support Vector Machine) classifier trained for each class (objects). The Non-Maximum Suppression method selects only the box with the highest score and removes the rest, to distinguish multiple boxes at the same location The bounding boxes for the classified images found using the Selective Search algorithm are inaccurate, so the regression model is adjusted to correct the box position.  
The trained convnet is shown in the Alexnet structure of the Caffe library, considering the image recognition rate. Alexnet shows the basic structure, as in Figure 9. The convolution layer, which consists of five convolution layers and three fully-connected layers, is combined with an \(11\times 11\), \(3\times 3\) mask filter to characterize the image. Then, relu which stacks multiple layers is a nonlinear function and an activation function. This function is applied to determine whether to transfer the output value to the next layer. The polling layer performs a \(3\times 3\) max pooling to avoid overfitting. Here, the pooling is a method of resizing the convolution layer to derive a new layer. The softmax function that normalizes to an output value between 0 and 1 is applied effectively to classify the output value (relu) for the Fully Connected layer (fc layer). The fc layer connects front layer and back layer. A cross-entropy loss function that reduces the difference between the real value and predicted value is applied to find the appropriate weight. The accuracy is confirmed to compare the input image with the image of the training model. The training data is classified into five classes with 400 images of 8 bit/image in the Graphics Processing Unit (GPU) environment of GTX 1080 which is a device that processes graphics. The data is divided into 80% training and 20% test, and 94% accuracy is confirmed through 10,000 iterations.  
The test results of the training model are represented with an accuracy of 84% from the IOU (Intersection Over Union) score compared to the input image of the chipped contact strip and the trained CNN model, as shown in Figure 10. Here, overkill is a result of overfitting and underkill is a  
Figure 8: Flow of Regions – Convoluted Neural Network (R-CNN).  
Figure 9: Basic flow chart of CNN (ConvNet).  
result of underfitting. In this study, the wear size is measured by extracting the ROI of the image of the contact strip, which has the highest score in the five classes.