skip to main content
10.1145/3704522.3704551acmotherconferencesArticle/Chapter ViewFull TextPublication PagesnsyssConference Proceedingsconference-collections
short-paper
Open access

Short Paper: Prediction of Yarn Fineness Using Computer Vision Based Techniques

Published: 03 January 2025 Publication History

Abstract

One of the most important factors that are associated with the quality and performance of textiles is the fineness of yarn. There is usually high demand for automated methods of yarn fineness measurement as the traditional methods are time consuming and are associated with high levels of errors. This paper puts forward a system that uses computer vision and image processing technique to estimate yarn fineness from yarn shadow images. The proposed method incorporates complex image analysis techniques to analyze the shadows formed by the yarn samples for fineness related characteristics. From the analyzed data, machine learning models are developed to estimate yarn fineness with a very high level of accuracy. The results show the effectiveness of the proposed method in increasing the measurement accuracy and decreasing the measurement time in comparison with the manual methods with 95% accuracy. Besides, this method improves the speed and accuracy of yarn fineness prediction and presents a solution to real-time monitoring in the large-scale textile industry. The approach presents potential usefulness in enhancing quality assurance and production efficiency of textile manufacturing industry.

1 Introduction

As the world’s second-largest textile exporter, Bangladesh prioritizes both increased production and high-quality standards to meet global demand [20]. To remain competitive, the textile industry must focus on both superior product quality and higher productivity. Textiles are categorized into woven and knit fabrics, with woven fabrics made from two yarn types: warp yarn (vertical) and weft yarn (horizontal). Yarn fineness, determined by diameter, is critical for modeling fabric properties like yarn densities, weave angles, fabric weight, and volumetric density [11]. However, variations in fiber density and yarn twist can cause discrepancies in diameter, even among yarns with the same count, making yarn count an imprecise diameter indicator[3]. Thus, consistent yarn diameter is crucial in production. Yarn count, which indicates yarn or fabric fineness, directly impacts fabric quality by affecting attributes like tensile strength, diameter, and tear strength [9, 19, 21]. While higher yarn counts reduce hairiness, they can increase defect likelihood [5]. Therefore, precise monitoring of yarn count is essential for maintaining fabric quality. Yarn diameter, which influences fabric density and strength, can vary due to fiber density and twist. Advanced AI and computer vision techniques provide accurate, automated solutions for assessing yarn characteristics, reducing manual labor and improving precision [8, 16, 18]. It is also significant for both side of manufacture and consume, the yarn characteristic must be estimated correctly for the best quality. The application of artificial intelligence, particularly machine learning and computer vision in quality assessment has turned out to be a powerful tool in increasing the objectivity of the process and at the same time, reducing the cost [1]. These technologies enable faster, more accurate identification of yarn imperfections and ensure consistent quality across products. Machine learning, once trained, optimizes operations by analyzing yarn count factors and adapting to new data. Machine learning-based image processing solutions, part of Industry 4.0, allow real-time monitoring, improving quality, productivity, and reducing costs. This research develops a system to accurately determine yarn fineness through image processing and computer vision by analyzing shadow images of cotton ring-spun yarns. We add the following to this paper considering the findings concerning our research:
Designing algorithms for the processing, and analysis of yarn shadow images to detect the fineness of the yarn.
Design and enhancement of machine learning models for image analysis using the yarn shadow diameter.
Development of a database (dataset) for storing all the data that will provide machine learning technique.

2 Background and Related Work

Yarn count and evenness are key determinants of textile quality, directly affecting a textile company’s performance. By using yarn shadow images and sophisticated image analysis, computer vision and machine learning algorithms have improved yarn count measurement, offering greater speed, accuracy, and real-time monitoring capabilities compared to traditional methods. These automated systems enhance productivity and quality control by detecting defects early, reducing waste, and supporting optimized spinning. Thus, helping textile manufacturers meet quality expectations and avoid costly recalls.

2.1 Research Works Related to Yarn Attribute Determination

