Next Article in Journal
Variation in Activation Parameters for the Preparation of Cellulose-Based Porous Carbon Fibers Used for Electrochemical Applications
Previous Article in Journal
Optimizing Synergistic Silica–Zinc Oxide Coating for Enhanced Flammability Resistance in Cotton Protective Clothing
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Advanced Image Analysis and Machine Learning Models for Accurate Cover Factor and Porosity Prediction in Knitted Fabrics: Tailored Applications in Sportswear, Swimwear, and Casual Wear

by
Tomislav Rolich
1,
Daniel Domović
1,*,
Goran Čubrić
2 and
Ivana Salopek Čubrić
3
1
Department of Fundamental Natural and Engineering Sciences, University of Zagreb Faculty of Textile Technology, 10000 Zagreb, Croatia
2
Department of Clothing Technology, University of Zagreb Faculty of Textile Technology, 10000 Zagreb, Croatia
3
Department of Textile Design and Management, University of Zagreb Faculty of Textile Technology, 10000 Zagreb, Croatia
*
Author to whom correspondence should be addressed.
Fibers 2024, 12(5), 45; https://doi.org/10.3390/fib12050045
Submission received: 20 December 2023 / Revised: 19 April 2024 / Accepted: 7 May 2024 / Published: 20 May 2024

Abstract

:
This paper presents a study focused on developing robust algorithms for cover factor and porosity calculation through digital image analysis. Computational models based on machine learning for efficient cover factor prediction based on fabric parameters have also been developed. Five algorithms were devised and implemented in MATLAB: the single threshold algorithm (ST); multiple linear threshold algorithms, ML-1 and ML-2; and algorithms with multiple thresholds obtained by the Otzu method, MT-1 and MT-2. These algorithms were applied to knitted fabrics used for football, swimming, and leisure. Algorithms ML-1 and MT-1, employing multiple thresholds, outperformed the single threshold algorithm. The ML-1 variant yielded the highest average porosity value at 95.24%, indicating the importance of adaptable thresholding in image analysis. Comparative analysis revealed that algorithm variants ML-2 and MT-2 obtain lower cover factors compared to ML-1 and MT-1 but can detect potential void areas in fabrics with higher reliability. Algorithm MT-1 proved to be the most sensitive when it came to distinguishing between different fabric samples. Computational models that were developed based on random tree, random forest, and SMOreg machine learning algorithms predicted cover factor based on fabric parameters with up to 95% accuracy.

Graphical Abstract

1. Introduction

Definition of porosity. Participating in sports is a daily routine for many individuals, whether they are amateurs or professionals. The selection of suitable and comfortable sportswear is a crucial element in achieving peak performance. Comfort, defined as the psychological sensation experienced during physical activity in the current environmental conditions, is paramount. Knitted fabrics are preferred in sportswear manufacturing due to their comfortable properties, characterized by high stretchability and low stress. Given that sports activities lead to the generation of heat and sweat through the contact of clothing with the body, it becomes essential to dissipate heat and release water vapor into the environment, influencing the wearer’s sense of comfort. This phenomenon is intricately tied to the porosity of the garment [1].
The porosity of a fabric is defined as the ratio of the total void area of the fabric to the total surface area of the fabric. Porosity responds to various parameters such as fabric thickness, pore shape and size, and the distribution of space between threads.
Importance of porosity in clothing comfort. Porosity plays a pivotal role in enhancing clothing comfort through its multifaceted impact on various key factors. Primarily, the relationship between porosity and air permeability is crucial, as higher porosity allows for improved airflow through fabrics. This contributes significantly to heat dissipation and the maintenance of a comfortable microclimate between the fabric and the wearer’s skin.
Air permeability is an important factor in fabric comfort as it plays a role in the transport of moisture from the skin to the outside atmosphere, as water vapor travels mainly through the interstitial spaces of the fabric by diffusing air from one side of the fabric to the other [2]. Air permeability depends on the structural parameters of the fabric and porosity, as described by Havlova and Špánková [3].
Moreover, porosity influences moisture management by facilitating efficient wicking and evaporation of sweat, preventing the discomfort associated with damp or wet clothing. Benltoufa et al. confirmed that the amount of liquid absorbed by the garment, as well as the thermal comfort of clothing, are closely related to the pore size and distribution [4].
Beyond functional aspects, the flexibility and stretchability of knitted fabrics are often heightened with higher porosity, enhancing ease of movement. Additionally, the overall feel and texture of a fabric are influenced by the arrangement and distribution of pores, creating a subjective sense of lightness and breathability. Ultimately, porosity is instrumental in tailoring clothing to be adaptable to different activities, ensuring that individuals experience optimal comfort across diverse settings and physical exertions.
Digital image analysis in porosity study. To delve deeper into exploration of porosity, digital image analysis emerges as an invaluable tool, offering a nuanced perspective on fabric structure. In the field of digital image analysis porosity is often investigated in terms of a cover factor. If porosity represents the total void area of the fabric, cover factor is the opposite measure, representing the proportion of the fabric’s surface covered by fibers or yarns.
Since the 1980s, it has been an ongoing mission of scientists to use image analysis for the evaluation of textile properties, including the porosity and description of pore size [5]. The first attempts used to obtain images for textile evaluation were based on the use of a scanner, a microscope with a CCD camera, or a digital camera with a lens. Further attempts were focused towards calculated optical porosity by analyzing white and black images [6,7].
In the most recent studies, Ramatan et al. used digital image analysis to measure pore size. The study also included the investigation of the effect of pore size, pore volume, and air permeability on fluid retention and air transfer [1].
The comparison of different algorithms that can be used to calculate the approximate porosity value of the fabric, such as air permeability calculation, digital image analysis, and geometric modeling, was a main topic of scientific interest of Bentoulfa et al. Their investigation indicated that the air permeability method is best for stretched fabric structures, digital image analysis for fabrics with high porosity, and geometric modeling for determining the shape of any structure’s conformation [4].
Fouda et al. presented a method of image analysis for the determination of pore size distribution [8]. Another group of scientists developed a theoretical model to predict the porosity and air permeability of the knitted fabric before production as a function of the following geometrical parameters: cross-sectional area of each pore, depth of each pore or fabric thickness, and number of pores per unit area [2]. It has been shown that the proposed model can be used to predict porosity with high reliability.
Researchers also developed a computer program to calculate porosity based on the threshold used to convert a digital image from a grayscale to a binary scale and calculate pore size by counting pixels [9].
When conducting the image analysis, image processing is extremely important to reduce the loss of data on the structure and size of individual pores. Owczarek described the influence and importance of image pre-treatment methods for interstitial pore (ITP) detection with the aim of accurately identifying each ITP tissue structure using an optimal pre-treatment algorithm for further quantitative morphometric structural analysis of specialized fabrics [10]. As indicated, the main problem with ITP identification in image analysis was the misclassification of pixels that were close to the edges of the yarn, resulting in image noise among other problems.
Research focus. Against this backdrop, our research endeavors to contribute to this evolving dialogue on textile comfort by contributing to the digital image analysis field with application in knitted fabrics. We present five digital image analysis algorithms—the single threshold algorithm (ST) and two multiple threshold algorithms (ML and MT, each with two variants). The introduction of five new algorithms for calculating porosity is driven by the need for precision and applicability to the specific context of knitted fabric used for football, swimming, and outdoor wear. While existing algorithms may effectively calculate porosity in general scenarios, the intricacies of knitted fabrics necessitate tailored approaches.
Moreover, traditional methods for calculating cover factor and porosity of knitted fabrics can face difficulty when dealing with the inherent complexity of fabric images. This complexity includes variations in color, texture, and structure. To overcome this, we have developed multiple computational models, leveraging machine learning algorithms. These algorithms can investigate the intricacies of the samples and uncover patterns that may not be immediately apparent. Computational models developed in this research can predict the cover factor value based on the parameter specific for each knitted fabric. Through this approach, we aimed to improve the accuracy and efficiency of cover factor and porosity calculation in the textile industry.

2. Materials and Methods

2.1. Fabrics

A set of representative knitted fabrics was carefully selected for use in the manufacture of sportswear and casual clothing to be worn as a single layer against the skin. The fabrics were chosen to cover various applications and were categorized based on their primary purpose:
  • Fabrics for football clothing: samples F1–F9, composed of 100% polyester, were selected for this series.
  • Fabrics for swimwear: samples S1–S9, made of a blend of polyamide and elastane, were chosen.
  • Fabrics for casual wear: samples I1–I4, consisting of various fiber compositions such as viscose, cotton, and modal blended with elastane, were included.
