A Novel Method for Knitted Fabric Defect Classification Using Image Processing and Weighted Voting Classifiers

A Novel Method for Knitted Fabric Defect Classification Using Image Processing and Weighted Voting Classifiers

Rungrot Suphongwibunphan Thaksin Sangsuwan Jirayut Hansot Wongsakorn Wongsaroj Natee Thong-un*

Department of Mechatronics Engineering, Rajamangala University of Technology Phra Nakhon, Bangkok 10800, Thailand

Department of Instrumentation and Electronics Engineering, King Mongkut’s University of Technology North Bangkok, Bangkok 10800, Thailand

Center of Excellence on Instrumentation Technology and Automation (CEITA), King Mongkut’s University of Technology North Bangkok Prachinburi Campus, Prachinburi 25230, Thailand

Corresponding Author Email: 
natee.t@eng.kmutnb.ac.th
Page: 
1047-1056
|
DOI: 
https://doi.org/10.18280/jesa.570412
Received: 
30 April 2024
|
Revised: 
19 July 2024
|
Accepted: 
5 August 2024
|
Available online: 
27 August 2024
| Citation

© 2024 The authors. This article is published by IIETA and is licensed under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/).

OPEN ACCESS

Abstract: 

This research proposes an application of the image processing device for the detection of knitted fabrics. The machine rolls up knitted fabrics and then the fabrics moves through a detection area, where the camera is connected to the image processing device. Next, an image captured after a defect exists is sent to be processed and analyzed by the NI myRIO device. An area pixel is computed based on Hue, Saturation, and Lightness (HSL) system and interpreted for defect selection. This procedure is performed on region of interest (ROI) to verify the defect. Three defects, examined in this research, consist of small holes, loose threads, and crook knitting needles. These knitted fabric defects are classified from the proposed weighted voting classifier, the results were found that the defects of three knitted fabrics can be accurately predicted. The proposed method can be available to the textile industry.

Keywords: 

defect classification, knitting fabrics, LabVIEW, machine learning, NI myRIO, weighted voting classifier

1. Introduction

"Thailand 4.0" is a policy vision for the economic development of Thailand. The policy has an important mission to reform in various fields of creating a way to develop the country and cope with rapidly new changing opportunities in the 21st century. Before coming to Thailand 4.0, Thailand had been a developing country in Southeast Asia for at least forty years. This led to the fourth era, as known “Thailand 4.0”, establishing a way to develop the country into a new economy country. To achieve real results, the policy aims to level up creativity, innovation, science, technology, and research, after that these activities will be used for the targeted technology and industry groups as follows: 1) Agro-industry and biotechnology group 2) Public health and medical technology 3) Tools, smart devices, robots and electronically controlled mechanics 4) Digital, internet technology that connects and controls various devices including artificial intelligence and embedded system technology and 5) Tourism industries.

Small and medium-sized businesses, called SMEs, are one of the key goals of the 4.0 policy to improve productivity because SMEs have played an important role in driving the Thai economy for a long time. The textile industry is one of the most famous SME businesses in Thailand. Several ten years ago, the government focused on textile factories and always issued measures to promote the textile business. However, with the global economic situation and the economic development of Thailand over the past 40 years, textile sectors have an economic structure that relies on low-wage workers. The implementation of traditional policies has made the textile business to face the high cost-of-living problem for a long time. In order for textile factories to escape from this problem, they therefore have to change their production structure to automation. The current situation of textile factories in Thailand are a small factory that lacks the knowledge of improving automation. These shortcomings are undesirable and adversely affect the quality level of the fabric. Therefore, to upgrade these factories following the policy of the Thailand government, the human error caused the eyesight should be limited as much as possible to step up the standard of productivity. The automated fabric defect detection is needed for the SME textile factories in Thailand 4.0.

