# The Development of a Prototype Solution for Detecting Wear and Tear in Pedestrian Crossings
### Performance Evaluation
#### 2.3.3 Results and Discussion  
As mentioned above, the use of the Adaptive Threshold method made it possible to determine the degradation state of crosswalks in images. However, to use this technique more effectively to classify wear, an image with an identified and isolated crosswalk should be used. To obtain these images, the YOLOv4-tiny model presented in the previous phase of this project was used but, in this case, retrained with the improved dataset containing more images. Table 3 shows the results obtained previously and using the new dataset. Based on the results given in Table 3, the model used in this project improved the mAP by approximately three percentage points. The use of this model ensures that only crosswalks are fed to the thresholding method, which then determines their state of degradation. This process is shown in Figure 12, which illustrates this mechanism. \begin{table}
\begin{tabular}{c c} \hline
**Class** & **State of Degradation** \\ \hline No wear & 555 \\ Moderate wear & 413 \\ Severe wear & 471 \\ \hline \end{tabular}
\end{table} 
Table 2: Total number of labels per class. \begin{table}
\begin{tabular}{c c c c} \hline
**Model** & **Images** & **Input Size** & **mAP (\%)** \\ \hline YOLOv4-tiny [8] & 642 & 608 \(\times\) 608 & 87 \\ YOLOv4-tiny * & 1182 & 608 \(\times\) 608 & 90 \\ \hline \end{tabular}
\end{table} 
Table 3: Comparison of the results obtained between the model presented in [8] and the one trained for this project (*). Although the results obtained so far with this approach show that it can be an effective solution when applied in a real-life scenario, there were some difficulties in identifying the state of disrepair of some crosswalks. Although this difficulty may be partly related to the quality of the camera used, the excessive brightness of the environment and even the interference of shadows from different elements projected onto the crosswalks proved to be the main problem with this approach. Figure 13 shows some situations that illustrate the problems encountered. Figure 13a(1-3) show the bounding boxes of different crosswalks detected by the YOLOv4-tiny model. Figure 13b(1-3) show the result of using the Adaptive Threshold method to determine the degradation state of each of them. Note that in Figure 13b(1), contour detection produced the expected output, indicating the locations of the degraded areas. In the case of Figure 13b(2,3), the result was not as expected. In these figures, it is possible to see places where the technique fails to delineate the crosswalk in a way that makes it possible to calculate its degree of degradation. For example, in Figure 13b(2), the shadow cast on the pavement has influenced the definition of the boundaries of its elements, thus affecting the result obtained. In the case of Figure 13b(3), the application of the technique failed to detect some of the pedestrian crossings. To study the influence of shadows on the previous results, this approach was tested during the day when the shadows of possible trees, buildings, or other urban elements were not directly on the crosswalks. Some of the results are shown in Figure 14.  
Figure 12: Diagram of how the first approach works. Figure 13: Examples of Adaptive Threshold detection: (**a**) Bounding boxes of three crosswalks (1)–(3) detected by the YOLOv4-tiny model; (**b**) Result of using the Adaptive Threshold method to determine the degradation state of the three crosswalks (1)–(3). For the YOLOv4 tiny model approach presented in Section 2.2, training has been performed on the data set containing three classes of intersections. The results are given in Table 4. Although the overall mAP value is not close to that of the YOLOv4-tiny model, which was trained only to detect crosswalks and not to classify them, as shown above, there is potential for improvement with the acquisition of more images. The number of images in the \"Moderate Wear\" class, which totals 413, negatively affected the mAP result, highlighting the need to acquire more images of crosswalks for this class.