Table 1 provides an overview of the selected fabrics, along with their assigned fabric IDs and respective fiber compositions.
In the experimental part of this study, all fabrics were subjected to testing for mass per unit area and fabric thickness. The mass per unit area was determined by weighing a specimen sized 100 × 100 mm on an analytic scale. Fabric thickness was measured according to the ISO 5084:2003 standard [11], using flat parallel metal plates with a thickness gauge and applying a pressure of 1 kPa during the test. Ten measurements were performed at different locations on each sample to ensure representative data.
The measurements of mass per unit area and fabric thickness were carried out using the Dino-lite AM7915MZT Edge microscope (Dino-Lite, Almere, The Netherlands), which offers a resolution of 5 megapixels and a magnification range of 10–220 times. The average values of mass per unit area m and fabric thickness t for the selected fabrics are presented in Table 2, alongside their standard deviation SD. The obtained fabric images were subsequently utilized in the experimental part of the study.
We selected these fabrics to represent the diverse range of fabrics commonly used in sportswear, swimwear, and casual wear. By including fabrics intended for different purposes, such as football clothing, swimwear, and casual wear, we aimed to capture the variations in fabric composition, structure, and performance that are relevant to these specific applications. This selection allows for a comprehensive evaluation of porosity characteristics and their impact on comfort across different fabric series. The use of a wide range of fabrics ensures that the research findings are applicable to various types of clothing and provides insights that can inform the design and manufacturing of optimized sportswear fabrics.

2.2. Methods

2.2.1. Measuring Porosity Using Cover Factor

Porosity, in the context of knitted fabrics, refers to the extent of void spaces or gaps within a fabric structure. It is defined as the ratio of the total void area to the total surface area of the fabric:
P = areavoid/areatotal
Porosity is an important factor in determining the comfort and functionality of textiles, influencing characteristics such as breathability, moisture management, and thermal comfort.
Cover factor is a measure used in textile engineering to quantify the amount of space occupied by the fibers in a fabric. It represents the ratio of the area covered by fibers to the total surface area of the fabric. A higher cover factor indicates that more of the fabric’s surface is covered by fibers, implying less open space or voids.
The relationship between cover factor (CF) and porosity (P) is mathematically expressed as:
CF = 1 − P
Fabrics with high porosity often have low cover factors, meaning there is more openness or void space between fibers or yarns. Fabrics with low porosity have higher cover factors, indicating that a larger proportion of the fabric is covered by fibers. Both CF and P are expressed as percentage.
The results in this study are presented in terms of cover factor, a common metric used in textile engineering and fabric analysis. Cover factor is a straightforward measure that directly reflects the coverage of fibers on the fabric surface. It is used to provide a clear and easily interpretable representation of the fabric structure.

2.2.2. Algorithms

This section outlines the five developed algorithms for calculating the porosity factor: the simple threshold algorithm (ST) and two variations of multiple thresholds algorithm, the multiple thresholds algorithm (ML) and the multiple thresholds algorithm with Otsu (MT). Programs were implemented in MATLAB [12].
All the developed algorithms employ a series of steps to convert a microscope photograph into a grayscale representation and subsequently calculate the porosity factor, presented in Figure 1. Each step serves a specific purpose and contributes to the overall accuracy and reliability of the algorithm:
  • Grayscale Conversion:
The conversion of the RGB color space to grayscale is necessary to simplify the subsequent porosity calculations. By transforming the image into grayscale, algorithms eliminate color variations that may not directly correlate with the presence of porosity. The weighted average expression used for grayscale conversion follows NTSC formula:
GP = 0.2989R + 0.5870G + 0.1140B
with GP being the gray scale value of a pixel, and R, G, and B being the corresponding red, green, and blue values of a pixel in the original image [13].
2.
Contrast Enhancement:
Enhancing the contrast in the grayscale photograph is crucial for accurate porosity analysis. By adjusting the gray levels to span the entire grayscale range (0–255 or 0–1), the algorithm maximizes the distinction between different gray values. This adjustment helps to reveal subtle variations in intensity, which may correspond to different degrees of porosity in the sample. A wider range of gray levels provides a more detailed representation of the image, allowing for more precise porosity calculations.
3.
Thresholding:
The conversion from grayscale to a binary black-and-white image through thresholding is a fundamental step in the simple threshold algorithm. It categorizes pixels as black or white based on whether their grayscale values fall below or equal to a threshold value. The thresholding operation simplifies the image by creating a clear differentiation between the porous and non-porous regions, which is essential for subsequent pixel counting and cover factor calculation.
4.
Pixel Counting and Cover Factor Calculation:
Once the binary image is obtained, the number of black pixels (representing non-porous regions) and white pixels (representing porous regions) are counted. The cover factor is then calculated as the percentage of white pixels relative to the total number of pixels in the image.
This calculation provides a quantitative measure of the porosity of the sample.
By following these steps, the developed algorithms effectively convert a microscope photograph into a grayscale representation, enhance contrast, isolate porous regions through thresholding, and quantify the porosity factor.

2.2.3. Simple Threshold Algorithm

Following the earlier described procedure, the simple threshold algorithm (ST) aims to convert a microscope photograph into a grayscale representation, which is essential for subsequent porosity calculations. The RGB color space is transformed into grayscale using a weighted average expression (1), whose (R, G, B) weights values of (0.2989, 0.5870, 0.1140) are derived from the standard formula for converting color images to grayscale.
To enhance the contrast in the grayscale photograph, the gray levels are adjusted to span the entire range from 0 to 255. Subsequently, the grayscale image is further converted into a binary black-and-white image using a fixed threshold value T = 200. The value of the hyper parameter T = 200 has been determined after thorough empirical analysis described in Section 4.4.
This thresholding operation categorizes pixels as black or white based on whether their grayscale values are lower or equal to T. The number of black pixels (B) and white pixels (W) are then counted in the resulting binary image. Finally, the cover factor (CF) is calculated as a percentage using Equation (1), which considers the ratio of white pixels to the total number of pixels.
However, we have recognized the potential limitations of a fixed threshold and addressed them by developing algorithms that employ an adaptive thresholding technique to further expand on the ST algorithm. In this context, the simple threshold algorithm with T = 200 serves as a baseline for comparative purposes. By comparing the performance of the adaptive thresholding version (using Otsu’s method) to the fixed threshold version, the effectiveness of the adaptive approach can be assessed and it can be determined whether superior segmentation results are provided.

2.2.4. Multiple Threshold Algorithms

To address the issues arising when using the single threshold algorithm, we have experimented with algorithms using multiple threshold values. We developed the ML (Multiple Threshold) and MT (Multiple Threshold with Otsu) algorithms as alternative approaches to calculate porosity. These algorithms offer additional flexibility and potential improvements over the simple threshold algorithm (ST) by introducing multiple thresholds and more refined pseudo-grayscale transformations.
The purpose of the ML and MT algorithms is to provide a more nuanced analysis of porosity by incorporating multiple thresholds instead of a single threshold value. This allows for a more detailed characterization of porosity within the sample, capturing variations in intensity that may correspond to different levels of porosity. The ML and MT algorithms aim to enhance the accuracy and precision of porosity calculations by introducing more sophisticated image processing techniques.
In the ML algorithm, the grayscale image is first linearly divided into eight equal parts to obtain multiple thresholds. This division allows for a more detailed differentiation of grayscale values. Each pixel is assigned a pseudo-grayscale value between 1 and 8 based on its corresponding threshold range T1 to T8.
To convert the pseudo-grayscale image into a binary black-and-white image, pixels with values from 1 to 7 are set to black, while pixels with a value of 8 are set to white. The number of black pixels (B) and white pixels (W) are then counted, and the cover factor is calculated using Equation (1).
A second version of the ML algorithm, ML-2, was created to further refine the porosity calculation. In this variation, pixels with pseudo-grayscale values from 1 to 6 are categorized as black, while those with a value of 7 or 8 are set to white to further experiment with enhancing segmentation accuracy. The remaining steps, including pixel counting and cover factor calculation, remain the same as in the previous version. Pixels with values of 7 and 8 represent the porosity in the knit, where pixels with a value of 8 indicate complete absence of porosity and those with a value of 7 denote potentially porous areas.
To further address the limitations that arise from using a fixed threshold set of ML algorithms, we have incorporated an adaptive thresholding technique that dynamically adjusts the threshold based on the image’s characteristics, hence creating the MT algorithm. An adaptive thresholding technique, such as Otsu’s, can automatically determine the optimal threshold value for each image, considering its specific features and reducing the reliance on a fixed threshold. This adaptability can enhance the algorithm’s robustness and segmentation accuracy across a wider range of images and conditions.
The MT algorithm employs multiple thresholds to convert the grayscale image into a pseudo-grayscale image. Instead of linearly dividing the grayscale range, the Otsu method is utilized to dynamically determine the thresholds. The Otsu method, described in [14] and implemented in MATLAB, calculates optimal threshold values (T1 to T8) specific to each photograph by maximizing the between-class variance of pixel intensities, effectively separating the foreground and background regions. By applying Otsu’s method, the algorithm can dynamically determine a threshold value that is better-suited to the image characteristics, improving the segmentation accuracy compared to using a fixed threshold.
The subsequent steps of assigning pseudo-grayscale values, converting to a binary black-and-white image, pixel counting, and cover factor calculation follow the same principles as in the ML algorithm. A second version of the MT algorithm was developed, in which the photograph is converted to black-and-white, so that all pseudo-grayscale values with a value of 1 to 6 become black, and all pseudo-grayscale values with a value of 7 to 8 become white.
Figure 2 depicts the procedural steps and histograms of the grayscale and pseudo-grayscale images for the ML and MT algorithms and the differences on the original image each step produces. These visual representations aid in understanding the transformations and highlight the differences between the algorithms.
The key difference between the ML and MT algorithms lies in the determination of threshold values and the subsequent pseudo-grayscale transformations. In the ML algorithm, the grayscale range is divided into eight equal parts, and threshold values (T1 to T8) are linearly distributed. These thresholds are empirically chosen to create a pseudo-grayscale image with values ranging from 1 to 8, while in the MT algorithm the grayscale range is divided into eight parts using the Otsu method. The Otsu method automatically calculates threshold values (T1 to T8) based on the image’s statistical properties, optimizing the separation of porous and non-porous regions.
The pseudocode for all algorithms is provided in Figure 3. It encompasses the procedures for obtaining the microscope photograph, enhancing image contrast, converting the photo to grayscale, and determining the cover factor using the appropriate formula based on the algorithm.
Moreover, Figure 4 presents the pseudocode for the “OBTAIN PSEUDO IMAGE” function, an essential component of the ML and MT algorithms. This function calculates the thresholds and assigns pseudo-grayscale values according to the specific requirements of each algorithm.

