Next Article in Journal
The Risk of Implementing Green Retrofitting in High-Rise Buildings Based on Work Breakdown Structures to Improve Quality of Resource Planning and Cost Accuracy
Previous Article in Journal
The Use of Support Vector Machine to Classify Potential Customers for the Wealth Management of a Bank
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Enhancing Fabric Detection and Classification Using YOLOv5 Models †

1
Department of Software Convergence, Soonchunhyang University, Asan-si 31538, Republic of Korea
2
Department of Computer Science, Kennesaw State University, Marietta, GA 30060, USA
3
Department of Computer Software Engineering, Soonchunhyang University, Asan-si 31538, Republic of Korea
*
Author to whom correspondence should be addressed.
Presented at the 2024 IEEE 7th International Conference on Knowledge Innovation and Invention, Nagoya, Japan, 16–18 August 2024.
Eng. Proc. 2025, 89(1), 33; https://doi.org/10.3390/engproc2025089033
Published: 3 March 2025

Abstract

The YOLO series is widely recognized for its efficiency in the real-time detection of objects within images and videos. Accurately identifying and classifying fabric types in the textile industry is vital to ensuring quality, managing supply, and increasing customer satisfaction. We developed a method for fabric type classification and object detection using the YOLOv5 architecture. The model was trained on a diverse dataset containing images of different fabrics, including cotton, hanbok, dyed cotton yarn, and a plain cotton blend. We conducted a dataset preparation process, including data collection, annotation, and training procedures for data augmentation to improve model generalization. The model’s performance was evaluated using precision, recall, and F1-score. The developed model detected and classified fabrics with an accuracy of 81.08%. YOLOv5s allowed a faster performance than other models. The model can be used for automated quality control, inventory tracking, and retail analytics. The deep learning-based object detection method with YOLOv5 addresses challenges related to fabric classification, improving the abilities and productivity of manufacturing and operations.

1. Introduction

Deep learning has improved rapidly recently. Image recognition and video classification are widely used within industry to judge the ripeness of fruits and vegetables [1]. Object detection methods have attracted much attention, as exemplified by the YOLO algorithm. The advent of YOLO has notably enhanced detection speeds, expanding the operation of deep learning into various domains.
In online shopping applications, platforms such as Amazon, eBay, and Taobao have seamlessly integrated YOLO for diverse functionalities [2]. In agriculture, YOLO is extensively applied to environmental monitoring, crop health assessment, and pest detection. In online shopping applications, image recognition is used in clothing design, coordinating accessories, categorizing items, and conducting analyses [3]. With the rapid growth of e-commerce, online shopping has provided consumers with convenience and cheaper products. In the apparel industry, engaging customers depends on visual elements such as color, style, and other features, highlighting the need for accurate image representation [4].
For online stores, showcasing garments’ various color and style variations as well as many try-on pictures and accessory options is paramount. This facilitates a straightforward selection aligned with customers’ preferences and enhances the shopping experience [5]. The applications of AI technologies such as YOLO extend beyond online shopping to clothing classification and detection, underscoring their versatility and potential in the industry [6]. Leveraging YOLO’s real-time processing capabilities and high accuracy in object detection, online retailers can streamline the browsing experience, offer accurate product recommendations, and elevate customer satisfaction. Moreover, this integration empowers online retailers to optimize inventory management to enhance the shopping experience.

2. Related Works

