Cloth defect detection method, system and electronic device

By combining a dual-model integration scheme with anomaly detection, target detection, and color/texture anomaly detection, the problems of low accuracy and low efficiency in fabric defect detection in existing technologies are solved, achieving efficient and accurate defect detection.

CN118279231BActive Publication Date: 2025-12-12RUIJIE NETWORKS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211734439.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-12-12
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Existing deep learning models suffer from low accuracy in fabric defect detection due to the small proportion of defect data, resulting in high manual collection costs, low efficiency, and low detection accuracy. Furthermore, a single model cannot promptly verify false positives, leading to low detection accuracy.

Method used

A dual-model integration scheme is adopted. First, the anomaly detection network model is used to initially confirm the presence of defects in the fabric image and output the first defect box. Then, the target detection network model is used for further confirmation. Finally, the color and texture anomaly detection models are used for verification to ensure the accuracy of the detection.

Benefits of technology

It improves the accuracy and efficiency of fabric defect detection, avoids false detections, saves human resources, and enhances the efficiency of defect data collection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118279231B_ABST
    Figure CN118279231B_ABST
Patent Text Reader

Abstract

The application discloses a cloth defect detection method and system and electronic equipment. The method comprises the following steps: receiving a cloth image; inputting the cloth image into an anomaly detection network model to obtain a first defect frame; inputting the cloth image into a target detection network model to obtain a second defect frame; calculating specified data between the first defect frame and the second defect frame, and determining whether the specified data meets a first preset condition; if yes, inputting the cloth image into a color anomaly detection model and a texture anomaly detection model respectively to confirm that the cloth image has no defect; and if no, confirming that the cloth image has a defect. Through the technical scheme provided in the embodiment of the application, the integration scheme of the double models is adopted, the problem that a single model cannot effectively review the misjudgment of the cloth defect in time is avoided under the premise of ensuring the accuracy of the model, and thus the detection accuracy of the cloth defect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of machine vision defect detection, and in particular to a cloth defect detection method and system and electronic equipment. BACKGROUND

[0002] With the large-scale development of the textile industry, the quality control of textile products is becoming more and more important. In the production process of cloth in textile products, cloth defects may be caused due to yarn, machine, worker operation, and other reasons. If the generated cloth defects cannot be found in time and remedial work such as manual repair, shutdown inspection, etc. is performed on the cloth defects in the first time, it will lead to uneven cloth quality, market competitiveness decline and other adverse consequences. Therefore, the detection of cloth defects is an important link in the cloth production process.

[0003] In the existing cloth defect detection method, a deep learning model can be used to detect cloth defects, such as training a convolutional neural network (CNN) based on defect data in cloth data, and then classifying and identifying the feature image in the cloth image through the trained CNN to realize the detection of cloth defects.

[0004] However, in the above-mentioned cloth defect detection of the deep learning model, when collecting defect data for training the deep learning model, the proportion of defect data in the entire cloth data is very small, resulting in high cost and low efficiency of manually collecting defect data, and thus leading to low detection accuracy and low detection efficiency of cloth defects. In addition, the deep learning model uses a single model, and in actual application, in order to ensure the inference performance of the deep learning model, the accuracy of the deep learning model cannot be avoided. In addition, the single model cannot effectively review the false detection of cloth defects in time, thus leading to low detection accuracy of cloth defects. SUMMARY

[0005] The present application provides a cloth defect detection method, system and electronic equipment to solve the problem of low detection accuracy of cloth defects caused by the single model being unable to effectively review the detection of cloth defects in time. The specific implementation scheme is as follows:

[0006] In a first aspect, the present application provides a cloth defect detection method, which comprises:

[0007] receiving a cloth image;

[0008] inputting the cloth image into an anomaly detection network model to obtain a first defect box;

[0009] inputting the cloth image into a target detection network model to obtain a second defect box;

[0010] calculating specified data between the first defect frame and the second defect frame, and determining whether the specified data meets a first preset condition;

[0011] If yes, inputting the cloth image into a color anomaly detection model and a texture anomaly detection model respectively to confirm that the cloth image does not have defects.

[0012] If no, confirming that the cloth image has defects.

[0013] Based on the anomaly detection network model, the cloth image is detected for defects. After it is preliminarily confirmed that the cloth image has defects and a first defect frame is output, the cloth image is further detected for defects based on the target detection network model to obtain a second defect frame. Finally, whether the cloth image has defects is further confirmed based on the determination of whether the specified data between the first defect frame and the second defect frame meets the first preset condition. When the specified data meets the first preset condition, the color anomaly detection model and the texture anomaly detection model are finally used to confirm that the cloth image does not have defects. The integration scheme of the double models avoids the problem that a single model cannot effectively review the false detection of cloth defects in a timely manner under the premise of ensuring the accuracy of the model, thereby improving the detection accuracy of cloth defects.

[0014] In a possible implementation, before the cloth image is received, the method further includes:

[0015] collecting N cloth images of a target cloth;

[0016] training a first anomaly detection network model based on the N cloth images to obtain a second anomaly detection network model;

[0017] If the second anomaly detection network model meets a second preset condition, the second anomaly detection network model is used as the anomaly detection network model.

[0018] Based on the N cloth images of the target cloth, the first anomaly detection network model is trained. Based on the second preset condition, the anomaly detection network model is obtained, so that the parameters in the anomaly detection network model are optimal parameters, and thus the result of detecting cloth defects by the anomaly detection network model is an optimal result, further improving the detection accuracy of cloth defects. Meanwhile, the anomaly detection network model obtained can collect defect data in a cloth defect data set used for subsequent training of the first target detection network model, avoiding manual collection of the cloth defect data set, thereby saving a large amount of human resources and improving the collection efficiency of defect data, thereby improving the detection efficiency of cloth defects.