2.3. Machine Learning

In recent years, machine learning has emerged as a powerful tool in the field of computer science. It involves the development of data-driven models that can automatically identify and recognize patterns from large sets of data. This unique ability has made machine learning an indispensable tool in fields such as image recognition, natural language processing, and financial forecasting [15].
One area where machine learning has shown great potential is in the analysis of digital images and for prediction models. The complexities and unique structures present in knitted fabrics can make it challenging for traditional computer algorithms to accurately analyze and classify them. However, with the adaptability and advanced pattern recognition abilities of machine learning models, these challenges can be overcome [16,17].
Through the utilization of machine learning algorithms, we have produced computational models that possess the ability to accurately predict the porosity values of knitted fabrics, without the necessity for complex digital image analysis. To achieve this, we utilized fabric parameters such as the mass per unit and thickness of the fabric as input values for the models, and the cover factor of the fabric as the output.
To create these models, we utilized the WEKA suite developed by the machine learning group at the University of Waikato, New Zealand. This suite offers a vast collection of algorithms and tools that enable researchers to build highly accurate and efficient predictive models [18].
For this study, we focused on regression models as they are best suited for numeric results and exclusively deal with numeric attributes. Some of the regression models used in this study include trees, such as alternating random tree and random forest, which utilize a decision tree algorithm to make predictions based on input data. Functions like linear regression, multilayer perceptron, and support vector machine (SMOReg) were also utilized to construct predictive models. In addition to these algorithms, we also employed lazy methods such as K-nearest neighbor classifier (Ibk) and K* (KStar), which use nearest neighbor matching to make predictions. Lastly, we incorporated meta techniques like additive regression, which combines multiple models to achieve a more accurate prediction.

2.4. Research Hypothesis

Based on the proposed algorithms and obtained material, the following research hypotheses have been posed:
H1. 
Algorithms ML-1 and MT-1 that use adaptive thresholding will obtain higher cover factor than the basic algorithm with a fixed threshold ST-1.
H2. 
Algorithms with higher threshold segmentation, i.e., ML-2 and MT-2, will recognize the underlying knitted fabric structure and will obtain lower cover factor than their counterparts ML-1 and MT-1.
H3. 
MT-1 algorithm, which uses Otzu adaptive thresholding, will be the most sensitive algorithm to different fabric structures.
H4. 
A machine learning model can predict cover factor based on knitted fabric parameters with high accuracy.

3. Results

3.1. Cover Factor Results per Sample in a Dataset

Multiple samples of knitted fabrics in the F, S, and I series were analyzed using five algorithms: ML-1, ML-2, MT-1, MT-1, and ST. The results, specifically cover factors, are summarized in Table 3, Table 4, and Table 5, respectively. The cover factor was calculated for a total of 22 knitted samples, each identified by a specific code (F1–F9, S1–S9, I1–I4). Multiple pictures of each sample were taken. Samples F1–F9 consisted of five photos each, as did samples S1, S3, S6, S8, and I1–I3. Samples S2, S4, S5, and S9 consisted of eight photos. Sample S7 consisted of ten photos and sample I4 consisted of four photos.
Table 3 features results for nine knitted samples in series F, labeled F1, F2, …, F9. Each row in the table corresponds to a specific sample from knitted samples, identified as F1-1, F1-2, …, F9-5, depending on how many photos of a knitted sample were obtained. The columns represent different algorithms for cover factor calculation. In each field a cover factor obtained for a sample using one of the five algorithms is noted. The value of a cover factor is expressed as a percentage. For example, for sample F1-1, the cover factor values obtained using the ML-1, ML-2, MT-1, MT-2, and ST algorithms are 86.30%, 83.13%, 86.63%, 82.04%, and 84.77%, respectively.
We can generalize that higher cover factors are preferable since they indicate lower porosity (although this generalization will be discussed and analyzed later in the paper).
Table 4 and Table 5 consist of cover factors for the knitted samples in the S and I series, respectively. The structure of these tables is similar to Table 3, with rows representing different samples and columns representing different algorithms.
Additional insights are provided by averaging the cover factors for all photos in each of the samples. Table 6 presents the resulting cover factors obtained from all algorithms, accompanied by descriptive statistical parameters:
  • Arithmetic mean (AVG): the average cover factor value for each algorithm and sample.
  • Standard deviation (STDEV): the measure of the dispersion or variability of the cover factor values for each algorithm and sample.
  • Relative standard deviation (REL STDEV): the standard deviation expressed as a percentage of the arithmetic mean.
  • Minimum (MIN): the lowest cover factor value observed for each algorithm across all samples.
  • Maximum (MAX): the highest cover factor value observed for each algorithm across all samples.
  • Range (RANGE): the difference between the maximum and minimum values for each algorithm.
The table presents cover factor values (%) obtained by five algorithms (ML-1, ML-2, MT-1, MT-2, and ST) for different samples within three fabric series (F, S, and I).
Detailed analysis of parameters including the average, standard deviation, variance, minimum, maximum and range of each sample per each method is presented in Supplementary Table S1.
Based on the results displayed in Table 6, we observed that ML-1 generally has higher cover factor values compared to ML-2, MT-1, MT-2, and ST, across most samples. There is considerable variability in cover factor values within each fabric series and algorithm.
In the examination of fabric series, distinct trends emerge. In the football clothing (F series), ML-1 consistently exhibits elevated cover factor values, surpassing other algorithms. Notably, Sample F5 stands out with the highest range of cover factor values, reaching 6.61%. The swimwear (S series) also showcases ML-1’s tendency towards higher cover factor values, with Sample S5 demonstrating the most considerable variability, boasting a wide cover factor range of 32.00%. The differences are larger for samples S2, S4, S5, S7, S9, and I3. It should be noted that for these samples we encountered difficulties in determining cover factor. The fabric in sample S7 was dark. In samples S5 and S9, the fabric was two-colored, dark blue and white, which further complicated the calculation of porosity factor. Other challenges included the fact that the contrast algorithm greatly altered the photo (sample S4), the fabric was relatively porous (sample S2), or the structure of the fabric was irregular (sample I3), all of which made it very difficult to determine what was knitted and what was not (i.e., holes in the mesh). A more reliable cover factor could be calculated with the simple threshold algorithm, but with a higher threshold value than T = 200.
In contrast, the casual wear (I series) reveals a nuanced picture. While ML-1, ML-2, and ST exhibit comparable cover factor values, Sample I3 within this series displays a noteworthy range of cover factor values, indicating substantial variability at 11.98%. These fabric series analyses underscore the algorithmic nuances in capturing porosity, offering valuable insights into the distinctive characteristics of each series.
In algorithmic comparison, ML-1 consistently exhibits the highest average cover factor values, followed by ML-2, MT-1, MT-2, and ST. ML-2, MT-1, MT-2, and ST generally show lower variability (lower STDEV and REL STDEV) compared to ML-1.
To sum up, ML-1 tends to yield higher cover factor values compared to other algorithms. Variability in cover factor values suggests algorithmic sensitivity to the fabric structure or characteristics. Further statistical tests will be conducted to assess significant differences between algorithms. The observed differences may have implications for the choice of algorithm depending on the specific requirements of the application.
In Figure 5, box-and-whisker plots have been made, representing obtained data for five algorithms across all samples.

3.2. Computational Models Based on Machine Learning for Cover Factor Prediction Based on Parameters of Knitted Fabric