Defects that impair the appearance and performance of the fabric can occur during the fiber-fabric manufacturing process or the fabric finishing process. The process of quality control of fabrics is carried out by the human eye on a bright table. The fabric layer is passed from the flaw detection screen on the quality control table. During this process, the resulting fabric defects are detected by quality control position employees. The quality control officer must detect an area about 3 meters wide, making the process time-consuming and boring. However, good quality control staff can detect 60 - 70% errors and can control the width of up to 2 m of the fabric area [1, 2]. This makes quality control procedures objective and statistically insignificant. Fabric faults or defects are responsible for nearly 85% of the defects found in the garment industry [3]. Inspection of fabric defects affects the quality of the fabric because at present most textile factories in Thailand, especially knitted fabric, use human labor as inspectors to inspect fabric defects. Inspection of fabric defects plays on vital role in the quality control department. However, the current situation in Thailand is primarily operated by human inspectors and this intensive labor cannot always focus on the evaluation of fabric in all days. The problem of defects that are small holes (Drop stitches) leads to human errors in eyesight. The eyes of inspectors who have been using it for a long time may have neglected the ability to allow defects to occur. If waste is allowed to enter the next process without warning, it wastes product inspection department time and increases costs. Automatic visual inspection is an attractive solution to human vision. Image processing involving advances in computer algorithms of pattern recognition can provide reliability and stability in product inspection. There have been numerous research papers in the past two decades during which computer vision become one of the most valuable applications [4-8]. The fabric that passes the finishing process uses a minicomputer for an inspector [9, 10]. The study [11] collected the use of image processing technology in detecting various aspects of defects in each type of fabric is presented. These techniques are powerful methods to eliminate the various fabric faults but still have a weak point in which the fault speed cannot be determined on the fabric. This is very significant for guarantee after the defect is detected. A system has been presented for the defect detection and classification of textile fabric in a thermal-based defect classification with a K-nearest neighbor algorithm [12]. This system uses machine learning (ML) for defect classification. According to the results of experiments, the presented algorithm generates an average accuracy rate of 96%. Multiple Gabor Filters and KPCA based on LabVIEW are used for four kinds of defect yarn types [13]. Unsupervised learning based on a multi-scale convolution denoising autoencoder network model to fabric defect is presented [14]. This method has the ability to synthesize results from several pyramid levels, highlighting defective areas through the reconstruction of the remaining maps. Fabric defect detection based on Neural Networks (NN) is proposed [15]. There are also reviews of articles that have gathered articles that have used AI technology to detect and distinguish flaws in fabrics [16, 17]. For the reasons mentioned above, research related to finding flaws in fabrics is also a hot and interesting issue.

Knitting is considered one of the most important industrial sectors of Thailand. As the demand for quality knitted fabrics increases, customers are becoming more aware of the problem of “bad quality” in order to avoid rejecting fabric. Therefore, knitting factories must continuously produce high-quality fabric. Detecting defects during the production of knitted fabrics by circular knitting machines is of great importance for improving quality and productivity. Any changes made to the knitting process must be verified and corrected. Knitting fabric defects, caused by the production, and unable to be repaired, frequently occur and can be classified into three cases: loose threads, crooked knitting needles, and, drop stitches [18]. Human inspection using knitted fabric inspection machines remains the most commonly used method for classifying defects after knitting and finishing. Defects are generally classified by type and by frequency of inspection. Inspection evaluation allows fabric quality to be assessed. Judgment of fabric quality depends on the fault tolerance level set by each knitter.

A voting classifier is a machine learning model that gains experience by training on a collection of several models and forecasts an output (class) based on the class with the highest likelihood of becoming the output [19]. Using a majority vote or the average projected probability, the Voting Classifier combines conceptually distinct machine-learning classifiers to predict class labels. The majority voting classifier is also used for coronary heart disease prediction [20] and Diabetes mellitus prediction [21].

This paper is to first present a majority voting classifier that relies on machine learning to group the defects on knitting fabric of Thai knitting factories. In this research, NI myRIO, which embedded a pre-image processing algorithm, was applied in the textile industry where fabric defects are inspected during the knitting process.

2. Knitting Fabric Defects

Knitting fabric is made from weaving using needles to create interlock loops of interlaced threads. The knitting fabric is processed into a circular pattern using a circular knitting machine, resulting in a shirt with no cuts. Single jersey is the complete characteristic of knitted fabric without defects as shown in Figure 1. The main factor affecting the quality of the fabric produced is defects in the knitting process that cannot be cleaned. It comes from many reasons, but it can be broadly classified into three cases: loose threads, crooked knitting needles, and drop stitches. Defects from loose threads, it is caused by incomplete transfer of the yarn to the knitting needle. The results can be shown in Figure 2. The holes are unusually wide and can be easily observed. The second type is a defect caused by the knitting needles being damaged and unable to make the fabric in the desired position. This is because the defects are flakes and holes that are of a large enough size that the inspector's eyes can observe as shown in Figure 3. The last defect is drop stitches caused by slubs or wax clogging the feeder. The result is holes in the fabric that are difficult to notice compared to other types of defects, as shown in Figure 4. These defects directly result in negative goods (NG). They were necessary to be corrected before moving to the next section.

