Fabric defect detection method and system based on CBS-YOLOV5
By using the CBS-YOLOV5 model in fabric defect detection, combining the CA attention module, BiFPN mechanism and SIoU loss function, the visual fatigue and subjectivity problems of traditional manual detection methods are solved, and efficient and accurate automated detection is achieved.
Patent Information
- Application Number
- CN202411326711.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-03-14
AI Technical Summary
Traditional fabric defect detection methods rely on manual labor, and there are problems of inconsistent visual fatigue, subjectivity and judgment standards, resulting in frequent missed inspections and missed inspections.
The end-to-end learning model based on CBS-YOLOV5 is used to detect fabric defects, and the model is constructed through the CA attention module, BiFPN mechanism and SIoU loss function, and feature representations are automatically learned from the original image, reducing manual feature engineering.
It realizes automated, efficient, accurate and consistent fabric defect detection, reduces labor costs, and the system is highly customizable.
Smart Images

Figure CN119624852A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of target detection, and in particular to a fabric defect detection method and system based on CBS-YOLOV5. Background Art
[0002] Traditional detection methods mainly rely on manual detection, but this type of detection method can easily cause visual fatigue and even visual damage, and the inspectors are easily disturbed by the surrounding environment, resulting in missed detection, false detection, etc. In addition, there is subjectivity in the detection and lack of unified evaluation standards. Therefore, seeking efficient and accurate fabric defect detection methods has become an urgent problem to be solved in the modern textile industry. Summary of the invention
[0003] The present invention provides a fabric defect detection method and system based on CBS-YOLOV5. The CBS-YOLOV5 model adopted by the present invention is an end-to-end learning model, which can automatically learn feature representation from original images without relying on manual feature engineering, thereby reducing workload and improving defect detection performance.
[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0005] A fabric defect detection method based on CBS-YOLOV5, comprising the following steps:
[0006] S10: Capture fabric defect images, establish a data set, preprocess the images in the data set, and obtain a fabric image data set with labels;
[0007] S20: Divide the preprocessed data set into a training set, a validation set, and a test set in a given ratio, wherein the ratio of the training set, the validation set, and the test set is 8:1:1;
[0008] S30: Add the CA attention module, BiFPN mechanism and SIoU loss function to the network structure to build the CBS-YOLOV5 model;
[0009] S40: Input the paths of the training set and the validation set, and the initial training weight file path into the parameters required for CBS-YOLOV5 model training to perform training, and obtain a trained CBS-YOLOV5 model;
[0010] S50: Input the fabric defect image path of the test set and the trained model path into the detection code, and each fabric image to be detected is output after being marked with a defect prediction frame in the CBS-YOLOV5 model. Then, the defect category, confidence level, and location information of each fabric in the test set are displayed through different prediction frames, thereby completing the detection of fabric defects.
[0011] S60: The fabric position and type information is obtained through image processing for guidance, and the fabric with known defects is grasped and placed by controlling the robot arm, so as to realize the sorting operation for the fabric with defects.
[0012] Preferably, the preprocessing of the images in the data set in S10 comprises the following steps:
[0013] S110: Data annotation: classify and number each image in the dataset;
[0014] S120: Data analysis: remove junk data sets, images with uneven overall data and poor quality due to differences in image types, length and width, and shooting environments;
[0015] S130: Image data standardization: performing normalization operation on the image to adjust the feature values of different dimensions to a similar range;
[0016] S140: Data augmentation: Expand the data set to increase the number of images in the data set.
[0017] Preferably, the CBS-YOLOV5 model includes an Input input end, a Backbone backbone network, a Neck neck, and a Head detection head end, and the construction of the CBS-YOLOV5 model includes the following steps:
[0018] S310: Join the Backbone network by introducing the CA attention module;
[0019] S320: Improve the Neck of the CBS-YOLOV5 model using the BiFPN mechanism;
[0020] S330: Use the CIOU loss function to optimize the SIOU loss function.
[0021] Preferably, the introduction of the CA attention module in S310 includes the following steps:
[0022] S311: For any input feature tensor size X=[x 1 , x 2 , …, x C , …, x H , …, x W , …], where C, H, and W are the number of channels, height, and width of the feature map, respectively, which decompose the global average pooling to effectively capture the long-range interaction features of precise location information;
[0023] S312: For the features of the input feature size C×H×W, pooling is performed in the X and Y directions respectively, generating z in the horizontal and vertical directions h and z wThe feature maps of size C×H×1 and C×1×W, where the calculation formulas for X and Y are as follows:
[0024]
[0025] S313: Concat the generated feature map with two feature maps with specific direction information in the third dimension, then use convolution to reduce the dimension, and use a nonlinear activation function to generate an intermediate feature vector f=R (C / r)×1×(h+w) ,The intermediate feature vector f contains horizontal and spatial vertical information, where r is the downsampling ratio in the channel process;
[0026] S314: Split the intermediate feature vector f along the spatial dimension to generate two feature vectors f h =R( C / r)×H×1 and f w =R (C / r)×1×W , respectively use 11× convolution to perform dimensionality increase operation, and then combine the activation function Sigmoid to get the attention g h =R C×H×1 and g W =R C×I×W ;
[0027] S315: Output the result of multiplying the feature map and the feature weight, thereby enhancing the feature representation capability.
[0028] Preferably, in S320, using the BiFPN mechanism to improve the Neck of the CBS-YOLOV5 model includes the following steps:
[0029] S321: Based on PANet, we remove nodes with smaller contributions in cross-scale fusion to simplify the network while retaining information.
[0030] S322: For the information of the same special layer, a fusion path from the original input node to the output node is added to reduce the loss of feature information caused by too many levels;
[0031] S323: Introduce a weighted feature fusion mechanism, assign a learnable weight to each fusion path, and suppress noise information by learning the fusion weights of iterative data features.
[0032] Preferably, the use of the CIOU loss function to optimize the SIOU loss function in S330 includes the following steps:
[0033] The SIoU function introduces a smoothing factor to reduce the peaks in the SIOU loss function, making the model more stable. The SIOU loss function includes Anglecost, Distancecost, Shapecost and IoUcost.
[0034] Preferably, the fabric defect detection method based on CBS-YOLOV5 further includes taking the sample data in the test set as input, performing target detection through the CBS-YOLOV5 model, outputting the target detection result, evaluating the performance of the improved CBS-YOLOV5 model, and using precision (P), recall (R), average precision (AP) and mean average precision (mAP) as evaluation indicators, wherein,
[0035] The calculation formula of precision P is as follows: Where TP represents the correct prediction of positive targets as positive; FP represents the wrong prediction of negative targets as positive;
[0036] The calculation formula for recall is as follows: In the formula, FN represents the correct judgment of negative class targets as negative;
[0037] For each detected target category, the area under the precision-recall curve is calculated, which is AP;
[0038] The average AP value of all categories is taken to get the mAP value. The calculation formula of the mAP value is as follows:
[0039]
[0040] A system for detecting fabric defects according to the aforementioned fabric defect detection method based on CBS-YOLOV5, characterized in that the system comprises:
[0041] An image preprocessing module, used for preprocessing the collected images;
[0042] An image recognition module is used to establish a data set based on the collected fabric images, construct a fabric defect detection model, and detect fabric defect points based on the fabric defect detection model; and
[0043] The fabric defect sorting module is used to sort defective fabrics.
[0044] Preferably, the image preprocessing module includes:
[0045] Data annotation unit, used to classify and label each image in the data set;
[0046] A data analysis unit, used to remove images with uneven data and poor quality from the data set;
[0047] An image data normalization unit is used to perform normalization operations on the image and adjust the feature values of different dimensions to a similar range; and
[0048] Data augmentation unit, used to expand the data set.
[0049] Preferably, the image recognition module includes:
[0050] A data set establishment unit is used to establish a data set for the collected images;
[0051] A fabric defect detection model unit, used to construct a fabric defect detection model;
[0052] A model training unit, used for training the constructed fabric defect detection model; and
[0053] Image detection unit, used for detecting fabric defects.
[0054] It can be seen from the above technical solutions that the present invention has the following beneficial effects:
[0055] 1. Automation and efficiency: The deep learning model combined with the sorting device can process fabrics for defects without human intervention. Compared with manual sorting, automated processing is more efficient and can process large quantities of fabrics quickly and continuously.
[0056] 2. Accuracy and consistency: The deep learning model has high accuracy in fabric defect tasks, is not affected by factors such as fatigue and emotions, and maintains consistency and stability. Compared with manual sorting, it reduces classification errors caused by human factors and improves the accuracy of defect classification.
[0057] 3. Reduce labor costs: The fabric defect detection system can significantly reduce labor input and save labor costs. Sorting devices, such as using robotic arms as sorting, can work continuously without rest and replenishment of manpower, thereby reducing operating costs.
[0058] 4. Highly customizable: The fabric defect detection system can be customized and adjusted according to actual needs. The parameters of the deep learning model and the sorting device can be optimized according to different fabric classification tasks, making the system more adaptable to different scenarios and needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a schematic diagram of each module of the present invention;
[0060] Figure 2 It is a schematic diagram of the implementation process of the present invention;
[0061] Figure 3 The model structure flow chart of the present invention;
[0062] Figure 4 It is a flow chart of the CA attention model of the present invention;
[0063] Figure 5 It is a structural schematic diagram of the BiFPN mechanism of the present invention. DETAILED DESCRIPTION
[0064] A preferred embodiment of the present invention is described in detail below with reference to the accompanying drawings.
[0065] To achieve the above purpose, the embodiment of the present invention adopts the following technical solution: Figure 1 , Figure 2 , a fabric defect detection method based on CBS-YOLOV5, comprising the following steps:
[0066] S10: Capture fabric defect images, establish a data set, preprocess the images in the data set, and obtain a labeled fabric image data set.
[0067] Specifically, fabric defect images are captured by a camera and image preprocessing is performed on them. The image contrast and brightness are adjusted in the preprocessing to obtain a fabric image dataset with labels.
[0068] It should be noted that in S10, LabelImg is used to perform defect data labeling processing on the constructed fabric image data set. After the defect area is labeled by the software, the real labeling box of the defect can be obtained. The obtained data includes the type of defect and the center coordinates of each real labeling box after normalization as well as the relative width and height.
[0069] S20: Divide the preprocessed data set into a training set, a validation set, and a test set in a given ratio, wherein the ratio of the training set, the validation set, and the test set is 8:1:1.
[0070] S30: Add the CA attention module, BiFPN mechanism, and SIoU loss function to the network structure to build the CBS-YOLOV5 model.
[0071] S40: Input the paths of the training set and the validation set, and the initial training weight file path into the parameters required for CBS-YOLOV5 model training to perform training, and obtain a trained CBS-YOLOV5 model.
[0072] S50: The fabric defect image path of the test set and the trained model path are input into the detection code. Each fabric image to be detected is labeled with a defect prediction frame in the CBS-YOLOV5 model and then output. The defect category, confidence level and location information of each fabric in the test set are then displayed through different prediction frames, thereby completing the detection of fabric defects.
[0073] S60: The fabric position and type information is obtained through image processing for guidance, and the fabric with known defects is grasped and placed by controlling the robot arm, so as to realize the sorting operation for the fabric with defects.
[0074] Compared with traditional manual sorting, the present invention has the following beneficial effects:
[0075] Automation and efficiency: Deep learning models combined with sorting devices can sort fabrics for defects without human intervention. Compared with manual sorting, automated processing is more efficient and can process large quantities of fabrics quickly and continuously.
[0076] Accuracy and consistency: The deep learning model has high accuracy in fabric defect tasks, is not affected by factors such as fatigue and emotions, and maintains consistency and stability. Compared with manual sorting, it reduces classification errors caused by human factors and improves the accuracy of defect classification.
[0077] Reduce labor costs: The fabric defect detection system can significantly reduce labor input and save labor costs. Sorting devices, such as using robotic arms as sorting, can work continuously without rest and replenishment of manpower, thereby reducing operating costs.
[0078] Highly customizable: The fabric defect detection system can be customized and adjusted according to actual needs. The parameters of the deep learning model and the sorting device can be optimized according to different fabric classification tasks, making the system more adaptable to different scenarios and needs.
[0079] As a preferred technical solution of this embodiment, the preprocessing of the images in the data set in S10 includes the following steps:
[0080] S110: Data labeling: classify and number each image in the dataset.
[0081] Specifically, data labeling refers to the classification and numbering of each image in the data set to facilitate subsequent analysis of the image data and other operations.
[0082] S120: Data analysis: remove junk data sets, images with uneven overall data and poor quality due to differences in image types, length and width, and shooting environments.
[0083] Specifically, data analysis refers to removing junk data in a data set, such as images with uneven overall data and poor quality due to differences in image type, length and width, and shooting environment. The presence of these images will interfere with subsequent image processing and therefore need to be removed.
[0084] S130: Image data normalization: Perform normalization operation on the image to adjust the feature values of different dimensions to a similar range.
[0085] S140: Data augmentation: Expand the data set to increase the number of images in the data set.
[0086] Reference Figure 3 , Figure 4 , Figure 5 As a preferred technical solution of this embodiment, the CBS-YOLOV5 model includes an Input input end, a Backbone backbone network, a Neck neck, and a Head detection head end. The construction of the CBS-YOLOV5 model includes the following steps:
[0087] S310: Join the Backbone network by introducing the CA attention module.
[0088] Specifically, the introduction of the CA attention module includes the following steps:
[0089] S311: For any input feature tensor size X=[x 1 , x 2 , …, x C , …, x H , …, x W , …], where C, H, and W are the number of channels, height, and width of the feature map, respectively, which decompose the global average pooling to effectively capture the long-range interaction features of precise location information.
[0090] S312: For the features of the input feature size C×H×W, pooling is performed in the X and Y directions respectively, generating z in the horizontal and vertical directions h and z w The feature maps of size C×H×1 and C×1×W, where the calculation formulas for X and Y are as follows:
[0091]
[0092] S313: Concat the generated feature map with two feature maps with specific direction information in the third dimension, then use convolution to reduce the dimension, and use a nonlinear activation function to generate an intermediate feature vector f=R (C / r)×1×(h+w) , the intermediate feature vector f contains horizontal and spatial vertical information, where r is the downsampling ratio in the channel process.
[0093] S314: Split the intermediate feature vector f along the spatial dimension to generate two feature vectors f h =R (C / r)×H×1 and fw = R (C / r)×1×W, respectively use 11× convolution to perform dimensionality increase operation, and then combine the activation function Sigmoid to get the attention g h =R C×H×1 and g W =R C×I×W .
[0094] S315: Output the result of multiplying the feature map and the feature weight, thereby enhancing the feature representation capability to improve the precision and accuracy of model recognition.
[0095] The method to add the CA attention module is: define the CA attention module in the code, put the CA attention module into the upper layer of the SPPF module, and then perform model training.
[0096] S320: Use BiFPN mechanism to improve the Neck of CBS-YOLOV5 model.
[0097] Specifically, using the BiFPN mechanism to improve the Neck of the CBS-YOLOV5 model includes the following steps:
[0098] S321: Based on PANet, the nodes with smaller contributions in cross-scale fusion are deleted to simplify the network while retaining information.
[0099] S322: For the information of the same feature layer, a new fusion path is added from the original input node to the output node to reduce the loss of feature information caused by too many levels.
[0100] S323: Introduce a weighted feature fusion mechanism, assign a learnable weight to each fusion path, and suppress noise information by learning the fusion weights of iterative data features.
[0101] It should be noted that the fast normalization fusion used is a weighted feature fusion method. This method is similar to the Softmax method in that the weights are scaled to between [0, 1]. It has fast training speed and high efficiency. Its expression is as follows:
[0102]
[0103] Among them, wi represents the learnable weight, which is always in the interval (0, 1); Ii is the input feature; ∈ is the minimum parameter, which is used to avoid the denominator being zero, and is taken as 0.0001 here. By constructing and increasing the learning weight, the network feature fusion capability is further increased.
[0104] How to add the Concat_bifpn module: Define the Concat_bifpn module in the code, replace the concat module in the YOLOv5s model with the Concat_bifpn module for training. Finally, three feature maps of different sizes are obtained and detected by the head end.
[0105] S330: Use the CIOU loss function to optimize the SIOU loss function.
[0106] Specifically, this method finally introduces the SIoU loss function. By introducing a smoothing factor, the SIoU loss function can reduce the peaks in the SIoU loss function, making the model more stable. The SIoU loss function consists of four parts: Anglecost, Distancecost, Shapecost, and IoUcost. The specific formula is as follows:
[0107]
[0108] Where B is the prediction box, B GT is the ground-truth box, Δ is the distance cost loss, and Ω is the shape cost loss.
[0109] Compared with the CIoU function, the SIoU loss function has the advantages of better size robustness, equal penalty terms, accurate position and shape measurement, and improved detection recall of small objects in small object detection. These advantages can effectively improve the performance and accuracy of small object detection.
[0110] As a preferred technical solution of this embodiment, the fabric defect detection method based on CBS-YOLOV5 also includes taking the sample data in the test set as input, performing target detection through the CBS-YOLOV5 model, outputting the target detection result, evaluating the performance of the improved CBS-YOLOV5 model, and using precision (P), recall (R), average precision (AP) and mean average precision (mAP) as evaluation indicators, wherein,
[0111] The calculation formula of precision P is as follows: Where TP represents the correct prediction of positive targets as positive; FP represents the wrong prediction of negative targets as positive. The precision P can be used to evaluate the precision of the network, which can measure the ability of the network model to correctly classify samples.
[0112] The calculation formula for recall is as follows: In the formula, FN represents the correct judgment of negative targets as negative. The recall rate can be used to evaluate the network's search capability, which can reflect the ability of the network model to detect all positive samples.
[0113] For each detected target category, the area under the precision-recall curve is calculated, which is AP;
[0114] The mAP value is obtained by averaging the AP values of all categories. mAP takes into account the performance of the model in different categories and provides a comprehensive metric that can more intuitively reflect the overall performance of the model. The calculation formula of the mAP value is as follows:
[0115] The present invention also provides a system for detecting fabric defects, the system comprising an image preprocessing module, an image recognition module and a fabric defect sorting module. Specifically, the image preprocessing module is used to preprocess the collected images, the image recognition module is used to establish a data set for the collected fabric images, construct a fabric defect detection model, and detect fabric defect points based on the fabric defect detection model. The fabric defect sorting module is used to sort defective fabrics. It should be noted that the fabric defect sorting module in the present invention can be a robotic arm. In this way, after obtaining the position and type information of the defective fabric, the robotic arm is guided to grab and place the known defective fabric to achieve the sorting task of defective fabrics.
[0116] Furthermore, the image preprocessing module includes a data labeling unit, a data analysis unit, an image data standardization unit and a data augmentation unit. The data labeling unit is used to classify and label each image in the data set, the data analysis unit is used to remove images with uneven data and poor quality in the data set, the image data standardization unit is used to normalize the image and adjust the eigenvalues of different dimensions to a similar range, and the data augmentation unit is used to expand the data set.
[0117] Furthermore, the image recognition module includes a data set establishment unit, a fabric defect detection model unit, a model training unit and an image detection unit. The data set establishment unit is used to establish a data set for the collected images, the fabric defect detection model unit is used to construct a fabric defect detection model, the model training unit is used to train the constructed fabric defect detection model, and the image detection unit is used to detect fabric defects.
[0118] The above-described embodiments are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A fabric defect detection method based on CBS-YOLOV5, characterized in that: The following steps are involved: S10: Capture fabric defect images, establish a data set, preprocess the images in the data set, and obtain a fabric image data set with labels; S20: Divide the preprocessed data set into a training set, a validation set, and a test set in a given ratio, wherein the ratio of the training set, the validation set, and the test set is 8:1:1; S30: Add the CA attention module, BiFPN mechanism and SIoU loss function to the network structure to build the CBS-YOLOV5 model; S40: Input the paths of the training set and the validation set, and the initial training weight file path into the parameters required for CBS-YOLOV5 model training to perform training, and obtain a trained CBS-YOLOV5 model; S50: Input the fabric defect image path of the test set and the trained model path into the detection code, and each fabric image to be detected is output after being marked with a defect prediction frame in the CBS-YOLOV5 model. Then, the defect category, confidence level, and location information of each fabric in the test set are displayed through different prediction frames, thereby completing the detection of fabric defects. S60: The fabric position and type information is obtained through image processing for guidance, and the fabric with known defects is grasped and placed by controlling the robot arm, so as to realize the sorting operation for the fabric with defects.
2. The fabric defect detection method based on CBS-YOLOV5 according to claim 1, characterized in that: The preprocessing of the images in the data set in S10 includes the following steps: S110: Data annotation: classify and number each image in the dataset; S120: Data analysis: remove junk data sets, images with uneven overall data and poor quality due to differences in image types, length and width, and shooting environments; S130: Image data standardization: performing normalization operation on the image to adjust the feature values of different dimensions to a similar range; S140: Data augmentation: Expand the data set to increase the number of images in the data set.
3. The fabric defect detection method based on CBS-YOLOV5 according to claim 1, characterized in that: The CBS-YOLOV5 model includes an Input input end, a Backbone backbone network, a Neck neck, and a Head detection head end. The construction of the CBS-YOLOV5 model includes the following steps: S310: Join the Backbone network by introducing the CA attention module; S320: Improve the Neck of the CBS-YOLOV5 model using the BiFPN mechanism; S330: Use the CIOU loss function to optimize the SIOU loss function.
4. The fabric defect detection method based on CBS-YOLOV5 according to claim 3, characterized in that: The introduction of the CA attention module in S310 includes the following steps: S311: For any input feature tensor size X=[x 1 , x 2 , …, x C , …, x H , …, x W , …], where C, H, and W are the number of channels, height, and width of the feature map, respectively, which decompose the global average pooling to effectively capture the long-range interaction features of precise location information; S312: For the features of the input feature size C×H×W, pooling is performed in the X and Y directions respectively, generating z in the horizontal and vertical directions h and z w The feature maps of size C×H×1 and C×1×W, where the calculation formulas for X and Y are as follows: S313: Concat the generated feature map with two feature maps with specific direction information in the third dimension, then use convolution to reduce the dimension, and use a nonlinear activation function to generate an intermediate feature vector f=R (C / r)×1×(h+w) ,The intermediate feature vector f contains horizontal and spatial vertical information, where r is the downsampling ratio in the channel process; S314: Split the intermediate feature vector f along the spatial dimension to generate two feature vectors f h =R (C / r)×H×1 and f w =R (C / r)×1×W , respectively use 11× convolution to perform dimensionality increase operation, and then combine the activation function Sigmoid to get the attention g h =R C×H×1 and g W =R C×I×W ; S315: Output the result of multiplying the feature map and the feature weight, thereby enhancing the feature representation capability.
5. The fabric defect detection method based on CBS-YOLOV5 according to claim 1, characterized in that: The S320 uses the BiFPN mechanism to improve the Neck of the CBS-YOLOV5 model, including the following steps: S321: Based on PANet, we remove nodes with smaller contributions in cross-scale fusion to simplify the network while retaining information. S322: For the information of the same special layer, a fusion path from the original input node to the output node is added to reduce the loss of feature information caused by too many levels; S323: Introduce a weighted feature fusion mechanism, assign a learnable weight to each fusion path, and suppress noise information by learning the fusion weights of iterative data features.
6. The fabric defect detection method based on CBS-YOLOV5 according to claim 1, characterized in that The use of the CIOU loss function to optimize the SIOU loss function in S330 includes the following steps: The SIoU function introduces a smoothing factor to reduce the peaks in the SIOU loss function, making the model more stable. The SIOU loss function includes Anglecost, Distancecost, Shapecost and IoUcost.
7. The fabric defect detection method based on CBS-YOLOV5 according to claim 1, characterized in that: The fabric defect detection method based on CBS-YOLOV5 also includes taking the sample data in the test set as input, performing target detection through the CBS-YOLOV5 model, outputting the target detection result, evaluating the performance of the improved CBS-YOLOV5 model, and using precision (P), recall (R), average precision (AP) and mean average precision (mAP) as evaluation indicators, wherein, The calculation formula of precision P is as follows: Where TP represents the correct prediction of positive targets as positive; FP represents the wrong prediction of negative targets as positive; The calculation formula for recall is as follows: In the formula, FN represents the correct judgment of negative class targets as negative; For each detected target category, the area under the precision-recall curve is calculated, which is AP; The average AP value of all categories is taken to get the mAP value. The calculation formula of the mAP value is as follows:
8. A system for detecting fabric defects according to the fabric defect detection method based on CBS-YOLOV5 according to any one of claims 1 to 7, characterized in that: The system comprises: An image preprocessing module, used for preprocessing the collected images; An image recognition module is used to establish a data set based on the collected fabric images, construct a fabric defect detection model, and detect fabric defect points based on the fabric defect detection model; and The fabric defect sorting module is used to sort defective fabrics.
9. The system for detecting fabric defects according to claim 8, characterized in that: The image preprocessing module comprises: Data annotation unit, used to classify and label each image in the data set; A data analysis unit, used to remove images with uneven data and poor quality from the data set; An image data normalization unit is used to perform normalization operations on the image and adjust the feature values of different dimensions to a similar range; and Data augmentation unit, used to expand the data set.
10. The system for detecting fabric defects according to claim 9, characterized in that: The image recognition module comprises: A data set establishment unit is used to establish a data set for the collected images; A fabric defect detection model unit, used to construct a fabric defect detection model; A model training unit, used for training the constructed fabric defect detection model; and Image detection unit, used for detecting fabric defects.
Citation Information
Cited By
Foreign fiber distribution detection and control system applied to spinning mill
CN120468144A