Recent studies on artificial intelligence and image processing have proposed innovative methods for assessing yarn quality. Liyakat et al. [14] developed an image-based approach to evaluate yarn hairiness, thickness, and color. Caldas et al. [2] designed an autonomous winding system to assess yarn quality, incorporating image processing to stabilize samples for analysis. Haleem et al. [7] introduced an online evenness testing system using Viola-Jones object detection to identify nep defects in real-time, while Xu et al. [23] employed a knowledge-augmented deep-learning approach for accurate yarn contour recognition. Several works have focused on measuring yarn diameter and evenness through image processing. For example, Khaddam et al. [10] used artificial neural networks for diameter estimation, while Liu et al. [13] assessed evenness in woven fabric samples using FFT-based image segmentation. Li et al. [12] developed a machine vision approach for continuous yarn evenness measurement, and Zhu et al. [26] created a dynamic threshold module to measure film thickness and evenness in sized yarns. Advanced methods for yarn hairiness and appearance have also been explored. Wang et al. [15] developed a 3-D imaging system to measure hair length, and Fabijanska et al. [4] proposed techniques for automatic hairiness assessment through segmentation and fiber extraction. Pereira et al. [17] introduced a mechatronic system for real-time hair analysis, while Wang et al. [22] devised an image-processing method to evaluate yarn diameter and hairiness index via segmented images.

2.2 Research Works Related to Yarn Fineness Detection

Various studies have explored image-based systems for evaluating yarn fineness and quality. Zhong et al. [25] developed an image-sequence analysis system for assessing yarn evenness in simulated testing environments. Zhang et al. [24] introduced a method combining modified Canny edge detection with gradient processing to evaluate evenness. Similarly, Noman et al. implemented a computer vision-based quality control system to detect yarn faults like neps through image analysis, while Elif et al. [6] designed a prototype for detecting defects in yarn bobbin and fabric using image processing techniques. Additionally, Filipe et al. [17] created a real-time computer vision system for yarn quality detection, featuring parameter analysis and classification capabilities.

2.3 Literature Review Analysis

Image processing and machine learning have revolutionized yarn attribute measurement, making assessments faster, more accurate and freer from human error. These advancements enable high-throughput analysis of yarn samples, enhancing productivity and cost-effectiveness. Machine learning models also offer refined insights into yarn structure, supporting quality improvement and environmental sustainability. Despite numerous techniques for yarn evaluation, a significant gap remains in systems that capture and analyze yarn shadow images specifically for fineness prediction. This research addresses this gap by developing an economical, image-based method to detect yarn fineness using shadow images, aiming to improve accuracy and efficiency in textile manufacturing.

3 Proposed Methodology

This section outlines the proposed methodology and the application of machine learning in our system and algorithm. Our integrated approach is designed to address the research objectives systematically, ensuring a scientific framework for solving the identified research questions and drawing meaningful conclusions. The methodology encompasses the general research strategy, data collection methods, and result analysis, while addressing any ethical considerations. This framework establishes a robust foundation for achieving sound and reliable results. The workflow is given in Figure 2.

3.1 System Design and Implementation

At the beginning of our work, we collect Ring Yarn packages of various counts from factories. The workflow in this work is shown in Figure 1.
Figure 1:
Figure 1: Data Collection Using Black Box
Figure 2:
Figure 2: Flowchart of Our Proposed Methodology
A black box was developed to capture static yarn shadow images under controlled conditions, using the LED flash of a Redmi 9 phone at a 30° angle. The yarn was positioned 21.5 cm from the lens, with the shadow 25.9 cm away from the camera. Images were captured using “POCO X3 Pro” and “Nothing Phone 1” smartphones, resulting in a dataset of 1,200 images at a resolution of 4098×3072 pixels with 96 dpi. Python code was used to analyze the images, determining yarn fineness for yarn count prediction. The data was then stored for training various machine learning models to detect yarn fineness and evaluate the results.

3.2 Data Storing

The Yarn fineness we find from the static yarn shadows using python code was stored into an excel sheet for regression analysis. This is shown in Figure 4.

3.3 Linear Regression Analysis

We used linear regression to develop a predictive equation for yarn count based on diameter. Data stored in an Excel sheet was analyzed to find the best-fitting linear equation, which predicts yarn count using the diameter obtained from Python code. This code analyzes yarn shadow images to calculate diameter, which is then applied in the regression equation to estimate yarn count accurately. The equation we found is:
\begin{equation*} \text{Predicted Count} = 50.7758 - (0.5147 \times \text{Yarn Diameter}) \end{equation*}
We use this equation to predict yarn count. This is a machine learning analysis of our processed data. The accuracy we get is 90.54%