Figure 1. Knitted fabric with no defects

Figure 2. Knitted fabric with loose threads

Figure 3. Knitted fabric with crooked knitting needles

Figure 4. Knitted fabric with drop stitches

3. Image Processing

From studying the methods for checking fabric defects currently used in textile factories, it was found that the human eye is used to judge the defects in fabric. Therefore, the researcher chose to use the method of judging fabric quality by image processing methods. An image was considered the observed object as space of HSL. It consists of three sub-dimensions: H (hue) represents the lightness of a color, S (saturation) represents saturation, and L (lightness) represents color brightness as shown in Figure 5. These color models were applied for color management and tuning in image processing. It was commonly used in cylindrical coordinate of points in an RGB color model. Red (R), Green (G), and Blue (B) are set in “0” and “1” as follows:

$\begin{aligned} & H=\left\{\begin{array}{ll}\text { undefined } & \text { if } \max =\min \\ 60^{\circ} \times \frac{G-B}{\max -\min }+0^{\circ} & \text { if } \max =R \text { and } G \geq B \\ 60^{\circ} \times \frac{G-B}{\max -\min }+360^{\circ} & \text { if } \max =R \text { and } G \leq B \\ 60^{\circ} \times \frac{G-B}{\max -\min }+120^{\circ} & \text { if } \max =G \\ 60^{\circ} \times \frac{G-B}{\max -\min }+240^{\circ} & \text { if } \max =B\end{array}\right\} \\ & S=\left\{\begin{array}{ll}\frac{\max -\min }{\max +\min }=\frac{\max -\min }{2 L} & \text { if } 0<L \leq \frac{1}{2} \\ \frac{\max -\min }{2(\max +\min )}=\frac{\max -\min }{2-2 L} & \text { if } L>\frac{1}{2} \\ L=\frac{1}{2}(\max +\min )\end{array}\right\}\end{aligned} \\ L=\frac{1}{2}(\max +\min )$                (1)

where, max refers to the largest value of the R, G, or B and min is the smallest value of the R, G, or B. Boundary, called spatial domain, can be represented by f(x,y) where x and y are the vertical and horizontal distances measured from the origin point. Improving images in the spatial domain can be written as in Eq. (2) [22]. f(x,y) is an original image. g(x,y) is the result image of the transformation (T[ ]). T[ ] is a function that is defined in the region around the point (x,y) region of interest (ROI). ROI can be any area within the image by surrounding the area of interest with a circle, square, or any rectangular frame in order to process that specific part of the image. ROI can be shown in Figure 6. ROI of the defects can be automatically detected by the color of background. The color was seen through the hole of defects. Therefore, in the normal case, the fabrics without the defects did not have ROI under an area of color.

$g(x, y)=T[f(x, y)]$      (2)

Figure 5. HSL color dimensional model

Figure 6. Region of interest

4. Machine Learning

The term “machine learning” (ML) refers to the process of helping machines discover their own algorithms without the need for any human-developed algorithms to explicitly tell them what to do [23]. Large language models, computer vision, audio recognition, email filtering, agriculture, and health are just a few areas where machine learning techniques have been used. Predictive analytics is the moniker given to ML when it is applied to various business issues. Despite the fact that not all machine learning is based on statistics, computational statistics is a key source of the field's techniques. Classification is a function that needs the use of ML algorithms that recognize how to assign a class label to examples from the problem. Binary Classification, Multi-Class Classification, Multi-Label Classification, and Imbalanced Classification are the four primary categories of classification problems. Binary classification refers to classification tasks that have two class labels. Binary classification problems often require two classes: one representing the normal state and the other representing the aberrant condition. Multi-class classification does not have the idea of normal and abnormal outcomes, in contrast to binary classification. Multi-class classification refers to tasks with more than two class labels. Popular algorithms that can be used for multi-class classification include k-nearest Neighbors, Decision Trees, Naive Bayes, Logistic Regression, and Support Vector Machines.

A voting classifier is a machine learning model that gains experience by training on a collection of several models and forecasts an output (class) based on the class with the highest likelihood of becoming the output [19]. Using a majority vote or the average projected probability (hard voting), the Voting Classifier combines conceptually distinct machine learning classifiers to predict class labels as follows:

