Fabric Defect Detection and Localisation Using Deep Neural Networks
Team
- E/23/076, M.T. Dineth, email
- E/23/266, H.M.U.A. Perera, email
- E/23/317, R.M.S.N. Rathnayake, email
- E/23/387, K. Srikaran, email
- E/23/430, K.W.H.N. Weerasinghe, email
Supervisors
Table of Contents
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:
- Classical baseline: LBP and GLCM texture features with SVM and Random Forest classifiers.
- 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.
- Unsupervised anomaly detection: a convolutional autoencoder trained only on defect free patches, flagging defects through reconstruction error heatmaps.
- 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 |