# The Development of a Prototype Solution for Detecting Wear and Tear in Pedestrian Crossings
### Classification with YOLOv4-Tiny  
A previous study by the same authors [8] showed that among the different CNN models tested, the one best suited to the objective was the YOLOv4-tiny model. Therefore, this model was chosen for the detection of crosswalks, since its architecture allowed it to perform well on devices with limited computational resources. The YOLO (You Only Look Once) model divides the image into a grid and determines the object's bounding box, confidence levels, and class. The result is a combination of bounding boxes of a given class with an associated confidence level. The tiny version of this model is based on the CSPDarknet53-tiny CNN [9], which consists of three convolutional layers and three CSPBlock modules. CSPDarknet53-tiny is a simplified version of CSPDarknet53 that uses the CSPBlock module instead of the ResBlock module. The CSPBlock module improves the learning capability of the CNN compared to the ResBlock module. The CSPDarknet53-tiny CNN contains three convolutional layers and three CSPBlock modules. The first two convolutional layers include a convolutional layer and a LeakyReLU layer with a kernel size of 3 and a stride of 2, respectively. The last convolutional layer has a kernel size of 3 and a stride of 1, as shown in Figure 8. CSPDarknet53-tiny also uses the LeakyReLU function as the activation function instead of the Mish activation function, which simplifies the computational process [10]. This architecture is illustrated in Figure 9.  
YOLOv4-tiny uses two feature maps, each with dimensions of 13 \(\times\) 13 and 26 \(\times\) 26, to predict the detection results. At the same time, each feature map uses three anchor boxes of different sizes to predict three bounding boxes. Figure 7: Example of how the increase in pixels can influence the results. Dataset  
To improve the existing dataset [12], new images of pedestrian crossings have been added, increasing the total number of images from 642 to 1182. This new dataset is available at [13]. The images were taken with a camera with a 160\({}^{\circ}\) field of view, as shown in Figure 10. They were taken during the day, but during a period of cloudy skies, which made it possible to diversify the set of images and obtain more information about the crosswalks. Figure 8: Illustration from CNN CSPDarknet53-tiny. Adapted from [9]. Figure 9: Architecture of the YOLOv4-tiny model. Adapted from [11]. An Arducam 1080 P Low Light WDR USB Camera Module was used to capture these images. It has a metal mount that allows it to be easily attached to a cell phone holder. This camera has a 160\({}^{\circ}\) super ultra-wide viewing angle. This makes it easier to capture details that might be hidden in cameras with normal angles, such as 90\({}^{\circ}\), as shown in Figure 11.  
Figure 11 shows a comparison of the angular aperture of a conventional 90\({}^{\circ}\) camera (in yellow) and the 160\({}^{\circ}\) camera used in this project (in red). As can be seen, the crosswalks to the left and right of the image would not be captured by the 90\({}^{\circ}\) cameras. To determine the degradation state of the crosswalks and subsequently classify the images in the dataset [14], all images in the dataset were labeled using the method presented in Section 2.1. In other words, the Adaptive Threshold method was applied to each image to determine which degradation state it would best fit into. After that, the labels in the dataset were changed from a dataset containing only one class to three classes. Thus, the dataset now consists of 413 labels referring to crosswalks classified as Moderate Wear, 471 as Severe Wear, and 555 as No Wear, for a total of 1440 images without the use of data augmentation. Table 2 summarizes the current composition of the generated dataset. The next section presents a comparative performance evaluation of the use of the two approaches described in the detection and classification of the state of degradation of crosswalks. Figure 11: Illustration of objects captured by a 90\({}^{\circ}\) camera vs. a 160\({}^{\circ}\) camera.