Machine Learning for Quality Control in Traditional Textile Manufacturing

This research is centered on the practical implementation of machine learning and computer vision technologies to enhance production quality control within the traditional textile industry. The traditional textile sector, known for labor-intensive practices, has slowly adapted to digital transformation. We present a practical case study from Bandung, Indonesia, to validate the effectiveness of our approach in real-world textile manufacturing. By emphasizing machine learning and computer vision, this research narrows the gap between traditional textile practices and digitalization, offering tailored solutions for manufacturers seeking to excel in today's rapidly changing global market. The findings provide valuable insights into the challenges and opportunities of using machine learning and computer vision for production quality control in traditional textile manufacturing. The machine learning models in the study showed good accuracy, ranging from 75% to 100% under various lighting conditions in real-world textile manufacturing environments, confirming their suitability for practical quality control applications.


Introduction
The traditional textile industry is a significant economic player in many developing countries, providing jobs and contributing to trade (Kim, Traore and Warfield, 2006).This industry involves various production stages, such as spinning, weaving or knitting, and dyeing, where multiple machines work together.These machines turn raw textile fibers into grey and dyed fabrics before becoming finished products.
It must be noted that traditional textile production is still quite labor-intensive.Workers manually load raw materials onto machines and unload finished products, which can be timeconsuming and prone to mishandling (Kim and Moon, 2020).Additionally, data about each production stage is recorded by hand, leading to potential mistakes and inefficiencies (Amaral and Peças, 2021).
In contrast, textile manufacturing in developed countries has evolved significantly.These modern setups are highly automated, using robots and sensors to manage production efficiently (Lee, Ju and Lee, 2021).They have embraced digital transformation, allowing physical and digital components to exchange information seamlessly and, therefore, an efficient production system for better global competition.
However, adopting these advanced technologies in the traditional textile industry requires challenging investment.Thus, despite its economic importance, these conventional industries often struggle to compete effectively (Amaral and Peças, 2021).
In the context of quality control, the traditional textile industry has long relied on manual human inspection.Skilled workers use their eyes and experience to examine textile products for patterns, defects, and imperfections.This manual inspection ensures that the final products meet the desired quality standards.However, it is a labor-intensive and subjective process prone to human error and fatigue, especially in long production runs.When the patterns are not recognizable, operators will do a destruction test to find the type or original color of the fabric.
This research focuses on using computer vision technology to improve quality control in the traditional textile industry.The goal is to enhance production, raise product quality, and make the sector more competitive through partial digitalization.We prove this approach with a real-world case study, showing how computer vision can be applied in traditional textile manufacturing.We aim to help this industry thrive in a changing global market by using computer vision to ensure product quality.
This paper discusses the challenges of bringing computer vision into the traditional textile industry and proposes solutions combining traditional practices with modern technology.We review existing research, explain our methodology, present case study findings, and conclude with future research suggestions.

Literature Review
This section explores the transition from manual inspection to automated computer vision, the potential advantages, and the associated implementation challenges.We will also reference specific studies and examples that highlight the successful integration of computer vision technology in various industries.
The traditional textile industry, predominant in many developing countries, has faced significant challenges due to labor-intensive practices and manual production processes.Notably, quality control has historically relied on manual human inspection, a process that, while effective, is subjective, labor-intensive, and error-prone, particularly in large-scale production (Dutta et al., 2021).These challenges have motivated the exploration of alternatives.
In contrast, computer vision technology has emerged as a powerful tool for quality control in various modern industries.By harnessing algorithms and image processing techniques, computer vision enables the swift and accurate identification of product defects, effectively overcoming the limitations associated with manual inspection (Wu and Sun, 2013).Notably, this technology has been widely embraced for its efficiency and costeffectiveness across electronics to automotive manufacturing (Konstantinidis, Mouroutsos and Gasteratos, 2021;Javaid et al., 2022).Furthermore, the pharmaceutical industry has adopted computer vision for ensuring the quality and safety of drug production (Galata et al., 2021), and the food and beverage industry employs it to enhance the inspection of food products, guaranteeing adherence to stringent quality standards (Wu and Sun, 2013).Aerospace and aerospace manufacturing also benefit from computer vision's ability to detect imperfections in components and ensure the reliability of critical systems (Yasuda et al., 2022).
The modern textile industry has similarly embraced computer vision by integrating systems equipped with cameras and sensors into production lines.These systems capture detailed product images, facilitating real-time analysis and the effective identification of defects (Kim, Traore and Warfield, 2006).Machine learning algorithms have been employed to enhance accuracy, enabling the recognition of complex patterns and defects.The data generated through computer vision inspections contributes to defect identification and can potentially optimize production processes, reduce downtime, and enhance overall operational efficiency.
The use of convolutional neural networks (CNNs) in fabric detection is proven.In fabric classification, recent studies have highlighted the effectiveness of CNNs in capturing intricate patterns and textures.Notably, a study demonstrated the successful application of CNNs in textile material identification, showcasing the potential for enhanced accuracy and efficiency in fabric classification processes (Wang, Wu and Zhong, 2019).Another study uses customized CNN to detect defects in the textile industry, combining image preprocessing, pattern extraction, and defect detection (Ouyang et al., 2019).The extension of CNN usage on textile classification and identification is also found in a study that combines the unsupervised learning method (Koulali and Eskil, 2021).
However, transitioning to computer vision in the traditional textile industry necessitates careful planning, strategic technology investment, and workforce training.Ensuring algorithm reliability in defect detection remains a significant research focus, addressing concerns about false positives and negatives (Zhong and Ma, 2021;Saberironaghi, Ren and El-Gindy, 2023).

