A fabric quality detection method based on the YOLO architecture combined with the attention mechanism is proposed. A computer vision aided data acquisition system collects images for defect detection. The goal is to create clean samples for on-linear detection. The proposed method outperforms traditional flaw detection methods such as statistical analysis or heuristic algorithms in terms of accuracy and detection speed. A convolution neural network model is used to create the deep learning model, which detects defect features using cascade convolution layers and cross stage partial network structures as the backbone network. The leaky rectified linear unit and residual units are used to effectively determine and extract features. block attention module is used to improve detection accuracy even further. Fabric flaw quality detection can thus be kept effective and precise. For performance validation, an open source practically captured data set of fabric with and without flaws is used.