[0019] In a possible implementation, before the cloth image is received, the method further includes:

[0020] obtain a fabric defect data set, wherein the defect data in the fabric defect data set is a fabric image determined to have a defect by the anomaly detection network model, the color anomaly detection model and the texture anomaly detection model, and after review;

[0021] train a first detection network model based on the fabric defect data set to obtain a second detection network model;

[0022] if the second detection network model meets a third preset condition, the second detection network model is used as the target detection network model.

[0023] The first detection network model is trained based on the fabric defect data set, and the parameters in the obtained target detection network model are optimal parameters based on the third preset condition, so that the result of the target detection network model in detecting fabric defects is an optimal result, and the detection accuracy of fabric defects is further improved.

[0024] In a possible implementation, the inputting the fabric image into the anomaly detection network model to obtain a first defect box includes:

[0025] inputting the fabric image into the anomaly detection network model to determine whether the fabric image has a defect;

[0026] if not, outputting that the fabric image has no defect, discarding the fabric image, and continuing to collect the next frame of fabric image to be detected for defects;

[0027] if yes, outputting the first defect box.

[0028] Based on the defect detection of the fabric image by the anomaly detection network model, it is preliminarily determined whether the fabric image has a defect, most of the normal data is filtered out, and the detection efficiency of fabric defects is further improved.

[0029] In a possible implementation, the inputting the fabric image into the target detection network model to obtain a second defect box includes:

[0030] inputting the fabric image into the target detection network model to determine whether the fabric image has a defect;

[0031] if not, outputting that the fabric image has no defect, inputting the fabric image into the color anomaly detection model and the texture anomaly detection model respectively to confirm that the fabric image has no defect;

[0032] if yes, outputting the second defect box.

[0033] The target detection network model is used for detecting defects in the cloth image, and whether the cloth image has defects is further confirmed, and the detection accuracy of the cloth defects is further improved.

[0034] In a possible implementation, the inputting the cloth image into the color anomaly detection model and the texture anomaly detection model respectively to confirm that the cloth image has no defects comprises:

[0035] The cloth image is inputted into the color anomaly detection model and the texture anomaly detection model respectively, and color information and texture information are outputted respectively;

[0036] It is judged whether the color information and the texture information have no anomaly;

[0037] If not, the cloth image is reviewed to confirm that the cloth image has defects, and the cloth image is used as a candidate data set for training the target detection network model;

[0038] If yes, it is confirmed that the cloth image has no defects.

[0039] The color anomaly detection model and the texture anomaly detection model are used to further check whether the cloth image has defects, avoid missing detection, and further improve the detection accuracy of the cloth defects.

[0040] In a second aspect, the application further provides a cloth defect detection system, which comprises:

[0041] The receiving module is configured to receive a cloth image.

[0042] The anomaly detection module is configured to input the cloth image into an anomaly detection network model to obtain a first defect frame.

[0043] The target detection module is configured to input the cloth image into a target detection network model to obtain a second defect frame.

[0044] The processing module is configured to calculate specified data between the first defect frame and the second defect frame, and judge whether the specified data meets a first preset condition.

[0045] If yes, the cloth image is inputted into a color anomaly detection model and a texture anomaly detection model respectively, and it is confirmed that the cloth image has no defects.

[0046] If not, it is confirmed that the cloth image has defects.

[0047] In a possible implementation, the receiving module is specifically configured to collect N cloth images of a target cloth.

[0048] training a first anomaly detection network model based on the N fabric images, to obtain a second anomaly detection network model;

[0049] if the second anomaly detection network model meets a second preset condition, taking the second anomaly detection network model as the anomaly detection network model.

[0050] In a possible implementation, the receiving module is specifically configured to acquire a fabric defect data set, wherein the defect data in the fabric defect data set is a fabric image determined to have a defect by the anomaly detection network model together with any one of the color anomaly detection model and the texture anomaly detection model and after review;

[0051] training a first detection network model based on the fabric defect data set, to obtain a second detection network model;

[0052] if the second detection network model meets a third preset condition, taking the second detection network model as the target detection network model.

[0053] In a possible implementation, the anomaly detection module is specifically configured to input the fabric image into the anomaly detection network model, and determine whether the fabric image has a defect.

[0054] if not, outputting that the fabric image does not have a defect, discarding the fabric image, and continuing to collect a next frame of fabric image to be detected for a defect;

[0055] if yes, outputting the first defect box.

[0056] In a possible implementation, the target detection module is specifically configured to input the fabric image into the target detection network model, and determine whether the fabric image has a defect.

[0057] if not, outputting that the fabric image does not have a defect, inputting the fabric image into the color anomaly detection model and the texture anomaly detection model respectively, and confirming that the fabric image does not have a defect;

[0058] if yes, outputting the second defect box.

[0059] In a possible implementation, the processing module is specifically configured to input the fabric image into the color anomaly detection model and the texture anomaly detection model respectively, and output color information and texture information respectively.

[0060] determining whether the color information and the texture information both do not have an anomaly.

[0061] If no, the cloth image is reviewed to confirm that the cloth image has defects, and the cloth image is used as a candidate data set for training the target detection network model.

[0062] If yes, it is confirmed that the cloth image does not have defects.

[0063] In a third aspect, the present application provides an electronic device, comprising:

[0064] a memory for storing a computer program;

[0065] a processor for executing the computer program stored on the memory to implement the steps of the cloth defect detection method described above.

