Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

Hybrid feature-based machine vision method for objective evaluation of textile pilling and fuzzing

  • Qingchun Jiao ,

    Roles Conceptualization, Methodology, Project administration, Supervision, Writing – review & editing

    jiaoqch@zust.edu.cn

    Affiliation School of Automation and Electrical Engineering, Zhejiang University of Science and Technology, Hangzhou, China

  • Zifan Qian,

    Roles Data curation, Investigation, Validation, Visualization, Writing – original draft

    Affiliation School of Automation and Electrical Engineering, Zhejiang University of Science and Technology, Hangzhou, China

  • Yue Dong,

    Roles Data curation, Investigation, Resources

    Affiliation Zhejiang Institute of Quality Science, Hangzhou, China

  • Bo He

    Roles Funding acquisition, Resources, Supervision

    Affiliation Zhejiang Institute of Quality Science, Hangzhou, China

Abstract

The degree of pilling and fuzzing in textile fabrics is a crucial indicator of textile product quality. Current evaluation methods predominantly rely on subjective judgments, leading to issues such as rating errors and inefficiency. To achieve objective assessment of pilling and fuzzing grades, this study proposes a Hybrid Feature-Based Machine Vision Method for Objective Evaluation of Textile Pilling and Fuzzing. The method incorporates a Hybrid Feature-based Depthwise Separable Attention Network for Objective Evaluation of Textile Pilling and Fuzzing (HDAN-PF), which effectively extracts and fuses frequency and Space domain features. A Channel Attention mechanism enhances the model’s ability to capture subtle features, while Depthwise Separable Convolutions reduce computational complexity, improving evaluation speed while maintaining high accuracy.The model size is approximately 327.37 MB with a total parameter count of 135,115,512. Experimental results demonstrate that the proposed method achieves a classification accuracy of 96.26% on diverse fabric images, showcasing robust generalization and practical utility.By leveraging this machine vision approach, the proposed method offers a transformative solution for achieving objective, consistent, and efficient assessments of pilling and fuzzing grades, advancing textile quality evaluation practices.

Introduction

Textiles, as a primary component of many products, directly impact the quality and comfort of the final goods [1]. With rising living standards, consumer expectations for fabric quality and tactile experience have also become more refined [2]. However, pilling and fuzzing frequently occur on fabric surfaces due to fiber friction and structural changes, forming particle clusters that detract from both appearance and performance, including hand feel and abrasion resistance [3,4]. Complaints regarding pilling and fuzzing constitute approximately 29.51% of textile quality issues [5], underscoring the importance of these characteristics in quality assessment.

Currently, pilling level detection in textiles is primarily conducted through manual visual inspection, which, due to the diversity in fabric types and pilling degrees, demands substantial expertise from inspectors [6]. Prolonged visual inspection often leads to subjective fatigue, introducing variability in inspection results. To ensure consistency, multiple experts are typically involved in joint reviews, which is both time-intensive and costly [7]. This context highlights the need for an objective, automated evaluation system.This context highlights the need for an objective, automated evaluation system, as a textile pilling and fuzzing quality evaluation system can automate fabric quality assessment, reduce human detection errors, and improve detection efficiency. It enhances product consistency and promotes the industry’s transition toward smart manufacturing, automation, and digitalization.

In response, researchers have explored computer image processing technology to achieve more objective and efficient fabric pilling evaluations. Current methods include Space domain techniques that analyze color or grayscale information for pilling detection and frequency domain techniques that use frequency information to distinguish pills from fabric [8]. However, each approach has limitations: Space domain methods are vulnerable to image noise, while frequency domain methods are sensitive to image size and morphology [9].

To overcome these limitations, this paper presents a Hybrid Feature-Based Machine Vision Method for Objective Evaluation of Textile Pilling and Fuzzing. This approach integrates frequency and Space domain characteristics, leveraging preprocessed grayscale images to capture fabric texture features. Retaining grayscale images helps mitigate noise effects when processing textured patterns, enhancing classification accuracy.We further developed a Hybrid Feature-based Depthwise Separable Attention Network for Objective Evaluation of Textile Pilling and Fuzzing (HDAN-PF), which is based on deep convolutional neural networks. We optimized the number of inception modules and convolution kernel sizes to achieve an optimal balance between network depth, generalization capability, and computational cost. By coordinating the application of the attention mechanism and Depthwise Separable Convolution (DSC) technology, we not only optimized the model structure but also improved computational efficiency. The main contributions of this paper are as follows:

  1. (1) We propose a Hybrid Feature-Based Machine Vision Method that effectively combines frequency domain, Space domain, and grayscale image features for objective evaluation of pilling and fuzzing.
  2. (2) We design the HDAN-PF, incorporating the Coordinate Attention (CA) mechanism to enhance the detection accuracy of pilled and fuzzed areas.
  3. (3) We utilize DSC technology to reduce computational complexity and improve the model’s operational speed.
  4. (4) We construct a diverse dataset covering various fabric types, textures, colors, and patterns to validate the model’s generalization across different samples.

Related work

Current status of objective evaluation of fabric pilling and fuzzing performance

To enhance textile quality and user experience, accurately evaluating the pilling and fuzzing performance of fabrics is of great significance. This not only affects the appearance retention and durability of products during use but also serves as an important reference for textile companies in product research and development and quality control. Various testing methods simulating real-world wearing or washing environments have been established in the industry to detect pilling and fuzzing phenomena caused by friction on fabric surfaces [10]. Although there are differences in the standard systems across countries, with the United States commonly using American Society for Testing and Materials (ASTM) standards, Europe relying on International Organization for Standardization (ISO) international standards, and China following Guobiao/Tuijian (GB/T) national standards or enterprise standards, these standards share fundamentally similar principles in terms of testing procedures and evaluation principles [11]. However, due to differences in testing methods and operational conditions, rating results in practical testing can still vary, further increasing the subjectivity and uncertainty of manual evaluations.

Currently, fabric pilling and fuzzing grade assessments still primarily rely on manual visual inspection. Although various standards clearly define the grading process and standard reference images, and require testing personnel to compare the test samples with the reference images and assess the grade based on descriptive criteria to ensure the consistency and standardization of the evaluation, many issues remain in practical applications [12]. On one hand, the grading process is cumbersome and inefficient. On the other hand, the results heavily depend on the experience level and visual sensitivity of the evaluator, making them susceptible to subjective judgment, visual fatigue, and the diversity of fabric types, leading to poor consistency and repeatability [13]. Particularly in large-scale sample testing or industrial applications requiring high grading precision, traditional manual grading methods are increasingly inadequate for modern quality control needs [14]. Therefore, developing an efficient, objective, and robust automatic grading method has become an important research direction.

With the rapid advancement of computer vision and artificial intelligence, image analysis-based objective evaluation methods have emerged as a mainstream research focus. Within the Space domain, objective rating methods based on image analysis and processing primarily include threshold processing and image reconstruction. For example, Sekulska-Nalewajko et al. [15] proposed a method using Optical Coherence Tomography imaging to analyze fabric texture characteristics and objectively assess the degree of pilling and fuzzing, achieving precise identification even in the early stages of pilling. Hassan [16] combined image analysis technology with artificial neural network models, extracting and calculating features from specific digital images, then classifying the fabric pilling grades accurately according to the obtained pilling feature vectors within a pre-trained neural network following ASTM standards. Liu et al. [17] used a mobile camera system and stereo vision algorithms to achieve three-dimensional reconstruction of fabric surfaces, extracting depth information to assist in the parameterization of pilling features, thereby enhancing the objectivity and accuracy of evaluations. Guan et al. [18] proposed a deep learning method combining saliency preprocessing with an improved ResNet 34 network model. By constructing a larger and more diverse fabric pilling and fuzzing dataset, they effectively enhanced the accuracy of fabric pilling grade assessments, achieving an average accuracy rate of 93.88%. However, threshold processing algorithms in the Space domain are susceptible to interference from fabric texture, color, and patterns, potentially leading to omission or introduction of invalid pilling information, thus reducing detection accuracy. Moreover, although three-dimensional image reconstruction methods can improve precision, they require higher computational resources and costs, posing significant challenges in practical applications.