In this section, we present computational models based on machine learning developed for predicting porosity in knitted fabrics using the knitted fabric parameters mass per unit area and thickness of knitted fabric. The regression model was implemented using WEKA 3.9.6 [18] on a dataset with 127 instances of two attributes, mass per unit and thickness of the fabric, taken from Table 2, and a class value for algorithm taken from Table 3, Table 4 and Table 5.
A comprehensive comparative analysis of nine regression models created in Weka was conducted. The developed models were: (1) random tree, (2) random forest, (3) linear regression, (4) multilayer perceptron, (5) support vector machine (SMOreg in Weka), (6) k-nearest neighbor classifier (IbK in Weka), (7) K* (KStar in Weka), (8) additive regression, and (9) regression by discretization.
These models were employed with their default parameter as set in WEKA. Model evaluation was conducted using 10-fold cross-validation, wherein the dataset was randomly divided into 10 equal-sized subsamples. One subsample was utilized for model validation, while the remaining nine were employed for training the model, following the principles outlined in [19]. Each experiment was iterated 10 times, each iteration employing a distinct random seed, resulting in a total of 100 results per model.
The results of the obtained correlation coefficients are presented in Table 7. Correlation coefficients close to 1 indicate a strong linear relationship between the predicted and actual values. The asterisk sign (*) in the superscript indicates the base model obtained a statistically higher result than the model it is compared to. The base model in this research is the random tree model. Similarly, the v sign in the superscript indicates the base model obtained a statistically lower result than the model it is compared to. For example, a correlation coefficient value of 0.95 obtained by the random tree model is statistically significantly higher than the one obtained by the linear regression model at 0.51, with significance α = 0.05.
Linear regression and k-nearest neighbor classifier have comparatively lower correlations, while random tree, random forest, support vector machine, and K* show strong correlations. Although the latter four models might obtain results with similar accuracy and can be used for porosity prediction, the random tree model is shown in Figure 6 due to its simplicity and error analysis in Section 4.5.

4. Discussion

In this research, five algorithms were developed for cover factor calculation: ST and improvement algorithms MT-1, MT-2, ML-1, and ML-2. In this section, we delve into the development and comparison of cover factor calculation algorithms. Notably, ML and MT differ in threshold determination and subsequent pseudo-grayscale transformations. In ML-1, the grayscale range is evenly divided into eight parts, employing empirically chosen thresholds (T1 to T8) for creating a pseudo-grayscale image. Contrastingly, MT-1 utilizes the Otsu method for threshold calculation, optimizing the separation of porous and non-porous regions. Both algorithms then undergo a pseudo-grayscale to binary conversion, enhancing segmentation accuracy and accounting for image variations. This refinement allows for a more precise differentiation between the background and the fabric regions, leading to better identification and calculation of the cover factor.
An additional attempt to account for image variations was made with ML-2 and MT-2 algorithms. Fabric images can exhibit variations in color, texture, and complexity. By defining additional threshold ranges (1–6 as black and 7–8 as white), we account for such variations and adapt the segmentation algorithm to better handle the specific characteristics of their fabric images. These improvements, grounded in empirical observations, fine-tune the segmentation process, enabling more precise porosity calculation than the ST algorithm.

4.1. Assessing the Influence of Multiple and Adaptive Thresholding: Comparative Analysis of ML-1 and MT-1 with ST

In this part of the study, the influence of the adaptive thresholding processing steps on the performance of ML-1, MT-1, and ST algorithms is investigated across all samples. The goal was to assess hypothesis H1 that algorithms ML-1 and MT-1 will obtain higher cover factors than the basic algorithm with a fixed threshold ST. Visual comparison is presented in Figure 5.
The statistical significance of the results was evaluated using the Wilcoxon signed-rank test, a non-parametric test for paired samples [20]. Like other non-parametric tests, the Wilcoxon signed-rank test does not make any assumptions about the distribution of the differences, specifically the absence of a normal distribution assumption. This test is typically used when analyzing pairs of measurements from the same subjects under two different conditions, or when there exists a one-to-one relationship between the two samples, with each value in one group corresponding to one value in the other group. The Wilcoxon signed-rank test calculates the comparison between the positive and negative ranks of the differences [21].
Null hypothesis of Wilcoxon signed-rank test claims there is no difference between the variables ML-1 [%] and ST [%]. Results indicated that there is a significant large difference between ST (median = 94.4, n = 127) and ML-1 (median = 96.4, n = 127), Z = 9.8, p < 0.001, r = 0.9, with significance level 0.95. The null hypothesis is thus rejected.
Results of the two-tailed Wilcoxon signed-rank test also indicated that there is a significant medium difference between MT-1 (median = 96, n = 127) and ST (median = 94.4, n = 127), Z = 9.8, p < 0.001, r = 0.9, with significance level 0.95. Null hypothesis that there is no difference between the variables MT-1 [%] and ST [%] is thus rejected.
Additionally, results of the Wilcoxon signed-rank test indicated that there is a significant medium difference between ML-1 (median = 96.4, n = 127) and MT-1 (median = 96, n = 127), Z = −4.8, p < 0.001, r = −0.4.
These findings suggest that utilizing the adaptive thresholding processing steps was effective in improving the performance of the algorithms for calculating porosity, thus making hypothesis H1 valid. Overall, the results underscore the importance of the adaptive thresholding processing steps in enhancing the accuracy and reliability of porosity calculations. The superiority of both ML-1 and MT-1 over ST highlights the potential of advanced algorithms and the validity of incorporating adaptive thresholding processing steps in porosity analysis.

4.2. Assessing the Impact of a Higher Threshold in ML-2 and MT-2 on Porosity Calculation: Comparison of ML-1 vs. ML-2 and MT-1 vs. MT-2 Algorithms

Accurately determining the cover factor of digital knitted fabric images presents its own set of challenges. One significant hurdle is the presence of stray yarns or fibers, posing difficulties in their distinction and introducing noise that can distort image analysis. These irregularities have the potential to impact cover factor precision, as the algorithm might misinterpret these stray elements. Additionally, variations in lighting conditions can cast shadows or shading, disrupting the perceived darkness or lightness of certain areas and significantly affecting the thresholding process. Recognizing these challenges, we pinpointed the selection of an appropriate threshold as a pivotal step in overcoming these issues. To tackle this, a larger threshold was integrated into the ML-1 and MT-1 algorithms, enhancing the accuracy of cover factor calculations.
As stated in Section 2, algorithm versions indicated with “−2” were created to further refine the porosity calculation by transforming pixels with pseudo-grayscale values from 1 to 6 and categorizing them as black, while those with a value of 7 or 8 were set to white. By categorizing pixels with specific pseudo-grayscale values as black or white, we aimed to better differentiate between the regions representing porous and non-porous areas in the image. This simplification of the pixel values could help create a clearer boundary between porosity and non-porosity, thereby improving the accuracy of the porosity calculation by not including stray yarns that are present in the porosity holes due to their structure. In addressing these considerations and implementing necessary measures, our goal was to minimize the margin of error in determining the cover factor from digital yarn images.
In this section, we present the results of the statistical analysis of cover factor calculation algorithms: ML-1 vs. ML-2, and MT-1 vs. MT-2. The aim was to assess the validity of hypothesis H2. We test whether ML-2 and MT-2 will recognize the underlying knitted fabric structure and will obtain better results than their counterparts ML-1 and MT-1. Visual comparison is presented in Figure 5.
To determine whether there were significant differences between the paired samples, the non-parametric Wilcoxon signed-rank test was employed [20,22]. The null hypothesis assumed no difference between the first and second version of each ML or MT model, while the alternative hypothesis suggested a significant difference between them.
Results of the two-tailed Wilcoxon signed-rank test indicated that there is a significant large difference between ML-1 (median = 96.4, n = 127) and ML-2 (median = 92.4, n = 127), Z = −9.8, p < 0.001, r = −0.9 at α = 0.05. Results also indicate that there is a significant large difference between MT-1 (median = 96, n = 127) and MT-2 (median = 89.5, n = 127), Z = −9.8, p < 0.001, r = −0.9, at α = 0.05.
The comparison between ML2 and MT2 and the results of the Wilcoxon signed-rank test indicated that there is a significant large difference between ML-2 (median = 92.4, n = 127) and MT-2 (median = 89.5, n = 127), Z = −7.3, p < 0.001, r = −0.7, with significance level 0.95.
Additionally, since the ML-1 [%] group had higher values than the ML-2 [%] group, we performed a one-tailed Wilcoxon signed rank. The null hypothesis that the variable ML-1 [%] has a smaller or equal value compared to the variable ML-2 [%] was tested using a one-tailed t-test for paired samples. The result was statistically significant, W = 0, p ≤ 0.001. The null hypothesis was rejected.
Lastly, the MT-1 [%] group had higher values than the MT-2 [%] group. The null hypothesis that the variable MT-1 [%] has a smaller or equal value compared to the variable MT-2 [%] was tested using a one-tailed t-test for paired samples. The result was statistically significant, at α = 0.05, W = 0, p ≤ 0.001. The null hypothesis is thus rejected, and hypothesis H2 has been confirmed.
When comparing the performance of two algorithms for porosity prediction, it is generally better to have a smaller porosity value, i.e., higher cover factor. A smaller porosity value indicates that there is less empty space and more solid fabric, which is often desired in various applications. However, despite the conventional preference for smaller porosity values, our research introduces a nuanced perspective. We believe that ML-2 and MT-2, despite yielding lower cover factor values (indicative of higher porosity) than ML-1 and MT-1, are anticipated to perform more effectively in capturing the true essence of fabric structure and to provide a more accurate representation of the actual fabric porosity, e.g., avoiding capturing stray yarns.

