The Effect of the Number of Classes on the Values Resulting from Evaluation Metrics in the YOLOv5 Model
Object detection is an essential field in computer vision. Building an object detection model requires specific categories during training: classes. This study aims to analyze the effect of the number of classes on the evaluation metrics obtained from detection model training. The dataset consists of ten classes, each containing one hundred images of size 416 x 416 pixels. The detection model is trained using the YOLOv5 model with one hundred epochs and a batch size of 16. Testing is done five times with the number of classes increasing gradually, namely two classes, four classes, six classes, eight classes, and ten classes. The test results in evaluation metrics, namely precision, recall, [email protected], [email protected]:0.95, and training time, were analyzed and compared. The analysis shows that the number of classes significantly affects the accuracy of the evaluation metrics. Training a model with eight classes gives the best accuracy results with a precision of 75.5%, recall of 62.5%, [email protected] of 71.2%, and [email protected]:0.95 of 35.5%. Meanwhile, training the model with two classes produced the lowest results, and training with 10 classes decreased compared to eight classes. A non-linear analysis relationship was also observed, as using ten classes slightly reduced the matrix value while maintaining efficiency in training time. This concludes that increasing the number of classes does not necessarily improve accuracy, and the optimal class configuration needs further consideration. These findings highlight important considerations for optimizing object detection models using YOLOv5 and contribute to future development.
Authors
- Tikaridha Hardiani
- Esi Putri Silmina
- Silvi Lailatul Mahfida
Publication Details
- Journal
- International Journal on Advanced Science Engineering and Information Technology
- Published
- 2025-04-24
- DOI
- https://doi.org/10.18517/ijaseit.15.2.20495
- Primary Topic
- Advanced Data Processing Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00