Within the frequency domain, objective rating methods primarily involve transforming signals or data mathematically into the frequency domain and selecting appropriate filters to extract pilling information. For instance, Wang et al. [19] used Fourier transforms and wavelet transforms to obtain Gaussian distributions of pilling frequencies and analyzed their impact on the pilling performance of polyester-cotton blended woven fabrics. Zhan et al. [20] proposes an innovative objective evaluation method for fabric pilling by integrating image analysis techniques in the frequency domain with a deep learning algorithm, achieving a classification accuracy of 94.2%. Although frequency domain evaluation methods perform well in separating pilling information, specific adjustments to filter parameters are needed for different fabric types, limiting their performance in classifying different fabric materials.

For example, Huang et al. [21] proposed a homomorphic filtering-based method for assessing the pilling and fuzzing grades of colored fabrics, achieving a comprehensive grading accuracy of 91.6%. Although this method integrates both space and frequency domain features, it loses the fabric’s texture information after the inverse transformation, thus performing poorly in classifying images with noise.

Compared to these methods, this paper introduces a method that simultaneously utilizes Space and frequency domain features input into a neural network for fabric pilling grade assessment.By comprehensively capturing details and global patterns, the method proposed here overcomes the limitations of existing methods by reducing texture interference in the Space domain and eliminating the need for filter parameter adjustments in the frequency domain. This approach enhances the model’s recognition accuracy and robustness under complex backgrounds, improving learning capability and processing efficiency, and achieving high accuracy and efficiency in fabric pilling assessment.

Machine vision

Machine vision is a technology that enables perception and analysis capabilities in machines by utilizing computer and image processing techniques. It involves acquiring images or videos through hardware devices such as cameras and sensors, followed by analysis using image processing algorithms to perform tasks like object recognition, measurement, detection, and control. Early machine vision methods primarily relied on traditional image processing algorithms, such as edge detection and shape matching [22]. With technological advancements, machine learning and pattern recognition have been increasingly integrated into machine vision [23]. In particular, the rapid development of deep learning in recent years has expanded the application of convolutional neural networks (CNNs) in this field, significantly enhancing the performance and adaptability of machine vision systems [24,25]. These systems can now handle more complex scenarios and achieve high-precision recognition tasks. The applications of machine vision are extensive, spanning industrial automation, medical image analysis, agricultural product inspection, and more [26,27]. In industrial automation and quality control, machine vision-based techniques have become indispensable in intelligent manufacturing systems, enabling real-time monitoring, precision detection, and automated control to meet the high-precision and automation demands of Industry 4.0 [28].

Recently, DSC and CA mechanisms have become integral to machine vision, demonstrating significant advantages in image processing tasks. DSC, by decomposing standard convolution operations, substantially reduce computational costs and improve processing speed and efficiency, making them particularly suitable for real-time processing of large-scale visual data. For example, Liu et al. [29] developed an efficient lightweight network for defect detection in polarizers (DDN) by employing DSC. This approach notably reduced parameters and computational load while enhancing image processing speed and accuracy, fulfilling the real-time requirements of online detection systems. Zhang et al. [30] further optimized the CURI-YOLOv7 model using DSC, achieving a significant reduction in computational complexity and model size while maintaining a high detection accuracy of 90.34% mAP. This advancement enabled rapid detection of single citrus trees in Unmanned Aerial Vehicle (UAV) remote sensing images, making it suitable for real-time applications on embedded devices.

CA mechanisms, by focusing on key feature regions in images, have significantly improved model robustness and accuracy, particularly in handling complex backgrounds and multiple objects [31]. For instance, Li et al. [32] proposed CCAFusion, integrating cross-modal CA mechanisms to effectively combine complementary features of infrared and visible-light images. This method enhanced image fusion quality and performance in advanced vision tasks such as salient object detection.

The combined application of DSC and attention mechanisms has also demonstrated superior performance. Li et al. [33] introduced an enhanced 3D convolutional neural network (3DCNN-AM-DSC) that incorporates both techniques, achieving a 91.77% reduction in training time while maintaining excellent classification performance in hyperspectral remote sensing image classification. These findings highlight that the synergy of these technologies not only optimizes model performance but also significantly reduces computational overhead.

Although studies on quality inspection of textile pilling and fuzzing are relatively scarce, the successful applications of DSC and attention mechanisms in industrial inspection and remote sensing indicate substantial potential for machine vision in this domain. DSC, with their efficient computational capabilities, can process textile sample data rapidly, while attention mechanisms enable detailed focus on critical surface areas, improving the detection of pilling and fuzzing features.

Leveraging high-precision cameras and advanced image processing algorithms, machine vision can capture subtle defects on textile surfaces. The integration of these techniques further optimizes feature extraction and analysis, enhancing detection efficiency and quality control. As these technologies mature, breakthroughs in textile pilling and fuzzing inspection are expected, reducing human error and ensuring stable and consistent detection outcomes. This will provide the textile industry with efficient and intelligent quality inspection solutions, driving its progress toward automation and intelligence.

System architecture

System composition

To enable efficient assessment of pilling and fuzzing grades in textile fabrics, this study develops a Hybrid Feature-Based Machine Vision System for Textile Pilling and Fuzzing Evaluation. The system encompasses data acquisition, preprocessing, feature extraction, and application of the HDAN-PF model, providing a systematic and objective approach for textile quality evaluation, as shown in Fig 1. By integrating multiple feature types, the system aims to improve evaluation accuracy and reliability.

thumbnail
Fig 1. Hybrid feature-based machine vision system for textile pilling and fuzzing performance evaluation.

This system consists of five main components. The Data Acquisition section presents the machines and tools used for pilling and fuzzing tests. The Dataset section provides a sample of the collected images. After data preprocessing and feature extraction, grayscale, Space domain, and frequency domain feature maps are generated. These feature maps are then input into the HDAN-PF, which classifies the images to determine the fabric’s pilling and fuzzing grade.

https://doi.org/10.1371/journal.pone.0329814.g001

Workflow

The system workflow involves the following steps: First, images of worn fabric areas are captured via an image acquisition device. These images then undergo preprocessing, including grayscale conversion, minimum filtering for noise reduction, and Single-Scale Retinex for brightness and contrast enhancement. Next, a Fast Fourier Transform (FFT) converts the images to the frequency domain, allowing extraction of low-frequency components associated with pilling and fuzzing characteristics. Concurrently, the preprocessed images are binarized and processed with a Closing Operation to remove noise and enhance Space domain feature extraction. The grayscale image, serving as a comprehensive feature map, along with the Space and frequency domain feature maps, are then input into the HDAN-PF model to classify pilling and fuzzing into five grades.

To ensure system robustness and effectiveness, key factors were carefully considered during the workflow design. For example, the choice of image acquisition device affects data quality, while the selection of filtering and enhancement algorithms during preprocessing impacts feature extraction accuracy. Integrating frequency and Space domain features is critical for accurate classification; hence, feature combination methods were optimized in the network architecture design. This systematic workflow aims to provide a reliable and scientific method for assessing fabric pilling and fuzzing performance.

To ensure system robustness and effectiveness, key factors were carefully considered during the workflow design. For example, the choice of image acquisition device affects data quality, while the selection of filtering and enhancement algorithms during preprocessing impacts feature extraction accuracy. Integrating frequency and Space domain features is critical for accurate classification; hence, feature combination methods were optimized in the network architecture design. This systematic workflow aims to provide a reliable and scientific method for assessing fabric pilling and fuzzing performance.

HDAN-PF

This study proposes the HDAN-PF, a network that integrates Space, frequency, and grayscale features to achieve high performance and efficiency in evaluating fabric pilling and fuzzing grades. The core innovation of the model lies in its balance between depth, generalization, and computational efficiency, strengthened by the integration of the CA mechanism and DSC technology, which enhance robustness and reduce computational demands.