3.4 Machine Learning

After performing linear regression, the dataset of 1,200 samples was analyzed using Python to predict yarn counts from acquired diameters, with results stored in an Excel sheet. These data were then used to train machine learning models.
Figure 3:
Figure 3: Machine Learning Model Training Process
Figure 4:
Figure 4: Excel sheet for storing regression analysis data
Such as k-NN, Nearest Centroid, Gradient Boosting, Gaussian Naive Bayes, and others. Model performance was evaluated using precision, recall, and F1 score through tenfold cross-validation. The dataset was divided into ten folds, with one-fold serving as the test set and the remaining nine as the training set. This process was repeated for all folds, resulting in ten evaluation outcomes. The average precision, recall, and F1 scores were calculated to assess the models comprehensively. The model learning process is illustrated in Figure 3.

3.5 Proposed Machine Learning Model

After Training the model we find the best accuracy in Gradient Boosting Classifier from Table 1. Which is why this is our proposed Machine learning Algorithm.

4 Experimental Evaluation

In this section we discuss our experience of the experimentation process

4.1 Industrial Data Collection

At first, we collect packages of Ring yarn of various counts from Pakiza Knit Composite for industrial data collection. Then we use the Blackbox and smartphone “POCO X3 Pro” and “Nothing Phone 1” to take static yarn shadow images. We run the images in python to extract the yarn diameter from the images. We use the found diameter from the code and use it to find an equation from “Linear Regression Analysis” to find a predicted yarn count. We then make use of this equation and make a new code which analyses the yarn shadow image, gives a yarn diameter from the image and then gives a predicted yarn count of that image from the equation. We know the count of the yarn packages when we collected data from industries. Then we compare the actual count and the predicted count to find the accuracy of our prediction.
The objective of the research was to develop a computer vision-based method for detecting yarn fineness using image processing techniques. The project utilized machine learning algorithms to improve the accuracy of yarn fineness prediction, focusing on the analysis of yarn shadow images. The experimental evaluation phase involved capturing yarn shadow images, analyzing these images using Python-based algorithms, and utilizing machine learning models such as k-NN, Nearest Centroid, Gradient Boosting, Gaussian Naive Bayes and others. The Python algorithm effectively detected yarn diameter by identifying the minimum enclosing circle around the yarn contour. The measured diameter values were compared against the theoretical values derived from the yarn count using the equation:
\begin{equation*} \text{Diameter} = \frac{1}{28} \times \sqrt {\text{Count measured in Ne}} \end{equation*}
The comparison showed that the diameter measured from the images closely matched the theoretical values, providing a reliable prediction of yarn fineness. The found yarn count from the code and their comparison to actual yarn count is shown in Figure 5.

5 Conclusion

The proposed approach offers a highly accurate alternative to manual yarn fineness prediction, as evidenced by the consistency between image analysis results and actual measurements. Its scalability, enabled by machine learning and image processing, makes it well-suited for real-time automation and monitoring in textile production. After training various models the results are given in Table 1.
Table 1:
AlgorithmPrecisionRecallF1
Nearest Centroid Classifier87.283.8184.20
Gaussian Naive Bayes88.5985.4984.82
SGD Classifier28.3447.4533.42
AdaBoost Classifier41.6561.1248.58
k-Nearest Neighbor Classifier95.4293.5993.98
Bagging Classifier93.8393.9593.89
Decision Tree Classifier95.5495.0494.87
Random Forest Classifier95.9395.2695.11
Gradient Boosting Classifier95.7995.2595.11
Extra Trees Classifier95.4195.1694.73
Support Vector Classifier91.0191.7890.85
Table 1: Accuracy of Machine Learning Model
We get the highest F1 score from “Gradient Boosting Classifier” which is 95.79%.
To evaluate model performance in yarn fineness detection, we compared several machine learning models based on precision, recall, and F1 scores. Gradient Boosting Classifier achieved the highest F1 score of 95.79%, excelling due to its ability to manage complex data and iteratively minimize bias and variance, making it ideal for the nuanced patterns in yarn shadow images. Conversely, models like SGD Classifier and Gaussian Naive Bayes underperformed, with F1 scores of 33.42% and lower, due to their limitations in handling non-linear relationships and interdependent features. K-Nearest Neighbors and Random Forest performed moderately well but required careful tuning and were less scalable. This system’s precision benefits the textile industry by automating yarn fineness prediction, reducing labor, and improving production efficiency. It enhances quality control and real-time monitoring, enabling consistent production, reduced waste, and cost savings.
Figure 5:
Figure 5: Analysis of the ‘Predicted Yarn Count’ and ‘Actual Yarn Count
Figure 6:
Figure 6: Confusion Matrix of Gradient Boosting Classifier
In future, we wish to enhance our model robustness to make the system more adaptable to real world production. Further we aim to expand our dataset to include a broader range of yarn types, counts and additional textile characteristics. Our aim is to also create models which retain accuracy across diverse manufacturing conditions. We wish to explore alternate algorithms such as deep learning for future development. Additionally, exploring alternative algorithms may increase accuracy and improve the detection of subtle features in yarn images. This system presents a cost-effective alternative to conventional equipment, like the Uster Tester 6, making high-precision yarn fineness detection more accessible to the industry.

