Fabric Surface Anomaly Detection
Unsupervised anomaly detection for textile inspection using PatchCore embedding with FAISS indexing, achieving 98.9% AUROC.
Overview
Fabric inspection requires detecting subtle defects โ snags, holes, density variations โ with no defective samples available during training. This project adapts the PatchCore algorithm for high-resolution textile images.
Method
Patch features are extracted from WideResNet-50 at layers and , then aggregated into a memory bank :
The anomaly score for a full image is the maximum patch score:
Coreset Subsampling
The memory bank is compressed via greedy coreset selection to maintain of the original feature set with < 1% AUROC degradation. This reduces search time with FAISS from 120 ms to < 5 ms.
Results
| Metric | Value | |---|---| | AUROC | 98.9% | | Inference Time | 12 ms/frame | | Training Samples Needed | 200 (normal only) |