As shown in Fig 2, the overall network architecture is based on deep CNNs, achieving an optimal balance between network depth, generalization, and computational cost by adjusting the number of modules and convolutional kernel sizes.Unlike conventional models such as ResNet and DenseNet that rely mainly on deep hierarchical spatial feature extraction, HDAN-PF fuses grayscale, spatial domain, and frequency domain features to form a hybrid representation, improving sensitivity to subtle surface variations. The use of DSC enhances computational efficiency, while the CA mechanism enables more precise localization of fine-grained texture regions critical for pilling and fuzzing assessment. These architectural differences highlight the task-specific design of HDAN-PF and its advantage in textile quality evaluation scenarios.

thumbnail
Fig 2. HDAN-PF.

Illustrates the main architecture of the HDAN-PF network. Through Concatenation Fusion, multiple features are input into the model. A 5-layer Inception, DSC, and CA are employed to optimize the network, ultimately determining the fabric’s pilling and fuzzing grade.

https://doi.org/10.1371/journal.pone.0329814.g002

Inception module

The Inception module is inspired by the “network-in-network” concept. Its primary objective is to expand the network’s depth and width by embedding multiple smaller network units while controlling the parameter scale and computational cost. This design integrates convolutional kernels of various sizes (such as 1x1, 3x3, and 5x5) and max-pooling operations, enabling parallel extraction and fusion of multi-scale features to create a hierarchical, dimensionally rich feature representation. As shown in Fig 3, the lightweight design of the Inception module reduces parameter count, simplifies training, and improves computational efficiency. When processing high-resolution fabric images, the 1x1 convolution layer and global average pooling further decrease computational load while preserving detailed information, ensuring model efficiency and comprehensive feature capture.

thumbnail
Fig 3. Inception module.

The diagram illustrates the basic structure of an Inception module, demonstrating how convolutional kernels of varying sizes (1x1, 3x3, and 5x5) are integrated alongside a max-pooling layer to work in concert. This design allows for the simultaneous processing of multi-scale features within a single layer.

https://doi.org/10.1371/journal.pone.0329814.g003

In fabric pilling and fuzzing assessments, the Inception module’s multi-scale processing capability offers notable advantages. It captures variations from small fiber entanglements to larger fuzzball structures, ensuring that both high-frequency details and low-frequency patterns are effectively extracted by convolutional kernels of different sizes. This enhances the model’s performance in fabric pilling and fuzzing assessments and provides a new approach for efficiently handling frequency and Space domain features in fabric quality control.

CA mechanism

In deep learning-based image recognition, attention mechanisms allow models to focus on critical image regions, improving classification accuracy and efficiency. For fabric pilling and fuzzing assessments, the CA mechanism strengthens feature representation by combining channel and Space attention, allowing the model to identify and prioritize regions associated with pilling and fuzzing while ignoring irrelevant background information.

The CA mechanism involves several steps: First, the input feature map is decomposed along the horizontal and vertical axes, with global average pooling capturing global information in each direction to detect long-range dependencies in the feature map. The decomposed features are then encoded to enhance directional feature representation, followed by a pointwise (1x1) convolution that maps the encoded features back to the original feature map size, reconstructing attention maps along both axes. Finally, the original feature map and attention maps are fused through weighted summation, creating enhanced feature representations. As shown in Fig 4, this process ensures the model can accurately capture prominent regions related to pilling in the image.

thumbnail
Fig 4. CA Mechanism flow.

The diagram illustrates the workflow of the CA mechanism. It generates attention vectors for width and height using 1D convolutions, capturing Space information. These vectors are then multiplied to form a comprehensive attention map, highlighting key areas. Finally, the attention map is applied to the input feature map to enhance features.

https://doi.org/10.1371/journal.pone.0329814.g004

In fabric pilling and fuzzing grade assessments, the CA mechanism effectively captures long-range dependencies and preserves key Space information, enhancing the model’s ability to differentiate between various pilling and fuzzing levels. By strengthening feature representation, the CA mechanism significantly improves the model’s perception of fine surface details, optimizing the evaluation process with high accuracy and consistency. This mechanism thus demonstrates strong potential for enhancing model performance, efficiency, and reliability, supporting deep learning applications in fabric quality control.

DSC

DSC is an efficient convolutional strategy that decomposes the convolution operation into two steps: depthwise convolution and pointwise convolution. This reduces computational requirements to about k/1 of traditional convolutions (where k is the kernel size), lowering model parameters, increasing inference speed, and mitigating overfitting. As illustrated in Fig 5, DSC begins with a depthwise convolution that processes each input channel independently, followed by a pointwise convolution that fuses these features to produce the final output. This design maintains the multi-scale feature extraction benefits of the Inception module while significantly improving computational efficiency, making it ideal for edge and mobile computing scenarios.

thumbnail
Fig 5. DSC.

The diagram shows the DSC workflow: depthwise convolution applies kernels to each input channel independently, followed by pointwise convolution using 1x1 kernels to combine feature maps.

https://doi.org/10.1371/journal.pone.0329814.g005

In fabric pilling and fuzzing assessments, using DSC instead of standard convolutions, especially with larger kernels like 3x3 and 5x5, greatly reduces computational complexity and enhances efficiency without compromising feature extraction or classification performance. This approach maintains evaluation precision and real-time responsiveness, offering an efficient solution for applying deep learning in this field. It also demonstrates the flexibility of deep learning in addressing industry-specific challenges.

Data acquisition and feature extraction

Data acquisition

The dataset for this study includes standard pilling images and worn fabric images provided by the Zhejiang Institute of Quality Sciences. Fabric wear tests were conducted following the national standard GB/T 4802.1-2008 “Textiles - Determination of Pilling and Fuzzing - Part 1: Circular Track Method,” using the YG502N fabric pilling tester from Nantong Hongda Experimental Instrument Co., Ltd. Detailed technical specifications of the instrument are listed in Table 1, and the equipment setup is shown in Fig 6.

thumbnail
Fig 6. YG502N fabric pilling tester.

The YG502N Fabric Pilling Tester used for pilling and fuzzing tests is shown, along with its structural components.

https://doi.org/10.1371/journal.pone.0329814.g006

thumbnail
Table 1. YG502N fabric pilling tester parameters.

https://doi.org/10.1371/journal.pone.0329814.t001

A custom-developed image acquisition device was also used to capture high-quality images of worn fabric samples in a controlled darkroom environment, with a stable light source to maintain consistent lighting. Images were captured using a Jieruiweitong DF100-720P industrial CMOS camera, ensuring high-resolution detail capture. A SuteFoto foldable studio and adjustable monochrome light panels were used to comply with the illumination standards of GB/T 4802.1-2008 and ISO 12945-4-2020 [34], enhancing image acquisition accuracy as shown in Fig 7.

thumbnail
Fig 7. Image acquisition device.

The components of the Image Acquisition Device are shown.

https://doi.org/10.1371/journal.pone.0329814.g007

During image acquisition, personnel from the Zhejiang Institute of Quality Sciences subjectively rated all samples according to GB/T 4802.1-2008 and ISO 12945-4-2020. The rating criteria are detailed in Table 2, with grades reflecting varying levels of pilling and fuzzing observed on fabric surfaces.

Dataset

The dataset used in this study includes standard images of Wool Fabric and Cotton Blend Fabric materials provided by the Zhejiang Institute of Quality Sciences, along with additional worn fabric images collected using a custom-developed image acquisition device. It should be emphasized that the model proposed in this study was trained and tested exclusively on Wool and Cotton Blend fabrics, and has not yet been evaluated on other fabric types. Fig 8 shows standard Wool Fabric images, while Fig 9 shows standard Cotton Blend Fabric images.

thumbnail
Fig 8. Standard images of wool fabrics.

The diagram shows the standard images of wool fabrics provided by Zhejiang Institute of Quality Sciences. These images serve as reference samples for quality assessment and research analysis.

https://doi.org/10.1371/journal.pone.0329814.g008

thumbnail
Fig 9. Standard images of cotton blend fabrics.

