Quality inspection model training method based on defect recognition in production process

By using the quality detection model training method based on the production link in fabric defect detection, real-time monitoring and dynamic adjustment of the detection process, the problem of low identification accuracy in the existing technology is solved, and efficient and accurate defect detection is achieved.

CN119444761BActive Publication Date: 2025-03-28GUANGZHOU JIESHENG INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510045172.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-03-28
Estimated Expiration
2045-01-13

AI Technical Summary

Technical Problem

The lack of real-time monitoring and adjustment of fabric defect detection process in the prior art leads to low recognition accuracy.

Method used

A quality detection model training method based on defect recognition in production links is provided. By collecting image data of each link in the production process, edge detection and marking, dynamically adjusting the sliding state of the scanning window based on the sliding scanning results, and edge enhancement processing is performed according to the severity of the defect.

Benefits of technology

Real-time monitoring and dynamic adjustment are achieved, the accuracy and efficiency of defect detection are improved, and the severity of defects can be accurately evaluated and the detection effect is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444761B_ABST
    Figure CN119444761B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of defect data recognition, and in particular to a quality inspection model training method based on defect recognition in the production process. The method includes collecting initial defective product images; marking defect contours; performing sliding scanning and contour analysis on the initial defective product images, determining the severity of the defects of the initial defective product images based on the contour analysis results; performing edge enhancement processing on each of the initial defective product images based on the actual defect severity; and performing model training to obtain the corresponding defect type. The present invention improves the flexibility and efficiency of the detection process by dynamically adjusting the sliding state of the scanning window based on the real-time contour analysis results, performs edge enhancement processing according to the severity of the defects, and optimizes different types of defects with different edge enhancement processing modes, which can effectively improve the visibility of the defects, making subsequent detection and analysis more accurate and improving the overall detection effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of defect data recognition, and in particular to a quality inspection model training method based on production link defect recognition. Background Art

[0002] Fabric is the basic raw material for people's daily clothing production. Fabric is affected by factors such as production process and production equipment, and cannot reach 100% pass rate. Defective fabrics often appear, and the defects include yarn shedding, yarn breakage, holes, lint, weft skew, stains, etc. With the continuous development of textile technology, cloth defect detection methods are constantly emerging. Cloth defect detection is an important part of fabric quality control. Defect detection can ensure the quality and aesthetics of fabrics, control production costs, and reduce resource waste. Therefore, it is of great significance to study an accurate and efficient method for fabric surface defect detection.

[0003] The Chinese patent document with publication number CN115311264A discloses a method for identifying fabric defect lines for textile production. The method obtains the fabric image after sewing and semantically segments the fabric area image to be detected. According to the regional features on the fabric, the defect line is identified. According to the position of the defect line, the stretching degree of the corresponding line is adjusted; it can be seen that the existing defect detection method often relies on manual inspection or simple image processing technology, which is easily affected by human factors, resulting in low recognition accuracy. Summary of the invention

[0004] To this end, the present invention provides a quality inspection model training method based on defect recognition in the production process, so as to overcome the problem in the prior art of lack of real-time monitoring and adjustment of the defect detection process, resulting in low recognition accuracy.

[0005] To achieve the above-mentioned purpose, the present invention provides a quality inspection model training method based on production process defect recognition, comprising:

[0006] Collect image data from each link in the production process, compare the image data with standard image data to screen out image data with differences, and obtain an initial defective product image;

[0007] Performing edge detection on each of the initial defective product images and marking defect contours;

[0008] Performing edge enhancement processing on each of the initial defective product images based on the actual defect severity to obtain a target defective product image;

[0009] The initial defective product image is subjected to sliding scanning and contour analysis with a preset window size. During the scanning process, the sliding state of the current scanning window is dynamically adjusted based on the sliding scanning result, and the severity of the defect of the initial defective product image is determined based on the contour analysis result. The edge enhancement processing includes a first edge enhancement processing mode and a second edge enhancement processing mode.

[0010] Wherein, the edge enhancement processing includes a first edge enhancement processing mode and a second edge enhancement processing mode;

[0011] The defect detection training mode is determined based on the severity of the defect, and the model training is performed to obtain the corresponding defect type.

[0012] Further, dynamically adjusting the sliding state based on the sliding scanning result includes:

[0013] Get the marked contour pixels in the current scanning window and extract the defect contour line segments;

[0014] Determining whether there is a defect contour in the current scanning window based on the number of defect contour line segments;