4.3. Analysis of Algorithmic Sensitivity to Cover Factor Calculations for Different Knitted Fabric Types

Fabrics designed for different purposes (football clothing—F, swimwear—S, and casual wear—I) inherently possess distinct structural features. These differences manifest in terms of cover factor and porosity, and algorithms capture these variations differently. Understanding the variations in cover factor across different fabric series is crucial for application-specific design, moisture management, and performance optimization. For example, certain sports demand specific fabric properties: swimwear benefits from quick-drying fabrics with high porosity while football clothing may require a balance between breathability and stretchability.
The primary objective of this study is to determine how sensitive each of the developed algorithms is to the specific fabric structure, by systematically comparing the cover factor values among distinct fabric series (Figure 7). By doing so, we will assess H3 that assumes MT-1 algorithm, that uses Otzu adaptive thresholding method, will be the most sensitive algorithm in recognizing different fabric structures.
Since F, S, and I are three distinct knitted fabrics series, the cover factor value should also be statistically significantly different, and a sufficiently sensitive algorithm should be able to distinguish the groups. Due to the distinct distribution for ML-2 and MT-2 observed in Figure 7, the hypothesis will be tested on the ML-1, MT-1, and ST algorithms.
To confirm this assumption, a non-parametric Kruskal–Wallis test was employed to assess the statistical difference of three fabric groups, F, S, and I, based on the cover factor results obtained by ML-1, MT-1, and ST [20,23]. Null hypothesis of the Kruskal–Wallis test is there is no difference between the three categories of the independent variable in terms of the dependent variable. The alternative hypothesis is there is a difference between the three categories of the independent variable in terms of the dependent variable.
For ML-1, the Kruskal–Wallis H test indicated that there is a significant difference in the dependent variable between the different groups, χ2(2) = 29.82, p < 0.001, with a mean rank score of 73.31 for F, 47.27 for S, 94.92 for I. The post-hoc Dunn’s test using a Bonferroni corrected at α = 0.017 indicated that the mean ranks of the following pairs are significantly different: F-S and S-I.
For MT-1, the Kruskal–Wallis H test indicated that there is a significant difference in the dependent variable between the different groups, χ2(2) = 30.16, p < 0.001, with a mean rank score of 71.82 for F, 47.71 for S, and 96.9 for I. The post-hoc Dunn’s test using a Bonferroni corrected α = 0.017 indicated that the mean ranks of the following pairs are significantly different: F-S, F-I and S-I.
For ST, the Kruskal–Wallis H test indicated that there is a significant difference in the dependent variable between the different groups, χ2(2) = 37.8, p < 0.001, with a mean rank score of 76.29 for F, 44.6 for S, 96.47 for I. The post-hoc Dunn’s test using a Bonferroni corrected α = 0.017 indicated that the mean ranks of the following pairs are significantly different: F-S and S-I.
The results of this study indicate that only the MT-1 algorithm can distinct the nuanced differences among knitted samples by recognizing series F, S, and I as statistically significantly different series, while ML-1 and ST recognize F-S and S-I as statistically significantly different series, therefore confirming H3.
Additional conclusions of this study are: (i) different algorithms interpret or quantify porosity in unique ways since they emphasize different aspects of the fabric structure, leading to variations in porosity calculations, (ii) some algorithms might be more sensitive to certain types of fabric structures or variations in porosity, and (iii) the yarn structure has an influence on the porosity levels observed in the fabric.

4.4. Comparison of Fixed Threshold vs. Adaptive Threshold Methods and Selection of Hyperparameter T

The choice of the threshold value T can significantly impact the performance of the algorithms. Using fixed threshold value for image segmentation has its benefits and drawbacks. One benefit of using a fixed threshold value, such as T = 200 in ST algorithm, is the simplicity it brings to the implementation. By choosing a specific threshold, the need for complex adaptive thresholding techniques is eliminated. This simplification makes the algorithms easier to understand and implement, reducing the complexity of the overall process.
Another advantage is the stability and reproducibility it offers in the results. When the same fixed threshold value is used across different datasets or experiments, the algorithms can produce consistent outcomes. This consistency facilitates easier comparison and analysis of the results, as researchers can rely on the stability of the threshold value.
However, there are also drawbacks to using fixed threshold values. One major drawback is the lack of adaptability. Fixed thresholds may not be optimal for all images or datasets. Different images can possess varying characteristics, such as differences in lighting, contrast, or noise levels. These variations can significantly affect the effectiveness of a fixed threshold. Consequently, a single threshold value may not be suitable for all situations, potentially leading to suboptimal segmentation results.
Furthermore, using a fixed threshold can make the algorithm sensitive to image variations. If the image quality changes or the characteristics of the objects being segmented vary, the chosen fixed threshold value may no longer be appropriate. This sensitivity to image variations can result in either over-segmentation (where objects are split into smaller regions) or under-segmentation (where objects are merged together), ultimately compromising the accuracy of the algorithm’s segmentation results.
We have chosen the value of T = 200 based on empirical observations and experimentation. In Table 8, the results of the analysis of the samples using the simple threshold algorithm with threshold values other than 200 are listed for samples S4, S5, S7, and S9. In the case of sample S4, the contrast was not corrected and the threshold was set to T = 140. As for sample S5, the contrast was corrected but the threshold was set to T = 240. In the case of sample S7, the contrast was corrected and the threshold was set to T = 245. It is worth noting that photos 1 to 5 were taken before contrast enhancement, while photos 6 to 10 were taken after contrast enhancement, resulting in significant differences between these two subgroups. For the photos in sample S9, the contrast was corrected and the threshold was set to T = 240. The algorithm’s performance with different threshold values for specific samples was subsequently investigated, and the results of the obtained cover factors using ST algorithm are presented in Table 8.
In the case of sample S4, a lower threshold value of T = 140 was experimented with, due to the uncorrected contrast in the photographs of sample S4. By reducing the threshold, an attempt was made to compensate for the lower contrast and potentially improve the segmentation results. For sample S5, although the contrast was corrected, the threshold was increased to T = 240. The higher threshold was chosen based on the specific image characteristics of sample S5, which required a higher threshold to accurately distinguish between foreground and background regions. Similarly, for sample S7, the contrast was corrected, and the threshold was set to T = 245. The threshold value was chosen based on the image characteristics of sample S7, requiring a higher threshold due to the specific properties of the objects in the image. In contrast, for sample S9, with corrected contrast, the threshold value of T = 240 was reverted to. Threshold T = 240 was found suitable for achieving satisfactory segmentation results for this sample.
After evaluating the algorithm’s performance on a representative set of images, it was determined that T = 200 yielded satisfactory results in terms of segmentation accuracy, computational efficiency, and ease of implementation.
However, we recognized the potential limitations of a fixed threshold and addressed that by developing algorithms that employ an adaptive thresholding technique (the Otsu method) to further expand on the ST algorithm. In this context, the simple threshold algorithm with T = 200 serves as a baseline for comparative purposes. By comparing the performance of the adaptive thresholding version (using Otsu’s method) to the fixed threshold version, the effectiveness of the adaptive approach can be assessed and it can be determined whether it provides superior segmentation results.

4.5. Error Analysis and Comparative Performance Evaluation of Machine Learning Models

This section presents an in-depth error analysis of the computational models presented in Section 3.2. Since the primary focus is on understanding the correlation between various models and the actual porosity values of the knitted fabrics, the following metrics have been observed: the correlation coefficient across all models in Table 7, mean absolute error (MAE), root mean square error (RMSE), relative absolute error (RAE), and root relative squared error (RRSE) in Table 9.
Error analysis for algorithm MT-1 is presented in Table 9 because it has been proven to be the most sensitive in Section 4.3. Error analysis, however, has been performed on all 5 algorithms and they all support the conclusion in this section.
To determine the significance of differences between the predictive capabilities of the algorithms, a paired t-test was employed in Weka, with significance α = 0.05. The random tree model served as a base model for statistical comparison shown in Table 9. The asterisk sign (*) in the superscript indicates the base model obtains statistically higher result than the model it is compared to. Similarly, the (v) sign in the superscript indicates the base model obtains statistically lower result than the model it is compared to.
Mean absolute error (MAE) represents the average absolute difference between predicted and actual values. Lower MAE values indicate better model performance. Random tree, random forest, and support vector machine have low MAE, suggesting better accuracy.
Root mean square error (RMSE) provides a measure of the average magnitude of errors. Lower values are desirable. Random tree, random forest, support vector machine, and K* show lower RMSE, indicating better predictive performance.
Similar to MAE and RMSE, lower values are better for both relative metrics. Random tree, random forest, k-nearest neighbor classifier, and K* exhibit lower relative errors.
In conclusion, random tree, random forest, and support vector machine models exhibit strong performance across multiple metrics with non-significantly different results, hence confirming hypothesis H4.

5. Conclusions

