## 2 Prototype
### Two-Stage Detection  
Two-stage models solve the detection problem in two stages, as shown in Figure 9. The first stage involves creating a region of interest (ROI) and extracting features using  
Figure 8: One-stage detection model architecture. Figure 6: Convolutional neural network structure. Figure 7: Classification of one-stage detection and two-stage detection model types in object detection. CNNs. The second stage consists of inputting the features identified from the ROI into a classifier based on support vector machines (SVMs) or CNNs to classify the features and then correct the positions of the objects using bounding box regression [35]. In the previous study from the same authors of this paper, the performance of three different models was compared: YOLOv3-Tiny, MobileNet-SSD V2 and FasterRCNN with ResNet-50. The YOLOv3-Tiny model was identified as the most promising, as it had the best mean average precision (mAP) and the second highest frames per second (FPS) rate. This justifies choosing it for the development of the prototype presented in this paper. YOLOv3 [37] is a real-time one-stage object detection model. It therefore only processes the entire image once to find objects. This model divides the image into a 3 \(\times\) 3 grid of cells and each cell checks whether or not there is an object nearby, as shown in Figure 10. In each cell, the model represents the location of the object in the image and indicates the probability and the class of the object, if applicable. This system offers excellent speed when the application requires efficiency [38]. YOLOv3-Tiny [9] is a simplified version of YOLOv3 designed to consume fewer computing resources. It uses 13 convolutional layers, a significantly lower number than the 106 layers of the standard version (53 convolutional layers, added to the 53 layers of the Darknet-53 feature extractor used by YOLOv3). Since this architecture requires fewer filters, the size of the model and the training time end up being smaller [39]. The architecture of this model is shown in Figure 11. It is considered a good choice for applications that require high computational efficiency, such as mobile devices or embedded systems [40]. The dataset created in our previous work [8] showed a discrepancy in the number of images between the person class and the motorcycle and bicycle classes. The person class had the highest number of images. The dataset had a total of 440 images, divided between training, validation and testing. To solve this issue, more images were added to better represent the remaining classes. Thus, the new, improved version of the dataset has 1086 images, of which 761 are for training, 223 for validation and 102 for testing. This updated dataset is available for the community in [41]. The total number of images per set shown in Table 2 considers that some of the images contain identifications of several classes. Figure 10: \(3\times 3\) grid division. Figure 9: Two-stage detection model architecture. With regard to the number of bounding boxes present in all of the images in the dataset, it can be seen in Figure 12 that the person class has 946 identifications, the bicycle class has 517 identifications and the motorcycle class has 566 identifications. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **No. of Training Images** & **No. of Validation Images** & **No. of Test Images** \\ \hline Persons & 186 & 54 & 26 \\ \hline Bicycles & 260 & 78 & 32 \\ \hline Motorcycles & 323 & 92 & 45 \\ \hline Total & 769 & 224 & 103 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Number of images per set and class in updated dataset. Figure 11: Architecture of YOLOv3-Tiny model. The same benchmark scenario as in [8] was used to train the new YOLOv3-Tiny model. A Google Colab notebook [42] created by Roboflow [43] and later adapted [44] was used. The NVIDIA Cuda Compiler Driver [45] was installed to associate the graphics processing unit (GPU) with the run, as well as the Darknet framework [46].