The diagram presents the standard images of cotton blend fabrics provided by Zhejiang Institute of Quality Sciences. These images serve as reference samples for quality assessment and research analysis.

https://doi.org/10.1371/journal.pone.0329814.g009

To address data imbalance across pilling grades, we increased testing intensity on the YG502N by extending wear time and pressure, artificially supplementing data for higher wear grades. This yielded a more balanced distribution of images across pilling grades. Figs 10 and 11 show examples of Plain-colored Wool Fabric and Cotton Blend Fabric images collected through this method.

thumbnail
Fig 10. Plain-colored images of wool fabrics.

The diagram presents partial plain-colored images of wool fabrics with varying pilling grades. These images are used to assess and compare surface changes in wool fabrics under different wear conditions.

https://doi.org/10.1371/journal.pone.0329814.g010

thumbnail
Fig 11. Plain-colored images of cotton blend fabrics.

The diagram shows partial plain-colored images of cotton blend fabrics with varying pilling grades. These images are used to assess and compare surface changes in cotton blend fabrics under different wear conditions.

https://doi.org/10.1371/journal.pone.0329814.g011

The initial dataset covered a range of fabrics with inherent patterns, which sometimes obscure pilling features and impact classification accuracy. To improve model robustness and classification accuracy, we collected additional patterned fabric images, adding diversity to the dataset and validating model generalization. Figs 12 and 13 present examples of noisy Wool Fabric and Cotton Blend Fabric images collected for this purpose.

thumbnail
Fig 12. Noisy images of wool fabrics.

The diagram presents noisy images of wool fabrics with varying pilling grades. These images, which include noise and artifacts from actual testing, are used to assess and compare surface changes and quality impacts on wool fabrics under different wear conditions.

https://doi.org/10.1371/journal.pone.0329814.g012

thumbnail
Fig 13. Noisy images of cotton blend fabrics.

The diagram shows noisy images of cotton blend fabrics with varying pilling grades. These images, which include noise and artifacts from actual testing, are used to assess and compare surface changes and quality impacts on cotton blend fabrics under different wear conditions.

https://doi.org/10.1371/journal.pone.0329814.g013

To mitigate the risk of classification bias due to data imbalance, we employed data augmentation techniques to equalize the number of images across different grades and fabric material types. The final dataset contains 38,758 images, as summarized in Table 3. The majority of images were collected from industrial fabric inspections provided by collaborating companies. To protect proprietary information, images involving patented designs or unreleased products were excluded from the public dataset. Furthermore, images containing identifiable information such as company names, product codes, order numbers, or client references were processed by cropping the sensitive regions and standardizing the image format before inclusion. This ensures that the shared dataset maintains confidentiality while supporting reproducible research. The publicly available subset of the dataset, consisting primarily of self-collected worn fabric images, can be accessed at: https://github.com/QIANCALGARY/Fabric-fuzzing-and-pilling-data/tree/master.

Image preprocessing and feature extraction

This section describes the process of preprocessing raw images to extract grayscale features and the subsequent extraction of Space and frequency domain features. These steps form the foundation for the classification of fabric fuzzing and pilling grades. Using plain-colored Cotton Blend fabrics as an example, we illustrate the impact of image processing at various stages and provide technical details of the methods used.

Preprocessing and grayscale feature extraction.

The image acquisition system was designed with cost-effectiveness in mind, using equipment with a high cost-to-performance ratio to enable broader application. However, low-cost devices may struggle with environmental lighting changes and noise. To address this, several preprocessing techniques were applied to enhance image quality while maintaining the cost advantages, improving the accuracy and reliability of subsequent analysis.

Firstly, low-cost cameras are sensitive to environmental lighting variations, leading to uneven illumination. To correct this, we employed the Single Scale Retinex algorithm, which enhances image contrast by correcting for uneven lighting. The principle of this algorithm involves converting the image into the logarithmic domain, applying a Gaussian filter to extract low-frequency information, subtracting the smoothed image from the log-domain image, and then transforming the result back into the Space domain to obtain an enhanced image, as shown in Eq (1).

(1)

In the Equation: represents the processed output image, denotes the input image, represents the Gaussian kernel function, denotes the convolution operation, signifies the image in the logarithmic domain.

Secondly, to address noise introduced by increased sensitivity, we applied minimum filtering, which is effective for eliminating salt-and-pepper noise and small-scale abnormally bright areas. This technique involves selecting a sliding window and assigning the minimum pixel value within the window to the central pixel. The process is shown in Eq (2).

(2)

In the Equation: represents the output image, Wx,y represents all pixel positions within a window centered at , denotes the minimum value of all pixel values within the window.

For feature extraction, grayscale conversion was employed to remove color information from the image, simplifying data dimensions and enhancing computational efficiency. Grayscale images retain important features, such as shape, edges, and texture, which are crucial for fabric classification tasks. Fig 14 shows the original image, and Fig 15 presents the preprocessed grayscale image, which retains sufficient texture and structural details.

thumbnail
Fig 14. Original image.

Shows original images of cotton blend fabrics across five pilling grades. These images provide a visual representation of surface characteristics at different grades.

https://doi.org/10.1371/journal.pone.0329814.g014

thumbnail
Fig 15. Grayscale feature.

Displays grayscale images of cotton blend fabrics across five pilling grades. These images retain important texture and structural features from the original images, supporting noise image classification.

https://doi.org/10.1371/journal.pone.0329814.g015

Space domain features.

The next step involves enhancing fabric fuzzing and pilling features in the preprocessed image, followed by binarization to separate pilling from the background. Binarization simplifies the image into two colors, emphasizing fabric fuzzing and pilling while reducing noise, resulting in clearer features. Additionally, binarization reduces the data size, accelerating processing and improving efficiency for feature extraction.

A closing operation, which combines dilation followed by erosion using a structuring element, was applied to remove small noise spots and fill minor gaps. This operation enhances image coherence, smooths object edges, and improves overall quality while preserving the shape of fabric features. The process is shown in Eq (3), with dilation and erosion operations detailed in Eq (4) and Eq (5).

(3)(4)(5)

In the Equation: I is the input image, B is the structuring element, is the current pixel position being processed, denotes the dilation operation, and denotes the erosion operation.

After the closing operation, smaller regions of noise are removed, leaving mainly the contours of fuzzing and fabric texture. Since fabric texture contours generally outnumber pilling contours, we calculated the average area size of the contours, added a 50% offset as a threshold, and applied morphological filtering to remove regions exceeding this threshold. The Space domain features of different fuzzing and pilling grades are shown in Fig 16.

thumbnail
Fig 16. Space domain features.

Shows Space domain features of cotton blend fabrics across five pilling grades. Space domain images emphasize the edges of pills, reflecting small-scale structures formed by localized fiber entanglements.

https://doi.org/10.1371/journal.pone.0329814.g016

Frequency domain features.

Fuzzing and pilling, caused by the entanglement of fibers, create small-scale, irregular structures in the Space domain. These features are represented by point-like or patchy structures, which appear random and lack periodicity. In the frequency domain, such features tend to occupy high-frequency components, while the inherent fabric texture, defined by yarn weaving patterns, occupies the medium to low-frequency range.

To accurately capture the frequency domain characteristics of fuzzing and pilling, we need to convert the preprocessed images to the frequency domain, relying on FFT. Specifically, the Space domain image is transformed into the frequency domain to obtain the frequency domain image, as shown in Eq (6).

(6)

In the Equation: denotes the frequency domain image, denotes the Space domain image, M and N represent the number of rows and columns of the image, respectively.

Although the Retinex enhancement method and minimum filtering improve image quality, they may introduce high-frequency artifacts and reduce high-frequency details, which could interfere with frequency domain feature extraction. Therefore, we focused on medium to low-frequency components to avoid these issues. Scale transformation techniques were applied to retain only the relevant frequency components, and binarization was used to highlight key frequency features, simplifying the image and making them easier to analyze. The frequency domain features are shown in Fig 17.

thumbnail
Fig 17. Frequency domain features.

Shows frequency domain features of cotton blend fabrics across five pilling grades. Pilling features predominantly occupy high-frequency components, while inherent fabric textures are mainly represented in the mid-to-low frequency range.