[0066] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the cloth defect detection method described above.

[0067] The technical effects of each aspect and each aspect that can be achieved in the above-mentioned second to fourth aspects can be referred to the technical effect description of the first aspect or the various possible schemes in the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0068] Figure 1 a flowchart of a cloth defect detection method provided by the present application;

[0069] Figure 2 a defect frame schematic diagram provided by the present application;

[0070] Figure 3 a cloth defect detection platform schematic diagram provided by the present application;

[0071] Figure 4 a processing process schematic diagram of a cloth defect detection method provided by the present application;

[0072] Figure 5 a schematic diagram of a cloth defect detection system provided by the present application;

[0073] Figure 6 a schematic diagram of an electronic device provided by the present application. DETAILED DESCRIPTION

[0074] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings. The specific operation methods in the method embodiment can also be applied to the device embodiment or the system embodiment. It should be noted that in the description of the present application, "multiple" is understood as "at least two". The association relationship of the associated objects is described, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. A and B are connected, which means that A and B are directly connected and A and B are connected through C. In addition, in the description of the present application, "first", "second", etc. are used only for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can it be understood as indicating or implying order.

[0075] The embodiments of the present application will be described in detail below with reference to the drawings.

[0076] At present, in the cloth defect detection based on the deep learning model, when collecting the defect data used for training the deep learning model, due to the very small proportion of the defect data in the whole cloth data, the cost of manually collecting the defect data is high and the efficiency is low, thereby causing the low detection accuracy and low detection efficiency of the cloth defect; and the deep learning model adopts a single model, in order to ensure the inference performance of the deep learning model in actual application, the accuracy of the deep learning model cannot be avoided; in addition, the single model cannot effectively review the mis-detection of the cloth defect in time, thereby causing the low detection accuracy of the cloth defect.

[0077] Therefore, the present application proposes a cloth defect detection method, which detects the cloth image based on an anomaly detection network model, detects the cloth image based on a target detection network model after preliminarily confirming that the cloth image has defects and outputting a first defect box, obtains a second defect box, and finally confirms whether the cloth image has defects based on the judgment of whether the specified data between the first defect box and the second defect box meets the first preset condition. When the specified data meets the first preset condition, the color anomaly detection model and the texture anomaly detection model finally confirm that the cloth image has no defects, an integrated scheme of double models is adopted, the problem that a single model cannot effectively review the mis-detection of the cloth defect in time is avoided on the premise of ensuring the accuracy of the model, and the detection accuracy of the cloth defect is improved.

[0078] Reference Figure 1 As shown in the figure, a cloth defect detection method flowchart provided by an embodiment of the present application is provided, and the method comprises:

[0079] S1, receiving a cloth image;

[0080] Specifically, first, a surface image of a target cloth with defects to be detected is acquired.

[0081] It should be noted that in the embodiments of the present application, the surface image of the target cloth can be acquired by an industrial camera or by a camera, and the present application does not limit the acquisition method of the surface image of the target cloth.

[0082] Then, the acquired surface image of the target cloth is converted according to a data preprocessing method, and a cloth image is obtained.

[0083] It should be noted that in the embodiments of the present application, the data preprocessing method is image grayscale and automatic detection of cloth edges.

[0084] In the above manner, the cloth image can be input into a subsequent model for defect detection without other operations.

[0085] Before receiving the cloth image, an anomaly detection network model and a target detection network model for detecting defects of the cloth image are also acquired.

[0086] First, the anomaly detection network model is acquired.

[0087] Specifically, when acquiring the anomaly detection network model, first, a target cloth is acquired, and then N cloth images of the target cloth are collected, where N is an integer greater than zero.

[0088] It should be noted that in the embodiments of the present application, the N cloth images collected are normal cloth images, i.e., cloth images without defects; and normal cloth images are easier to collect than cloth images with defects, thereby ensuring that the subsequent first anomaly detection network model has sufficient and easily accessible training data.

[0089] Then, based on the N cloth images, the first anomaly detection network model is trained to obtain a second anomaly detection network model.

[0090] It should be noted that in the embodiments of the present application, the first anomaly detection network model is not limited to any one of the most advanced (English: State of the arts, abbreviated as SOTA) model, where the SOTA model represents a model with the best performance in a specific task. For example, the first anomaly detection network model can be a CNN or a K-Nearest Neighbors (English: K-Nearest Neighbors, abbreviated as KNN).

[0091] It is determined whether the second anomaly detection network model meets a second preset condition.

[0092] It should be noted that in the embodiments of the present application, the second preset condition can be that the detection accuracy of the second abnormality detection network model on the fabric defects reaches a first preset threshold, or the detection error of the second abnormality detection network model on the fabric defects is lower than a second preset threshold. In the embodiments of the present application, the second preset condition can be adjusted according to the actual application scene.

[0093] If the second abnormality detection network model does not meet the second preset condition, the model parameters that can be modified in the first abnormality detection network model are modified, and the first abnormality detection network model after the modified model parameters is continuously trained until the second abnormality detection network model meets the second preset condition.

[0094] If the second abnormality detection network model meets the second preset condition, it is considered that the first abnormality detection network model is trained, and the second abnormality detection network model is used as the subsequent abnormality detection network model for fabric defect detection.

[0095] It should be noted that in the embodiments of the present application, because different styles of fabric contain different feature information, one style of fabric corresponds to one abnormality detection network model.

