$$\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.