Research Article

An End-to-end Deep Learning Framework for Automated Woven Fabric Pattern Recognition using UNet, GAN, and CNN

DOI:

10.3791/69632

April 3rd, 2026

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

An end-to-end deep learning framework integrating CNNs, GANs, and UNet-based denoising was developed for automated recognition of woven fabric patterns. Augmentation and synthetic image generation improved robustness. The method achieved 99.1% accuracy, providing a scalable solution for industrial textile inspection.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The quality and production of high-grade textiles largely depend on accurate recognition of weave patterns, which are traditionally identified through manual visual inspection. However, this approach is subjective, time-consuming, and error-prone. While machine learning methods offer automation, they often rely on handcrafted features sensitive to lighting and imaging variations, limiting their robustness and scalability. Even deep learning models face generalization issues due to domain shifts in real-world acquisition conditions, and to address these challenges, a novel deep learning framework that combines a Convolutional Neural Network (CNN) with Generative Adversarial Networks (GANs) for end-to-end fabric classification is proposed. The approach integrates geometric and photometric data augmentation with UNet-based image denoising, while the GAN component generates high-quality synthetic images to enhance training diversity and feature learning. Experiments on a woven fabric dataset demonstrate that this method achieves state-of-the-art performance, with a balanced accuracy of 99.1%, outperforming baseline models in accuracy, generalizability, and robustness to visual distortions. This framework offers a scalable and reliable solution for automated textile inspection, with significant implications for improving efficiency and reducing manual labor in industrial fabric manufacturing. This work integrates CNN, GAN, and U-shaped Convolutional Neural Network (UNet)modules into a single optimization-based learning pipeline rather than handling denoising, data creation, and classification as distinct processes. The joint training mechanism creates a feedback loop between the generative and discriminative networks, going a step further methodologically than standard fine-tuning practices.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Design, redesign, textural analysis, and the aesthetic appearance of materials are all greatly influenced by pattern, which is the most important factor in the production of cloth. Fabric is a historical human invention that has evolved from handcrafted cloth to modern machine-produced digital fabrics1. Before being further processed by weaving machinery, woven cloth patterns must be identified. Nowadays, traditional methods that rely on visual perception, enhanced by tools such as microscopes or magnifying glasses, remain the mainstay of cloth pattern detection. Usually, a specialist with the necessary training and experience performs this manual evaluation. However, it is linked to a number of drawbacks, such as excessive work, inefficiency, and time consumption, in addition to psychological issues like physical and mental stress, lethargy, and exhaustion that ultimately affect the identification results. Therefore, in order to identify fabric patterns and produce high-quality products that meet customer needs, a computerized examination approach is necessary2.

Fabric pattern recognition has recently gained attention and achieved great success3. Broadly speaking, there are two types of methods for recognizing weave patterns: texture-based statistical and model-based methods. The texture-based statistical method uses preprocessed images. A method based on photometric differential analysis was done using an adaptive Wiener filter and histogram equalization to gather information about the fabric structure from various directions4. Afterward, they divided images into sub-images using an adaptive mesh model to extract grayscale features. Although the work was restricted to simple woven materials, the model was reliable for retrieving interlacing sites in the weaving structure. A recognition or classification algorithm is used by the database/model-based cognitive technique to recognize and match the weave patterns of the materials.

Fabric textures have been classified using support vector machines (SVM) after extracting features through local binary patterns (LBP) and gray-level co-occurrence matrices (GLCM)5. The combined use of LBP and GLCM improved recognition performance compared with either descriptor individually; however, the approach relied entirely on handcrafted features and was not evaluated on knitted or nonwoven fabrics. Woven fabric patterns have also been identified using transform-invariant low-rank textures (TILT) and histogram of oriented gradients (HOG), while warp and weft intersections were detected using fuzzy c-means clustering (FCM)6. This method showed limitations under significant rotational variations and demonstrated reduced effectiveness in detecting double-yarn weave structures. In addition, an improved convolutional neural network (CNN) with a visualization strategy has been proposed for complex texture analysis; however, validation was conducted on a limited dataset under restricted experimental conditions7.

Texture data have been extracted using the CIE-Lab color model and a co-occurrence matrix, after which a self-organizing map (SOM) network was utilized to categorize cloth weave patterns8. However, the performance and accuracy of these algorithms were affected by the size of the database. A textile is a planar material composed of textile fibers. FabricNet developed using a special class-based ensemble CNN architecture, was among the early techniques for identifying textile fibers from images9. Using fabric datasets, deep learning approaches for accurate fiber recognition have been implemented with the Faster R-CNN, SSD, Residual Network (ResNet50), and ResNet101 algorithms, with Faster R-CNN identified as the most effective.