In this research we introduced and explored five algorithms—ST, MT-1, MT-2, ML-1, and ML-2—to study cover factor and porosity in knitted fabrics, with focus on knitted fabrics for sportswear, swimwear, and casual wear. We have also created computational models based on machine learning algorithms for cover factor prediction based on knitted fabric structural parameters.
The common steps for all the developed algorithms include grayscale conversion, contrast enhancement, thresholding, pixel counting, and cover factor calculation. The key difference between them is threshold selection. The single threshold algorithm (ST) relies on a fixed threshold, offering simplicity in its approach. In contrast, the multiple linear threshold algorithms (ML-1 and ML-2) and multiple threshold algorithms with the Otzu method (MT-1 and MT-2) introduce additional threshold ranges to account for variations in color, texture, and complexity in the pseudo-grayscale image conversion step. In ML algorithms, the grayscale range is divided linearly to perform pseudo-grayscale transformations with empirically chosen thresholds, while in the MT algorithms the Otsu method is used for threshold calculation, optimizing porous and non-porous region separation.
In algorithmic comparison, ML-1 consistently exhibits the highest average cover factor values. Comparing fixed (ST) and adaptive threshold (ML and MT) algorithms highlighted the advantages of the simplicity and stability of a fixed threshold. Yet, exploring alternative adaptive algorithms like Otsu’s method suggests room for further refinement, acknowledging the limitations of fixed thresholds in adapting to diverse image characteristics. Our investigation into the impact of adaptive thresholding (ML-1 and MT-1) validated our hypothesis (H1) that these algorithms outperform the fixed threshold algorithm (ST). This emphasizes the pivotal role of adaptive steps in beefing up the accuracy and reliability of porosity calculations.
Tackling challenges related to stray yarns and lighting variations, the use of a higher threshold in ML-2 and MT-2 demonstrated superior recognition of fabric structure, supporting H2. Despite these algorithms yielding lower cover factors, they proved more effective in capturing the true essence of fabric porosity by minimizing errors linked to stray elements.
Our sensitivity analysis across different fabric types (F, S, and I) affirmed H3, with MT-1 showing sensitivity and recognizing distinct fabric series as statistically significant. Sensitivity to fabric variations makes MT-1 a valuable tool for considering specific design aspects in textile manufacturing.
Lastly, computational regression models based on machine learning have been developed that are able to predict cover factor based on knitted fabric parameters with high accuracy. Random tree, random forest, and SMOreg models exhibit strong performance across multiple statistical metrics.

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/fib12050045/s1, Table S1: Descriptive statistical analysis of samples per each method.

Author Contributions

Conceptualization, T.R. and D.D.; methodology, T.R. and D.D.; software, T.R.; validation, D.D.; formal analysis, D.D.; investigation, D.D. and T.R.; resources, G.Č. and T.R.; data curation, G.Č. and T.R.; writing—original draft preparation, D.D., T.R., G.Č., and I.S.Č.; writing—review and editing, D.D., T.R., G.Č., and I.S.Č.; visualization, D.D. and T.R.; supervision, T.R.; project administration, I.S.Č.; funding acquisition, I.S.Č. All authors have read and agreed to the published version of the manuscript.

Funding

This work has been supported in part by the Croatian Science Foundation under the project IP-2020-02-5041 Textile Materials for Enhanced Comfort in Sports–TEMPO, and research grants given by the University of Zagreb TP/15-2024 and TP/16-2024.

Data Availability Statement

Data is contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

References

  1. Ramratan; Kumar, R.; Sood, S. A Study on Porosity Related Aspects of Cotton Knitted Fabric with Single Jersey Structure for Improved Comfort Application for Garment. JTEFT 2020, 6, 199–204. [Google Scholar] [CrossRef]
  2. Mezarcioz, S.; Ogulata, R.T. Modelling of Porosity in Knitted Fabrics. J. Fash. Technol. Text. Eng. 2015, s1, 1–3. [Google Scholar] [CrossRef]
  3. Havlová, M.; Špánková, J. Porosity of Knitted Fabrics in the Aspect of Air Permeability—Discussion of Selected Assumptions. Fibres Text. East. Eur. 2017, 25, 86–91. [Google Scholar] [CrossRef]
  4. Benltoufa, S.; Fayala, F.; Cheikhrouhou, M.; Nasrallah, S.B. Porosity determination of jersey structure. AUTEX Res. J. 2007, 7, 7. [Google Scholar] [CrossRef]
  5. Stipaničev, D. Introduction to Digital Image Processing and Analysis; University of Split: Split, Croatia, 1994. [Google Scholar]
  6. Wardiningsih, W.; Troynikov, O. Influence of Cover Factor on Liquid Moisture Transport Performance of Bamboo Knitted Fabrics. J. Text. Inst. 2012, 103, 89–98. [Google Scholar] [CrossRef]
  7. Tàpias, M.; Ralló, M.; Escofet, J.; Algaba, I.; Riva, A. Objective Measure of Woven Fabric’s Cover Factor by Image Processing. Text. Res. J. 2010, 80, 35–44. [Google Scholar] [CrossRef]
  8. Ragab, A.; Fouda, A.; El-Deeb, H.; Abou-Taleb, H. Determination of Pore Size, Porosity and Pore Size Distribution of Woven Structures by Image Analysis Techniques. J. Text. Sci. Eng. 2017, 7, 5. [Google Scholar] [CrossRef]
  9. Imrith, M.K.; Unmar, R.; Rosunee, S. Determination of Knitted Fabric Porosity Using Digital Imaging Techniques. Adv. Mater. Sci. Eng. 2016, 2016, 1–10. [Google Scholar] [CrossRef]
  10. Owczarek, M. The Impact and Importance of Fabric Image Preprocessing for the New Method of Individual Inter-Thread Pores Detection. AUTEX Res. J. 2020, 20, 250–262. [Google Scholar] [CrossRef]
  11. ISO 5084:1996; Textiles—Determination of Thickness of Textiles and Textile Products. ISO Central Secretary, International Organization for Standardization: Geneva, Switzerland, 1996.
  12. MATLAB, 8.6.0.267246 (R2015b); The MathWorks Inc.: Natick, MA, USA, 2015.
  13. Gonzalez, R.C.; Woods, R.E. Digital Image Processing, 3rd ed.; Prentice Hall: Upper Saddle River, NJ, USA, 2008; ISBN 978-0-13-168728-8. [Google Scholar]
  14. Otsu, N. A Threshold Selection Method from Gray-Level Histograms. IEEE Trans. Syst. Man Cybern. 1979, 9, 62–66. [Google Scholar] [CrossRef]
  15. Bhavsar, P.; Safro, I.; Bouaynaya, N.; Polikar, R.; Dera, D. Chapter 12—Machine Learning in Transportation Data Analytics. In Data Analytics for Intelligent Transportation Systems; Chowdhury, M., Apon, A., Dey, K., Eds.; Elsevier: Amsterdam, The Netherlands, 2017; pp. 283–307. ISBN 978-0-12-809715-1. [Google Scholar]
  16. Das, S.; Wahi, A. Digital Image Analysis Using Deep Learning Convolutional Neural Networks for Color Matching of Knitted Cotton Fabric. J. Nat. Fibers 2022, 19, 15716–15722. [Google Scholar] [CrossRef]
  17. Fabijańska, A.; Jackowska-Strumiłło, L. Image Processing and Analysis Algorithms for Yarn Hairiness Determination. Mach. Vis. Appl. 2012, 23, 527–540. [Google Scholar] [CrossRef]
  18. Frank, E.; Hall, M.A.; Witten, I.H. The WEKA Workbench. Online Appendix for “Data Mining: Practical Machine Learning Tools and Techniques”, 4th ed.; University of Waikato: Hamilton, New Zealand, 2006. [Google Scholar]
  19. McCormick, C. K-Fold Cross-Validation, with MATLAB Code. Available online: http://mccormickml.com/2013/08/01/k-fold-cross-validation-with-matlab-code/ (accessed on 16 June 2019).
  20. Parab, S.; Bhalerao, S. Choosing Statistical Test. Int. J. Ayurveda Res. 2010, 1, 187. [Google Scholar] [CrossRef] [PubMed]
  21. Wilcoxon Signed Rank Test Calculator. Available online: https://www.statskingdom.com/175wilcoxon_signed_ranks.html (accessed on 28 November 2023).
  22. Wilcoxon Signed-Rank Test Calculator. Available online: https://www.socscistatistics.com/tests/signedranks/default2.aspx (accessed on 28 November 2023).
  23. Kruskal Wallis Test Calculator—With Post-Hoc Dunn’s Test Multiple Comparisons. Available online: https://www.statskingdom.com/kruskal-wallis-calculator.html (accessed on 28 November 2023).