$y=\operatorname{mode}\left\{C_1(x), C_2(x), \ldots, C_m(x)\right\}$        (3)

where, x = attribute, y = prediction, and C(x) = classifier. The hard voting classifier was used for coronary heart disease prediction [20] and Diabetes mellitus prediction [21]. In order to counteract the flaws of a group of equally effective models, such a classifier can be helpful. Soft voting, as opposed to majority voting (hard voting), gives the class label as the maximum of the anticipated probability. Each classifier has a specific weight applied to it using the weights option. The predicted class probabilities for each classifier are gathered, multiplied by the classifier weight, and averaged where weights are given. The class label with the greatest average probability is then used to determine the final class label. To demonstrate this using a straightforward example, let's say that we have three classifiers and a three-class classification issue and that we give each classifier the same amount of weight (w1=0.3, w2=0.5, and w3=0.2) as follows:

$y=\frac{w_1 C_1(x)+w_2 C_2(x)+w_3 C_3(x)+\ldots+w_m C_m(x)}{m}$         (4)

where, m is the classifier numbers, and w is the weight of the classifier. The soft voting classifier was also used to study for predicting brain stroke detection [24] and COVID-19 patient detection [25]. Therefore, all classifier algorithms, mentioned above, were applied for the fabric’s defect classifier inside the proposed idea. The researcher therefore had the idea of applying image processing technology to the textile industry by using the NI myRIO [26] to perform the fabric images.

5. Experimental Setup

This research began by studying problems in the textile industry. From the study, it was found that the fabric quality control process still has problems in the process of inspecting fabric defects. In Figure 7(a), the rotation of the knitted fabric used a belt attached to the roller to force the knitted fabric to move through a defect inspection camera. The structure of the fabric inspection machine was 500 mm wide, 1220 mm long, and 820 mm high. The roller had a length of 450 mm and a diameter of 40 mm. It was driven by a motor to rotate the roller to move the fabric. The structure of the prototype was made of an aluminum profile and had a width of 500 mm., a length of 320 mm., and a height of 400 mm as shown in Figure 7(b). The camera was 310 mm above the detection area so that the camera had a detection area according to the size of the fabric. The inspection point had a light that shone onto the fabric and the speed of releasing the fabric through the camera was 1-5 yards per minute. Region of interest was used to detect defects in knitted fabric by drawing a straight line approximately in the middle of the image and processing it. The detected defected images were spatially modified using HSL color using Red or Hue, Green or Saturation, and Blue or Lightness.

Figure 7. Knitting inspection roller. (a) Detection area, (b) Proposed prototype

Figure 8. Fabric defect inspection control panel

Figure 9. Fabric defect inspection control panel

Figure 8 is the LabView program written to control image processing. The process of checking fabric defects of the proposed prototype had the following steps. Starting when opening the LabView program was performed. The run command started the LabView program with the camera. Then, the camera received the image and processed it on the HSL color system. When the defect of the fabric on ROI was captured with the camera, the image of that deflect was transformed to the white point as shown in Figure 9. The knitted fabric defect inspection tester runs continuously until the entire roll of knitted fabric is finished.

6. Defect Classifiers

Next, the pixel and diameter of the deflect, captured by means of image pre-processing as mentioned previously, was used to identify the type of defect. The 200 samples were divided equally into 3 groups according to the defect type. The outcomes of performing the image pre-processing to determine the defect type are shown in Figure 10. Figure 10(a) and (b) is the defect group, which is classified by diameter and pixels, of inspection speeds at 5 yards per minute and 10 yards per minute, respectively. The diameter captured from the camera was scaled at 10 pixels per centimeter. The defection of small holes had approximate diameters in a range of 0-10 cm and 0 – 100 pixels at an inspection speed of 5 yards per minute. The crooked-knitting-needles problem had an approximate diameter in a range of 0 – 10 cm and 1000 – 2000 pixels at an inspection speed of 5 yards per minute. For loose threads, it had a diameter in a range of 40 – 70 cm and 3000 pixels at an inspection speed of 5 yards per minute. However, when increasing the inspection speed to 10 yards per minute, small holes and crooked knitting needle defects still had the same diameter and pixel, but the loose threads were inaccurate. Next, the defects were grouped by various machine learning algorithm: k-NN, Logical Regression, Naïve Bayes, Random Forrest, Decision Tree, and Support Vector Machine. They have the ability of correctly classifying examples, the low cost of computation time to train, the simplicity of the algorithm, and the ability of the algorithm to perform well unseen data set [27]. In Figure 11, the defects at 5 yards per minute were classified based on a number of neighbors at k = 3, 5, 7, and 9, respectively. The experimental results showed that every k was able to provide 100% of accuracy.