The pulse-coupled neural network (PCNN) method has been reported to outperform other approaches and highlighted the need for further research on warp-knitted fabric databases10. Textile recognition remains challenging due to the time-consuming nature of manual visual inspection, and studies have implemented data augmentation and transfer learning for classification and feature extraction using residual networks (ResNet), with most work focused on distinguishing between handloom and powerloom fabrics. Methods have also been proposed for locating and identifying different stitch types, though experiments were limited to knit and purl stitches11. Many earlier techniques relied on a single image for fabric prototyping through reverse engineering. In addition, a principal component analysis–based dimensionality reduction approach has been introduced for feature extraction and classification in defective fleece fabrics, demonstrating that the K-nearest neighbor classifier achieved higher accuracy than the Naive Bayes classifier.

Automatic identification of handloom fabrics has also been achieved using a deep metric learning algorithm applied to a tagged dataset of 25,166 images from six types of handloom textiles collected from native weavers in Assam, Northeast India12. By learning biased feature representations that enable efficient separation of fiber types within a learned feature space, the approach achieved 97.8% classification accuracy after extensive testing and comparison with baseline models. Deep learning models based on data augmentation and transfer learning have also been proposed for woven textile classification using a Residual Network (ResNet) to automatically extract and classify texture features, with performance evaluated using accuracy, balanced accuracy, and F1-score; experimental results indicate that the model remains stable and achieves state-of-the-art accuracy even when fabric physical characteristics vary13.

Deep learning has been further applied to simulate three-dimensional textile geometry using architectures combining recurrent and convolutional characteristics14. By training deep neural networks (DNNs) using a library of precomputed weaving cases generated through digital element-based simulation, the method estimated 3D textile architectures and predicted stiffness properties with an error margin of less than 10%, demonstrating improved computational efficiency compared with traditional modeling approaches. In addition, fabric contexture has been analyzed through pattern recognition and image processing techniques that measure parameters such as isolated blocks, vertical and horizontal section succession, and diagonal line continuity15. These parameters enable classification of basic weave patterns into satin, twill, and plain categories using the Analytic Hierarchy Process (AHP), with statistical evaluation showing strong agreement between predicted and experimental classification results.

A fog computing–based optimization method has been proposed for fabric design analysis, consisting of four primary phases: fabric image collection, preprocessing, feature extraction, and classification16. Using fog-edge devices for image acquisition, the system applies various filtering techniques during preprocessing, after which features are extracted using a gray-level co-occurrence matrix (GLCM) and classified through an ensemble deep learning model. Experimental results demonstrate the effectiveness of this approach, showing superior accuracy compared with existing algorithms. In addition, a neural network–based framework has been developed to characterize the umbrella drape of woven fabrics by establishing objective categorization criteria based on macro-level mechanical properties17. The framework integrates ResNet-18 with a Deep Graph Convolutional Neural Network (DGCNN) to extract and classify features from drape images and point clouds, respectively. Through supervised learning, both networks were evaluated to determine the most effective model for extracting drape styles from unlabeled datasets. Furthermore, a sketch-downsampling (SDS) technique was introduced to represent the point clouds of umbrella-shaped draperies, enabling an objective assessment of fabric drape and supporting downstream applications, such as similarity-based fabric retrieval.

Despite advancements in deep learning, woven fabric identification remains hindered by reliance on handcrafted feature engineering and the lack of standardized large-scale databases. Traditional inspection methods suffer from human error and inconsistency, while many automated models lack the domain adaptivity required to handle variations in lighting, rotation, and camera angles. In addition, the absence of end-to-end automated frameworks and advanced data augmentation techniques limits the generalization and practical scalability of existing classification systems. Unlike previous approaches that employ UNet, GAN, or CNN independently, this study proposes a co-optimization strategy in which UNet-denoised outputs guide GAN-based synthesis, and the generated textures further refine CNN classification through an iterative feedback process, extending beyond conventional model stacking or fine-tuning.

Accordingly, an integrated end-to-end deep learning framework combining UNet-based denoising, GAN-based data synthesis, and CNN-based classification is introduced for automated woven fabric pattern recognition, unifying data enhancement, generative augmentation, and feature learning within a single trainable system. In this framework, UNet-denoised images serve not only as preprocessed inputs but also as feedback for GAN generation, improving photometric consistency and texture realism, while joint optimization across denoising, synthetic augmentation, and classification enhances representation learning and domain robustness. By employing UNet-based denoising and GAN-generated synthetic data to increase feature variability and model generalization, and training a CNN classifier on these discriminative features, the system aims to replace manual inspection and conventional machine learning, improving industrial inspection efficiency, quality control, and reducing labor-intensive errors.

The proposed end-to-end architecture integrates CNN-based classification, GAN-driven synthetic data generation, and UNet denoising to enhance robustness to lighting and texture variability, achieving 99.1% classification accuracy while reducing overfitting and eliminating manual feature engineering, thereby improving domain adaptability for industrial textile inspection.

