Abstract Fabric defect detection represents a pivotal step in quality control within the textile industry. However, it confronts challenges such as high similarity between pattern backgrounds and defects, the complexity of fabric backgrounds, and the diversity of defects. To address these issues, this paper proposes a fabric defect detection method based on contrast enhancement and aggregated downsampling. Firstly, a Multi-scale local contrast enhancement module is designed to enhance defect features and suppress the interference from complex background information by extracting significant nonlinear features from images. Secondly, a parallel wavelet downsampling module is introduced to avoid the loss of target information when extracting multi-level feature maps, and a lightweight design is adopted to reduce the computational burden of the network. To tackle the feature map misalignment issue during upsampling, a feature alignment aggregation module is proposed, which employs a learnable interpolation strategy to align cross-layer features. Experimental results demonstrate that this method achieves an mAP@50 of 83.9% in fabric defect detection tasks, representing a 7.3% improvement over the baseline model YOLOv8s, with an average inference speed of 67.8 FPS, meeting the requirements for real-time detection. Furthermore, the model exhibits good generalization ability, adapting to defect detection scenarios involving fabrics of different colors and textures. This study provides an efficient and robust solution for fabric defect detection in complex backgrounds.