A two-stage grey cloth defect detection method, system, medium and computer

CN115937107BActive Publication Date: 2026-09-25SHANGHAI ZHIJING INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211459649.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-16
Publication Date
2026-09-25
Estimated Expiration
2042-11-16

AI Technical Summary

Technical Problem

[0003]针对现有技术存在的不足,本发明的目的在于提供一种两阶段坯布缺陷检测方法、系统、介质及计算机,以解决现有的缺陷检测算法存在的缺陷漏检率较高的问题

Benefits of technology

[0027]综上所述,本发明具有以下有益效果:本申请通过使用两个阶段的坯布缺陷神经网络模型,对坯布照片上的缺陷进行识别、定位和检测,在第一阶段的定位和预分类过程中,可以设置较低的置信度阈值,使更多的缺陷都输入到深度学习检测模型中进行检测和识别,以保证整体缺陷检测的召回率,同时在第二阶段的精细化分类过程中,提升缺陷类别识别的准确率,相比传统的一阶段的缺陷检测定位方法,具有更高的检测准确率,并且可以降低良品区域的过度检测率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115937107B_ABST
    Figure CN115937107B_ABST
Patent Text Reader

Abstract

The present application relates to a two-stage gray cloth defect detection method, system, medium and computer, the present application is through using two-stage gray cloth defect neural network model, the defect on the gray cloth photo is identified, positioned and detected, in the positioning and pre-classification process of the first stage, the lower confidence threshold can be set, more defects are input into the deep learning detection model for detection and identification, to ensure the recall rate of the whole defect detection, at the same time in the second stage of the fine classification process, the accuracy of defect category identification is improved, compared with the traditional one-stage defect detection positioning method, it has higher detection accuracy, and can reduce the over detection rate of good product area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection technology, and more specifically, to a two-stage fabric defect detection method, system, medium, and computer. Background Technology

[0002] During the production of grey fabric, it is necessary to detect defects in a timely manner and then carry out subsequent processing. Conventional defect detection algorithms mainly use detection algorithms to detect defects. These algorithms include shallow machine learning methods such as manually constructed features + AdaBoost, and object detection methods based on deep learning. Conventional methods directly use detection algorithms to detect defects in grey fabric. This approach is not very accurate in terms of defect category because some defect categories have little difference in appearance, and some defects are not much different from the background. Therefore, in actual inspection, using detection algorithms to intelligently identify defects in grey fabric suffers from low detection efficiency and a large number of missed detections. Summary of the Invention

[0003] To address the shortcomings of existing technologies, the present invention aims to provide a two-stage fabric defect detection method, system, medium, and computer to solve the problem of high defect false negative rates in existing defect detection algorithms.

[0004] The above-mentioned technical objective of the present invention is achieved through the following technical solution: a two-stage fabric defect detection method, comprising:

[0005] S1. Obtain the first photo of the greige fabric;

[0006] S2. Using a target detection neural network model, target recognition is performed on the first fabric photograph to determine whether there are defects on the first fabric photograph;

[0007] S3. If a defect exists, use a rectangle to select the target area where the defect is located on the first fabric photograph to obtain the corresponding defect frame area.

[0008] S4. Pre-classify the defects in the defect box area to obtain the corresponding pre-classification results;

[0009] S5. Based on the pre-classification result, input all defect box regions corresponding to the pre-classification result into a pre-trained defect classification neural network model corresponding to the pre-classification result, so as to determine whether the defects in each defect box region corresponding to the pre-classification result are textile defects, and obtain the corresponding fabric defect detection result.

[0010] S6. Statistically analyze all textile defects and use them as the corresponding raw fabric defect detection results.

[0011] Optionally, the step of using the target detection neural network model to perform target recognition on the first fabric photograph includes: replacing the cspdarknet53 architecture backbone network in the target detection neural network model with the res2net architecture backbone network.

[0012] Optionally, the step includes: selecting the target area using a rectangular frame with a rotation angle.