https://doi.org/10.1371/journal.pone.0329814.g017

In the low-frequency range, fabric texture patterns are clearly visible, but as fuzzing and pilling increase, these features become less distinct. When pilling and fuzzing reach extreme levels, the texture may be obscured by a halo effect due to dense pilling.

Resampling and uniform feature image size.

Given the emphasis on medium to low-frequency components during frequency domain feature extraction, the generated frequency domain feature images differ in pixel dimensions from the original color images and Space domain feature images. To ensure consistency in subsequent analysis and compatibility with model inputs, it is necessary to standardize these feature image sizes. For this purpose, we employed resampling techniques aimed at adjusting the resolution of each feature image to a unified specification, matching the input requirements of the classification model. Specifically, we set the target size to 512×512 pixels, a dimension chosen to satisfy the model’s input requirements while optimizing algorithm performance.

Resampling ensures consistency between input images and model requirements, optimizes storage space and computational resources, while maintaining image quality. Among various interpolation algorithms, we chose bicubic interpolation due to its superior performance in handling Space domain and frequency domain features of fabric fuzzing and pilling. Bicubic interpolation facilitates smooth transitions in images, effectively preserving detail and edge clarity, particularly suitable for images containing fine textures. Additionally, bicubic interpolation offers controllable sharpening and smoothing functions, adapting to complex image transformations, ensuring precise reproduction of fabric features at different angles, thereby enhancing both image quality and analysis precision. The specific process of bicubic interpolation is shown in Eq (7).

(7)

In the Equation: represents the interpolation result at point , wij denotes the weighting coefficient, xi and yj are polynomial basis functions dependent on u and v.

Experimental results and analysis

Evaluation metrics

Evaluating model performance based solely on accuracy may not fully capture its effectiveness, especially with imbalanced datasets. In such cases, a model might favor the majority class, overlooking minority class samples. Therefore, multiple metrics are considered.

Accuracy (Acc) is a fundamental metric for model evaluation, prized for its simplicity, ease of calculation, and broad applicability, as shown in Equation Eq (8).

(8)

In the equation: TP stands for True Positives, TN represents True Negatives, FP denotes False Positives, and FP signifies False Negatives

Precision (PRC) and Recall (REC) further assess classification performance. Precision measures the proportion of correctly identified positive samples among all predicted positives, as shown in Eq (9). Recall evaluates the proportion of actual positives correctly identified by the model, reflecting its capacity to cover true positives, as shown in Eq (10).

(9)(10)

To address class imbalance, the F1-score combines Precision and Recall as a balanced metric, providing the harmonic mean of these metrics and accounting for both model accuracy and coverage, as shown in Eq (11):

(11)

The Receiver Operating Characteristic (ROC) Curve highlights the model’s ability to distinguish between positive and negative samples across various thresholds. An optimal ROC curve approaches the upper left corner, demonstrating high recall and minimal false positives. The area under the curve (AUC) provides an aggregate measure, with a higher AUC indicating superior performance.

Experimental environment and hyperparameter

Experiments were conducted on a dataset consisting of 9,877 images of cotton blend fabrics, targeting the evaluation of pilling and fuzzing severity. The dataset was split into 80% for training and 20% for testing. All experiments were run on a system equipped with an Intel Core i7-6700HQ processor, NVIDIA GeForce GTX 1060 GPU, and 16 GB RAM, using Windows 10, Anaconda3, and TensorFlow 2.7.0 as the software environment.

To determine the optimal training configuration, cross-validation was first employed to explore different combinations of optimizers, learning rates, and dropout rates under the ReLU activation function and a batch size of 32. The Adam optimizer achieved higher classification accuracy with a learning rate of 0.001 and dropout rates of 0.3 and 0.4. In contrast, the SGD optimizer performed best at a learning rate of 0.1 with dropout rates of 0.3, 0.4, and 0.5, as detailed in Table 4.

thumbnail
Table 4. Results of cross-validation for parameter optimization.

https://doi.org/10.1371/journal.pone.0329814.t004

To further investigate the effects of activation function and batch size, additional cross-validation experiments were performed based on the previously identified optimal settings. These experiments involved testing alternative activation functions, including Leaky ReLU and PReLU, and increasing the batch size to 64. As shown in Table 5, the highest classification accuracy was obtained using the Adam optimizer with a learning rate of 0.001, dropout rate of 0.4, ReLU activation function, and a batch size of 32. The momentum parameters were set to beta1 equal to 0.9 and beta2 equal to 0.999, which helped enhance convergence stability and overall model performance.

thumbnail
Table 5. Performance under different training configurations.

https://doi.org/10.1371/journal.pone.0329814.t005

Although Leaky ReLU and PReLU are theoretically designed to address the “dying ReLU” problem and improve non-linear representation capability, experimental results demonstrated that ReLU consistently outperformed both in this structural image classification task. This is likely due to the nature of structural fabric images, which are characterized by sparsity and clearly defined edges. ReLU’s ability to suppress negative activations helps highlight salient features while minimizing the influence of background noise, a property especially beneficial in this context. Moreover, the absence of additional learnable parameters in ReLU reduces model complexity and risk of overfitting, particularly when used in conjunction with a relatively high dropout rate. Combined with the stable and fast convergence behavior of the Adam optimizer, these advantages led to superior classification performance when using ReLU in this experimental setup.

Inception module

The Inception module is key to HDAN-PF. Increasing the number of Inception modules enhances expressive power but also raises computational complexity, training time, and overfitting risk. When the number of modules is odd, the computational graph structure better supports parallel processing, improving hardware resource utilization and classification speed.

The optimal number of modules was determined by incrementally adding modules, starting with three, while monitoring performance. A Dropout layer was introduced to prevent overfitting. FPS and accuracy with various module counts are shown in Table 6.

thumbnail
Table 6. Performance comparison with different numbers of inception modules.

https://doi.org/10.1371/journal.pone.0329814.t006

As shown, with five Inception modules, classification speed improves by at least 2.1 FPS over deeper architectures, with a minor accuracy decrease of 0.15%. Compared to shallower models, accuracy improves by 0.65% without significant speed loss. Thus, a five-module structure was selected for HDAN-PF.

Comparative analysis with other classic models

To validate the effectiveness of the proposed HDAN-PF model, a systematic comparison was conducted against two classic convolutional neural network architectures: DenseNet and ResNet. As presented in Table 7, HDAN-PF demonstrates superior overall performance in both inference speed and classification accuracy. Specifically, HDAN-PF significantly improves inference speed compared to DenseNet, while also achieving a 1.06% higher classification accuracy. Although it is slightly slower than ResNet, HDAN-PF surpasses it by 1.77% in accuracy, indicating stronger discriminative capability and model stability, thereby confirming its effectiveness in the fabric pilling grade classification task.

thumbnail
Table 7. Classification performance comparison between HDAN-PF and classical CNN models on fabric pilling task.

https://doi.org/10.1371/journal.pone.0329814.t007

To further evaluate the adaptability of the Vision Transformer (ViT) for this specific task, two different input strategies were investigated and compared with the HDAN-PF model. One strategy utilizes the original RGB three-channel color images as input, while the other employs grayscale images fused with multiple frequency-domain and texture-based features. As shown in Table 8, the ViT model achieves a classification accuracy of only 76.73% when using RGB images, which is considerably lower than that of other models. When fused grayscale images are used as input, the accuracy improves to 83.54%, highlighting the positive impact of effective image representations. However, even with enhanced input features, ViT still underperforms compared to HDAN-PF, indicating its limited suitability for this task.

thumbnail
Table 8. Performance comparison of ViT under different input strategies and HDAN-PF on fabric pilling classification.

https://doi.org/10.1371/journal.pone.0329814.t008

