# The Efficiency of YOLOv5 Models in the Detection of Similar Construction Details
## 1 Introduction  
Over the past decade, the application of artificial intelligence has grown in various areas. Many different methods of artificial intelligence can be used for different types of data analysis, such as those involving numbers, texts, sounds, and images. Deep learning methods play a significant role in various scientific research. This is due to the possibility of using not only the CPU, but also the GPU in model building. One field of artificial intelligence based on deep learning methods is computer vision. The most popular computer vision tasks are image classification, segmentation, and object detection. For example, in medicine, image data can be used to predict different diseases, such as cancer [1, 2], glaucoma [3, 4], and pneumonia [5, 6]. Object detection models can be used in systems for travel direction recommendation [7], in industry for solutions to robotization tasks [8, 9], in face detection for different applications [10, 11], or other fields [12, 13, 14, 15, 16]. Usually, in all research, various computer vision methods or combinations are used to solve thespecific problem. This is because there is no unambiguously appropriate method for all of them and, as a result, the results may depend on various factors. One of the factors in building successful artificial intelligence models is properly prepared data for model training. A large amount of research has sought to analyse the data showing features that are distinctly different, and for which the natural size of the object is large in the real world [17; 18]. In this case, the obtained results of object detection are high. A more complex task is to detect a similar object within an image, especially when the object is small in the real world. Objects that are similar can be described by the following characteristics: shape, colour, size, etc. For example, if we analyse medical pill detection, some of the pills can look identical in different images, depending on the angle, distance, lighting, shadows, and other external factors. At self-service checkouts [19], object detection methods have been implemented to detect fruits. It is difficult for models to determine what type of apple the customer is trying to buy due to the similarity between fruits. The same problem occurs in the construction detail analysis because some details can look identical. Detecting similar objects requires a much deeper analysis. In this investigation, the efficiency of YOLOv5 has been investigated using the newly collected construction details dataset [20]. In construction detail analysis, datasets have a large number of categories, and items have similar features. It is therefore important to investigate the parameters of the dataset and find which of them has the highest influence on object detection. Additionally, one must take into account the size of the chosen YOLOv5 model and the selected training hyperparameters. The training dataset used in the experimental investigation consisted of 440 images (22 construction details on a white background, with 20 images in each category). Additionally, a test dataset consisting of 3300 images (22 construction details on 3 different backgrounds, with 50 images belonging to each category). Because training each model costs a large amount of time, the experimental investigation was performed in two stages. In the first stage, primary research was performed to determine the influence of epoch numbers, image size, batch size, layer freeze option, and data augmentation on object detection results. A total of 50 experiments were performed using the most popular and widely used models of other researchers--YOLOv5s and YOLOv5m. During the primary experiments, the best parameters were found and used in the second stage. In the second stage, a total of 135 experiments were performed using all five models of YOLOv5 (n, s, m, l, x). The main aim was to find the best training hyperparameters, such as learning rate, weight decay, and momentum. The main contributions of the paper are as follows:  
1.