[0015] When there is a defect contour, determining whether to reduce the preset window size according to the closure of the defect contour line segment;

[0016] Determine whether to adjust the sliding state based on the real-time eccentric distance of the current scanning window and the defect profile.

[0017] Further, determining whether there is a defect contour in the current scanning window based on the number of defect contour line segments includes:

[0018] Determine the number of defect contour segments in the current scanning window.

[0019] If the number of defect contour segments is zero, continue sliding scanning;

[0020] If the number of defect contour segments is not zero, it is determined that there is a defect in the current scanning window.

[0021] Further, determining whether to reduce the preset window size according to the closure of the defect contour line segment includes:

[0022] Calculate the actual closure index based on the length and area of ​​the defect contour segment;

[0023] Comparing the actual closure index with the preset closure threshold, and determining the closure state of the defect contour segment based on the comparison result;

[0024] Determine the closed state of the defect contour segment:

[0025] If the defect contour segment is closed, reduce the preset window size;

[0026] If the defect contour segment is not closed, the preset window size is kept unchanged and the sliding scan and analysis are continued.

[0027] Further, determining whether to adjust the sliding state based on the real-time eccentric distance between the current scanning window and the defect profile includes:

[0028] Compare the standard eccentricity distance with the real-time eccentricity distance.

[0029] If the real-time eccentric distance is less than or equal to the standard eccentric distance, the area of ​​the defect contour is calculated to obtain the real-time defect contour area, and the contour area abnormal defect is determined based on the real-time defect contour area;

[0030] If the real-time eccentric distance is greater than the standard eccentric distance, obtain the line connecting the scanning window and the defect contour center, slide along the extension direction of the line, and re-analyze the number of contour curve segments for analysis;

[0031] The real-time eccentric distance is the distance between the center point of the current scanning window and the center point of the defect contour.

[0032] Further, determining the contour area abnormal defect based on the real-time defect contour area includes:

[0033] Compare the real-time defect outline area with the standard defect outline area:

[0034] If the real-time defect contour area is less than or equal to the standard defect contour area, no marking will be performed;

[0035] If the real-time defect contour area is larger than the standard defect contour area, the corresponding defect contour is marked as an abnormal contour area defect.

[0036] Further, determining the severity of the defect of the initial defective product image based on the contour analysis result includes:

[0037] The percentage of abnormal defects in contour area to the total number of defect contours in the initial defective product image is obtained to obtain the severity of the defect.

[0038] Further, performing edge enhancement processing on each of the initial defective product images based on the actual defect severity includes:

[0039] Compare the actual defect severity with the standard defect severity.

[0040] When the actual defect severity is less than or equal to the standard defect severity, executing the first edge enhancement processing mode;

[0041] When the actual defect severity is greater than the standard defect severity, the second edge enhancement processing mode is executed.

[0042] Furthermore, the first edge enhancement processing mode is:

[0043] Obtaining brightness values ​​of all pixels in the area within each defect outline in the initial defective product image, and storing them as an initial brightness value list;

[0044] Calculate the average brightness value of the area within any of the defect contours to obtain the corresponding average defect brightness;

[0045] Obtain the brightness values ​​of all pixels outside the defect contours and store them as a background brightness value list;

[0046] Calculate the average brightness value of the area outside the defect outline to obtain the average background brightness;

[0047] Get the difference between the average background brightness and the average foreground brightness to get the actual brightness difference;

[0048] Using the corrected brightness value to update each initial brightness value of each defect contour in the initial defective product image;

[0049] Among them, for each initial brightness value, the sum of the initial brightness value and the actual brightness difference is calculated to obtain the corrected brightness value; the average defect brightness is the ratio of the initial brightness value of each pixel within the defect outline to the number of pixels; the average background brightness is the ratio of the initial brightness value of each pixel outside the defect outline to the number of pixels.

[0050] Furthermore, the second edge enhancement processing mode is:

[0051] Obtaining the grayscale values ​​of all pixels in the area within each defect outline in the initial defective product image, and recording them as first actual grayscale values;

[0052] Obtaining the grayscale values ​​of all pixels in the area outside each defect outline in the initial defective product image, and recording them as second actual grayscale values;

[0053] Obtaining the average grayscale value corresponding to the pixel point whose first actual grayscale value is less than the first average contour inner grayscale value as the second average contour inner grayscale value;