Further analysis reveals two main limitations contributing to ViT’s performance. First, the ViT architecture primarily captures global structure and color information, whereas fabric pilling grade classification relies heavily on fine-grained local texture and frequency features, which are not adequately represented in standard RGB images. Although using fused grayscale images partially mitigates this limitation, ViT remains less effective due to its insufficient capability in modeling local texture information. Second, ViT typically requires large-scale and diverse pretraining datasets to achieve optimal performance. In this study, however, the dataset is self-collected and relatively limited in scale, which constrains ViT’s ability to fully leverage its architectural strengths.

In conclusion, the HDAN-PF model is better aligned with the task-specific feature requirements and demonstrates stronger generalization and robustness under the current data conditions, outperforming ViT in overall performance. Future research will further explore integrating vision modeling techniques with the rapidly evolving large language models (LLMs) to enable deeper cross-modal feature fusion, advancing intelligent recognition in fabric surface analysis and other complex visual tasks.

Model optimization and performance enhancement

Although the HDAN-PF model outperforms traditional methods, its accuracy remains at 89.37%, which does not meet the requirements for practical applications. The primary limitation of the HDAN-PF model lies in its constrained ability to extract critical information, making it difficult to fully capture the subtle texture features of fabric pilling and fuzzing. The grading of fabric pilling and fuzzing relies on variations in local fiber structures, such as the density, length distribution, and aggregation of fuzz. However, traditional convolutional operations employ fixed-size receptive fields, which can only focus on local features and struggle to establish long-range dependencies. This limitation affects the model’s performance in handling complex surface texture patterns, particularly when addressing subtle variations across different fabric materials, weaving techniques, and testing conditions. For example, in fabric pilling and fuzzing evaluation, the density, size, and distribution patterns of localized fuzz are interrelated, yet conventional convolutional operations may fail to effectively capture these long-range dependencies. To address this issue, this study introduces a coordinated attention mechanism to enhance the model’s ability to focus on critical features and establish stronger feature associations across Space locations. Specifically, the coordinated attention mechanism is integrated after the initial convolutional layers and before the Flatten layer to assess its optimization effect. Experimental results demonstrate that this optimization significantly improves classification accuracy, as shown in Table 9.

As shown in the Table 9, the introduction of the CA mechanism significantly improves the classification accuracy, reaching at least 96.82%. Although the classification speed decreases slightly, the overall performance improves considerably, with a particularly notable increase in accuracy. Placing the CA mechanism before the Flatten layer, rather than immediately after the initial convolutional layer, results in a 0.25% increase in accuracy and an improvement in classification speed. This indicates that the placement of the attention mechanism plays a critical role in enhancing model performance. Consequently, the final implementation positions the CA mechanism after the initial convolutional layer to maximize its benefits. However, the model’s parameter count reaches 136 million, and the classification speed decreases.

This issue primarily arises due to the large number of parameters associated with standard convolution operations. Compared to DSC, standard convolution uses larger kernels and fully connected operations, increasing both the parameter count and computational complexity, thereby impacting the FPS. To further enhance model performance, DSC is introduced to replace standard convolution kernels. By decomposing convolution operations into depthwise convolution and pointwise convolution, DSC effectively reduces both parameter count and computational complexity, thereby improving overall model efficiency while maintaining high performance. The experimental results are presented in Table 10.

As shown in the table, the optimized HDAN-PF model demonstrates outstanding performance, achieving an overall classification accuracy of 97.92%. Compared to the version without DSC, the number of parameters is reduced by 1.12 million, and the classification speed significantly improves to 12.079 FPS, representing a 77.11% increase. Fig 18 presents the confusion matrix of the optimized deep convolutional neural network incorporating hybrid features, illustrating its classification performance under different operating conditions. To further evaluate the model, the ROC curve is plotted, as shown in Fig 19. The AUC values provide a comprehensive assessment of the model’s classification capability across various thresholds.

thumbnail
Fig 18. Performance evaluation of the HDAN-PF model with mixed feature fusion: confusion matrix.

The diagram presents the classification results of plain-colored images of cotton blend fabrics using the HDAN-PF model. This is the confusion matrix.

https://doi.org/10.1371/journal.pone.0329814.g018

thumbnail
Fig 19. Performance evaluation of the HDAN-PF model with mixed feature fusion: ROC curve.

The diagram presents the classification results of plain-colored images of cotton blend fabrics using the HDAN-PF model. This is the ROC curve. Together, they reflect the accuracy and performance of the HDAN-PF model in classifying these images.

https://doi.org/10.1371/journal.pone.0329814.g019

In the current laboratory workflow, manual evaluation requires 2 to 3 staff members to independently assess the test images, with each sample taking approximately one minute to evaluate. In contrast, the optimized HDAN-PF model achieves a real-time inference speed of 12.079 FPS, resulting in a classification efficiency over 700 times faster than manual assessment. Its accuracy of 97.92% also matches the level of manual evaluation, which achieves 97.82%. Therefore, the model demonstrates excellent real-time performance and stability, making it fully suitable for practical deployment in industrial fabric pilling and fuzzing assessment applications.

The final optimized model contains 135,115,512 parameters and effectively compresses the model complexity while maintaining high performance compared to the initial version. After training, the model size is 327.37 MB, which can be stably deployed on the edge host environment used in this study’s laboratory. During actual operation, the model not only maintains high accuracy but also achieves real-time inference capability, fully meeting the dual requirements of accuracy and responsiveness for industrial fabric pilling and fuzzing assessment. Leveraging the computational resources of the edge host, the model delivers efficient real-time performance and stability, ensuring reliability and operational efficiency in practical applications.

Ablation study

To evaluate the impact of hybrid features on classification accuracy, seven ablation experiments were conducted to examine the effect of Space domain features, frequency domain features, grayscale image features, and their combinations on classification performance. To ensure the reliability and validity of the experimental results, all experiments were performed under the same conditions with identical training hyperparameters, while maintaining optimization measures such as the attention mechanism and DSC. By comparing the classification accuracy across different experimental groups, the contribution of hybrid features to model performance was comprehensively assessed. The results of the ablation study are presented in Table 11.

From the data in Table 11, it can be observed that among single-feature models, frequency domain features yield the best overall performance, achieving the highest accuracy of 95.49% while also providing the fastest classification speed at 15.807 FPS. In contrast, the grayscale image feature model, despite having a classification accuracy of 79.81%, retains crucial fabric pattern and texture information that Space and frequency domain features lack. When combined with other features, grayscale features effectively mitigate the negative impact of noise data on accuracy, thereby enhancing classification performance. Although the classification speed of the hybrid feature model decreases slightly, it achieves an accuracy improvement of at least 2.43%, demonstrating that integrating multiple features significantly enhances model accuracy, particularly in handling fabric pattern and texture information with greater stability.

Discussion and analysis

To assess the generalization and noise resistance of HDAN-PF across various materials and fabric patterns, we conducted a series of tests under diverse conditions. The following sections discuss the model’s noise resistance, performance on different materials, and overall effectiveness on a diversified dataset.

Individual classification performance under different materials and noise conditions

The HDAN-PF model was first tested on datasets comprising plain-colored Wool Fabric, noisy Wool Fabric, and noisy Cotton Blend. Results show that the classification accuracy for noisy Wool Fabric is 93.84%, as shown in Fig 20, and for noisy Cotton Blend, it is 94.79%, as shown in Fig 21. For Plain-colored Wool Fabric, accuracy reaches 97.29%, as shown in Fig 22, and for Plain-colored Cotton Blend, 97.92%, as shown in Fig 18. This indicates a minor accuracy difference of 0.63% between Wool Fabric and Cotton Blend under noise-free conditions, demonstrating strong model generalization across different materials. However, with noise, Wool Fabric accuracy decreases by 3.45%, while Cotton Blend decreases by 3.13%, suggesting that Cotton Blend provides more stable classification performance under noisy conditions and that noise resistance varies slightly by material.

thumbnail
Fig 20. Confusion matrices for classification performance under different materials and noise conditions: noisy wool fabric.

The diagram presents the classification results for different types of fabrics using the HDAN-PF model. This is the confusion matrix for noisy wool fabric.

https://doi.org/10.1371/journal.pone.0329814.g020

