# The Development of a Prototype Solution for Detecting Wear and Tear in Pedestrian Crossings
## 4 Testing and Validation  
This section outlines validating the prototype developed for identifying and classifying wear and tear on crosswalks. The main focus of this section is the description of the steps involved in validating the prototype, from the initial detection of a crosswalk and its classification to the visualization of the data in the web application. During the tests carried out, an additional amount of current was consumed when using a Powerbank as a power supply for the Raspberry PI. This additional current was due to the necessity of supporting the use of the cooling apparatus utilized to cool the Raspberry Pi. Otherwise, the device would cease functioning without warning. Table 5 illustrates the consumption identified with all the components assembled. The process of detecting wear and tear on crosswalks begins with the identification of a crosswalk and the classification of its state of degradation by the IoT device. Figure 34 illustrates the result of this stage. The IoT device then transmits the data from this detection to the integrated platform via the developed API. These data, once received, are stored in Firebase's Firestore database. Figure 35 presents a graph illustrating the quantity of data received by the database over a specified period. To ascertain the efficacy of the prototype, a route was traversed through the city of Castelo Branco. This route is depicted in Figure 36. A route was selected with crosswalks exhibiting varying degrees of deterioration, during the day when the sun was relatively low. This time of day posed a challenge for the YOLOv4-tiny model in detecting and classifying the state of degradation of crosswalks due to the presence of shadows and excess light. A total of 17 crosswalks were identified along the route. Of these, nine were in good condition, three exhibited moderate wear, and five displayed severe wear. Figure 34: An example of a crosswalk classified as severely worn. Figure 35: Example of the number of documents received by Firestore. \begin{table}
\begin{tabular}{c c c c} \hline
**Hardware** & **Watts** & **Volts** & **Amps** \\ \hline Raspberry PI 5 8 GB with cooler & 27 & 5 & 6 \\ Raspberry PI 5 8 GB without cooler & 27 & 5 & 5 \\ \hline \end{tabular}
\end{table} 
Table 5: Raspberry Pi consumption. The Raspberry PI 5, in conjunction with the YOLOv4-tiny model, was able to identify the state of degradation of the crosswalks in an average time of 130 ms, as illustrated in Figure 37. About the detections made, the device was able to identify 15 of the 17 crosswalks on the route. This information is summarized in Table 6. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Class** & **Real Classification** & **YOLOv4-tiny** \\ \hline No wear & 9 & 9 \\ Moderate wear & 3 & 2 \\ Severe wear & 5 & 4 \\
**Total** & **17** & **15** \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Comparison of real classifications with those made by the YOLOv4-tiny model. Figure 36: Illustration of the route taken. One of the issues identified was the challenge of discerning diagonal crosswalks. An illustrative example of this issue can be observed in Figure 38. Consequently, it is imperative to gather a greater number of images to enhance the precision of this solution. The data transmitted by the Raspberry PI can be viewed on the web platform, as illustrated in Figure 39. This allows for the precise location of the crosswalks and their condition to be observed. This detailed visualization facilitates the monitoring and maintenance of pedestrian infrastructures, thereby contributing to pedestrian safety and convenience. The results of the conducted tests indicated the necessity to augment the number of images in the dataset. This enhancement is crucial for enhancing the accuracy of the classification of the deterioration of crosswalks.