Methodology
This study aimed to develop a fabric classification system using machine learning and computer vision technologies.The research focused on cotton-based fabrics as the primary material of interest.Initially, a trial phase involved collecting hundreds of fabric samples with different colors and patterns to test the feasibility of fabric classification were performed.Then, an application for fabric classification was developed, intended for use in both mobile and web applications.

System Architecture for Fabric Classification Application
Figure 1 visually represents the system architecture of our fabric classification application, catering to mobile and web platforms.This depiction elucidates the core components and their interactions within the application, facilitating a comprehensive understanding of its functionality.In the traditional textile industry, users with diverse backgrounds and varying levels of education are expected to be encountered.Additionally, we prioritize avoiding additional hardware investments as part of our cost-saving strategy.
Users can utilize personal computers or mobile phones for image input, providing accessibility across diverse devices.The application accepts fabric images as input, which users can capture directly.Images undergo preprocessing steps, including resizing and standardization, ensuring compatibility with subsequent classification processes.
Central to the system is the machine learning model, represented by the chosen Convolutional Neural Network (CNN) architecture, such as VGG16 (Simonyan and Zisserman, 2015).This component is the core engine for processing input fabric images and generating classification results, presenting these outcomes as specific fabric types and colors.Classification results, including fabric type and color labels, are presented to users through the user interface, enhancing the usability and interpretability of the application.
This study considers the prevalence of Android-based mobile devices, and the application is optimized for seamless functionality.Users can access the application through any web browser, ensuring accessibility across various computing environments.
In Figure 2, clear directional arrows illustrate the flow of data and interactions between components, highlighting the journey of fabric images from input to processing and classification, culminating in the results through the user interface.The application supports data storage capabilities and enables sending classified data to a central database, ensuring data retention and potential future analysis.

Machine Learning and Computer Vision Algorithms
Fabric samples were obtained from the finished fabric sections within the textile factory, reflecting the real-world conditions of a traditional textile industry setting.Data acquisition was conducted using commonly available devices, namely a simple webcam and a mobile phone camera.This choice aligned with the practical constraints often faced in traditional textile environments, where highend imaging equipment may not be readily accessible.

Experimental Results
To support our research claims, we conducted an extensive experimental study in Bandung, Indonesia, a region renowned for its abundant traditional textile factories.This location was chosen due to its relevance to the traditional textile industry and the availability of diverse fabric samples for experimentation.
A controlled environment was established to conduct experiments.This setup included a mini studio where lighting and environmental conditions could be regulated.Creating a controlled environment helped mitigate external factors affecting image quality and classification accuracy.It is important to acknowledge certain limitations associated with this study.One notable limitation is the variability of lighting conditions in the textile outlet.These conditions can be challenging to control entirely.Therefore, it is recommended to designate specific locations within the outlet for fabric classification to minimize the impact of variable lighting on classification accuracy.
The dataset consists of 2000 fabric images sourced from various traditional textile factories in Bandung, as shown in Figure 3.These images encompassed different fabric types, primarily polyester and mixed cotton polyester, and were predominantly in shades of grey.Data collection was conducted in two distinct lighting conditions: 1. Ambient lighting: Initially, data was collected under typical ambient lighting conditions, simulating real-world manufacturing environments.2. Controlled lighting: we collected data under controlled lighting conditions to assess the model's performance under standardized settings.We considered four distinct machine-learning algorithms for our experiments: MobileNet, VGG16, Resnet50, and Xception.These algorithms were selected based on their established performance and suitability for image classification tasks.We opted for these specific algorithms for the following reasons: MobileNet is known for its efficiency and practicality for mobile applications.VGG16 is a widely used architecture with proven capabilities in image classification.Resnet50 is renowned for its depth and accuracy in image recognition tasks.Xception is acknowledged for its ability to capture fine-grained details in images.To ensure that only models with a reasonable level of accuracy were deployed in practical applications, we established a threshold accuracy rate of 90% during the selection process.