Figure 1. The steps for converting a photograph taken with a microscope to a black and white photograph include utilizing a grayscale converter, enhancing contrast, and converting to black and white using thresholding.
Figure 1. The steps for converting a photograph taken with a microscope to a black and white photograph include utilizing a grayscale converter, enhancing contrast, and converting to black and white using thresholding.
Fibers 12 00045 g001
Figure 2. The figure depicts a digital image as it passes through the different stages of the ML and MT algorithms. The figure presents the original photo (A), grayscale photos (B), grayscale photos with enhanced contrast (C), pseudo-grayscale photos (D), black-and-white photos obtained by ML-1 and MT-1 algorithms (V1), and by ML-2 and MT-2 algorithm (V2), grayscale photos histogram (H1), and pseudo-grayscale photo histogram (H2).
Figure 2. The figure depicts a digital image as it passes through the different stages of the ML and MT algorithms. The figure presents the original photo (A), grayscale photos (B), grayscale photos with enhanced contrast (C), pseudo-grayscale photos (D), black-and-white photos obtained by ML-1 and MT-1 algorithms (V1), and by ML-2 and MT-2 algorithm (V2), grayscale photos histogram (H1), and pseudo-grayscale photo histogram (H2).
Fibers 12 00045 g002aFibers 12 00045 g002b
Figure 3. Pseudocode of ST, ML1, ML2, MT1, and MT2 algorithm.
Figure 3. Pseudocode of ST, ML1, ML2, MT1, and MT2 algorithm.
Fibers 12 00045 g003
Figure 4. Pseudocode of _OBTAIN PSEUDO IMAGE_ function.
Figure 4. Pseudocode of _OBTAIN PSEUDO IMAGE_ function.
Fibers 12 00045 g004
Figure 5. Box plot of ML-1, MT-1, and ST obtained through all samples.
Figure 5. Box plot of ML-1, MT-1, and ST obtained through all samples.
Fibers 12 00045 g005
Figure 6. Random tree model from Weka.
Figure 6. Random tree model from Weka.
Fibers 12 00045 g006
Figure 7. Violin plots in blue, red and yellow represent the distributions of the results of ML-1 algorithm (a), ML-2 algorithm (b), MT-1 algorithm (c), MT-2 algorithm (d), and ST algorithm (e) for samples in F, S and I series respectively.
Figure 7. Violin plots in blue, red and yellow represent the distributions of the results of ML-1 algorithm (a), ML-2 algorithm (b), MT-1 algorithm (c), MT-2 algorithm (d), and ST algorithm (e) for samples in F, S and I series respectively.
Fibers 12 00045 g007
Table 1. Overview of selected fabrics.
Table 1. Overview of selected fabrics.
Nr.Fabric IDFibre Composition
Main YarnPlating Yarn
1F1100% polyester-
2F2100% polyester-
3F3100% polyester-
4F4100% polyester-
5F5100% polyester-
6F6100% polyester-
7F7100% polyester-
8F8100% polyester-
9F991% polyester9% elastane
10S180% polyamide20% elastane
11S280% polyamide20% elastane
12S378% polyamide22% elastane
13S478% polyamide22% elastane
14S559% polyamide41% elastane
15S673% polyamide27% elastane
16S780% polyamide20% elastane
17S872% polyamide28% elastane
18S971% polyamide29% elastane
19I193% viscose7% elastane
20I290% cotton10% elastane
21I389% modal11% elastane
22I491% cotton9% elastane
Table 2. Mass per unit area and thickness of selected fabrics.
Table 2. Mass per unit area and thickness of selected fabrics.
Nr.Fabric IDImagem, g/m2
SD
t, mm
SD
Nr.Fabric IDImagem, g/m2
SD
t, mm
SD
1F1Fibers 12 00045 i001100
0.03323
0.548
0.0063
12S3Fibers 12 00045 i002198
0.01134
0.561
0.0032
2F2Fibers 12 00045 i003145
0.00223
0.632
0.0092
13S4Fibers 12 00045 i004209
0.00127
0.527
0.0116
3F3Fibers 12 00045 i005178
0.05112
0.830
0.0047
14S5Fibers 12 00045 i006226
0.03555
0.495
0.0085
4F4Fibers 12 00045 i007135
0.05775
0.739
0.0120
15S6Fibers 12 00045 i008113
0.00647
0.358
0.0063
5F5Fibers 12 00045 i009125
0.04469
0.488
0.0042
16S7Fibers 12 00045 i010216
0.01244
0.502
0.0103
6F6Fibers 12 00045 i011157
0.02754
0.618
0.0042
17S8Fibers 12 00045 i012160
0.03456
0.404
0.0097
7F7Fibers 12 00045 i013155
0.03099
0.491
0.0137
18S9Fibers 12 00045 i014184
0.03371
0.450
0.0170
8F8Fibers 12 00045 i015145
0.02618
0.556
0.0107
19I1Fibers 12 00045 i016223
0.06001
0.679
0.0320
9F9Fibers 12 00045 i017180
0.05941
0.492
0.0155
20I2Fibers 12 00045 i018135
0.11001
0.689
0.0080
10S1Fibers 12 00045 i019187
0.00768
0.655
0.0053
21I3Fibers 12 00045 i020160
0.09002
0.672
0.0131
11S2Fibers 12 00045 i021171
0.00713
0.655
0.0108
22I4Fibers 12 00045 i022170
0.05000
0.695
0.0170
Table 3. Cover factors for samples in the F series.
Table 3. Cover factors for samples in the F series.
Algorithm for Cover Factor Calculation
SampleML-1 [%]ML-2 [%]MT-1 [%]MT-2 [%]ST [%]
F1-186.3083.1386.6382.0484.77
F1-285.6883.0585.9482.1584.39
F1-384.7982.6785.4583.0383.76
F1-486.2983.3786.5882.3384.85
F1-585.1082.7385.5282.5583.93
F2-192.3389.2092.4087.2190.93
F2-294.0191.4093.9088.6592.86
F2-394.7292.4494.5889.5293.71
F2-497.9295.9697.5992.8997.02
F2-594.8992.5494.7989.6793.86
F3-191.5190.5691.7189.5591.09
F3-288.2086.6288.6486.9787.49
F3-388.9687.6689.3087.3788.35
F3-490.4389.2790.3587.8089.85
F3-588.0486.5788.1085.5087.37
F4-198.0496.1898.0495.2197.08
F4-298.2296.6397.9994.1197.61
F4-398.0494.9397.8892.2796.68
F4-498.1796.5798.3195.4697.58
F4-598.3196.6098.1593.9697.61
F5-197.2793.7997.0691.4095.84
F5-296.9293.1596.1590.0695.22
F5-397.5493.9697.2491.4095.90
F5-497.6694.3196.9690.8696.32
F5-597.3293.7296.5789.9695.69
F6-198.3197.5498.7397.7597.89
F6-298.0996.8697.7794.5697.45
F6-398.2797.2097.7894.7297.69
F6-498.2796.8998.4296.7997.67
F6-598.1797.1098.0396.0997.63
F7-197.9495.6197.6093.3796.86
F7-297.7494.8597.4392.8696.44
F7-397.9595.9697.8394.5497.02
F7-497.7095.0098.0194.3896.30
F7-597.9395.7598.0495.0697.03
F8-198.5197.5198.2795.5898.09
F8-298.4097.6198.8697.8297.99
F8-398.4497.6398.1194.9898.08
F8-498.1496.8997.5994.9297.45
F8-598.3497.4398.1895.6097.91
F9-198.3697.1098.1495.1497.78
F9-298.4897.0598.7095.8097.90
F9-397.5692.1596.9488.8195.67
F9-498.0194.3897.3989.4596.82
F9-597.9994.4297.7992.9296.76
Table 4. Cover factors for samples in the S series.
Table 4. Cover factors for samples in the S series.
Algorithm for Cover Factor Calculation
SampleML-1 [%]ML-2 [%]MT-1 [%]MT-2 [%]ST [%]
S1-198.3697.1498.4196.8697.80
S1-298.2495.2898.2493.5797.05
S1-398.0495.0797.6292.3196.69
S1-498.0695.4097.8092.2196.95
S1-598.1996.8398.1995.3797.62
S2-194.0985.3093.4284.1389.71
S2-294.2886.8993.7584.8690.52
S2-393.9885.8492.9084.2689.62
S2-493.5485.1793.2284.4788.98
S2-592.6685.4091.9483.6388.81
S2-693.1584.6393.1584.6388.48
S2-792.3583.2692.3582.4287.33
S2-892.8285.1991.6683.7488.72
S3-196.4092.1396.0790.3994.30
S3-296.3392.2896.0090.7094.28
S3-396.3892.2996.0591.0094.40
S3-496.4792.5296.1590.8994.52
S3-596.6392.7396.7891.7594.66
S4-195.5485.0094.7080.8891.44
S4-296.3587.7895.2081.9692.84
S4-395.7584.2094.1877.1990.93
S4-495.0083.3993.0578.6890.50
S4-595.7782.1494.0576.9890.22
S4-696.2181.5494.4979.1490.67
S4-795.6082.7394.0177.4990.41
S4-895.8683.2494.0778.8890.35
S5-186.8656.0483.2957.3672.00
S5-288.1358.4888.1364.9573.86
S5-383.0650.5484.9560.5966.19
S5-483.5354.2781.5356.9668.81
S5-586.0452.0181.3153.2068.22
S5-688.0556.3984.5557.8073.18
S5-787.7456.1085.2358.7773.35
S5-887.5753.0485.7955.5870.44
S6-196.3692.7596.5991.0594.63
S6-296.0491.2895.1688.4793.79
S6-396.3792.5495.6789.9394.58
S6-496.5492.6896.0290.0894.72
S6-595.8190.9895.1988.3093.39
S7-178.3061.3278.3061.3269.14
S7-294.5084.0892.5579.4289.63
S7-378.1360.5779.6760.5768.71
S7-480.6861.6382.1963.2671.36
S7-578.0558.5279.6760.1268.21
S7-680.9364.5280.9364.5272.21
S7-794.2784.9792.6480.6489.75
S7-894.2383.7591.7878.1689.33
S7-993.6183.0392.3379.8888.81
S7-1094.3482.9693.1381.3489.09
S8-198.1496.4098.6896.7297.27
S8-297.9896.1698.2595.8397.05
S8-398.0796.6698.3696.0697.36
S8-497.8396.0198.4896.3096.85
S8-597.9596.0898.3596.2597.04
S9-195.8387.0794.2378.4892.71
S9-295.3186.1093.5178.8691.87
S9-395.2887.1693.9980.2792.09
S9-495.7888.2194.7283.0492.75
S9-595.5087.3294.2880.1192.39
S9-694.1678.0192.3073.0488.04
S9-795.2985.5793.9179.7191.70
S9-895.6188.6794.1083.3792.54
Table 5. Cover factors for samples in the I series.
Table 5. Cover factors for samples in the I series.
Algorithm for Cover Factor Calculation
SampleML-1 [%]ML-2 [%]MT-1 [%]MT-2 [%]ST [%]
I1-198.8498.6098.9198.6598.73
I1-298.7598.3998.9998.7598.57
I1-398.7798.4698.9498.6298.62
I1-498.7098.1998.7798.1998.43
I1-598.7698.4398.9098.6898.60
I4-196.5895.9196.9696.5096.24
I4-297.9597.5098.1797.9297.72
I4-394.7693.9694.6192.6594.36
I4-498.5397.9498.9898.4698.22
I4-597.8797.2498.5097.8497.55
I2-198.2396.6398.1495.4197.51
I2-298.0595.7797.5392.8597.02
I2-398.1996.0898.1995.3297.08
I2-498.2296.7098.5196.3797.48
I2-597.9995.9698.2095.1697.11
I3-196.8888.6895.5782.8393.82
I3-297.1989.1496.0983.1894.53
I3-396.8288.7395.5483.1293.81
I3-497.0692.5696.4487.3495.52
I3-597.6493.1197.2489.2696.05
Table 6. Descriptive statistics for cover factor values for all samples.
Table 6. Descriptive statistics for cover factor values for all samples.
SampleML-1 [%]ML-2 [%]MT-1 [%]MT-2 [%]ST [%]AVGSTDEVREL
STDEV
MINMAXRANGE
F185.6382.9986.0282.4284.3484.281.601.89%82.3586.023.68
F294.7792.3194.6589.5993.6893.002.162.32%89.5994.795.20
F389.4388.1489.6287.4488.8388.690.941.06%87.3789.642.27
F498.1696.1898.0894.2097.3196.791.661.72%94.2098.183.98
F597.3493.7996.7990.7495.8094.892.692.84%90.7497.346.61
F698.2297.1298.1495.9897.6797.430.981.00%95.9498.342.40
F797.8595.4397.7894.0496.7396.371.651.71%94.0497.933.89
F898.3697.4198.2095.7897.9097.531.091.12%95.7498.462.72
F998.0895.0297.7992.4296.9996.062.382.49%92.4298.125.70
S198.1895.9498.0594.0697.2296.691.731.79%94.0698.194.12
S293.3685.2192.8084.0289.0288.884.274.81%84.0293.369.34
S396.4492.3996.2190.9594.4394.082.402.55%90.9596.475.53
S495.7683.7594.2278.9090.9288.717.198.11%78.9095.7616.86
S586.3754.6184.3558.1570.7670.8514.6320.69%54.6186.6132.00
S696.2292.0595.7389.5694.2293.562.772.96%89.5696.276.71
S786.7172.5486.3270.9279.6279.227.539.85%70.6087.1716.57
S897.9996.2698.4296.2397.1297.201.011.03%96.0798.422.35
S995.3586.0193.8879.6191.7689.326.517.32%79.6195.3515.73
I198.7698.4198.9098.5898.5998.650.200.20%98.4198.900.49
I497.1496.5197.4496.6796.8296.920.470.49%96.2597.471.23
I298.1496.2398.1195.0297.2496.951.351.40%95.0298.243.21
I397.1290.4496.1885.1494.7592.734.955.36%85.1497.1211.98
MIN85.6354.6184.3558.1570.76
AVG95.2489.9494.9088.2092.80
MAX98.7698.4198.9098.5898.59
Table 7. Correlation coefficient obtained by machine learning models created in Weka across all samples. The superscript asterisk (*) serves as an indicator, denoting that the baseline model, specifically the random tree model, as shown in column (1), achieved a significantly higher outcome when compared to the model with the presence of an asterisk.
Table 7. Correlation coefficient obtained by machine learning models created in Weka across all samples. The superscript asterisk (*) serves as an indicator, denoting that the baseline model, specifically the random tree model, as shown in column (1), achieved a significantly higher outcome when compared to the model with the presence of an asterisk.
TreesFunctionsLazyMeta
Algorithm(1)(2)(3)(4)(5)(6)(7)(8)(9)
ML-10.900.900.23 *0.23 *0.900.21 *0.890.820.88
ML-20.940.940.52 *0.82 *0.940.53 *0.930.87 *0.91
MT-10.920.920.26 *0.49 *0.920.30 *0.920.84 *0.91
MT-20.950.940.55 *0.82 *0.950.55 *0.940.85 *0.92 *
ST0.930.930.42 *0.74 *0.930.42 *0.920.85 *0.88 *
Table 8. Revised analysis for samples S4, S5, S7, and S9 for simple threshold algorithm with value threshold values different than T = 200.
Table 8. Revised analysis for samples S4, S5, S7, and S9 for simple threshold algorithm with value threshold values different than T = 200.
SampleST [%]SampleST [%]SampleST [%]SampleST [%]
S4-199.93S5-195.39S7-189.23S9-197.92
S4-299.89S5-296.16S7-289.49S9-297.69
S4-399.82S5-393.96S7-392.12S9-397.67
S4-499.86S5-493.69S7-489.58S9-497.78
S4-599.84S5-595.44S7-590.85S9-597.70
S4-699.94S5-696.05S7-697.98S9-697.40
S4-799.95S5-795.90S7-797.84S9-797.63
S4-899.98S5-896.19S7-897.75S9-897.61
S7-997.91
S7-1097.94
Table 9. Error analysis for algorithm MT-1. The superscript v sign (v) serves as an indicator, denoting that the baseline model, specifically the random tree model, as shown in column (1), achieved a significantly lower outcome when compared to the model with the presence of a v sign.
Table 9. Error analysis for algorithm MT-1. The superscript v sign (v) serves as an indicator, denoting that the baseline model, specifically the random tree model, as shown in column (1), achieved a significantly lower outcome when compared to the model with the presence of a v sign.
TreesFunctionsLazyMeta
Factors(1)(2)(3)(4)(5)(6)(7)(8)(9)
Mean absolute error1.201.213.68 v3.67 v1.203.31 v1.37 v1.99 v1.34 v
Root mean square error2.052.064.79 v4.74 v2.054.77 v2.152.67 v2.15
Relative absolute error31.8732.3897.57 v97.46 v31.8786.20 v36.63 v53.38 v35.88 v
Root relative squared error42.5842.8599.46 v98.30 v42.5897.47 v44.8855.52 v45.05
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

