Fabric Defect Detection Based on YOLOv8 with Color Constancy Preprocessing for Variable Illumination
Abstract
Fabric defect detection is a vital quality control procedure in textile manufacturing. Complex and variable illumination in industrial scenes often causes color distortion on fabric surfaces, which is easily misjudged as defects and reduces detection accuracy. This paper proposes a fabric defect framework combining Retinex-based color constancy preprocessing and improved YOLOv8 network. First, the Retinex module is used to estimate and compensate illumination components, generating illumination-invariant fabric images. Second, we embed Deformable Serpentine Convolution into the YOLOv8 backbone to enhance the feature extraction capability for tiny and irregular defects. Experiments are conducted on a self-constructed multi-illumination fabric defect dataset. The proposed method achieves an mAP of 89.6%, outperforming the original YOLOv8 by 7.2%. Running on an NVIDIA RTX 3060 GPU, the inference speed reaches 62 FPS, which fully meets the real-time requirements of industrial fabric inspection.