## 4 Detecting Chalking Position by Photographing and Analyzing Wall Surfaces
### Chalking-Position Detection Model  
#### 4.2.1 Object Detection Using Deep Learning  
In this study, we developed a method to detect the positions marked by chalk in the headrace tunnel using deep learning. An early example of deep-learning-based object-detection algorithms was the region-based convolutional neural network (R-CNN) proposed by [PERSON] et al. (2015). R-CNN uses processes such as selective search ([PERSON] et al., 2014) to detect regions containing object candidates (region proposal) and classifies these regions using a CNN ([PERSON] et al., 2014). However, it takes a long time to classify the proposed regions one-by-one using the CNN; thus, Fast R-CNN ([PERSON] et al., 2014), which classifies the proposed regions using the features obtained when analyzing the input image with the CNN, was proposed. Additionally, to further accelerate the process, Faster R-CNN ([PERSON] et al., 2014), which uses a region proposal network that classifies objects in a rectangular area set in an image as objects or background, was proposed. However, Faster R-CNN has a limited processing speed because the algorithm is divided into the two stages: object detection and classification of detected objects. For damage detection in a headrace tunnel, as in the present study, the number of images to be analyzed inevitably increases because the entire tunnel is photographed comprehensively. Therefore, in addition to a high detection accuracy, a high detection speed is desirable. You Only Look Once (YOLO), which is an object-detection algorithm using deep learning ([PERSON] et al., 2014), achieves fast processing by conducting object detection and classification processing in parallel, making it suitable for the present study. YOLO estimates the object region, divides the input image into \(S\times S\) grid cells, and classifies each grid cell. According to the detected area and classification result of each grid cell, the classification result of the detected area is determined. A confidence score is calculated for each detection result, and the results whose scores exceed the threshold are output as the final results. Algorithms such as YOLOv2 ([PERSON] et al., 2014) and YOLOv3 ([PERSON] et al., 2014), which are based on YOLO and have higher processing speeds and detection accuracies, have also been proposed. YOLO evolves quickly; the current YOLO version is v8 ([[https://github.com/ultralytics/ultralytics](https://github.com/ultralytics/ultralytics)]([https://github.com/ultralytics/ultralytics](https://github.com/ultralytics/ultralytics)), accessed on 18 August 2023), and further accuracy improvements are expected in the future. However, the accuracy improvement is likely only a few percentage points ([PERSON] et al., 2014); thus, in this paper, we report the results of YOLOv7, which was the latest version at the time of analysis. YOLOv7 is a supervised machine-learning model. Supervised machine learning is a method where input data that were prepared in advance and the corresponding output data are used as training data to learn the relationship between input and output data. The training data generated in this study for model training and the training flow are discussed below.