Model Performance Metrics
Once the model was developed, we assessed the performance of each machinelearning model by measuring accuracy under three different lighting conditions.The first lighting condition, represented by a single light source, simulates the weakest light, similar to a sunset.The second condition, with two light sources, emulates afternoon lighting conditions.The third condition, featuring three light sources, represents the strongest lighting, similar to morning.It is important to note that the specific light sources may vary at different factory locations.Consequently, training and validation are necessary at each unique location.Figure 4 illustrates that Xception and MobileNet performed the best, while Resnet50 exhibited the lowest accuracy under similar lighting conditions.

Figure 3 Model classification accuracy under different lighting source conditions
Under single-source lighting, MobileNet achieved an accuracy of 95.63%, VGG16 achieved 90.75%, Resnet50 reached 53%, and Xception attained 98.88%.In the presence of dual light sources, MobileNet maintained a high accuracy at 95.63%, VGG16 achieved 89.88%, while Resnet50 encountered challenges with a lower accuracy of 50.25%.Xception sustained its robust accuracy at 98.25%.When confronted with the most complex lighting scenario involving three light sources, MobileNet and Xception demonstrated intense accuracy levels, achieving 96.50% and 98.50%, respectively.In contrast, VGG16 and Resnet50 exhibited reduced accuracy rates of 87.13% and 75.26%, indicating their sensitivity to elevated lighting complexity.
The performance of each machine learning model was evaluated using the above metrics in controlled lighting conditions.These results provide insights into how each model performs under ideal circumstances.However, the realworld deployment of these models in textile manufacturing environments often involves The reported accuracy rates for each algorithm reveal distinct qualities and suitability for different aspects of fabric classification.This divergence in accuracy underscores the importance of selecting the suitable algorithm for the specific requirements of fabric classification.Notably, Resnet50, while renowned for its depth and accuracy in image recognition tasks, demonstrated a lower accuracy of 50% in our experiments when classifying fabric under varying lighting conditions.In contrast, Xception and MobileNet outperformed Resnet50 significantly, achieving close to 98% accuracy.These results highlight the specific challenges Resnet50 faces in accurately classifying fabrics under different lighting scenarios.While it excels in capturing fine-grained details, its performance under these conditions may warrant further investigation and optimization for practical applications in textile manufacturing.
To assess the practical applicability of our fabric classification conducted deployment accuracy tests in textile manufacturing environments with varying lighting conditions.In this experiment, we only use the algorithms with accuracy above 80%: MobileNet, VGG16, and Xception.This transition from model evaluation to deployment accuracy highlights the need to understand how well these models perform when deployed in real-world scenarios, which can significantly differ from controlled laboratory settings.As shown in Figure 6, the deployment accuracy results reflect the models' robustness and reliability when faced with the complexities of actual textile production environments.
For fabrics classified under a single light source, the accuracy rates were 75%, 100%, and 100% for MobileNet, VGG16, and Xception, respectively.These models exhibited consistently high accuracy when confronted with two light sources, achieving rates of 89%, 100%, and 100%, respectively.Even in the most challenging scenario involving three light sources, the accuracy remained commendably high at 98%, 100%, and 100%, respectively.These results emphasize the models' robustness and reliability in practical textile production settings, where lighting conditions are subject to variation, reaffirming their suitability for real-world quality control applications.