(a)

(b)

Figure 10. Fabric defect (a) inspection speed at 5 yards per minute (b) inspection speed at 10 yards per minute

Figure 11. k-NN classifier at an inspection speed of 5 yards per minute

Logical regression at different solvers is depicted in Figure 12. All solvers had 100% of accuracy without error. This type of predictor has a linear segmentation feature to differentiate defects. Naïve Bayes is presented in Figure 13. For Naïve bayes, complement function could not affect to the defects of both small holes and loose threads. The Bernoulli function was unable to identify the defects at all. The multinomial had 90% of accuracy from the prediction. However, Gaussian function had the most accuracy without error of the prediction. The Naïve Bays classifier is characterized by a diagonal clustering of defects. Random forest classifier, as shown in Figure 14, provided 100% of accuracy in all layers without misprediction. Random Forest provides a method of grouping defects by separating them with vertical and horizontal lines. Decision Tree classifier, considered in the last prediction, also showed 100% of defect prediction as shown in Figure 15. Decision Tree classifier, like random forest, are segmented into vertical and horizontal segments. Support Vector Machine, as shown in Figure 16, had 100% of accuracy for only the polynomial kernel functions. As for other functions, they did not have sufficient ability to separate fabric defects.

Figure 12. Logical regression classifier at an inspection speed of 5 yards per minute

Figure 13. Naïve Bayes classifier at an inspection speed of 5 yards per minute

Figure 14. Random Forest classifier at an inspection speed of 5 yards per minute

Figure 15. Decision Tree classifier at an inspection speed of 5 yards per minute

Figure 16. Support Vector Machine classifier at an inspection speed of 5 yards per minute

Figure 17. k-NN classifier at an inspection speed of 10 yards per minute

Figure 18. Logical regression classifier at an inspection speed of 10 yards per minute

Figure 19. Naïve Bayes classifier at an inspection speed of 10 yards per minute

Figure 20. Random Forest classifier at an inspection speed of 10 yards per minute

It is clear from the above that at a speed of 5 yards per minute all the predictors were able to provide accurate and error-free predictions of defects except Naïve Bays (Bernoulli Function) and Support Vector Machine (linear, sigmoid, RBF).

In the next step of the knitted fabric defect grouping test, the fabric feeding speed was varied to 10 yards per minute. In Figure 17, the k-NN defect classifier can predict defects with 92% of accuracy in all functions. The result of the incorrect prediction is that the defect of a loose thread was predicted to be a defect of crooked knitting needles. However, the k-NN classifier predicted the defect of small holes at 100% of accuracy. The results of the classification of defects in knitted fabrics by the Logical Regression classifier is shown in Figure 18. The results clearly show that the Logical Regression Classifier is accurate and error-free. In the case of Naïve Bayes, as shown in Figure 19, there was 100% of accuracy at Gaussian function. However, at Bernoulli, Complement, and Multinomial functions, they were unable to separate the knitting fabric defects. Random Forest classifier provided 100% of accuracy (depth = 1, 3, and 4), and 98% of accuracy (depth = 2). Random Forest classifier’s results is shown in Figure 20. In Figure 21, Decision Tree classifier at depth = 1 separated two layers of small holes and loose threads but Decision Tree classifier at depth = 2, 3, and 4, had 100% of accuracy. Support Vector Machine’s results, as shown in Figure 22, of only polynomial kernel had 100% of accuracy. From the experiment of varying the speed at 10 yards per minute, it was found that the performance of classifiers decreased. After sifting through the results, the authors assessed the following predictions for the vote: 1. k-NN classifier at k = 9, 2. Logical Regression (LR), 3. Naïve Bayes (NB) at Gaussian function, 4. Random Forest (RF) at depth = 4, Decision Tree (DT) at depth = 4, and Support Vector Machine (SVM) at polynomial kernel.

Figure 21. Decision Tree classifier at an inspection speed of 10 yards per minute