Acknowledgments

We convey our gratitude Pakiza Knit Composite Ltd. for helping us in data collection.

References

[1]
Manal R Abd-Elhamied, Wael A Hashima, Sherien ElKateb, Ibrahim Elhawary, and Adel El-Geiheini. 2022. Prediction of cotton yarn’s characteristics by image processing and ANN. Alexandria Engineering Journal 61, 4 (2022), 3335–3340.
[2]
Pedro Caldas, Filipe Sousa, Filipe Pereira, Helena Lopes, and José Machado. 2022. Automatic system for yarn quality analysis by image processing. Journal of the Brazilian Society of Mechanical Sciences and Engineering 44, 11 (2022), 565.
[3]
Mohamed Eldessouki, Sayed Ibrahim, and Jiři Militky. 2014. A dynamic and robust image processing based method for measuring the yarn diameter and its variation. Textile Research Journal 84, 18 (2014), 1948–1960.
[4]
Anna Fabijańska and Lidia Jackowska-Strumiłło. 2012. Image processing and analysis algorithms for yarn hairiness determination. Machine Vision and Applications 23 (2012), 527–540.
[5]
GM Faysal, TN Sonia Azad, Md Reazuddin Repon, Md Tanjim Hossain, and Mohammad Abdul Jalil. 2022. Sustainable yarn production using leftover fabric from apparel industries. Heliyon 8, 11 (2022).
[6]
Elif Gültekin, Halil İbrahim Çelik, Lale Canan Dülger, Halil İbrahim Sünbül, and Harun Kani. 2019. Image Processing Applications on Yarn Characteristics and Fault Inspection. Tekstil ve Mühendis 26, 116 (2019), 340–345.
[7]
Noman Haleem, Matteo Bustreo, and Alessio Del Bue. 2021. A computer vision based online quality control system for textile yarns. Computers in Industry 133 (2021), 103550.
[8]
Habiba Halepoto, Tao Gong, Saleha Noor, and Hafeezullah Memon. 2022. Bibliometric analysis of artificial intelligence in textiles. Materials 15, 8 (2022), 2910.
[9]
Hassan Jamal, Faheem Ahmad, Farooq Azam, Muhammad Umair, Sheraz Ahmad, Yasir Nawab, Abher Rasheed, and Tehseen Ullah. 2023. Development and characterization of impact resistant fabric with better comfort for motorbike riders. The Journal of The Textile Institute 114, 7 (2023), 925–932.
[10]
Hiyam Saleh Khaddam and Ghandi Ghazi Ahmad. 2022. A method to evaluate the diameter of carded cotton yarn using image processing and artificial neural networks. The Journal of The Textile Institute 113, 8 (2022), 1648–1657.
[11]
GAV Leaf. 2004. The mechanics of plain woven fabrics. International Journal of Clothing Science and Technology 16, 1/2 (2004), 97–107.
[12]
Junjuan Li, Baoqi Zuo, Chen Wang, and Wenxiao Tu. 2015. A direct measurement method of yarn evenness based on machine vision. Journal of Engineered Fibers and Fabrics 10, 4 (2015), 155892501501000403.
[13]
Jihong Liu, Hongxia Jiang, Ruru Pan, Weidong Gao, and Min Xu. 2012. Evaluation of yarn evenness in fabric based on image processing. Textile Research Journal 82, 10 (2012), 1026–1037.
[14]
Kazi Kutubuddin Sayyad Liyakat, Nilima S Warhade, Rahul S Pol, Hemlata M Jadhav, and Altaf O Mulani. 2022. Yarn quality detection for textile industries using image processing. Journal Of Algebraic Statistics 13, 3 (2022), 3465–3472.
[15]
Yunjiao Ma, Xinhuan Zuo, Lei Wang, Bugao Xu, Ruru Pan, and Weidong Gao. 2022. Three-dimensional measurement of yarn evenness using mirrored images. Measurement 191 (2022), 110834.
[16]
T Meeradevi, S Sasikala, S Gomathi, and K Prabakaran. 2023. An analytical survey of textile fabric defect and shade variation detection system using image processing. Multimedia Tools and Applications 82, 4 (2023), 6167–6196.
[17]
Filipe Pereira, Alexandre Macedo, Leandro Pinto, Filomena Soares, Rosa Vasconcelos, José Machado, and Vítor Carvalho. 2023. Intelligent computer vision system for analysis and characterization of yarn quality. Electronics 12, 1 (2023), 236.
[18]
Monica Puri Sikka, Alok Sarkar, and Samridhi Garg. 2024. Artificial intelligence (AI) in textile industry operational modernization. Research Journal of Textile and Apparel 28, 1 (2024), 67–83.
[19]
Zoran Stjepanovič and Anton Jezernik. 1991. The prediction of cotton yarn properties using artificial intelligence. Computers in Industry 17, 2-3 (1991), 217–223.
[20]
Ishtehar Sharif Swazan and Debanjan Das. 2022. Bangladesh’s emergence as a ready-made garment export leader: an examination of the competitive advantages of the garment industry. International Journal of Global Business and Competitiveness 17, 2 (2022), 162–174.
[21]
Umme Magreba Takebira, ATM Mohibullah, Md Zawadul Hossain, Shajidul Islam Tanim, Md Sharif Ahammad Redoy, Md Lutfar Rahman, Md Shakib Rejwan, et al. 2020. A regular study on yarn count, size box temperature and machine speed to increase weaving efficiency of cotton fabric. Journal of Textile Science and Technology 6, 04 (2020), 168.
[22]
Lei Wang, Yichen Lu, Ruru Pan, and Weidong Gao. 2021. Evaluation of yarn appearance on a blackboard based on image processing. Textile Research Journal 91, 19-20 (2021), 2263–2271.
[23]
Chuqiao Xu, Junliang Wang, Jing Tao, Jie Zhang, and Pai Zheng. 2022. A knowledge augmented deep learning method for vision-based yarn contour detection. Journal of Manufacturing Systems 63 (2022), 317–328.
[24]
Huanhuan Zhang, Shuaikai Cheng, Yan Zhao, Junfeng Jing, Zebin Su, and Pengfei Li. 2024. Measurement of yarn apparent evenness based on modified Canny edge detection. The Journal of The Textile Institute 115, 4 (2024), 600–606.
[25]
Ping Zhong, Zhang Kang, Sen Han, Rui Hu, Jiayu Pang, Xiuyun Zhang, and Fanxia Huang. 2015. Evaluation method for yarn diameter unevenness based on image sequence processing. Textile Research Journal 85, 4 (2015), 369–379.
[26]
Bo Zhu, Zhongjian Li, Xinwei Cao, Jianli Liu, and Weidong Gao. 2018. Dynamic measurement of foam-sized yarn properties from yarn sequence images. Autex Research Journal 18, 3 (2018), 314–322.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
NSysS '24: Proceedings of the 11th International Conference on Networking, Systems, and Security
December 2024
278 pages
ISBN:9798400711589
DOI:10.1145/3704522
Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the owner/author(s).

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 03 January 2025

Check for updates

Author Tags

  1. Yarn Fineness Prediction
  2. Computer Vision
  3. Image Processing
  4. Machine Learning
  5. Yarn Shadow Analysis
  6. Textile Industry
  7. Textile Quality Control

Qualifiers

  • Short-paper

Conference

NSysS '24

Acceptance Rates

Overall Acceptance Rate 12 of 44 submissions, 27%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 288
    Total Downloads
  • Downloads (Last 12 months)288
  • Downloads (Last 6 weeks)76
Reflects downloads up to 05 Mar 2025

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media