[0096] In the above manner, based on the N fabric images of the target fabric, the first abnormality detection network model is trained, and based on the second preset condition, the abnormality detection network model is obtained, so that the parameters in the abnormality detection network model are optimal parameters, and thus the result of the abnormality detection network model detecting fabric defects is the optimal result, further improving the detection accuracy of fabric defects. At the same time, based on the obtained abnormality detection network model, the defect data in the fabric defect data set used for subsequent training of the first target detection network model can be collected, avoiding manual collection of the fabric defect data set, thereby saving a large amount of human resources and improving the collection efficiency of the defect data, thereby improving the detection efficiency of the fabric defects.

[0097] Further, in the embodiments of the present application, in addition to determining the abnormality detection network model, the target detection network model also needs to be obtained.

[0098] In obtaining the target detection network model, first, the fabric defect data set is obtained, wherein the defect data in the fabric defect data set is the fabric image determined to have defects by any one of the color abnormality detection model and the texture abnormality detection model in the abnormality detection network model and rechecked.

[0099] Specifically, first, the defect of the cloth image is detected by running the anomaly detection network model for a period of time to obtain a certain amount of data set, and then the data set is further confirmed to have defects by any one of the color anomaly detection model and the texture anomaly detection model, and finally the data set is reviewed and confirmed to have defects, and the cloth defect data set is obtained. During the detection of the defect of the cloth image by the anomaly detection network model running for a period of time, this stage can also be referred to as a cold detection stage.

[0100] It should be noted that in the embodiment of the present application, the defect data in the cloth defect data set can be defect data of different styles of cloth determined by different anomaly detection network models.

[0101] Then, based on the cloth defect data set, the first detection network model is trained to obtain the second detection network model, and it is judged whether the second detection network model meets the third preset condition.

[0102] It should be noted that in the embodiment of the present application, the first detection network model is not limited to any SOTA model, for example, the first detection network model can be a single step multi-frame target detection model (English: Single Shot MultiBox Detector, abbreviated as SSD), or a generative adversarial network model (English: Generative Adversarial Network, abbreviated as GAN).

[0103] In the embodiment of the present application, the third preset condition can be that the detection accuracy of the cloth defect of the second detection network model reaches the third preset threshold and the loss function curve is smooth, or the detection error of the cloth defect of the second detection network model is lower than the fourth preset threshold. In the embodiment of the present application, the third preset condition can be adjusted according to the specific application scenario.

[0104] If the second detection network model does not meet the third preset condition, the model parameters in the first detection network model that can be modified are modified, and the first detection network model after the modified model parameters is continuously trained until the second detection network model meets the third preset condition.

[0105] If the second detection network model meets the third preset condition, it is considered that the first detection network model is trained, and the second detection network model is taken as the target detection network model.

[0106] Through the above-mentioned manner, based on the cloth defect data set, the first detection network model is trained, and based on the third preset condition, the parameters in the obtained target detection network model are optimal parameters, so that the result of the target detection network model detecting the cloth defect is the optimal result, and the detection accuracy of the cloth defect is further improved.

[0107] S2, Input the fabric image into the anomaly detection network model to obtain the first defect bounding box;

[0108] After acquiring the fabric image, the fabric image is first input into the anomaly detection network model obtained in step S1 to perform preliminary defect detection on the fabric image.

[0109] Furthermore, the anomaly detection network model is used to determine whether the input fabric image has defects. If the anomaly detection network model determines that the input fabric image does not have defects, the output fabric image does not have defects, and then the fabric image is discarded, and the next frame of fabric image to be detected for defects is collected. If the anomaly detection network model determines that the input fabric image has defects, the first defect box representing the location of the defect point is output.

[0110] By using the above method, based on the anomaly detection network model, the detection of defects in fabric images was initially determined, and most of the normal data was filtered out, further improving the detection efficiency of fabric defects.

[0111] S3, input the fabric image into the target detection network model to obtain the second defect box;

[0112] Only after the anomaly detection network model determines that there are defects in the fabric image is the fabric image input into the target detection network model to obtain the second defect bounding box.

[0113] Specifically, the fabric image is first input into the object detection network model; then, the object detection network model determines whether the input fabric image has defects; if the object detection network model determines that the input fabric image has no defects, it outputs that the fabric image has no defects. Then, the fabric image is input into the color anomaly detection model and the texture anomaly detection model respectively to further confirm that the fabric image has no defects; if the object detection network model determines that the input fabric image has defects, it outputs a second defect box indicating the location of the defect point.

[0114] By using the above method, based on the target detection network model, the detection of defects in fabric images is further confirmed, thereby further improving the detection accuracy of fabric defects.

[0115] S4, calculate the specified data between the first defect frame and the second defect frame, and determine whether the specified data meets the first preset condition;

[0116] After the target detection network model also determines that there are defects in the fabric image, it is necessary to further process the first defect box output by the anomaly detection network model and the second defect box output by the target detection network model to further determine whether there are defects in the fabric image.

[0117] Specifically, firstly, the specified data between the first defect frame and the second defect frame is calculated, and then it is determined whether the calculated specified data meets the first preset condition.

[0118] It should be noted that in this embodiment, the first preset condition can be that the specified data is less than the fifth preset threshold, or that the specified data is within the range of the sixth preset threshold and the seventh preset threshold. In this embodiment, the first preset condition can be adjusted according to the specific type of the specified data.

[0119] If the specified data meets the first preset condition, then proceed to step S5; if the specified data does not meet the first preset condition, then proceed to step S6.

[0120] For example, the specified data can be set as the Intersection-Over-Union (IOU), where IOU is the ratio of the intersection to the union of the first and second defect boxes. (See example...) Figure 2 The diagram shows a defect frame, where A represents the first defect frame and B represents the second defect frame. The IOU is the ratio obtained by dividing A∩B by A∪B. The first preset condition is set to IOU being less than a preset threshold, which is determined based on the operator's historical experience in fabric defect detection. Then, the IOU between the first and second defect frames is calculated, and it is determined whether the calculated IOU meets the first preset condition. If the IOU is less than the preset threshold, it means that the IOU meets the first preset condition, and step S5 is executed; if the IOU is not less than the preset threshold, it means that the IOU does not meet the first preset condition, and step S6 is executed.

[0121] By using the above method, the calculation based on the specified data comprehensively considers the defect range contained in the first defect box and the second defect box, that is, it comprehensively considers the detection results of the anomaly detection network model and the target detection network model, avoiding the occurrence of false detection by a single model, and further improving the detection accuracy of fabric defects.

[0122] S5. Input the fabric image into the color anomaly detection model and the texture anomaly detection model respectively to confirm that the fabric image has no defects.

[0123] When the specified data calculated in step S4 meets the first preset condition, the fabric image is input into the color anomaly detection model and the texture anomaly detection model respectively, and then it is confirmed that the fabric image has no defects.

[0124] Specifically, the fabric image is first input into the color anomaly detection model and the texture anomaly detection model, respectively, and the color information and texture information are output respectively.

[0125] It should be noted that in the embodiments of the present application, when the fabric image is input into the color anomaly detection model and the texture anomaly detection model respectively, the fabric image can be first input into the color anomaly detection model to detect whether there is color anomaly in the fabric image, or the fabric image can be first input into the texture anomaly detection model to detect whether there is texture anomaly in the fabric image. In the embodiments of the present application, the detection order of the color anomaly detection model and the texture anomaly detection model is not limited.

[0126] In addition, it should be noted that in the embodiments of the present application, the color anomaly detection model and the texture anomaly detection model are obtained in the same way as the abnormality detection network model in step S1, that is, based on the obtained N fabric images for training, and then when the trained model meets the preset condition, the color anomaly detection model and the texture anomaly detection model are obtained.

[0127] Moreover, in the embodiments of the present application, the color anomaly detection model and the texture anomaly detection model are still not limited to any SOTA model. For example, the color anomaly detection model can be a Gaussian statistical model based on 3σ standard, or a clustering model based on spiking neural network (English: Apiking Neural Nerwork, abbreviated as SNN). The texture anomaly detection model can be a frequency domain analysis model based on Fourier transform, or a texture inspection model based on Gaussian mixed (English: Gaussian Mixed Model, abbreviated as GMM) classifier. In the embodiments of the present application, the specific color anomaly detection model and the texture anomaly detection model can be selected according to the actual application scene.

[0128] Further, it is judged whether the color information and the texture information both do not exist abnormality;

[0129] If the color information and the texture information do not both exist abnormality, it means that there is color anomaly or texture anomaly in the fabric image, or both color and texture exist abnormality in the fabric image. Then the fabric image needs to be reviewed, the existence of defects in the fabric image is confirmed according to the review result, and the fabric image is used as a candidate data set for training the target detection network model. The fabric image is also uploaded to the upper computer, which is used to store the defect data set.

[0130] It should be noted that in the embodiments of the present application, when the target detection network model no longer meets the third preset condition, the first detection network model can be continuously trained based on the candidate data set and the original fabric defect data set, until the second detection network model after training meets the third preset condition again, and a new target detection network model is obtained. At this time, the new target detection network model meets the third preset condition.

[0131] If neither the color information nor the texture information is abnormal, it is determined that the cloth image does not have defects.

[0132] It should be noted that, in the embodiment of the present application, when the color abnormality detection model detects that the cloth image has color abnormality, it can be directly determined that the cloth image has defects, without further detecting whether the texture of the cloth is abnormal; similarly, when the texture abnormality detection model detects that the cloth image has texture abnormality, it can also be directly determined that the cloth image has defects, without further detecting whether the color of the cloth is abnormal. In the embodiment of the present application, the detection of cloth texture abnormality and the detection of cloth color abnormality can be adjusted according to the actual application scene.

[0133] In the above manner, based on the color abnormality detection model and the texture abnormality detection model, it is further checked whether the cloth image has defects, avoiding the occurrence of missed detection, and further improving the detection accuracy of cloth defects.

[0134] In a possible implementation, when the cloth image is input into the color abnormality detection model and the texture abnormality detection model respectively, the detection accuracy or the detection error of the cloth defects can be calculated based on the cloth defects, and the target defect frame with the highest detection accuracy or the lowest detection error can be determined in the first defect frame and the second defect frame, and then the local cloth image corresponding to the target defect frame in the cloth image can be determined.

[0135] Further, the local cloth image is input into the color abnormality detection model and the texture abnormality detection model respectively, and the color information and the texture information are output; then it is determined whether the color information and the texture information are both abnormal.

[0136] If the color information is abnormal or the texture information is abnormal, or both the color information and the texture information are abnormal, the local cloth image is rechecked, and according to the rechecking result, it is determined that the local cloth image has defects, and then the local cloth image is used as a candidate data set for training the network model, and the local cloth image is uploaded to the upper computer.

[0137] If neither the color information nor the texture information is abnormal, it is determined that the local cloth image does not have defects, and further, it is determined that the cloth image does not have defects.

[0138] By the above manner, based on the calculation method of the detection accuracy or detection error of the cloth defect, the target defect frame with the highest detection accuracy or the lowest detection error is determined in the first defect frame and the second defect frame, and then the local cloth image corresponding to the target defect frame in the cloth image is subjected to color and texture anomaly detection. Compared with directly inputting the cloth image into the color anomaly detection model and the texture anomaly detection model, the detection data of the color anomaly detection model and the texture anomaly detection model is reduced, thereby the detection time of the color anomaly detection model and the texture anomaly detection model is reduced, and the detection efficiency of the cloth defect is further improved.

[0139] S6, confirming that the cloth image has a defect;

[0140] When the specified data calculated in step S4 does not meet the first preset condition, it is confirmed that the cloth image has a defect, and then the cloth image and the first defect frame and the second defect frame representing the defect position are uploaded to the upper computer. Next, the next frame of cloth image to be detected for defect is continuously collected for defect detection.

[0141] In addition, it should be noted that in the embodiment of the present application, based on steps S1-S6, a "cloud-edge-end" collaborative scheme can be used to build a cloth defect detection platform.

[0142] For example, referring to the cloth defect detection platform schematic diagram as shown in Figure 3 , the "cloud" is a cloud data center, the "edge" is an edge computing node, and the "end" is a production line.

[0143] Based on the cloud data center, rich data from the production line can be used to train a centralized target detection network model according to the needs of the production scene, and then the trained target detection network model is sent to the edge computing node.

[0144] The edge computing node is deployed in the production line server and mainly includes an inference server, a model manager and a model warehouse and other components, which are used for inference of a hybrid model and sending of inference results to a quality control system in the production line. The hybrid model is an integrated model of the anomaly detection network model and the target detection network model.

[0145] The production line mainly performs image acquisition, pre-processing operation on the acquired image, and management of the inference results of the model.

[0146] In summary, the fabric defect detection method proposed in the application detects fabric images based on an anomaly detection network model to detect defects. After preliminarily confirming that the fabric image has defects and outputting a first defect box, the fabric image is detected based on a target detection network model to obtain a second defect box. Finally, whether the fabric image has defects is further confirmed based on whether the specified data between the first defect box and the second defect box meets the first preset condition. When the specified data meets the first preset condition, the fabric image is finally confirmed to have no defects based on the color anomaly detection model and the texture anomaly detection model. Through the double-model integration scheme adopted by the method, the problem of single model being unable to effectively review the false detection of fabric defects in a timely manner is avoided under the premise of ensuring the accuracy of the model, thereby improving the detection accuracy of fabric defects.

[0147] In addition, the anomaly detection network model can collect defect data in the fabric defect data set used to train the first target detection network model, avoiding manual collection of the fabric defect data set, thereby saving a large amount of human resources and improving the collection efficiency of defect data, thereby improving the detection efficiency of fabric defects.

[0148] The technical scheme of the application will be further described below in combination with a specific application process.

[0149] As Figure 4 shown is a processing process schematic diagram of the fabric defect detection method. First, the fabric surface image is collected by the industrial camera in image acquisition. Then, the collected fabric surface image is transmitted to the data preprocessing module to perform gray scale processing on the surface image to obtain a fabric image. The fabric image is transmitted to the model training module to train the first anomaly detection network model, the first detection network model, the first color anomaly detection model, and the first texture anomaly detection model. Then, based on the preset condition, the anomaly detection network model, the target detection network model, the color anomaly detection model, and the texture anomaly detection model are obtained. The data set used to train the first detection network model is a fabric defect data set composed of fabric images determined to have defects after being determined by the anomaly detection network model and any one of the color anomaly detection model and the texture anomaly detection model and being reviewed. The color anomaly detection model and the texture anomaly detection model constitute the post-processing module.

[0150] Further, based on the image acquisition and data preprocessing module, the target cloth image is acquired; the target cloth image is transmitted to the anomaly detection network model, if the anomaly detection network model determines that the target cloth image does not exist defect, the target cloth image is discarded, and the next frame of target cloth surface image is continuously acquired; if the anomaly detection network determines that the target cloth image exists defect, the first defect frame is output, and the first defect frame is transmitted to the IOU calculation module, and the target cloth image transmitted from the data preprocessing module is transmitted to the target detection network model;

[0151] In the target detection network model, if it is determined that the target cloth image does not exist defect, the target cloth image is transmitted to the post-processing module, and then the texture anomaly detection model and the color anomaly detection model in the post-processing module are used to determine whether the target cloth image exists defect; if it is determined that the target cloth image exists defect, the second defect frame is output, and the second defect frame is transmitted to the IOU calculation module;

[0152] Further, after the first defect frame and the second defect frame are transmitted to the IOU calculation module, the IOU between the first defect frame and the second defect frame is calculated in the IOU calculation module, and then it is judged whether the IOU is less than a preset threshold value;

[0153] If the IOU is less than the preset threshold value, the target cloth image is transmitted to the post-processing module, and then the texture anomaly detection model and the color anomaly detection model in the post-processing module are used to detect whether the target cloth image exists texture anomaly or color anomaly; if the target cloth image does not exist texture anomaly and color anomaly, the target cloth image is rechecked, it is confirmed that the target cloth image exists defect, and then the target cloth image is used as a candidate data set for training the target detection network model, and the target cloth image is uploaded to the upper computer for saving; if the target cloth image does not exist texture anomaly and color anomaly, it is confirmed that the target cloth image does not exist defect, the target cloth image is discarded, and the next frame of target cloth surface image is continuously acquired;

[0154] If the IOU is not less than the preset threshold value, it is confirmed that the target cloth image exists defect, and at this time, the target cloth image and the first defect frame and the second defect frame representing the defect position are uploaded to the upper computer for saving.