[0054] Obtaining the average grayscale value corresponding to the pixel point whose second actual grayscale value is less than the first average outer contour grayscale value as the second average outer contour grayscale value;

[0055] Obtaining the average grayscale value corresponding to the pixel point whose first actual grayscale value is greater than the first average contour inner grayscale value as the third average contour inner grayscale value;

[0056] Obtaining the average grayscale value corresponding to the pixel point whose second actual grayscale value is greater than the first average outer contour grayscale value as the third average outer contour grayscale value;

[0057] Calculate the square of each average contour inner grayscale value and the corresponding average contour outer grayscale value respectively to obtain the corresponding real-time grayscale difference;

[0058] Add the grayscale value in each average contour to the corresponding actual grayscale difference to obtain the target grayscale value;

[0059] Each original grayscale value of the initial defective product image is adjusted to a corresponding target grayscale value.

[0060] Compared with the prior art, the beneficial effect of the present invention lies in that, by real-time monitoring of the sliding scanning process, the sliding state of the scanning window is dynamically adjusted based on the real-time contour analysis results, so that the detection process is more flexible and efficient. By analyzing the defect contour, the severity of the defect can be accurately assessed to ensure that the model training accurately classifies the defect type. Edge enhancement processing is performed according to the severity of the defect, which can effectively improve the visibility of the defect and make subsequent detection and analysis more accurate. Different edge enhancement processing modes are optimized for different types of defects to improve the overall detection effect.

[0061] Furthermore, by analyzing the characteristics of defect contours in real time to adapt to different inspection situations, defects can be found and handled in a timely manner during the production process. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a flowchart of a quality inspection model training method based on production process defect identification according to an embodiment of the present invention;

[0063] Figure 2 It is a schematic diagram of a process of dynamically adjusting a sliding state based on a sliding scanning result according to an embodiment of the present invention;

[0064] Figure 3 A schematic diagram of a flow chart of determining whether to reduce a preset window size according to the closure status of a defect contour segment according to an embodiment of the present invention;

[0065] Figure 4 It is a schematic diagram of a process of performing edge enhancement processing on each of the initial defective product images according to an embodiment of the present invention. DETAILED DESCRIPTION

[0066] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0067] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0068] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.

[0069] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0070] See also Figure 1 As shown, it is a flow chart of a quality inspection model training method based on production link defect recognition according to an embodiment of the present invention; the present invention provides a quality inspection model training method based on production link defect recognition, comprising:

[0071] Step S1, collecting image data of each link in the production process, comparing the image data with standard image data to screen out image data with differences, and obtaining an initial defective product image;

[0072] Step S2, performing edge detection on each of the initial defective product images and marking the defect contours;

[0073] Step S3, performing sliding scanning and contour analysis on the initial defective product image with a preset window size, dynamically adjusting the sliding state of the current scanning window based on the sliding scanning result, and determining the severity of the defect of the initial defective product image based on the contour analysis result during the scanning process;

[0074] Step S4, performing edge enhancement processing on each of the initial defective product images based on the actual defect severity to obtain a target defective product image;

[0075] Wherein, the edge enhancement processing includes a first edge enhancement processing mode and a second edge enhancement processing mode;

[0076] Step S5, determining a defect detection training mode based on the defect severity, and performing model training to obtain a corresponding defect type.

[0077] In this embodiment, a PXW-X280 high-definition camera (Sony) is used to capture fabric images. In the process, a ring flash is used to provide uniform and soft light to ensure that the image can truly reflect the texture and defects on the fabric surface. When detecting possible defects on the fabric surface, a suitable lens is selected and a suitable shooting angle is determined based on the expected defect size and characteristics. The standard image data is a normal product image.

[0078] By real-time monitoring of the sliding scanning process and dynamically adjusting the sliding state of the scanning window based on the real-time contour analysis results, the detection process is made more flexible and efficient. By analyzing the defect contour, the severity of the defect can be accurately assessed to ensure that the model training accurately classifies the defect type. Edge enhancement processing is performed according to the severity of the defect, which can effectively improve the visibility of the defect and make subsequent detection and analysis more accurate. Different edge enhancement processing modes are optimized for different types of defects to improve the overall detection effect.

[0079] See also Figure 2 As shown, it is a schematic diagram of a process of dynamically adjusting the sliding state based on the sliding scanning result according to an embodiment of the present invention;

[0080] Specifically, dynamically adjusting the sliding state based on the sliding scanning result includes:

