# The Efficiency of YOLOv5 Models in the Detection of Similar Construction Details
## 3 Experimental Investigation
### Results of the Primary Research  
The newly collected construction details dataset was used in the experimental investigation [20]. The dataset was constructed in such a way that it is divided into three parts in order to be used in three stages. In the first stage, the dataset of 440 images was collected to train the models. The dataset consists of 22 different categories of images of construction details that were photographed on a white background. Each construction detail has been \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & **Image Size** & **mAPval** & **mAPval** & **Speed (ms)** & **Speed (ms)** & **Speed (ms)** & **Params (M)** & **FLOPs** \\  & **(pixels)** & **(50–95)** & **(50)** & **CPU bl** & **V100 bl** & **V100 b32** & **V100 b32** & **@640 (B)** \\ \hline YOLOv5n & 640 & 28.0 & 45.7 & 45 & 6.3 & 0.6 & 1.9 & 4.5 \\ YOLOv5s & 640 & 37.4 & 56.8 & 98 & 6.4 & 0.9 & 7.2 & 16.5 \\ YOLOv5m & 640 & 45.4 & 64.1 & 224 & 8.2 & 1.7 & 21.2 & 49.0 \\ YOLOv5l & 640 & 49.0 & 67.3 & 430 & 10.1 & 2.7 & 46.5 & 109.1 \\ YOLOv5x & 640 & 50.7 & 68.9 & 766 & 12.1 & 4.8 & 86.7 & 205.7 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The specification of the pre-trained YOLOv5 models [40]. Figure 1: The workflow of the experimental investigation. rotated 20 times in order for each picture to show a new angle. Each item of the dataset has been manually annotated. The number of images in the dataset is not high because the pre-trained models of YOLOv5 have been used. A sample of the analysed dataset is presented in Figure 2.  
To evaluate the efficiency of the models, a larger number of construction details have been prepared. Each construction detail used in the training process has been photographed 50 times from different angles using 3 different backgrounds: white (W), neutral (N), and mixed (M) (Figure 3). The main reason for using three different backgrounds is to simulate the efficiency of the models in a real environment. On a neutral background, all analysed construction details can be clearly observed. In contrast, on a white background, all details usually stand out and are highlighted from the background, except the construction details of the white colour. On the third background, which is mixed, the pattern can be considered as noise. In this case, it is more difficult to correctly detect the object compared with the white and neutral backgrounds. A total of 3300 images were prepared (1100 images on each background). The last part of the dataset which was used in the experimental investigation is formed by 150 images. In these, several dozen construction details are placed on the three backgrounds (Figure 4). The main idea of these images is to evaluate the efficiency of the YOLOv5 models that obtained the highest accuracy. As mentioned above, selecting different parameters during the training process can lead to different results. It is important to investigate not only the hyperparameters of the YOLOv5 models, but also the other important parameters that could influence the final detection results. Training each model can be time consuming, so the experimental study was divided into two stages. The first was called primary research, and the second was called main research. In the primary research, the influence of the following five parameters was investigated: epoch numbers (one complete forward and backward pass of all training  
Figure 3: A sample of the dataset used to evaluate the YOLOv5 models. Figure 2: A sample of the dataset used to train the YOLOv5 models. examples), batch size (number of images processed simultaneously in a forward pass), image size, layer freezing option, and different data augmentation options. Related works have shown the efficiency of YOLOv5s and YOLOv5m when used for the detection of small objects with similar features. In this case, these two models have been chosen in primary research. Various combinations of training parameters have been used in the training process (Table 2) and a total of 50 models were created and evaluated.