thumbnail
Fig 21. Confusion matrices for classification performance under different materials and noise conditions: noisy cotton blend.

The diagram presents the classification results for different types of fabrics using the HDAN-PF model.This is the confusion matrix for noisy cotton blend fabric.

https://doi.org/10.1371/journal.pone.0329814.g021

thumbnail
Fig 22. Confusion matrices for classification performance under different materials and noise conditions: plain-colored wool fabric.

The diagram presents the classification results for different types of fabrics using the HDAN-PF model.This is the confusion matrix for plain-colored wool fabric. Together, they reflect the accuracy and performance of the HDAN-PF model in classifying images under various materials and noise conditions.

https://doi.org/10.1371/journal.pone.0329814.g022

Comparison of plain-colored and noisy fabrics

Further experiments compared the model’s performance on plain-colored and noisy datasets of Cotton Blend and Wool Fabric. Results show that classification accuracy for Plain-colored fabrics is 97.33%, as shown in Fig 23, and for noisy fabrics, 96.37%, as shown in Fig 24. Although noise has a slight impact on classification, the model maintains high accuracy across different materials and noise conditions, demonstrating robustness and noise resistance.

thumbnail
Fig 23. Confusion matrices for classification performance under different materials and noise conditions: all plain-colored.

The diagram shows the classification performance of the HDAN-PF model. This is the confusion matrix for all plain-colored fabrics.

https://doi.org/10.1371/journal.pone.0329814.g023

thumbnail
Fig 24. Confusion matrices for classification performance under different materials and noise conditions: (b) All noise.

The diagram shows the classification performance of the HDAN-PF model.This is the confusion matrix for all noisy fabrics. Together, they reflect the model’s accuracy and performance across different conditions.

https://doi.org/10.1371/journal.pone.0329814.g024

Classification performance on mixed plain-colored and noisy datasets

To further evaluate noise resistance, we tested the model on mixed plain-colored and noisy images of Wool Fabric and Cotton Blend. Results show that the classification accuracy for Wool Fabric is 96.57%, as shown in Fig 25, and for Cotton Blend, 96.70%, as shown in Fig 26. These results confirm that HDAN-PF maintains high classification accuracy on fabrics with noise, underscoring its strong noise resistance.

thumbnail
Fig 25. Confusion matrices for classification performance under different materials and noise conditions: all cotton blend.

The diagram shows the classification performance of the HDAN-PF model under different material conditions. This is the confusion matrix for all cotton blend fabrics.

https://doi.org/10.1371/journal.pone.0329814.g025

thumbnail
Fig 26. Confusion matrices for classification performance under different materials and noise conditions: all wool fabrics.

The diagram shows the classification performance of the HDAN-PF model under different material conditions.This is the confusion matrix for all wool fabrics. These matrices collectively reflect the model’s accuracy and performance in distinguishing between different fabric types.

https://doi.org/10.1371/journal.pone.0329814.g026

Comprehensive test analysis

Finally, datasets of plain-colored Wool Fabric, noisy Wool Fabric, plain-colored Cotton Blend, and noisy Cotton Blend were combined for a comprehensive evaluation. The resulting confusion matrix and ROC curve are shown in Fig 27. The model achieved an accuracy of 96.26%, as shown in Fig 28, further demonstrating the applicability of HDAN-PF to both Cotton Blend and Wool Fabric classification tasks. The experiment validates that the model maintains high accuracy in the presence of noise, reinforcing its excellent noise resistance capabilities.

thumbnail
Fig 27. Performance evaluation of the model on multi-material and noisy datasets: confusion matrix.

The diagram presents the comprehensive classification results of a mixed dataset including plain-colored wool fabrics, noisy wool fabrics, plain-colored cotton blend fabrics, and noisy cotton blend fabrics using the HDAN-PF model. This is the confusion matrix.

https://doi.org/10.1371/journal.pone.0329814.g027

thumbnail
Fig 28. Performance evaluation of the model on multi-material and noisy datasets: ROC curve.

The diagram presents the comprehensive classification results of a mixed dataset including plain-colored wool fabrics, noisy wool fabrics, plain-colored cotton blend fabrics, and noisy cotton blend fabrics using the HDAN-PF model.This is the ROC curve. Together, they reflect the accuracy and performance of the HDAN-PF model across various material types and noise conditions, demonstrating its strong generalization capability.

https://doi.org/10.1371/journal.pone.0329814.g028

Statistical analysis

To further validate the reliability and robustness of the proposed model, a statistical analysis was conducted on the experimental results across different datasets. The evaluation metrics included PRC, REC, F1-score, and accuracy. By calculating the mean and standard deviation of each metric, the overall performance and stability of the model under varying conditions were assessed, as summarized in Table 12.

thumbnail
Table 12. Statistical Analysis of Model Performance on Different Datasets.

https://doi.org/10.1371/journal.pone.0329814.t012

The results show that the mean PRC across all datasets was 0.9687 with a standard deviation of 0.0069, indicating consistently high precision. The mean REC was 0.9678 with a standard deviation of 0.0069, suggesting strong recognition capability across different datasets. The mean F1-score was 0.9679 with a standard deviation of 0.0068, reflecting a well-balanced performance between precision and recall. The overall accuracy reached 96.23% with a standard deviation of 1.217%, demonstrating the model’s stability while also highlighting some fluctuation due to the presence of noise in certain datasets.

These findings confirm the robustness of the model. Under various dataset conditions, the model maintained stable PRC, REC, and F1-score values with minimal variation, underscoring its reliability across different fabric types and noise conditions. Moreover, the statistical analysis indicates that despite variations in dataset characteristics, the model consistently achieved high accuracy. This adaptability is particularly valuable in real-world scenarios where textile types and testing environments may vary. The relatively low standard deviations across most metrics further substantiate the model’s stability and practicality for pilling and fuzzing evaluation tasks in the textile industry.

Conclusion and outlook

This paper presents a hybrid feature-based machine vision approach for assessing textile fabric wear performance, focusing on the objective evaluation of pilling and fuzzing. Using custom-designed equipment, we collected a comprehensive dataset of fabric wear images, including plain-colored color, textured, and patterned fabrics. In the preprocessing stage, we applied a combination of frequency and Space domain enhancements to highlight pilling features, which improved classification accuracy. Additionally, by incorporating texture and pattern features from grayscale images, we enhanced the model’s generalization capability, especially when processing noisy images.

For model selection, after evaluating multiple classic models, we adopted the GoogLeNet architecture and optimized the number of Inception modules through a progressive strategy. The inclusion of CA increased the model’s sensitivity to feature channels and Space positions, enhancing recognition accuracy. Using DSC instead of plain-colored convolutions reduced computational complexity, accelerating the evaluation process while maintaining high precision. These refinements culminated in the HDAN-PF model.The final optimized model contains 135,115,512 parameters, and the trained model file size is 327.37 MB.

Experimental results indicate that this approach achieved a minimum accuracy of 97.29% in assessing wear grades for noise-free, plain-colored cotton blend fabrics; for noisy fabric images, the model’s accuracy reached 96.26%, demonstrating strong noise resistance. Compared to traditional methods relying on subjective inspector evaluations, this approach enhances objectivity and consistency, significantly reducing rating errors caused by human factors and highlighting the advantages of machine vision technology in textile quality inspection.

Currently, due to the collaboration with the Zhejiang Institute of Quality Science, which mainly employs circular trajectory and pilling box methods for testing, this study is limited to specific fabric types (cotton and wool), and the performance on other materials remains uncertain.” “Future work will further optimize the model to assess pilling and fuzzing grades for a broader range of fabric types, enhancing the model’s versatility.

Future research will focus on further optimizing the model architecture to enable wear grade assessment for a broader range of fabric types, thereby enhancing the model’s generalization and adaptability. Although the ViT did not outperform the proposed CNN-based architecture under the current experimental settings—primarily due to limited input feature diversity and a relatively small training dataset—this does not negate its potential under large-scale, multimodal data conditions. We plan to expand the dataset by collecting a wider variety of samples covering different fabric materials (e.g., polyester, silk), weaving techniques (e.g., plain, twill, satin), and post-finishing processes, thereby improving the model’s ability to learn and represent diverse wear patterns.