Discussion
Integrating machine learning and computer vision technologies in traditional textile manufacturing promises to revolutionize quality control practices within the industry.The transformation is shown in Figure 5.The ability to accurately identify fabric types, even in the absence of labels, offers a transformative leap in product quality.One significant benefit of this enhancement is minimizing the potential for wrong product shipments and deliveries, a concern that has been in the industry for a long.This technology enables supervisors, even in very traditional settings, to conduct random quality checks by simply pointing their smartphones at fabrics, thus ensuring the quality of the products.A fundamental paradigm shift facilitated by this technology is the reduction of reliance on labor-intensive manual fabric inspection.Historically, skilled human inspectors are responsible for meticulously examining textiles for defects and inconsistencies, particularly in long production runs.With the introduction of machine learning and computer vision, this reliance on manual inspection can be significantly diminished.The benefits are twofold: first, it alleviates the burden on skilled inspectors, allowing them to focus on more complex tasks, and second, it eliminates the potential for human error, which can be particularly pronounced in extended production runs.
Deploying machine learning models in quality control processes brings substantial cost savings and operational efficiency improvements.As human labor requirements decrease, manufacturing plants can significantly reduce labor costs.Furthermore, the fabric classification process automation minimizes errors and inaccuracies, translating to further cost savings by reducing the incidence of defective products and rework.The technology's efficiency gains are particularly noteworthy, as it enables real-time, precise, and consistent fabric classification, contributing to the overall streamlining of production processes.
A cornerstone of quality control in the textile industry is product consistency.The ability of machine learning algorithms to consistently and accurately classify fabrics plays a pivotal role in maintaining product consistency.This consistency extends to fabric quality, color, and type, ultimately leading to reduced defective products and a noticeable enhancement in the overall quality of finished goods.The technology ensures that every product adheres to specified standards, reducing waste and improving customer satisfaction.
While the potential of machine learning in the textile industry is immense, it is not without its challenges.One notable challenge is the need for robust IT infrastructure to support the deployment of machine learning models.The industry is still developing the necessary infrastructure, which can be a substantial investment.However, it is encouraging to note that the technology has shown remarkable progress in its adaptability.By enabling fabric classification via smartphones and web applications, it has circumvented the need for extensive hardware investments, offering a more accessible and practical solution.
Initial user feedback and experiences with the machine learning application have been positive.Users appreciate the additional technology that simplifies quality control processes.While there have been minimal user acceptance issues, these are outweighed by the numerous success stories that have emerged during the implementation phase.The industry's workforce has embraced the technology as a valuable tool that complements their existing skill sets and enhances their capabilities in ensuring product quality.
The potential for scaling machine learning in the traditional textile industry is vast.As the technology matures and becomes more readily available, opportunities for future expansion become apparent.Adapting the technology to various fabric types and manufacturing processes presents a promising avenue for growth.The scalability of machine learning offers the industry the flexibility to tailor its application to different contexts, ensuring its relevance and effectiveness across a broad spectrum of textile production scenarios.
The deployment of machine learning in traditional textile manufacturing can revolutionize the industry's quality control practices, reduce reliance on manual inspection, realize significant cost savings, and improve product consistency.Challenges associated with IT infrastructure development are being addressed, and the technology's adaptability through smartphones and web applications is a testament to its accessibility.User feedback has been largely positive, and the technology's scalability ensures its longterm relevance and impact on the industry's competitiveness and adaptability in a rapidly changing global market.

Conclusion
This study explored how machine learning and computer vision technologies can improve quality control in the traditional textile industry.Our research in Bandung, Indonesia, aimed to make quality control more efficient and effective in such an industry.The process no longer relies on manual, time-consuming, and sometimes destructive quality control.Instead, the quality control is now assisted by computer vision technology with a high accuracy.We tested various machine learning models and found they could accurately classify fabrics, even in challenging lighting conditions.The real-world deployment of these models in textile manufacturing environments showed that they can handle the complexities of actual production.This transition from controlled testing to real-world use is essential to understand how well these models perform in practical situations.
Integrating machine learning and computer vision into the traditional textile industry can reduce human error, lower labor costs, streamline production and ensure consistent product quality.It empowers supervisors and inspectors to conduct quality checks efficiently.Challenges remain, particularly the need for robust IT infrastructure.However, the technology's adaptability through smartphones and web applications makes it a practical solution for traditional textile settings.
In conclusion, integrating machine learning and computer vision technologies into traditional textile manufacturing holds significant promise.It modernizes quality control, enhances competitiveness, and prepares the industry for success in a changing global market.As this technology continues to evolve, we expect a brighter future for the traditional textile industry, marked by efficiency, consistency, and product quality.

Figure 1 Figure 1
Figure 1 Traditional textile production process

Figure 2
Figure 2 Fabric samples under different magnification

Figure 5
Figure 5 Computer vision based business process