[0013] Optionally, step S4 includes: the pre-classification result includes: the defect in the defect box is a meridional defect or a latitudinal defect or other defects.

[0014] Optionally, step S5 includes: if the defect in the defect box is a warp defect, inputting the corresponding second fabric photograph into a first defect classification neural network model; if the defect in the defect box is a weft defect, inputting the corresponding second fabric photograph into a second defect classification neural network model; and if the defect in the defect box is another type of defect, inputting the corresponding second fabric photograph into a third defect classification neural network model.

[0015] Optionally, the warp defects include: broken warp, double warp, misaligned warp, and buttonholes; the weft defects include: broken weft, double weft, edge weft, and weft shrinkage; the other defects include: dot defects, foreign matter woven in, holes, stained yarn, stains, broken yarn, dragging yarn, and flyaways.

[0016] Optionally, step S5 further includes: cutting out each defect frame region from the first fabric photograph to obtain a corresponding second fabric photograph; adjusting the pixel size of the second fabric photograph according to the pre-classification result, including: when the defect in the defect frame region is a warp defect, normalizing the pixel size of the corresponding second fabric photograph to 224*40; when the defect in the defect frame is a weft defect, normalizing the pixel size of the corresponding second fabric photograph to 40*224; when the defect in the defect frame is another defect, normalizing the pixel size of the corresponding second fabric photograph to 112*112.

[0017] A two-stage fabric defect detection system includes:

[0018] Fabric photo acquisition module: used to acquire the first fabric photo;

[0019] First defect judgment module: Performs target recognition on the first fabric photo to determine whether there are defects on the first fabric photo;

[0020] Defect location module: Use a rectangle to select the target area where the defect is located on the first fabric photo to obtain the corresponding defect frame area;

[0021] Pre-classification module: pre-classifies the defects in the defect box area to obtain the corresponding pre-classification results;

[0022] Second defect judgment module: Determines whether the defects in each defect box area corresponding to the pre-classification result are textile defects;

[0023] Fabric photo cutting module: used to cut out the area selected by the defect frame from the first fabric photo to obtain the corresponding second fabric photo;

[0024] Image size adjustment module: used to adjust the pixel size of the second fabric photograph according to the pre-classification result.

[0025] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described above.

[0026] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0027] In summary, the present invention has the following beneficial effects: This application uses a two-stage neural network model for fabric defects to identify, locate, and detect defects on fabric photographs. In the first stage of localization and pre-classification, a lower confidence threshold can be set to allow more defects to be input into the deep learning detection model for detection and identification, thereby ensuring the overall recall rate of defect detection. At the same time, in the second stage of refined classification, the accuracy of defect category identification is improved. Compared with the traditional one-stage defect detection and localization method, it has a higher detection accuracy and can reduce the over-detection rate in good product areas. Attached Figure Description

[0028] Figure 1 This is a flowchart of a two-stage fabric defect detection method according to the present invention;

[0029] Figure 2 This is a structural diagram of a two-stage fabric defect detection system according to the present invention;

[0030] Figure 3 This is an illustration of the angled bounding box calculation elements of the present invention;

[0031] Figure 4 This is an internal structural diagram of a computer device in an embodiment of the present invention.

[0032] In the diagram: 1. Fabric photo acquisition module; 2. First defect judgment module; 3. Defect location module; 4. Pre-classification module; 5. Second defect judgment module; 6. Fabric photo cutting module; 7. Image size adjustment module. Detailed Implementation

[0033] To make the objectives, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Several embodiments of the present invention are shown in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein.

[0034] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature.

[0035] In this invention, unless otherwise expressly specified and limited, "above" or "below" a second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of a second feature includes the first feature being directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" of a second feature includes the first feature being directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature. The terms "vertical," "horizontal," "left," "right," "above," "below," and similar expressions are for illustrative purposes only and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed or operated in a specific orientation, and therefore should not be construed as limiting the invention.

[0036] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0037] This invention provides a two-stage method for detecting defects in raw fabric, such as... Figure 1 As shown, it includes:

[0038] S1. Obtain the first photo of the greige fabric;

[0039] S2. Using a target detection neural network model, target recognition is performed on the first fabric photograph to determine whether there are defects on the first fabric photograph;

[0040] S3. If a defect exists, use a rectangle to select the target area where the defect is located on the first fabric photograph to obtain the corresponding defect frame area.

[0041] S4. Pre-classify the defects in the defect box area to obtain the corresponding pre-classification results;

[0042] S5. Based on the pre-classification result, input all defect box regions corresponding to the pre-classification result into a pre-trained defect classification neural network model corresponding to the pre-classification result, so as to determine whether the defects in each defect box region corresponding to the pre-classification result are textile defects, and obtain the corresponding fabric defect detection result.

[0043] S6. Statistically analyze all textile defects and use them as the corresponding raw fabric defect detection results.

[0044] In practical applications, traditional defect detection methods primarily involve artificially constructing defects, training a deep learning neural network model, photographing the fabric on a textile machine, and then using the trained model to analyze and detect defects. Bounding boxes are used to mark the defects in the photos, and the coordinates of these boxes are sent to users to help them locate the defects on the fabric. However, in practice, some defects are indistinguishable from the fabric's texture, and some photos capture areas outside the fabric, causing the deep learning model to mistake these environmental elements for defects. Therefore, the traditional approach is to increase the number of training samples to improve the deep learning model's detection accuracy. A loss function is also needed to control the model's accuracy and prevent over-detection or under-detection. However, since over-detection and under-detection are contradictory, accurately detecting defects on the fabric remains extremely difficult.

[0045] To address the above situation, this application proposes a two-stage fabric defect detection method. Specifically, firstly, a photograph of the fabric is acquired. In this application, an industrial camera is mounted on the fabric spinning machine to photograph the fabric. Correspondingly, to ensure good uniformity of the fabric photograph, preprocessing is performed after photographing. The preprocessing includes: histogram uniformization of the photograph to ensure uniform light distribution; resizing the photograph using OPEN CV to obtain a photograph with uniform scale, thereby increasing the proportion of defects in the photograph; and then performing target recognition on the resized photograph to determine whether defects exist in the target photograph, and the type and location of the defects. In this application, the first target detection neural network model uses the YOLOX model. The YOLOX model has two branches: one responsible for predicting defect regions, and the other responsible for predicting the defect category to which each defect region belongs. The latter is a binary classification problem (N defect types result in N binary classifications), using multi-label binary classification cross-entropy loss, the formula of which is: In this model, the true labels are `labels`, and the final prediction output is `y`. This means the first-stage deep learning model outputs two results: the location of the defect (annotated using a bounding box) and the type of defect (determining the type of defect within the bounding box). In this application, defect types are mainly divided into three categories: meridional defects, latitudinal defects, and other defects. When a defect target is obtained, it is determined whether the defect is a meridional defect, a latitudinal defect, or another type of defect. Through these three determinations, the defect can be classified accordingly.

[0046] To improve the accuracy of defect identification and avoid misidentifying non-defects as defects, the defect detection results obtained in the first stage need to be further classified and judged. In the second stage of detection, the area selected by the defect box needs to be cut out from the original photo to increase the proportion of defects in the overall photo, ensuring accurate defect identification. Then, the cut-out photo is normalized, and the defect photo is adjusted to different sizes according to the different types of defects to ensure a higher proportion of defects in the photo. The pre-processed photo is then input into a pre-trained defect classification neural network model for further classification of defects to determine whether the defects in the second fabric photo are truly defects, and the corresponding judgment results are output.

[0047] In the second stage of defect assessment, multiple neural network models are typically pre-set. These models are trained specifically based on the pre-classification results from the first stage. In this embodiment, the detected defects are pre-classified into three main categories in the first stage: longitudinal defects, latitudinal defects, and other defects. Then, three refined classification models are trained for each of these three categories. Based on the classification from the first stage, a defect is input into the model corresponding to the pre-classified main category for refined assessment. This involves further judging whether the defect belongs to a specific subcategory within the main category. If the defect does not belong to any subcategory, it is considered not a defect. If the defect belongs to a specific subcategory, a notification of the detection result is output.

[0048] Furthermore, this application also provides an application embodiment:

[0049] In actual production, an industrial camera is used to photograph the fabric production line, resulting in a photograph of the fabric, referred to as the first fabric photograph. Then, a target detection neural network model is used to identify targets in the first fabric photograph to detect all defects. In this step, since there may be other targets in the first fabric photograph that are very similar to defects but are not fabric defects, they may also be detected by the target detection neural network model. Therefore, further classification is required for these cases. For example, if 15 targets are actually detected in the first fabric photograph, only 12 of them are fabric defects, and the other 3 are false detections. Therefore, in order to remove these false detections from the fabric defects, further detection and classification of the 15 targets are required. Therefore, based on the "error" results of the target detection neural network model, the 15 targets are first pre-classified. In this embodiment, the pre-classification mainly includes three categories: longitudinal defects, latitudinal defects, and other defects. The longitudinal defects category contains 9 targets, of which 2 are non-defective and 7 are defective. The latitudinal defects category contains 4 targets, of which 3 are defective and 1 is non-defective. The other defects category contains 2 defective targets. Then, for each pre-classification category, a defect classification neural network model is trained, resulting in three defect classification neural network models. The first model receives the 9 longitudinal defect targets, the second model receives the 4 latitudinal defect targets, and the third model receives the 2 other defect targets. Using these models, the input targets are further accurately classified. Therefore, the first model should output 7 defect detection results, the second model should output 3, and the third model should output 2.

[0050] Furthermore, the step of using the target detection neural network model to perform target recognition on the first fabric photograph includes: replacing the cspdarknet53 architecture backbone network in the target detection neural network model with the res2net architecture backbone network.

[0051] In practical applications, the native backbone network of YOLOx is the CSPDarkNet53 structure, which plays a role in image feature extraction. However, the feature extraction capability of this structure is not strong enough. Through experimental optimization, the CSPDarkNet53 structure is replaced with the Res2Net network structure, which can effectively improve the image feature extraction capability and ultimately improve the detection accuracy.

[0052] Furthermore, the step of using a rectangular frame to select the target area where the defect is located on the first fabric photograph to obtain at least one defect frame includes: using a rectangular frame with a rotation angle to select the target area.

[0053] In practical applications, specifically, the output of a traditional object detection model without rotation angles consists of the fixed coordinates (x, y) of the top-left corner of the bounding box (bbox) and the normalized width and height (w, h); while the output with rotation angles adds an angle value (θ). A bounding box with rotation angles can achieve a higher proportion of the target (defect) within the image region it encloses, and a lower proportion of the background region, which helps the model learn the target region more accurately and reduces interference from background information. In this application, as... Figure 3 As shown, the bounding box with rotation angle is represented using a five-parameter method, namely x, y, w, h, and θ. x and y are the coordinates of the center point of the bounding box, respectively. θ is the acute angle between the rotation coordinate system and the x-axis, with counter-clockwise rotation designated as a negative angle; therefore, the angle range is [-90°, 0). The width w of the rotated box is the corner of the rotated box, and the height h is the other side. In this application, the θ value is also used as a classification criterion. That is, when the θ value is greater than a threshold, the defect is considered a meridional defect; when the θ value is less than a threshold, the defect is considered a lateral defect. This decouples the angle information from the bounding box parameter information. Therefore, the loss calculation of the rotated box is also divided into two parts: angle loss and horizontal bounding box loss.

[0054] Further, step S4 includes: the pre-classification result includes: the defect in the defect box is a meridional defect or a latitudinal defect or other defects.

[0055] In practical applications, the pre-classification results can usually be adjusted according to business needs and do not necessarily include only these three pre-classification results. In the actual production and testing process, different classifications can also be made through other classification standards.

[0056] Further, in step S5, based on the pre-classification result, the second fabric photograph is input into three pre-trained defect classification neural network models for accurate classification, including: if the defect in the defect box is a warp defect, the corresponding second fabric photograph is input into the first defect classification neural network model; if the defect in the defect box is a weft defect, the corresponding second fabric photograph is input into the second defect classification neural network model; if the defect in the defect box is another type of defect, the corresponding second fabric photograph is input into the third defect classification neural network model.

[0057] In practical applications, different defect classification neural network models need to be trained according to different pre-classification results. This means further identification and detection of the pre-classified defect photos. On the one hand, this ensures that the target in the defect photo is indeed a textile defect, and on the other hand, it enables more refined classification of textile defects.

[0058] Furthermore, the warp defects include: broken warp, double warp, misaligned warp, and buttonholes; the weft defects include: broken weft, double weft, edge weft, and weft shrinkage; the other defects include: dot-like defects, foreign matter woven in, holes, stained yarn, stains, broken yarn, dragging yarn, and flyaways.

[0059] Further, step S5 also includes: cutting out each defect frame region from the first fabric photograph to obtain a corresponding second fabric photograph; adjusting the pixel size of the second fabric photograph according to the pre-classification result, including: when the defect in the defect frame region is a warp defect, normalizing the pixel size of the corresponding second fabric photograph to 224*40; when the defect in the defect frame is a weft defect, normalizing the pixel size of the corresponding second fabric photograph to 40*224; when the defect in the defect frame is another defect, normalizing the pixel size of the corresponding second fabric photograph to 112*112.

[0060] In practical applications, image normalization refers to the process of performing a series of standard transformations on an image to convert it into a fixed standard form; this standard image is called a normalized image. After undergoing some processing or attacks, the original image can produce multiple copies. These copies, after undergoing image normalization with the same parameters, can obtain a standard image of the same form. First, the parameters of the transformation function are determined using moments in the image that are invariant to affine transformations. Then, the transformation function determined by these parameters is used to transform the original image into a standard form (this image is independent of affine transformations). Generally speaking, moment-based image normalization includes four steps: coordinate centering, x-shearing normalization, scaling normalization, and rotation normalization. Image normalization makes images resistant to geometric transformation attacks; it can identify the invariants in the image, thus revealing that these images were originally identical or part of a series.

[0061] In summary, this application uses a two-stage neural network model for fabric defects to identify, locate, and detect defects in fabric photographs. In the first stage of localization and pre-classification, a lower confidence threshold can be set to allow more defects to be input into the deep learning detection model for detection and identification, thus ensuring the overall recall rate of defect detection. Meanwhile, in the second stage of refined classification, the accuracy of defect category identification is improved. Compared with the traditional one-stage defect detection and localization method, this method has a higher detection accuracy and can reduce the over-detection rate in good product areas.

[0062] like Figure 2 As shown, the present invention also provides a two-stage fabric defect detection system, comprising:

[0063] Fabric photo acquisition module: used to acquire the first fabric photo;

[0064] First defect judgment module: Performs target recognition on the first fabric photo to determine whether there are defects on the first fabric photo;

[0065] Defect location module: Use a rectangle to select the target area where the defect is located on the first fabric photo to obtain the corresponding defect frame area;

[0066] Pre-classification module: pre-classifies the defects in the defect box area to obtain the corresponding pre-classification results;

[0067] Second defect judgment module: Determines whether the defects in each defect box area corresponding to the pre-classification result are textile defects;

[0068] Fabric photo cutting module: used to cut out the area selected by the defect frame from the first fabric photo to obtain the corresponding second fabric photo;

[0069] Image size adjustment module: used to adjust the pixel size of the second fabric photograph according to the pre-classification result.

[0070] For specific limitations regarding a two-stage fabric defect detection system, please refer to the limitations of a two-stage fabric defect detection method described above, which will not be repeated here. Each module in the aforementioned two-stage fabric defect detection system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0071] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. When the computer program is executed by the processor, it implements a two-stage fabric defect detection method.

[0072] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0073] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps: including:

[0074] S1. Obtain the first photo of the greige fabric;

[0075] S2. Using a target detection neural network model, target recognition is performed on the first fabric photograph to determine whether there are defects on the first fabric photograph;

[0076] S3. If a defect exists, use a rectangle to select the target area where the defect is located on the first fabric photograph to obtain the corresponding defect frame area.

[0077] S4. Pre-classify the defects in the defect box area to obtain the corresponding pre-classification results;

[0078] S5. Based on the pre-classification result, input all defect box regions corresponding to the pre-classification result into a pre-trained defect classification neural network model corresponding to the pre-classification result, so as to determine whether the defects in each defect box region corresponding to the pre-classification result are textile defects.

[0079] S6. Statistically analyze all textile defects and use them as the corresponding raw fabric defect detection results.

[0080] In one embodiment, the step of using a target detection neural network model to perform target recognition on the first fabric photograph includes: replacing the cspdarknet53 architecture backbone network in the target detection neural network model with a res2net architecture backbone network.

[0081] In one embodiment, selecting the target area containing the defect on the first fabric photograph using a rectangular frame to obtain at least one defect frame includes: selecting the target area using a rectangular frame with a rotation angle.

[0082] In one embodiment, step S4 includes: the pre-classification result includes: the defect in the defect box is a meridional defect or a latitudinal defect or other defects.

[0083] In one embodiment, step S5 includes: if the defect in the defect box is a warp defect, inputting the corresponding second fabric photograph into a first defect classification neural network model; if the defect in the defect box is a weft defect, inputting the corresponding second fabric photograph into a second defect classification neural network model; and if the defect in the defect box is another type of defect, inputting the corresponding second fabric photograph into a third defect classification neural network model.

[0084] In one embodiment, the warp defects include: broken warp, double warp, misaligned warp, and buttonholes; the weft defects include: broken weft, double weft, edge weft, and weft shrinkage; the other defects include: dot defects, foreign matter woven in, holes, stained yarn, stains, broken yarn, dragging yarn, and flyaways.

[0085] In one embodiment, step S5 further includes: cutting each defect frame region from the first fabric photograph to obtain a corresponding second fabric photograph; adjusting the pixel size of the second fabric photograph according to the pre-classification result, including: when the defect in the defect frame region is a warp defect, normalizing the pixel size of the corresponding second fabric photograph to 224*40; when the defect in the defect frame is a weft defect, normalizing the pixel size of the corresponding second fabric photograph to 40*224; when the defect in the defect frame is another defect, normalizing the pixel size of the corresponding second fabric photograph to 112*112.

[0086] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0087] In summary, this application uses a two-stage neural network model for fabric defects to identify, locate, and detect defects in fabric photographs. In the first stage of localization and pre-classification, a lower threshold can be set to allow more defects to be input into the deep learning detection model for detection and identification, thus ensuring the overall recall rate of defect detection. Meanwhile, in the second stage of refined classification, the accuracy of defect category identification is improved. Compared with the traditional one-stage defect detection and localization method, this method has a higher detection accuracy and can reduce the over-detection rate in good product areas.