Rolich, T.; Domović, D.; Čubrić, G.; Salopek Čubrić, I. Advanced Image Analysis and Machine Learning Models for Accurate Cover Factor and Porosity Prediction in Knitted Fabrics: Tailored Applications in Sportswear, Swimwear, and Casual Wear. Fibers 2024, 12, 45. https://doi.org/10.3390/fib12050045

AMA Style

Rolich T, Domović D, Čubrić G, Salopek Čubrić I. Advanced Image Analysis and Machine Learning Models for Accurate Cover Factor and Porosity Prediction in Knitted Fabrics: Tailored Applications in Sportswear, Swimwear, and Casual Wear. Fibers. 2024; 12(5):45. https://doi.org/10.3390/fib12050045

Chicago/Turabian Style

Rolich, Tomislav, Daniel Domović, Goran Čubrić, and Ivana Salopek Čubrić. 2024. "Advanced Image Analysis and Machine Learning Models for Accurate Cover Factor and Porosity Prediction in Knitted Fabrics: Tailored Applications in Sportswear, Swimwear, and Casual Wear" Fibers 12, no. 5: 45. https://doi.org/10.3390/fib12050045

APA Style

Rolich, T., Domović, D., Čubrić, G., & Salopek Čubrić, I. (2024). Advanced Image Analysis and Machine Learning Models for Accurate Cover Factor and Porosity Prediction in Knitted Fabrics: Tailored Applications in Sportswear, Swimwear, and Casual Wear. Fibers, 12(5), 45. https://doi.org/10.3390/fib12050045

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop