Fabric Defect Detection and Localisation Using Deep Neural Networks


Team

Supervisors

Table of Contents

  1. Introduction
  2. Approach
  3. Notebooks
  4. Links

Introduction

Quality control in textile manufacturing still relies heavily on manual visual inspection, which is slow, subjective and affected by operator fatigue. Small defects such as broken yarn, holes, knots, stains and irregular weaving patterns are easy to miss on high resolution fabric.

This project automates that inspection using the AITEX Fabric Image Database. Each 4096x256 fabric image is classified as defective or defect free for the course Kaggle competition and defective regions are localised for the extended project task. We compare a classical texture feature baseline against deep learning models trained with transfer learning and evaluate both supervised and unsupervised localisation methods.

Approach

Every image is sliced into 16 non overlapping 256x256 patches so fine yarn texture survives preprocessing. The train and validation split is made once at the whole image level before patching, which prevents patch leakage between splits. Four model families are compared under the same validation protocol:

  1. Classical baseline: LBP and GLCM texture features with SVM and Random Forest classifiers.
  2. Transfer learning CNN: an ImageNet pretrained EfficientNet-B0 fine-tuned on patches with data augmentation, class weighting and early stopping, aggregated to image level with a max probability rule.
  3. Unsupervised anomaly detection: a convolutional autoencoder trained only on defect free patches, flagging defects through reconstruction error heatmaps.
  4. Supervised localisation: a U-Net trained on the original AITEX binary masks, evaluated with Dice and IoU.

Notebooks

Notebook Purpose
01_data_pipeline.ipynb Image manifest, stratified image level split, patch extraction, leakage checks
02_classical_baseline.ipynb LBP and GLCM features with SVM and Random Forest
03_cnn_transfer_learning.ipynb EfficientNet-B0 transfer learning and comparison with the baseline
04_submission.ipynb Test inference and Kaggle submission generation
05_autoencoder_anomaly.ipynb Unsupervised autoencoder anomaly detection and heatmaps
06_unet_localisation.ipynb Supervised U-Net defect segmentation