[0088] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0089] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A two-stage method for detecting defects in grey fabric, characterized in that, include: S1. Obtain the first photo of the greige fabric; S2. Using a target detection neural network model, target recognition is performed on the first fabric photograph to determine whether there are defects on the first fabric photograph; S3. If a defect exists, use a rectangle to select the target area where the defect is located on the first fabric photograph to obtain the corresponding defect frame area. S4. Pre-classify the defects in the defect box area to obtain the corresponding pre-classification results; S5. Based on the pre-classification result, input all defect box regions corresponding to the pre-classification result into a pre-trained defect classification neural network model corresponding to the pre-classification result, so as to determine whether the defects in each defect box region corresponding to the pre-classification result are textile defects. S6. Statistically analyze all textile defects and use them as the corresponding raw fabric defect detection results; The step of performing target recognition on the first fabric photograph using a target detection neural network model includes: Replace the cspdarknet53 architecture backbone in the object detection neural network model with the res2net architecture backbone; Step S3 includes: selecting the target area using a rectangular frame with a rotation angle; Step S4 includes: the pre-classification result includes: The defect in the defect box is a meridional defect, or the defect in the defect box is a latitudinal defect, or the defect in the defect box is another type of defect; Specifically, an industrial camera is mounted on the fabric spinning machine to photograph the fabric and obtain fabric photos. Correspondingly, to ensure good uniformity in the fabric photos, preprocessing is performed after photography. This preprocessing includes: histogram normalization to ensure uniform light distribution in the photos; resizing the photos using OpenCV to obtain photos with uniform scale, thereby increasing the proportion of defects in the photos; and then performing target recognition on the resized photos to determine whether defects exist in the target photos, and the type and location of the defects. The target detection neural network model uses the YOLOX model, which has two branches: one responsible for predicting defect regions, and the other responsible for predicting the defect category of each defect region.

2. The two-stage fabric defect detection method according to claim 1, characterized in that, Step S5 includes: If the defect in the defect box is a warp defect, the corresponding second fabric photograph is input into the first defect classification neural network model; If the defect in the defect box is a weft defect, the corresponding second fabric photograph is input into the second defect classification neural network model; If the defect in the defect box is another defect, the corresponding second fabric photograph is input into the third defect classification neural network model.

3. The two-stage fabric defect detection method according to claim 2, characterized in that, The warp defects include: broken warp, double warp, misalignment, and buckle marks; The latitudinal defects include: discontinuous lattice, double lattice, edge lattice, and lattice contraction; Other defects include: spot defects, foreign matter embedded in the yarn, holes, stained yarn, stains, broken yarn, dragging yarn, and flyaway yarn.

4. The two-stage fabric defect detection method according to claim 1, characterized in that, Step S5 further includes: Each defect frame region is cut out from the first fabric photograph to obtain a corresponding second fabric photograph; based on the pre-classification result, the pixel size of the second fabric photograph is adjusted accordingly, including: When the defect in the defect box area is a warp defect, the corresponding second fabric photograph is normalized to a pixel size of 224*40. When the defect in the defect box is a weft defect, the corresponding second fabric photograph is normalized to a pixel size of 40*224. If the defect in the defect box is another defect, the corresponding second fabric photograph is normalized to a pixel size of 112*112.

5. A two-stage fabric defect detection system for implementing the method of claim 1, characterized in that, include: Fabric photo acquisition module: used to acquire the first fabric photo; First defect judgment module: Performs target recognition on the first fabric photo to determine whether there are defects on the first fabric photo; Defect location module: Use a rectangle to select the target area where the defect is located on the first fabric photo to obtain the corresponding defect frame area; Pre-classification module: pre-classifies the defects in the defect box area to obtain the corresponding pre-classification results; Second defect judgment module: Determines whether the defects in each defect box area corresponding to the pre-classification result are textile defects; Fabric photo cutting module: used to cut out the area selected by the defect frame from the first fabric photo to obtain the corresponding second fabric photo; Image size adjustment module: used to adjust the pixel size of the second fabric photograph according to the pre-classification result.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Product defect detection method, device and equipment and computer readable storage medium

    CN112712513A

  • Defect classification method and device, storage medium, equipment and computer program product

    CN114581723A