Object detection and image classification have been advanced thanks to deep learning techniques. In particular, the YOLO models have garnered considerable attention due to their ability to execute object detection. Video classification using deep learning techniques is used to simulate clothing for customers [7]. Song et al. [8] proposed evolved YOLOv5-based object detection to address inaccurate detection. The enhanced model achieved a better object detection performance using network pruning and parameter optimization [8]. The eye-in-hand measurement method showed increased precision, recall, mean average precision (mAP) value, and F1 score in contrast with the original YOLOv5 models [8]. Li et al. [9] enhanced object detection and addressed illegal immigration, industrial scenarios, natural disasters, and locating missing individuals or items utilizing photography with an F11 4K PRO drone and the VisDrone dataset.
Aduen et al. [10] enhanced the YOLOv5 object detection of smaller objects, particularly in autonomous racing, proposing a modified YOLO-Z model. The model’s mAP was enhanced by 6.9% for fewer objects at an intersection over union of 50% in object detection and its speed increased by 3 ms compared with the original YOLOv5. Hang et al. [11] proposed YOLOv5 for object detection in satellite images by introducing fusion layers and predicting heads. They used swin transformer prediction heads (SPHs) to reduce calculation intricacy and integrate normalization-based attention modules (NAMs) to improve attention performance. Evaluated on the NWPU-VHR10 and DOTA datasets, the modified model SPH-YOLOv5 outperformed the original YOLOv5 with an increase of 0.071 in mAP. Additionally, most YOLO versions enhance object detection based on machine learning.

3. Methodology

YOLOv5 is an advanced deep-learning technique that consists of an input, backbone, neck, and head. Among its variants, YOLOv5s is notable for its compact size, making it ideal for edge artificial intelligence (AI) and deployment on microcontroller units (MCUs). Deep learning models rely on GPU-powered systems for efficient computations. We used an open-source Jupyter Notebook (7.2.2) for model training and testing. Figure 1 shows the steps used for setup, configuration, and running process applications to create a new YOLO layer. Users need to confirm the graphics processing unit (GPU) and compute the unified device architecture (CUDA) settings before installing YOLO algorithms. Finally, the selected YOLO algorithm was trained and tested by using pre-defined weights.

3.1. YOLO Algorithms

YOLO is a single-stage object detection algorithm renowned for its efficiency and effectiveness. Unlike traditional two-stage methods, YOLO formulates object detection as a regression problem. It predicts bounding boxes and class probabilities from entire images in a single evaluation, offering real-time inference capabilities. This approach enables YOLO to achieve a high accuracy while maintaining an impressive speed, making it well-suited for various applications such as autonomous vehicles, surveillance systems, and robotics. YOLO streamlines the object detection process by simultaneously handling localization and classification and provides a robust and efficient solution for computer vision tasks.
The YOLO series has evolved through Darknet powering versions 1 to 4, while YOLOv5 is built on PyTorch (2.5.1+cu121). YOLOv1, inspired by GoogLeNet, treated object detection as a regression task. YOLOv2 improved accuracy and speed by adopting the Darknet-19 framework, though challenges remained in detecting small objects. To address this, YOLOv3 introduced a feature fusion module and expanded its output to three dimensions, enhancing performance with smaller objects. Based on such advancements, YOLOv4 refined its detection accuracy. YOLOv5, the latest version, allows for more compact models.
The YOLO architecture is structured using the backbone, neck, and head. Figure 2 highlights the main differences among the various versions of YOLO. In YOLOv5, the FOCUS function enhances the processing speed by slicing and rearranging the input image. Spatial pyramid pooling (SPP) reduces image distortion in measurements, color, or culture. It accelerates the generation of candidate boxes while decreasing computational overheads.

3.2. Dataset

Image datasets were collected using a camera, capturing data from the fabric category machine shown in Figure 3. The dataset comprised more than 5000 images and was categorized into five groups: plain cotton fabric, the hanbok fabric nobang, dyed cotton yarn, hanbok fabric, and a plain cotton blend fabric.
The dataset was split into training, validation, and testing sets. The training set was used to train the model, while the testing dataset was used for fine-tuning parameters and selecting the best model. Table 1 presents the distribution of samples in each category used in this study.

3.3. Image Labeling