Figure 22. Support Vector Machine classifier at an inspection speed of 10 yards per minute

7. Weighted Voting Classifier

Weighted voting classifier (WVC) is taking the prediction results of the Classifier in the previous topic and evaluating them to find the final answer. The classifier with the highest accuracy is weighted equal to one. The second best accurate was assigned a weight of 0.9, and finally the least accurate one was weighted equal to 0.8. Therefore, ensemble results combine a series of classifiers and the final result is assigned to the corresponding class by using a majority voting algorithm. Tables 1 and 2 are a confusion matrix of weighted voting classifier at 5 and 10 yards per minute of the inspection speed, respectively. For 5 yards per minutes, Table 1 shows the weighted voting classifier's predictions compared to other classifiers. All predictors result can provide all correct answers from the 20 samples for which the answers are given. However, for 10 yards per minute, the results of the experimental result can reveal that predicting defects in knitted fabrics using typical classifiers may not be sufficient for accuracy. Sometimes a classifier is appropriate for some answers but not others. Therefore, combining the advantages of each classifier results in the most accurate knitted fabric defect prediction answer. The weighted voting classifier is presented based on the specific weight of each classifier. Each weighted classifier for assembling the weighted voting classifier is depicted in Table 3.

Table 1. Confusion matrix of weighted voting classifier at the inspection speed = 5 yards per minute

Classifier

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

k-NN

3

1

2

2

1

1

1

1

1

1

1

1

2

2

3

3

2

3

2

3

LR

3

1

2

2

1

1

1

1

1

1

1

1

2

2

3

3

2

3

2

3

NB

3

1

2

2

1

1

1

1

1

1

1

1

2

2

3

3

2

3

2

3

RF

3

1

2

2

1

1

1

1

1

1

1

1

2

2

3

3

2

3

2

3

DT

3

1

2

2

1

1

1

1

1

1

1

1

2

2

3

3

2

3

2

3

SVM

3

1

2

2

1

1

1

1

1

1

1

1

2

2

3

3

2

3

2

3

WVC

3

1

2

2

1

1

1

1

1

1

1

1

2

2

3

3

2

3

2

3

Answer

3

1

2

2

1

1

1

1

1

1

1

1

2

2

3

3

2

3

2

3

Table 2. Confusion matrix of weighted voting classifier at the inspection speed = 10 yards per minute

Classifier

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

k-NN

3

3

2

1

1

3

3

3

2

1

1

2

2

2

3

2

2

2

3

2

LR

3

3

1

2

1

3

3

2

2

1

1

3

2

2

3

2

2

2

3

2

NB

3

3

1

2

1

3

3

3

2

1

1

3

2

2

3

2

2

2

3

1

RF

3

3

1

2

1

3

3

3

2

1

1

3

2

3

3

2

2

2

3

2

DT

3

3

1

2

1

3

3

3

1

1

1

3

2

2

3

2

2

2

3

2

SVM

2

3

1

2

2

3

3

3

2

1

1

3

2

2

3

2

2

2

3

2

WVC

3

3

1

2

1

3

3

3

2

1

1

3

2

2

3

2

2

2

3

2

Answer

3

3

1

2

1

3

3

3

2

1

1

3

2

2

3

2

2

2

3

2

*1 = Small holes, 2 = Crook knitting needles, 3 = Loose threads

Table 3. Weighted factor for voters

Classifier

Weighted Factor

k-NN

0.8

LR

1.0

NB

0.9

RF

0.9

DT

1.0

SVM

1.0

Figure 23. Comparison of the proposed weighted voting classifier at speed inspection = 5 yards per minute

Figure 24. Comparison of the proposed weighted voting classifier at speed inspection = 10 yards per minute

Figures 23 and 24 visualize the boundary of the proposed weighted voting classifier, compared with that of Support Vector Machine, Decision Tree, Naïve Bayes, Random Forest, and k-NN. In Figure 23, the accuracy of the weighted voting classifier at inspection speed = 5 yards per minute predicted every defect; moreover, other classifiers provided 100% of correct answer. This situation is not difficult for grouping because of slow inspection speed. If the inspection speed was varied to 10 yards per minute, a few classifiers predicted answers with high accuracy but the weighted voting classifier provided 100% of accuracy as shown in Figure 24. The random testing data set, generated repeatedly 10 times, was evaluated in Figure 25. The predicted results with free-error of the proposed weighted voting classifier have robustness to different testing data sets.