[0155] Through the above manner, the fabric image is detected for defects based on the anomaly detection network model, after the fabric image is preliminarily confirmed to exist defects and the first defect box is output, the fabric image is detected for defects based on the target detection network model, the second defect box is obtained, and finally whether the fabric image exists defects is further confirmed based on the judgment of the IOU between the first defect box and the second defect box and the preset threshold, and when the IOU is less than the preset threshold, whether the fabric image exists defects is finally confirmed based on the color anomaly detection model and the texture anomaly detection model. Through the double-model integration scheme adopted by the method, the problem that a single model cannot effectively review the false detection of fabric defects in time is avoided under the premise of ensuring the accuracy of the model, and thus the detection accuracy of fabric defects is improved.

[0156] In addition, the anomaly detection network model can collect defect data in the fabric defect data set used to train the first target detection network model, avoiding manual collection of the fabric defect data set, thereby saving a large amount of human resources and improving the collection efficiency of the defect data, thereby improving the detection efficiency of the fabric defects.

[0157] Based on the same inventive concept, the embodiment of the present application also provides a fabric defect detection system, as shown in Figure 5 The structure of a fabric defect detection system provided by the present application is shown in the figure, and the system comprises:

[0158] The receiving module 501 is configured to receive a fabric image.

[0159] The anomaly detection module 502 is configured to input the fabric image into the anomaly detection network model to obtain a first defect box.

[0160] The target detection module 503 is configured to input the fabric image into the target detection network model to obtain a second defect box.

[0161] The processing module 504 is configured to calculate specified data between the first defect box and the second defect box, and determine whether the specified data meets a first preset condition.

[0162] If the specified data meets the first preset condition, the fabric image is input into the color anomaly detection model and the texture anomaly detection model respectively, and it is confirmed that the fabric image does not exist defects.

[0163] If the specified data does not meet the first preset condition, it is confirmed that the fabric image exists defects.

[0164] In a possible implementation, the receiving module 501 is specifically configured to collect N fabric images of a target fabric.

[0165] Based on the N fabric images, the first anomaly detection network model is trained to obtain a second anomaly detection network model.

[0166] If the second anomaly detection network model meets the second preset condition, the second anomaly detection network model is used as the anomaly detection network model.

[0167] In a possible implementation, the receiving module 501 is specifically configured to acquire a fabric defect data set, wherein the defect data in the fabric defect data set is a fabric image with defects determined by the anomaly detection network model together with any one of the color anomaly detection model and the texture anomaly detection model and determined to have defects after review;

[0168] Based on the fabric defect data set, the first detection network model is trained to obtain a second detection network model;

[0169] If the second detection network model meets the third preset condition, the second detection network model is used as the target detection network model.

[0170] In a possible implementation, the anomaly detection module 502 is specifically configured to input the fabric image into the anomaly detection network model, and determine whether the fabric image has defects.

[0171] If the anomaly detection network model confirms that the fabric image has no defects, it is output that the fabric image has no defects, the fabric image is discarded, and the next frame of fabric image to be detected for defects is continuously collected.

[0172] If the anomaly detection network model confirms that the fabric image has defects, the first defect box is output.

[0173] In a possible implementation, the target detection module 503 is specifically configured to input the fabric image into the target detection network model, and determine whether the fabric image has defects.

[0174] If the target detection network model confirms that the fabric image has no defects, it is output that the fabric image has no defects, and the fabric image is input into the color anomaly detection model and the texture anomaly detection model respectively to confirm that the fabric image has no defects.

[0175] If the target detection network model confirms that the fabric image has defects, the second defect box is output.

[0176] In a possible implementation, the processing module 504 is specifically configured to input the fabric image into the color anomaly detection model and the texture anomaly detection model respectively, and output color information and texture information respectively.

[0177] It is determined whether the color information and the texture information both have no abnormalities.

[0178] If the color information and the texture information do not both have no abnormalities, the fabric image is reviewed to confirm that the fabric image has defects, and the fabric image is used as a candidate data set for training the target detection network model.

[0179] If the color information and the texture information are both normal, it is confirmed that the fabric image is free of defects.

[0180] Based on the same inventive concept, the embodiment of the present application further provides an electronic device, which can realize the functions of the fabric defect detection system described above, and refer to Figure 6 The electronic device includes:

[0181] At least one processor 601 and a memory 602 connected with the at least one processor 601, the specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application, Figure 6 In the embodiment, the connection between the processor 601 and the memory 602 through the bus 600 is taken as an example. The bus 600 is represented by a thick line in Figure 6 The connection mode between other components is only schematically illustrated, and is not limited. The bus 600 can be divided into an address bus, a data bus, a control bus, etc., for the convenience of representation, Figure 6 In the embodiment, only one thick line is used to represent, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 601 can also be called a controller, and the name is not limited.

[0182] In the embodiment of the present application, the memory 602 stores instructions executable by the at least one processor 601, and the at least one processor 601 can execute the fabric defect detection method discussed above by executing the instructions stored in the memory 602. The processor 601 can realize the functions of various modules in the system shown in Figure 6

[0183] Among them, the processor 601 is the control center of the system, and can connect various parts of the whole control device through various interfaces and lines, and through running or executing the instructions stored in the memory 602 and calling the data stored in the memory 602, the system Various functions and processing data, thereby overall monitoring the system.

[0184] In a possible design, the processor 601 can include one or more processing units, and the processor 601 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 can be realized on the same chip, and in some embodiments, they can also be realized on independent chips respectively.

[0185] ​The processor 601 can be a general processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic component, a discrete hardware component, and can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general processor can be a microprocessor or any conventional processor. The steps of the cloth defect detection method disclosed in the embodiments of the present application can be directly embodied as execution by a hardware processor, or executed by a combination of hardware and software modules in the processor.