LabelImg is an annotation tool developed in Python (3.12.4) that applies PyQt for its graphical interface annotations. It stores XML files in the PASCAL VOC format. Movere is also used in the YOLO and CreateML formats. The tool determines the object’s area and class in labeling and selects an appropriate layout compatible with YOLO. This information includes the class, X, and Y coordinates and the distance and confines of objects Figure 4.

4. Result and Discussion

We used a Windows 10 system with an AMD Ryzen 9 5900X processor running at 3.70 GHz, 128 GB of RAM, and an NVIDIA GeForce RTX. PyTorch, TensorFlow, and other supporting libraries were used to develop the YOLOv5 with a backbone, neck, and head. In object detection, the spatial locations of objects are represented by encircling boxes. YOLO employs anchor boxes of different sizes and shapes to manage overlapping objects within images. Each anchor box is evaluated to determine which object’s encircling box has the highest overlapping-to-non-overlapping ratio. In training, the expected encircling boxes are more continuous than the ground-truth labels, enhancing the detection performance where bounding boxes are color-coded by class, as shown in Table 2 and the results in Figure 5.

5. Conclusions

We used the lightweight YOLOv5 algorithm for clothing recognition in various conditions and weight constraints. YOLOv5s, a single-stage object detection approach, enhances both the detection speed and size of the compact model. The model was developed and tested using the Jupyter Notebook in an open-source integrated development environment. Image samples were taken using the LUMIX GH6 camera. Steps for building an efficient and cost-effective computing setup were developed. The experimental results highlighted the benefits of YOLOv5s regarding mAP, CPU and GPU operation times, and efficiency.

Author Contributions

M.H., conceptualization, project administration, writing—review and editing. J.M. and A.L., conceptualization, writing—review, and editing. M.M. format analysis, writing—original draft preparation, writing—review and editing. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the Basic Science Research Program through the National Research Foundation of Korea (NRF), funded by the Ministry of Education (NRF-2022R1I1A3069371), was funded by BK21 FOUR (Fostering Outstanding Universities for Research) (No.: 5199990914048), and was supported by the Soonchunhyang University Research Fund.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data available on request due to restrictions, e.g., privacy or ethical.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Cheng, Z.Q.; Wu, X.; Liu, Y.; Hua, X.S. Video2shop: Exact matching clothes in videos to online shopping images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 4048–4056. [Google Scholar]
  2. Latha, R.S.; Sreekanth, G.R.; Rajadevi, R.; Nivetha, S.K.; Kumar, K.A.; Akash, V.; Bhuvanesh, S.; Anbarasu, P. Fruits and vegetables recognition using YOLO. In Proceedings of the International Conference on Computer Communication and Informatics (ICCCI), Hammamet, Tunisia, 25–27 January 2022; pp. 1–6. [Google Scholar]
  3. Zhou, M.; Chen, G.H.; Ferreira, P.; Smith, M.D. Consumer behavior in the online classroom: Using video analytics and machine learning to understand the consumption of video courseware. J. Mark. Res. 2021, 58, 1079–1100. [Google Scholar] [CrossRef]
  4. Yin, W.; Xu, B. Effect of online shopping experience on customer loyalty in apparel business-to-consumer ecommerce. Text. Res. J. 2021, 91, 2882–2895. [Google Scholar] [CrossRef]
  5. Soegoto, E.S.; Marbun, M.A.S.; Dicky, F. Building the Design of E-Commerce. IOP Conf. Ser. Mater. Sci. Eng. 2018, 407, 012021. [Google Scholar] [CrossRef]
  6. Boardman, R.; Chrimes, C. E-commerce is king: Creating effective fashion retail website designs. In Pioneering New Perspectives in the Fashion Industry: Disruption, Diversity and Sustainable Innovation; Emerald Publishing Limited: Bingley, UK, 2023; pp. 245–254. [Google Scholar]
  7. Mao, M.; Va, H.; Lee, A.; Hong, M. Supervised Video Cloth Simulation: Exploring Softness and Stiffness Variations on Fabric Types Using Deep Learning. Appl. Sci. 2023, 13, 9505. [Google Scholar] [CrossRef]
  8. Song, Q.; Li, S.; Bai, Q.; Yang, J.; Zhang, X.; Li, Z.; Duan, Z. Object detection method for grasping robot based on improved YOLOv5. Micromachines 2021, 12, 1273. [Google Scholar] [CrossRef] [PubMed]
  9. Jung, H.K.; Choi, G.S. Improved yolov5: Efficient object detection using drone images under various conditions. Appl. Sci. 2022, 12, 7255. [Google Scholar] [CrossRef]
  10. Benjumea, A.; Teeti, I.; Cuzzolin, F.; Bradley, A. YOLO-Z: Improving small object detection in YOLOv5 for autonomous vehicles. arXiv 2021, arXiv:2112.11798. [Google Scholar]
  11. Gong, H.; Mu, T.; Li, Q.; Dai, H.; Li, C.; He, Z.; Wang, W.; Han, F.; Tuniyazi, A.; Li, H.; et al. Swin-transformer-enabled YOLOv5 with attention mechanism for small object detection on satellite images. Remote Sens. 2022, 14, 2861. [Google Scholar] [CrossRef]