Access restricted. Please log in or start a trial to view this content.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This study did not involve human participants or animal subjects. Therefore, ethical approval and informed consent were not required. The proposed end-to-end woven fabric classification framework (Figure 1) consists of four sequential stages: image acquisition, preprocessing and augmentation, model training, and evaluation. The output of each stage serves as the input to the next.

Stage 1: Image acquisition: Woven fabric images were obtained from the dataset and captured using a digital camera under a controlled illumination setup. Images were acquired at 300 dpi using a 50 mm fixed focal length.

Stage 2: Preprocessing and augmentation: Images were resized and prepared for training. To enhance generalization, geometric and photometric augmentations were applied using a deep learning framework included horizontal and vertical flips (p = 0.1), affine translation (±0.1), scaling (0.8–1.2), and rotation (±45°). Photometric adjustments included brightness, contrast, and saturation variations (±40%) and hue variation (±10%).
UNet-based denoising was applied prior to training. The UNet model was implemented in the Deep learning software library (Keras Deep learning framework) and trained for 30 epochs using the Adam optimizer (learning rate = 0.001, batch size = 16).

Stage 3: Model training: A GAN was used to generate synthetic images of woven fabric to enhance features. The discriminator comprised five convolutional layers with LeakyReLU activation, while the generator included four convolutional and four deconvolution layers. The GAN was trained for 100 epochs using binary cross-entropy loss (learning rate = 0.0002, β₁ = 0.5). The CNN classifier (ResNet-50 backbone) was then jointly trained in an iterative GAN–CNN framework with a batch size of 32, dropout of 0.2, a learning rate of 0.001, and the Adam optimizer.

Stage 4: Model Evaluation: Model performance was assessed using accuracy, precision, recall, F1-score, and balanced accuracy.

1. Data set description

A total of 3,540 woven fabric images from 880 fabric samples were obtained from a publicly available dataset under controlled illumination conditions12. Of these, 2,832 images were used for testing, while the remaining 708 images were augmented to generate 11,328 training samples. The dataset is anonymized and, therefore, does not require ethical approval. Representative samples are shown in Figure 2.

The dataset comprises three weave classes: plain, satin, and twill. Fabrics were produced using polyester textured yarns (110 dtex; 1.14 and 3.05 dtex filament linear densities) and polyester microfilament textured yarns (110 dtex; 0.33, 0.57, and 0.76 dtex) as weft, and 83 dtex polyester yarns (1.14 dtex) as warp. Three weave types—1/1 Plain, 3/2 Twill, and 4/1 Satin—were constructed.

The data used in this study were obtained from a publicly available dataset that includes raw and preprocessed images, augmentation metadata, and GAN-generated samples12. Additional augmentation and GAN-based synthesis were applied to further enhance training diversity. of the dataset. The final dataset contained 11,328 training and 2832 testing images; 80% of the training data were used for model training and 20% for validation. Structural parameters ranged as follows: yarn linear density (Ne: 6–40), yarn count (25–58 ends/cm), and fabric areal density (125–485 gsm). Training and testing were performed on a graphics processing unit using a deep learning framework and software.

2. Proposed Efficient Preprocessing with augmentation

To address limited training data and improve generalization, data augmentation was applied. Augmentation expands the dataset without modifying model architecture, reduces overfitting, and enhances robustness. Two types of augmentation were employed:

Geometric augmentation:
Transformations included horizontal and vertical flips (p = 0.1), affine transformation (translate = 0.1, scale = 0.8–1.2), and fixed-angle rotation (45°). These operations simulate variations in warp–weft orientation and imaging conditions (Figure 3).

Photometric augmentation:
To increase robustness to illumination and sensor variability, brightness, contrast, and saturation were adjusted by ±40%, and hue by ±10%. These modifications preserve geometric structure while varying lighting characteristics (Figure 4).

3. Denoising using UNet

UNet is an encoder–decoder convolutional architecture used to denoise structured woven fabric textures. Because fabric patterns are sensitive to sensor and illumination noise, denoising is performed prior to classification to preserve structural details; the network uses a sigmoid activation function in the output layer, and the UNet-based denoising architecture (Figure 5). The denoised images served as refined inputs to the GAN–CNN pipeline for synthetic generation and classification. The mathematical formulation of the UNet denoising process and the GAN optimization strategy (Equations 1–10) are provided in Supplementary File 1. The interaction among UNet, GAN, and CNN modules within the end-to-end framework is illustrated in Figure 6.

4. Proposed End-to-End model generation and training using GAN-CNN

The GAN–CNN hybrid framework was employed for woven fabric pattern recognition. As shown in Figure 6, a generative adversarial network (GAN), consisting of a generator (G) and a discriminator (D), was used to synthesize realistic woven fabric images under varying lighting, noise, and texture conditions to increase dataset diversity, while the CNN learned discriminative features from both real and generated samples to improve classification accuracy.

5. CNN-based classification

Following GAN-based image synthesis, both real and generated woven fabric images were used to train a CNN for texture feature extraction and classification. A pretrained ResNet-50 architecture was adopted to classify three weave types. The original fully connected layer was removed, while the early convolutional layers were retained as the backbone. On top of this backbone, a global average pooling layer, two batch normalization layers, two fully connected layers (512 and 256 neurons), ReLU activations, and dropout were added. A Softmax layer performed the final three-class classification. The modified architecture is shown in Figure 7.

The model was trained using the Adam optimizer with categorical cross-entropy loss for 50 epochs (batch size = 32, learning rate = 0.001, dropout = 0.2). Hyperparameter tuning is conducted via grid search (learning rate: 0.001–0.0001; batch size: 16–64; dropout: 0.1–0.3). Early stopping based on validation loss was applied to prevent overfitting, with convergence achieved in approximately 2.3 hours per training.

A coordinated end-to-end training strategy was employed to ensure consistency across denoising, data synthesis, and classification stages. The UNet was first pre-trained for 30 epochs using noisy–clean image pairs (Adam, learning rate = 0.001, batch size = 16, MSE loss). The GAN module, comprising a generator with four convolutional and four deconvolution layers and a discriminator with five convolutional layers using LeakyReLU activations, was trained adversarially for 100 epochs (binary cross-entropy loss, β₁ = 0.5, learning rate = 0.0002). Subsequently, the GAN and CNN were jointly trained in an iterative loop for 50 epochs (batch size = 32), with generated samples used to update the classifier. CNN optimization used the Adam optimizer (learning rate = 0.001, dropout = 0.2), promoting stable convergence and improved generalization across weave types.

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Evaluation Metrics
Accuracy is the most widely used evaluation statistic for categorization. This is defined as the proportion of accurate predictions among all predictions. Equation 11 shows that balanced accuracy is the appropriate performance evaluation metric to use in these circumstances18. "N" represents the number of classes. TP, TN, FP, and FN denote the numbers of true positives, true negatives, false positives, and false negatives, respectively, in t...

Access restricted. Please log in or start a trial to view this content.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

While the proposed GAN–CNN framework demonstrates strong generalization, there are other alternative methods such as transformer-based vision architectures, attention-enhanced CNNs, or self-supervised representation learning that could address similar hypotheses. These may offer advantages in feature interpretability or computational efficiency and should be evaluated comparatively in the future17,19.

The improved recognition and...

Access restricted. Please log in or start a trial to view this content.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors have no conflicts of interest.

Acknowledgements

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors gratefully acknowledge the support provided by the School of Art and Design, Guangzhou University, Guangzhou, China, which facilitated the completion of this research.

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
Canon EOS 90D Canon Inc., Tokyo, JapanEOS 90D 32.5 MP CMOS sensorDigital imaging camera for fabric image acquisition
Intel i7 ProcessorIntel Corporation, Santa Clara, CA, USAhttps://www.intel.comMulti-core central processing unit (CPU) for computational processing
Keras Deep Learning FrameworkGoogle LLC, Mountain View, CA, USAhttps://keras.ioDeep learning software library for neural network development
LED Ring Light (5500 K)Commercially available laboratory illumination systemNot applicableControlled illumination source for uniform image acquisition
NVIDIA GeForce GTX1060MQ GPUNVIDIA Corporation, Santa Clara, CA, USAhttps://www.nvidia.comGraphics processing unit (GPU) for accelerated deep learning computation
OpenCV LibraryOpen Source Communityhttps://opencv.orgComputer vision software library for image processing
Python Programming LanguagePython Software Foundation, Wilmington, DE, USAhttps://www.python.orgHigh-level programming language for machine learning implementation
ResNet50 Pretrained ModelMicrosoft Research / He et al. (2016)https://keras.io/api/applications/resnet/Pretrained convolutional neural network architecture for feature extraction and classification
scikit-learn LibraryOpen Source Communityhttps://scikit-learn.orgMachine learning software library for data analysis and model evaluation
TensorFlow FrameworkGoogle LLC, Mountain View, CA, USAhttps://www.tensorflow.orgDeep learning framework for neural network training and deployment
Warp Yarn (Polyester, 83 dtex)In-house Textile LaboratoryNot applicableSynthetic textile yarn used as warp material in woven fabric samples
Woven Fabric Samples (Plain, Satin, Twill)In-house Textile LaboratoryPolyester yarns 110 dtexRepresentative woven textile samples with different weave structures

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

Woven Fabric RecognitionFabric Pattern ClassificationConvolutional Neural NetworkGenerative Adversarial NetworkUNet Image DenoisingSynthetic Image GenerationTextile Inspection AutomationData AugmentationVisual Distortion Robustness

Related Articles