However, in the case of the speed over than 10 yards per minute, the proposed method was unable to detect the defect because the sampling rate of the camera used in this project was too slow for the inspection speed. Moreover, the lighting for the inspection camera was significant role for accuracy; therefore, the inspection camera was enclosed under the appropriate light within the box as shown Figure 7.

Figure 25. Accuracy comparison in each classifier at different ten testing data set

8. Conclusions

This research solves the problem of detecting defects in knitted fabrics caused by 1. small holes, 2. loose threads, and 3. broken knitting needles. These defects are difficult for the human eye to detect for a long time due to eye fatigue. For this reason, we have presented the application of the NI myRIO device for detecting defects in knitted fabrics in the textile industry in combination with the LabView program and camera. The proposed method utilizes machine learning algorithms to predict defects in knitted fabrics. Machine learning algorithms applied in this paper consists of k-NN, Random Forrest, Naïve Bayes, Decision Tree, and Support Vector Machine. These algorithms precisely predicted defects of knitted fabric in 5 yards per minute of inspection speed but accuracy was not enough for the case of 10 yards per minute. For this reason, the weighted voting classifier was assembled from these machine learning algorithms by utilizing their accuracy. The proposed method was evaluated by randomly different ten testing data set. The results provided 100% of predicted answers, and had more accuracy than other typical classifiers. The research results can be useful in the textile industry where there is a need to reduce the number of workers and reduce waste in production.

Acknowledgements

This research is supported by funding from Faculty of Engineering, King Mongkut’s University of Technology North Bangkok (Grant No.: ENG-64-107).

The authors gratefully acknowledge the help of Rajamangala University of Technology Phra Nakhon (RMUTP), Thailand, for supporting this research and Samai weaving, Prapradang, Thailand, for giving the defects.

  References

[1] Anagnostopoulos, C., Vergados, D., Kayafas, E., Loumos, V., Stassinopoulos, G. (2001). A computer vision approach for textile quality control. The Journal of Visualization and Computer Animation, 12(1): 31-44. https://doi.org/10.1002/vis.245

[2] Rallo, M., Millán, M.S., Escofet, J., Navarro, R. (2002). Wavelet based techniques for textile inspection. Wavelets and Applications. Lecture Notes, 1: 435-466.

[3] Mahajan, P.M., Kolhe, S.R., Patil, P.M. (2009). A review of automatic fabric defect detection techniques. Advances in Computational Research, 1(2): 18-29.

[4] Ngan, H.Y., Pang, G.K., Yung, N.H. (2011). Automated fabric defect detection—A review. Image and Vision Computing, 29(7): 442-458. https://doi.org/10.1016/j.imavis.2011.02.002

[5] Bu, H., Wang, J., Huang, X. (2009). Fabric defect detection based on multiple fractal features and support vector data description. Engineering Applications of Artificial Intelligence, 22(2): 224-235. https://doi.org/10.1016/j.engappai.2008.05.006.

[6] Seçkin, A.Ç., Seckin, M. (2022). Detection of fabric defects with intertwined frame vector feature extraction. Alexandria Engineering Journal, 61(4): 2887-2898. https://doi.org/10.1016/j.aej.2021.08.017

[7] Li, C., Li, J., Li, Y., He, L., Fu, X., Chen, J. (2021). Fabric defect detection in textile manufacturing: A survey of the state of the art. Security and Communication Networks, 2021(1): 9948808. https://doi.org/10.1155/2021/9948808

[8] Jmali, M., Zitouni, B., Sakli, F. (2014). Fabrics defects detecting using image processing and neural networks. In 2014 Information and Communication Technologies Innovation and Application (ICTIA), Sousse, Tunisia, pp. 1-6. https://doi.org/10.1109/ICTIA.2014.7883765

[9] Gorbunov, V., Bobkov, V., Htet, N.W., Ionov, E. (2018). Automated control system of fabrics parameters that uses computer vision. In 2018 IEEE Conference of Russian Young Researchers in Electrical and Electronic Engineering (EIConRus): Moscow and St. Petersburg, Russia, pp. 1728-1730. https://doi.org/10.1109/EIConRus.2018.8317438

[10] Li, C., Gao, G., Liu, Z., Yu, M., Huang, D. (2018). Fabric defect detection based on biological vision modeling. Ieee Access, 6: 27659-27670. https://doi.org/10.1109/ACCESS.2018.2841055