[0081] Step S3001, obtaining the marked contour pixels in the current scanning window and extracting the defect contour line segments;

[0082] Step S3002, determining whether there is a defect contour in the current scanning window based on the number of defect contour line segments;

[0083] Step S3003, when there is a defect contour, determining whether to reduce the preset window size according to the closure of the defect contour line segment;

[0084] Step S3004, determining whether to adjust the sliding state based on the real-time eccentric distance between the current scanning window and the defect profile.

[0085] By analyzing the characteristics of defect contours in real time to adapt to different inspection situations, defects can be found and handled in a timely manner during the production process.

[0086] Specifically, determining whether there is a defect contour in the current scanning window based on the number of defect contour line segments includes:

[0087] Determine the number of defect contour segments in the current scanning window.

[0088] If the number of defect contour segments is zero, continue sliding scanning;

[0089] If the number of defect contour segments is not zero, it is determined that there is a defect in the current scanning window.

[0090] See also Figure 3 As shown, it is a schematic diagram of a flow chart of determining whether to reduce the preset window size according to the closure status of the defect contour line segment according to an embodiment of the present invention;

[0091] Specifically, determining whether to reduce the preset window size according to the closure of the defect contour segment includes:

[0092] Step S3013, calculating the actual closure index according to the length and area of ​​the defect contour segment;

[0093] Step S3023, comparing the actual closure index with a preset closure threshold, and determining the closure state of the defect contour segment based on the comparison result;

[0094] Step S3033, determine the closed state of the defect contour segment:

[0095] If the defect contour line segment is closed, reduce the preset window size to the correction window size;

[0096] If the defect contour line segment is not closed, the preset window size is kept unchanged and the sliding scan and analysis are continued;

[0097] The correction window size is the absolute value of the difference between the area within the closed region formed by the defect contour segment and the area outside the closed region.

[0098] In this embodiment, the preset closure threshold is set to 1.5, and image processing technology is used to determine whether the defect contour segment is in a closed state. The contour is determined to be closed by comparing the length and area of ​​the contour. The ratio of the square of the perimeter of the defect contour segment to the area is calculated to obtain the actual closure index, and the actual closure index is compared with the preset closure threshold.

[0099] If the actual closure index is less than the preset closure threshold, the defect contour is determined to be in a closed state;

[0100] If the actual closure index is greater than or equal to the preset closure threshold, the defect contour is determined to be in a non-closed state.

[0101] When it is determined that the defect contour segment is in a closed state, it indicates that the defect area is relatively complete and concentrated. At this time, the preset window size is reduced to focus on the defect details more accurately and obtain more accurate defect feature information. The ratio of reducing the window size can also be set according to the common size range and accuracy requirements of defects in actual production, for example, it can be set to between 0.5-0.8 times the original window size.

[0102] Specifically, determining whether to adjust the sliding state based on the real-time eccentric distance between the current scanning window and the defect profile includes:

[0103] Compare the standard eccentricity distance with the real-time eccentricity distance.

[0104] If the real-time eccentric distance is less than or equal to the standard eccentric distance, the area of ​​the defect contour is calculated to obtain the real-time defect contour area, and the contour area abnormal defect is determined based on the real-time defect contour area;

[0105] If the real-time eccentric distance is greater than the standard eccentric distance, obtain the line connecting the scanning window and the defect contour center, slide along the extension direction of the line, and re-analyze the number of contour curve segments for analysis;

[0106] The real-time eccentric distance is the distance between the center point of the current scanning window and the center point of the defect contour.

[0107] In this embodiment, the standard eccentric distance represents the threshold distance between the center point of the defect contour area in the set initial defective product image and the current scanning window, which characterizes the distribution of the defect contour in the current scanning window. If the real-time eccentric distance is less than or equal to the standard eccentric distance, it means that the defect contour has not deviated from the center position of the current scanning window, and the sliding scan can continue according to the normal sliding step and direction. If the real-time eccentric distance is greater than the standard eccentric distance, it means that the defect contour has deviated from the center position of the current scanning window, then the sliding direction is adjusted according to the eccentric direction to make the window closer to the center position of the defect, that is, by moving the scanning window position, it is ensured that all parts of the defect are completely scanned to prevent incomplete defect detection due to excessively fast sliding or direction deviation, thereby improving the integrity and accuracy of defect recognition.