[0186] The memory 602 is a non-volatile computer readable storage medium, which can be used to store non-volatile software programs, non-volatile computer executable programs, and modules. The memory 602 can include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. The memory 602 is any other medium capable of carrying or storing desired program codes in the form of instructions or data structures and capable of being accessed by a computer, but is not limited thereto. The memory 602 in the embodiments of the present application can also be a circuit or any other device capable of realizing a storage function, used for storing program instructions and / or data.

[0187] By designing and programming the processor 601, the codes corresponding to the cloth defect detection method introduced in the foregoing embodiments can be fixed into the chip, so that the chip can execute the steps of the cloth defect detection method of the embodiments shown in the running time. Figure 5 How to design and program the processor 601 is a technology known to those skilled in the art, which will not be described here.

[0188] Based on the same inventive concept, the embodiments of the present application also provide a storage medium storing computer instructions, when the computer instructions run on a computer, the computer executes the cloth defect detection method discussed above.

[0189] In some possible implementation, the various aspects of the method for detecting fabric defects provided by the present application can also be implemented in the form of a program product, which includes program codes for causing the control device to perform the steps of the method for detecting fabric defects according to various exemplary embodiments of the present application described above in the specification when the program product is run on the device.

[0190] Those skilled in the art should understand that the embodiments of the present application can be provided in the form of a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer-usable program codes.

[0191] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as a combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks

[0192] These computer program instructions can also be stored in a computer-readable memory capable of directing the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction means, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks

[0193] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide a process for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks

[0194] Obviously, many modifications and variations of the present application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A method of detecting flaws in a cloth, characterized by, The method comprises: receiving a cloth image; inputting the cloth image into an anomaly detection network model to obtain a first defect frame; inputting the cloth image into a target detection network model to obtain a second defect frame; calculating specified data between the first defect frame and the second defect frame, and determining whether the specified data meets a first preset condition; if yes, inputting the cloth image into a color anomaly detection model and a texture anomaly detection model respectively to confirm that the cloth image has no defect; if no, confirming that the cloth image has a defect.

2. The method of claim 1, wherein, Before the receiving of the cloth image, the method further comprises: collecting N cloth images of a target cloth; training a first anomaly detection network model based on the N cloth images to obtain a second anomaly detection network model; if the second anomaly detection network model meets a second preset condition, taking the second anomaly detection network model as the anomaly detection network model.

3. The method of claim 1, wherein, Before the receiving of the cloth image, the method further comprises: obtaining a cloth defect data set, wherein the defect data in the cloth defect data set is a cloth image determined to have a defect by the anomaly detection network model and any one of the color anomaly detection model and the texture anomaly detection model after common determination and rechecking; training a first detection network model based on the cloth defect data set to obtain a second detection network model; if the second detection network model meets a third preset condition, taking the second detection network model as the target detection network model.

4. The method of claim 1, wherein, The inputting of the cloth image into the anomaly detection network model to obtain the first defect frame comprises: inputting the cloth image into the anomaly detection network model to determine whether the cloth image has a defect; if no, outputting that the cloth image has no defect, discarding the cloth image, and continuing to collect a next frame of cloth image to be detected for a defect; if yes, outputting the first defect frame.

5. The method of claim 1, wherein, The inputting of the cloth image into the target detection network model to obtain the second defect frame comprises: inputting the cloth image into the target detection network model to determine whether the cloth image has a defect; if no, outputting that the cloth image has no defect, inputting the cloth image into the color anomaly detection model and the texture anomaly detection model respectively, and confirming that the cloth image has no defect; if yes, outputting the second defect frame.

6. The method of claim 1, wherein, The inputting of the cloth image into the color anomaly detection model and the texture anomaly detection model respectively to confirm that the cloth image has no defect comprises: inputting the cloth image into the color anomaly detection model and the texture anomaly detection model respectively to output color information and texture information respectively; determining whether there is no anomaly in the color information and the texture information; if no, rechecking the cloth image to confirm that the cloth image has a defect, and taking the cloth image as a candidate data set for training the target detection network model; if yes, confirming that the cloth image has no defect.

7. A system for detecting defects in a fabric image, the system comprising: a light source; a camera; a light source controller; a camera controller; and a processor. The system comprises: a receiving module configured to receive a cloth image; an anomaly detection module configured to input the cloth image into an anomaly detection network model to obtain a first defect frame; The target detection module is configured to input the cloth image into a target detection network model to obtain a second defect frame; The processing module is configured to calculate specified data between the first defect frame and the second defect frame, and determine whether the specified data meets a first preset condition; If yes, the cloth image is input into a color anomaly detection model and a texture anomaly detection model respectively to confirm that the cloth image does not have defects; If no, it is confirmed that the cloth image has defects.

8. The system of claim 7, wherein, The processing module is configured to input the cloth image into the color anomaly detection model and the texture anomaly detection model respectively, and output color information and texture information respectively; Determine whether there is no anomaly in the color information and the texture information; If no, the cloth image is rechecked to confirm that the cloth image has defects, and the cloth image is used as a candidate data set for training the target detection network model; If yes, it is confirmed that the cloth image does not have defects.

9. An electronic device, comprising: The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-6. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-6. ​ 10. A computer-readable storage medium, characterized in that, ​

Citation Information

Patent Citations

  • Cloth defect detection method based on multi-modal fusion deep learning

    CN111028204A

  • High-definition camera cloth defect detection method based on convolutional neural network

    CN111047655A