In addition, to improve the model’s discriminative power and robustness in complex real-world scenarios, we will introduce structured semantic information such as fabric type, weave structure, and processing parameters as auxiliary inputs alongside visual features. A multimodal Transformer-based architecture will be explored to achieve effective fusion of image and semantic information. Notably, related research is already underway in our lab—one of our team members is currently investigating methods to encode fabric attribute information into the Transformer model to enable collaborative text-image-based wear grade prediction. This research direction is expected to enhance the model’s generalization and interpretability, paving the way toward more intelligent and automated textile appearance evaluation systems.

Despite these advancements, there are areas for further improvement. The current model is large and not suitable for deployment on devices with limited computational resourcesTo enable the model to be deployed and applied on devices with more limited computational resources, future research can further lightweight the model through techniques such as quantization, pruning, knowledge distillation, and neural architecture search.

Acknowledgments

We would like to express our sincere gratitude to Mr. Yuan Lu from the Zhejiang Institute of Quality Science for his valuable assistance in sourcing the fabrics for the study.

References

  1. 1. Tang X. Investigation on fabric pilling detection methods and testing details. China Fiber Inspection. 2022:86–7.
  2. 2. Teng Y, Xu Y, Li G. Reflections on fabric pilling performance testing methods. China Fiber Inspection. 2022:51–3.
  3. 3. Dong X, Xing T, Chen G. Improving the anti-pilling performance of cellulose fiber blended knitted fabrics with 2,4,6-trichloropyrimidine treatment. Coatings. 2020;10(10):969.
  4. 4. Wang Y, Huang Z, Li B. Analysis of differences between standards for fabric pilling and hairiness testing methods. China Fiber Inspection. 2021;:90–2.
  5. 5. Song L. Influencing factors and detection methods of pilling and balling phenomenon in wool textile product. Textile Testing and Standard. 2024;10(1):4–7.
  6. 6. Dong H. Discussion on the factors affecting the accuracy of the evaluation results of textile pilling and pilling. Textile Testing and Standard. 2023;9:9–11.
  7. 7. Telli A. An image processing research consistent with standard photographs to determine pilling grade of woven fabrics. Textile and Apparel. 2019:268–76.
  8. 8. Wu J, Liu Q, Xiao Z, Zhang F, Geng L. Objective rating method for fabric pilling based on LSNet network. The Journal of The Textile Institute. 2023;115(4):535–43.
  9. 9. Wu J, Wang L, Xiao Z, Geng L, Zhang F, Liu Y. Wool knitted fabric pilling objective evaluation based on double-branch convolutional neural network. The Journal of the Textile Institute. 2020;112(7):1037–45.
  10. 10. Xiao W, Xue B. Research on the detection method for fabric fuzzing and pilling. In: Proceedings of the 2024 7th International Conference on Signal Processing and Machine Learning, 2024. p. 95–9. https://doi.org/10.1145/3686490.3686504
  11. 11. Yang H, Cai Y. Analysis of the causes of pilling in textiles and introduction to testing methods. Melliand China. 2020;48(11):38-40 42.
  12. 12. Yan Y, Tan Y, Gao P, Yu Q, Deng Y. Fabric pilling image segmentation by embedding dual-attention mechanism U-Net network. Textile Research Journal. 2024;94(21–22):2434–44.
  13. 13. Elkateb S, Mustafa E, El Gholmy S, El Geiheini A, Malek AS. Prediction of fabric pilling tendency based on blended worsted fabric construction. The Journal of The Textile Institute. 2022;114(5):782–9.
  14. 14. Mendes A de O, Fiadeiro PT, Miguel RAL, Lucas JM, Silva MJ dos S. Optical 3D-system for fabric pilling assessment: a complementary tool to avoid evaluation errors. The Journal of The Textile Institute. 2020;112(6):921–7.
  15. 15. Sekulska-Nalewajko J, Gocławski J, Korzeniewska E. A method for the assessment of textile pilling tendency using optical coherence tomography. Sensors (Basel). 2020;20(13):3687. pmid:32630189
  16. 16. Hassan M. Applications of image analysis and artificial neural network techniques for fabric pilling evaluation (Dept.T). MEJ Mansoura Engineering Journal. 2020;34(1):1–9.
  17. 17. Liu L, Deng N, Xin B, Wang Y, Wang W, He Y, et al. Objective evaluation of fabric pilling based on multi-view stereo vision. The Journal of The Textile Institute. 2020;112(12):1986–97.
  18. 18. Guan S, Liu D, Hu L, Lei M, Shi H. Evaluation method of fabric pilling grades based on saliency-based deep convolutional network. Textile Research Journal. 2023;93(13–14):2980–94.
  19. 19. Wang R, Xiao Q. Study on pilling performance of polyester-cotton blended woven fabrics. Journal of Engineered Fibers and Fabrics. 2020;15.
  20. 20. Xiao Q, Wang R, Sun H, Wang L. Objective evaluation of fabric pilling based on image analysis and deep learning algorithm. IJCST. 2020;33(4):495–512.
  21. 21. Huang Y, Dong K. Assessment of pilling severity for color fabrics based on homomorphic filtering. Progress in Textile Science & Technology. 202;:29–34.
  22. 22. Cheng J, Fang G, Gao H. Research progress on machine vision technology for surface defect detection. Application Research of Computers. 2023;40:967–77.
  23. 23. Yang L, Zhou F. Overview of scratch detection technology based on machine vision. Laser & Optoelectronics Progress. 2022;59:118–25.
  24. 24. Zhu Y, Lin Z, Zhang Y. Progress and prospects of machine vision technology research. Journal of Graphics. 2020;41:871–90.
  25. 25. Lins RG, Santos RE dos, Gaspar R. Vision-based measurement for quality control inspection in the context of Industry 4.0: a comprehensive review and design challenges. J Braz Soc Mech Sci Eng. 2023;45(4):229
  26. 26. Moru DK, Agholor D, Imouokhome FA. Machine vision and metrology systems: an overview. Int J Data Science. 2021;2(2):77–84.
  27. 27. David J, Švec P, Pasker V, Garzinová R. Usage of real time machine vision in rolling mill. Sustainability. 2021;13(7):3851.
  28. 28. Kolanur CB, Bali J, Tanvashi S, Giriyapur A. An overview of machine vision based quality control strategies for smart manufacturing. In: AIP Conference Proceedings. 2023.
  29. 29. Liu R, Sun Z, Wang A, Yang K, Wang Y, Sun Q. Real-time defect detection network for polarizer based on deep learning. J Intell Manuf. 2020;31(8):1813–23.
  30. 30. Zhang Y, Fang X, Guo J, Wang L, Tian H, Yan K, et al. CURI-YOLOv7: a lightweight YOLOv7tiny target detector for citrus Trees from UAV remote sensing imagery based on embedded device. Remote Sensing. 2023;15(19):4647.
  31. 31. Ghaffarian S, Valente J, van der Voort M, Tekinerdogan B. Effect of attention mechanism in deep learning-based remote sensing image processing: a systematic literature review. Remote Sensing. 2021;13(15):2965.
  32. 32. Li X, Li Y, Chen H, Peng Y, Pan P. CCAFusion: cross-modal coordinate attention network for infrared and visible image fusion. IEEE Trans Circuits Syst Video Technol. 2024;34(2):866–81.
  33. 33. Li W, Chen H, Liu Q, Liu H, Wang Y, Gui G. Attention mechanism and depthwise separable convolution aided 3DCNN for hyperspectral remote sensing image classification. Remote Sensing. 2022;14(9):2215.
  34. 34. ISO 1294 5-4:2020. Determination of fabric propensity to surface pilling, fuzzing or matting — Part 4: Assessment of pilling, fuzzing and matting by visual analysis. 2020.Determination of fabric propensity to surface pilling, fuzzing or matting — Part 4: Assessment of pilling, fuzzing and matting by visual analysis. 2020.