[0108] Through the real-time analysis of eccentric distance and contour area, timely feedback and adjustment of detection strategy can be achieved. This real-time nature ensures rapid response during the production process, timely detection and handling of defects, and reduced production losses.

[0109] Specifically, the abnormal defects determined based on the real-time defect contour area include:

[0110] Compare the real-time defect outline area with the standard defect outline area:

[0111] If the real-time defect contour area is less than or equal to the standard defect contour area, no marking will be performed;

[0112] If the real-time defect contour area is larger than the standard defect contour area, the corresponding defect contour is marked as an abnormal contour area defect.

[0113] In this embodiment, the abnormality level of the defect is determined based on the area of ​​the defect contour. If the real-time defect contour area is determined to be less than or equal to the standard defect contour area, it indicates that the type of the defect is a horizontal line burr form. If the real-time defect contour area is determined to be greater than the standard defect contour area, it indicates that the type of the defect is a larger defect such as burrs and stains. The standard defect contour area is set to 50 square millimeters and is adjusted and optimized based on actual production data to ensure the accuracy and effectiveness of detection.

[0114] Specifically, determining the severity of the defect of the initial defective product image based on the contour analysis result includes:

[0115] The percentage of abnormal defects in contour area to the total number of defect contours in the initial defective product image is obtained to obtain the severity of the defect.

[0116] Figure 4 It is a schematic diagram of a process of performing edge enhancement processing on each of the initial defective product images according to an embodiment of the present invention;

[0117] Specifically, performing edge enhancement processing on each of the initial defective product images based on the actual severity of the defect includes:

[0118] Step S4001, comparing the actual defect severity with the standard defect severity.

[0119] Step S4002, when the actual defect severity is less than or equal to the standard defect severity, executing the first edge enhancement processing mode;

[0120] Step S4003: when the actual defect severity is greater than the standard defect severity, a second edge enhancement processing mode is executed.

[0121] In this embodiment, the abnormal defect contour area is determined according to the area of ​​the defect contour to pre-screen out different types of defects. Since the defects that appear most frequently in the production process are horizontal hair, fuzz and stains, and the horizontal hair appears as a slender linear defect with a relatively small corresponding area, and its characteristics are mainly reflected in the details, while fuzz and stains appear as irregular shapes with large contour areas, which will cover a larger surface area. Therefore, by counting the main types of defects in the initial defective product image and preliminarily screening the defect types, different edge enhancement processing modes are performed for defects with different characteristics to effectively enhance the visualization effect of the defects, so that the model can more easily identify and distinguish different types of defects during training.

[0122] Due to the different severity of defects, different manifestations will appear. If it is determined that the actual defect severity is less than or equal to the standard defect severity, it means that most of the defects in the initial defective product image are manifested as horizontal hairs, which are long and thin and have a small area. Enhancing the brightness and contrast can make these long and thin defects more obvious. Therefore, executing the first edge enhancement processing mode can make the long and thin defects more prominent in the background by improving the contrast of the image, thereby ensuring subsequent defect identification and analysis. If it is determined that the actual defect severity is greater than the standard defect severity, it means that most of the defects in the initial defective product image are manifested as stains, fuzz and other defect types with relatively large contour areas. For these defects, more refined grayscale processing is required to better highlight the details of the defective area, that is, executing the second edge enhancement processing mode. Since the shapes of stains and fuzz are irregular, detailed grayscale processing can help identify their complex edges and details. By adjusting the brightness and contrast of the image, the edges and internal features of the defects are clearer.

[0123] Specifically, the first edge enhancement processing mode is:

[0124] Obtaining brightness values ​​of all pixels in the area within each defect outline in the initial defective product image, and storing them as an initial brightness value list;

[0125] Calculate the average brightness value of the area within any of the defect contours to obtain the corresponding average defect brightness;

[0126] Obtain the brightness values ​​of all pixels outside the defect contours and store them as a background brightness value list;

[0127] Calculate the average brightness value of the area outside the defect outline to obtain the average background brightness;

[0128] Get the difference between the average background brightness and the average foreground brightness to get the actual brightness difference;

[0129] Using the corrected brightness value to update each initial brightness value of each defect contour in the initial defective product image;

[0130] Among them, for each initial brightness value, the sum of the initial brightness value and the actual brightness difference is calculated to obtain the corrected brightness value; the average defect brightness is the ratio of the initial brightness value of each pixel within the defect outline to the number of pixels; the average background brightness is the ratio of the initial brightness value of each pixel outside the defect outline to the number of pixels.