Figure 1. Implementation process for YOLOv5 model.
Figure 1. Implementation process for YOLOv5 model.
Engproc 89 00033 g001
Figure 2. Architecture and processes of YOLOv5.
Figure 2. Architecture and processes of YOLOv5.
Engproc 89 00033 g002
Figure 3. Images of samples of each category of fabric.
Figure 3. Images of samples of each category of fabric.
Engproc 89 00033 g003
Figure 4. YOLOv5 labeling.
Figure 4. YOLOv5 labeling.
Engproc 89 00033 g004
Figure 5. Results from testing the types of fabrics.
Figure 5. Results from testing the types of fabrics.
Engproc 89 00033 g005
Table 1. Fabric dataset in this study.
Table 1. Fabric dataset in this study.
Fabric DatasetTrainingValidationTesting
Plain Cotton Fabric 756216108
Hanbok Fabric945270135
Dyed Cotton Yarn1029294147
Hanbok Fabric, Nobang1197342171
Plain Cotton Blend Fabric1470402201
Table 2. Performance obtained for 5 and 100 epochs. Time spent by CPU and GPU.
Table 2. Performance obtained for 5 and 100 epochs. Time spent by CPU and GPU.
Model NamemAP@0.5 (%)mAP@0.95 (%)CPU Time (s)GPU Time (s)
YOLOv5s60.0781.081805 s665 s
YOLOv5n45.0781.023364 s665 s
YOLOv5m50.0781.021.1169 s784 s
YOLOv5l50.0881.021.8475 s906 s
YOLOv5x60.3381.023.8888 s1200 s
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Mao, M.; Ma, J.; Lee, A.; Hong, M. Enhancing Fabric Detection and Classification Using YOLOv5 Models. Eng. Proc. 2025, 89, 33. https://doi.org/10.3390/engproc2025089033

AMA Style

Mao M, Ma J, Lee A, Hong M. Enhancing Fabric Detection and Classification Using YOLOv5 Models. Engineering Proceedings. 2025; 89(1):33. https://doi.org/10.3390/engproc2025089033

Chicago/Turabian Style

Mao, Makara, Jun Ma, Ahyoung Lee, and Min Hong. 2025. "Enhancing Fabric Detection and Classification Using YOLOv5 Models" Engineering Proceedings 89, no. 1: 33. https://doi.org/10.3390/engproc2025089033

APA Style

Mao, M., Ma, J., Lee, A., & Hong, M. (2025). Enhancing Fabric Detection and Classification Using YOLOv5 Models. Engineering Proceedings, 89(1), 33. https://doi.org/10.3390/engproc2025089033

Article Metrics

Back to TopTop