[11] Hanbay, K., Talu, M.F., Özgüven, Ö.F. (2016). Fabric defect detection systems and methods—A systematic literature review. Optik, 127(24): 11960-11973.

[12] Yıldız, K., Buldu, A., Demetgul, M. (2016). A thermal-based defect classification method in textile fabrics with K-nearest neighbor algorithm. Journal of Industrial Textiles, 45(5): 780-795. https://doi.org/10.1177/1528083714555777

[13] Jing, J., Fan, X., Li, P. (2016). Automated fabric defect detection based on multiple Gabor filters and KPCA. International Journal of Multimedia and Ubiquitous Engineering, 11(6): 93-106. https://doi.org/10.14257/ijmue.2016.11.6.09 

[14] Mei, S., Wang, Y., Wen, G. (2018). Automatic fabric defect detection with a multi-scale convolutional denoising autoencoder network model. Sensors, 18(4): 1064. https://doi.org/10.3390/s18041064 

[15] Rebhi, A., Benmhammed, I., Abid, S., Fnaiech, F. (2015). Fabric defect detection using local homogeneity analysis and neural network. Journal of photonics, 2015(1): 376163. https://doi.org/10.1155/2015/376163

[16] Guder, O., Isik, S., Anagun, Y. (2024). Fabric defects identification for textile industry with a deep learning approach. The Journal of the Textile Institute, 1-10. https://doi.org/10.1080/00405000.2024.2383799 

[17] Jun, X., Wang, J., Zhou, J., Meng, S., Pan, R., Gao, W. (2021). Fabric defect detection based on a deep convolutional neural network using a two-stage strategy. Textile Research Journal, 91(1-2): 130-142. https://doi.org/10.1177/0040517520935984

[18] Taher, A., Rahman, M., Jahangir, A., Mia, S., Ashaduzzaman, M. (2016). Study on different types of knitting faults, causes and remedies of knit fabrics. International Journal of Textile Science, 5(6): 119-131. https://doi.org/10.5923/j.textile.20160506.01

[19] Bauer, E., Kohavi, R. (1999). An empirical comparison of voting classification algorithms: Bagging, boosting, and variants. Machine Learning, 36: 105-139. https://doi.org/10.1023/A:1007515423169

[20] Singh, P., Bansal, R., Sharma, S. (2021). Coronary heart disease prediction using voting classifier ensemble learning. In 2021 3rd International Conference on Advances in Computing, Communication Control and Networking: Greater Noida, India, pp. 181-185. https://doi.org/10.1109/ICAC3N53548.2021.9725705

[21] Mushtaq, Z., Ramzan, M.F., Ali, S., Baseer, S., Samad, A., Husnain, M. (2022). Voting classification-based diabetes mellitus prediction using hypertuned machine-learning techniques. Mobile Information Systems, 2022(1): 6521532. https://doi.org/10.1155/2022/6521532

[22] Sayed, M.S. (2016). Robust fabric defect detection algorithm using entropy filtering and minimum error thresholding. In 2016 IEEE 59th International Midwest Symposium on Circuits and Systems: Abu Dhabi, United Arab Emirates, pp. 1-4. https://doi.org/10.1109/MWSCAS.2016.7870031 

[23] Alpaydin, E. (2020). Introduction to Machine Learning. MIT Press.

[24] Srinivas, A., Mosiganti, J. P. (2023). A brain stroke detection model using soft voting based ensemble machine learning classifier. Measurement: Sensors, 29, 100871. https://doi.org/10.1016/j.measen.2023.100871

[25] Manconi, A., Armano, G., Gnocchi, M., Milanesi, L. (2022). A soft-voting ensemble classifier for detecting patients affected by COVID-19. Applied Sciences, 12(15): 7554. https://doi.org/10.3390/app12157554

[26] Rafiq, A. A., Yusuf, M. (2018). Implementation of digital image processing using NI myRIO and Arduino Mega 2560 as controller on Rover bogie robot. In 2018 International Conference on Applied Science and Technology (iCAST): Manado, Indonesia, pp. 210-215. https://doi.org/10.1109/iCAST1.2018.8751506

[27] Bhattacharyya, M. (2023). 10 popular ML algorithms for solving classification problems. Medium. https://medium.com/@howtodoml/10-popular-ml-algorithms-for-solving-classification-problems-b3bc1770fbdc.