[0131] Specifically, the second edge enhancement processing mode is:

[0132] Obtaining the grayscale values ​​of all pixels in the area within each defect outline in the initial defective product image, and recording them as first actual grayscale values;

[0133] Obtaining the grayscale values ​​of all pixels in the area outside each defect outline in the initial defective product image, and recording them as second actual grayscale values;

[0134] Obtaining the average grayscale value corresponding to the pixel point whose first actual grayscale value is less than the first average contour inner grayscale value as the second average contour inner grayscale value;

[0135] Obtaining the average grayscale value corresponding to the pixel point whose second actual grayscale value is less than the first average outer contour grayscale value as the second average outer contour grayscale value;

[0136] Obtaining the average grayscale value corresponding to the pixel point whose first actual grayscale value is greater than the first average contour inner grayscale value as the third average contour inner grayscale value;

[0137] Obtaining the average grayscale value corresponding to the pixel point whose second actual grayscale value is greater than the first average outer contour grayscale value as the third average outer contour grayscale value;

[0138] Calculate the square of each average contour inner grayscale value and the corresponding average contour outer grayscale value respectively to obtain the corresponding real-time grayscale difference;

[0139] Add the grayscale value in each average contour to the corresponding actual grayscale difference to obtain the target grayscale value;

[0140] Each original grayscale value of the initial defective product image is adjusted to a corresponding target grayscale value.

[0141] In terms of determining the defect detection training mode based on the severity of the defect and training the model to obtain the defect type, the defect severity is divided into three levels: mild, moderate and severe. For product images with mild defects, a more relaxed training mode is adopted, focusing on the learning and identification of subtle defect features. The number of training rounds can be appropriately increased during model training to improve the detection accuracy of such defects that are easily overlooked. For product images with moderate defects, a moderate training mode is adopted to balance the comprehensive learning and training efficiency of defect features. For product images with severe defects, an enhanced training mode is adopted to quickly lock obvious defect features, accelerate the convergence speed of the model, and improve the model's ability to quickly detect severe defects. Through such differentiated training for different defect severities, the quality inspection model finally trained can more accurately identify various types of defects, whether it is slight surface scratches, uneven dyeing, or severe damage, holes and other defects, they can be detected efficiently and accurately, thereby effectively improving the quality inspection level of the production link, reducing the defective rate, and improving the overall quality and production efficiency of the product.

[0142] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

[0143] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A quality inspection model training method based on defect recognition in production process, characterized in that: include, Collect image data from each link in the production process, compare the image data with standard image data to screen out image data with differences, and obtain an initial defective product image; Performing edge detection on each of the initial defective product images and marking defect contours; Performing edge enhancement processing on each of the initial defective product images based on the actual defect severity to obtain a target defective product image; The initial defective product image is subjected to sliding scanning and contour analysis with a preset window size. During the scanning process, the sliding state of the current scanning window is dynamically adjusted based on the sliding scanning result, and the actual defect severity of the initial defective product image is determined based on the contour analysis result. The edge enhancement processing includes a first edge enhancement processing mode and a second edge enhancement processing mode. Dynamically adjust the sliding state based on the sliding scanning results including: Get the marked contour pixels in the current scanning window and extract the defect contour line segments; Determining whether there is a defect contour in the current scanning window based on the number of defect contour line segments; When there is a defect contour, determining whether to reduce the preset window size according to the closure of the defect contour line segment; Determine whether to adjust the sliding state based on the real-time eccentric distance of the current scanning window and the defect profile, including: Compare the standard eccentricity distance with the real-time eccentricity distance. If the real-time eccentric distance is less than or equal to the standard eccentric distance, the area of ​​the defect contour is calculated to obtain the real-time defect contour area, and the contour area abnormal defect is determined based on the real-time defect contour area; If the real-time eccentric distance is greater than the standard eccentric distance, obtain the line connecting the scanning window and the defect contour center, slide along the extension direction of the line, and re-analyze the number of contour curve segments for analysis; The real-time eccentric distance is the distance between the center point of the current scanning window and the center point of the defect contour, and the standard eccentric distance represents the threshold distance between the center point of the defect contour area in the set initial defect product image and the current scanning window; The defect detection training mode is determined based on the actual defect severity, and the model training is performed to obtain the corresponding defect type.

