# Pothole Classification Model Using Edge Detection in Road Image
## 3 Pothole Classification Model Using Edge Detection in Road Image
### Pothole Classification Model Using Edge Detection  
In order to classify potholes from road damage image data, we construct a pothole detection model that extracts various features such as points, lines, and areas of the potholes using YOLO based on CNN. The Ministry of Land, Infrastructure and Transport defines a pothole as a jar-shaped breakage where one part of the entire surface of the asphalt pavement is recessed and detached [13]. YOLO searches the entire object in the image data at once, so the computation speed is fast and accurate recognition is possible [47]. However, there is a disadvantage of the low accuracy for classification. To solve this problem, the CNN method is additionally used in the network to accurately learn and recognize features to improve the accuracy of pothole classification. Classification derives results based on the presence or absence of potholes in the image data. Figure 5 shows the block diagram of the pothole classification model using edge detection in road image proposed. Figure 4: The accuracy according to the size of the filter using the laplacian mask. The road damage image data for analysis in the model of Figure 5 has a size of (486,353). YOLO consists of 24 convolutional layers and 2 FC (Fully Connected) layers. To extract the features for the edge of the pothole, the filter used in convolution is constructed using the Laplacian mask. It is used to extract the edge of the pothole from all directions and carry out the fast calculations. It also approximates the second-order differential function of pixel values in the image. The loss function used for learning in YOLO uses a multi-part loss function [47]. Equation (1) represents the multi-part loss function. \(S\) represents the size of the grid cell. This is a matrix. Therefore, the total number of grid cells is represented by \(S\times S\), \(S^{2}\). \(CS\) stands for Confidence Score. Also, \(\lambda_{\textit{coord}}\) is used as a balance parameter to balance the loss for the coordinates (\(k\), \(l\), \(m\), \(n\)) and other losses. \(\lambda_{\textit{noobj}}\) is a balance parameter for the balance between a box with and without an object. This is used to maintain the balance because the number of cells with objects is relatively more than that of cells without objects in a general image. \[\lambda_{\textit{coord}}\sum\limits_{i=0}^{S^{2}}\sum\limits_{j=0}^{ B}\alpha_{ij}^{obj}\Big{[}\Big{(}k_{i}-\hat{k}_{i}\Big{)}^{2}+\Big{(}l_{i}- \hat{l}_{i}\Big{)}^{2}\Big{]} \tag{1}\] \[+\lambda_{\textit{coord}}\sum\limits_{i=0}^{S^{2}}\sum\limits_{j =0}^{B}\alpha_{ij}^{obj}\Big{[}\Big{(}\sqrt{m_{i}}-\sqrt{\hat{m}_{i}}\Big{)}^{ 2}+\Big{(}\sqrt{n_{i}}-\sqrt{\hat{n}_{i}}\Big{)}^{2}\Big{]}\] \[+\sum\limits_{i=0}^{S^{2}}\sum\limits_{j=0}^{B}1_{ij}^{obj}\big{(} CS_{i}-\hat{CS}_{i}\big{)}^{2}\] \[+\lambda_{\textit{noobj}}\sum\limits_{i=0}^{S^{2}}\sum\limits_{j =0}^{B}1_{ij}^{obj}\big{(}CS_{i}-\hat{CS}_{i}\big{)}^{2}\] \[+\sum\limits_{i=0}^{S^{2}}1_{ij}^{obj}\sum\limits_{\textit{ clockless}}(p_{i}(cl)-\hat{p}_{i}(cl))^{2}\]  
The process of Equation (1) is as follows. The first stage computes the loss of \(k\) and \(l\) for the predictor bounding box of the grid cell where there is an object. The predictor affects overall reproducibility improvement. In the second stage, the loss value of \(h\) is calculated for the \(j\)-\(th\) predictor bounding box of the \(i\)-\(th\) grid cell where the object is present, and for large boxes, the sum squared error is calculated after applying the root to apply the small deviation. In the third stage, the loss of the confidence score is calculated for the \(j\)-\(th\) predictor bounding box of the \(i\)-\(th\) grid cell in which the object exists. On the other hand, the fourth step calculates the loss of the confidence score for the \(j\)-\(th\) predictor bounding box of the \(i\)-\(th\) grid cell where there is no object. In the last stage, the loss of conditional class probability is calculated for the grid cells in which the object exists [47]. Accordingly, an optimized model is generated.