2. The quality inspection model training method based on production process defect identification according to claim 1 is characterized in that: Determining whether there is a defect contour in the current scanning window based on the number of defect contour line segments includes: Determine the number of defect contour segments in the current scanning window. If the number of defect contour segments is not zero, it is determined that there is a defect in the current scanning window.

3. The quality inspection model training method based on production process defect recognition according to claim 1 is characterized in that: Determining whether to reduce the preset window size based on the closure of the defect contour segment includes: Calculate the actual closure index based on the length and area of ​​the defect contour segment; Comparing the actual closure index with the preset closure threshold, and determining the closure state of the defect contour segment based on the comparison result; Determine the closed state of the defect contour segment: If the defect contour segment is closed, reduce the preset window size; If the defect contour segment is not closed, the preset window size is kept unchanged and the sliding scan and analysis are continued.

4. The quality inspection model training method based on production process defect identification according to claim 1 is characterized in that: Determine contour area based on real-time defect contour area. Abnormal defects include: Compare the real-time defect outline area with the standard defect outline area: If the real-time defect contour area is less than or equal to the standard defect contour area, no marking will be performed; If the real-time defect contour area is larger than the standard defect contour area, the corresponding defect contour is marked as an abnormal contour area defect.

5. The quality inspection model training method based on production process defect identification according to claim 1 is characterized in that: Determining the severity of the defect of the initial defective product image based on the contour analysis result includes: The percentage of abnormal defects in contour area to the total number of defect contours in the initial defective product image is obtained to obtain the severity of the defect.

6. The quality inspection model training method based on production process defect recognition according to claim 1 is characterized in that: Performing edge enhancement processing on each of the initial defective product images based on the actual defect severity comprises: Compare the actual defect severity with the standard defect severity. When the actual defect severity is less than or equal to the standard defect severity, executing the first edge enhancement processing mode; When the actual defect severity is greater than the standard defect severity, the second edge enhancement processing mode is executed.

7. The quality inspection model training method based on production process defect identification according to claim 6 is characterized in that: The first edge enhancement processing mode is, Obtaining brightness values ​​of all pixels in the area within each defect outline in the initial defective product image, and storing them as an initial brightness value list; Calculate the average brightness value of the area within any of the defect contours to obtain the corresponding average defect brightness; Obtain the brightness values ​​of all pixels outside the defect contours and store them as a background brightness value list; Calculate the average brightness value of the area outside the defect outline to obtain the average background brightness; Get the difference between the average background brightness and the average foreground brightness to get the actual brightness difference; Using the corrected brightness value to update each initial brightness value of each defect contour in the initial defective product image; Among them, for each initial brightness value, the sum of the initial brightness value and the actual brightness difference is calculated to obtain the corrected brightness value; the average defect brightness is the ratio of the initial brightness value of each pixel within the defect outline to the number of pixels; the average background brightness is the ratio of the initial brightness value of each pixel outside the defect outline to the number of pixels.

8. The quality inspection model training method based on production process defect identification according to claim 6 is characterized in that: The second edge enhancement processing mode is, Obtaining the grayscale values ​​of all pixels in the area within each defect outline in the initial defective product image, and recording them as first actual grayscale values; Obtaining the grayscale values ​​of all pixels in the area outside each defect outline in the initial defective product image, and recording them as second actual grayscale values; Obtaining the average grayscale value corresponding to the pixel point whose first actual grayscale value is less than the first average contour inner grayscale value as the second average contour inner grayscale value; Obtaining the average grayscale value corresponding to the pixel point whose second actual grayscale value is less than the first average outer contour grayscale value as the second average outer contour grayscale value; Obtaining the average grayscale value corresponding to the pixel point whose first actual grayscale value is greater than the first average contour inner grayscale value as the third average contour inner grayscale value; Obtaining the average grayscale value corresponding to the pixel point whose second actual grayscale value is greater than the first average outer contour grayscale value as the third average outer contour grayscale value; Calculate the square of each average contour inner grayscale value and the corresponding average contour outer grayscale value respectively to obtain the corresponding real-time grayscale difference; Add the grayscale value in each average contour to the corresponding actual grayscale difference to obtain the target grayscale value; Each original grayscale value of the initial defective product image is adjusted to a corresponding target grayscale value.

Citation Information

Patent Citations

  • Fabric flaw line defect identification method for textile production

    CN115311264A

  • Defect detection method and device, electronic equipment, computer readable storage medium and product detection method

    CN115995023A