A defect detection method and system

By establishing a relationship between rule sets and configuration file encoding in defect detection, and combining image processing and deep learning models, the problem of frequent code changes in existing technologies is solved, achieving flexible and efficient defect detection.

CN115620008BActive Publication Date: 2026-01-30BEIJING LUSTER LIGHTTECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211407891.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-10
Publication Date
2026-01-30
Estimated Expiration
2042-11-10

AI Technical Summary

Technical Problem

Existing defect detection software requires frequent code changes when faced with different products to be inspected or changes in defect types, resulting in a cumbersome and time-consuming process.

Method used

By identifying defect features, a rule set is formed based on feature frequency ranking, and the rule set is linked to the configuration file encoding. Defect detection is adjusted using preset rules without changing the code, and defect regions are determined by combining image processing and deep learning models.

Benefits of technology

It enables flexible adjustment of defect detection without changing the code, shortens the change cycle, improves the efficiency and accuracy of defect detection, and can efficiently identify multiple defect types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115620008B_ABST
    Figure CN115620008B_ABST
Patent Text Reader

Abstract

This application relates to the field of defect detection technology, specifically to a defect detection method and system that solves the problem of the cumbersome process of accurately determining various defects by modifying code in defect detection software. The method includes: determining features used to describe defects; sorting the features based on their frequency of use, forming a rule set; establishing a relationship between the rule set and the encoding used in the configuration file using preset rules, so that the corresponding features in the rule set can be smoothly read from the configuration file; extracting defect regions from the received image as candidate defect determination regions; calculating the values ​​of each feature in the candidate defect determination region to obtain a first feature value set; and when each feature value in the first feature value set corresponds to the corresponding data parameters in the quality inspection specification used for single defect determination, obtaining the candidate defect determination region corresponding to the rule set and outputting it as a single defect region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of defect detection technology, and more specifically, to a defect detection method and system. Background Technology

[0002] In the field of industrial defect detection, it is often necessary to detect whether there are defects in items such as displays. Items without defects are considered finished products.

[0003] During the defect detection process, defects are usually controlled according to the defect size requirements in the quality inspection specifications. At this time, the code in the defect detection software needs to be modified according to the defect size control requirements in the corresponding specifications so that the defect detection software can accurately meet the defect detection requirements before the defect detection process can proceed.

[0004] However, when the items to be inspected are different, or when the required types of defects to be detected change, in order for the defect detection software to accurately determine the defects, the developers need to modify the code in a timely manner to adapt to the different defect detection processes. This is quite cumbersome and the change cycle is long. Summary of the Invention

[0005] To address the cumbersome process of making defect detection software accurately identify various defects by modifying the code, this application provides a defect detection method and system.

[0006] The embodiments of this application are implemented as follows:

[0007] A first aspect of this application provides a defect detection method, including:

[0008] The features used to describe the defects are determined, and the features are sorted according to their frequency of use. The sorted features form a rule set, and different rule sets are used to detect defects with different features.

[0009] By using preset rules, the relationship between the rule set and the encoding used in the configuration file is established, so that the features in the corresponding rule set can be successfully read after the configuration file is configured.

[0010] Extract the defect region from the received image as the candidate defect determination region;

[0011] Calculate the values ​​of each feature in the candidate defect determination region to obtain a first feature value set, wherein the features in the first feature value set are of the same type as the features in the corresponding rule set;

[0012] Once each feature value in the first feature value set corresponds to the corresponding data parameter in the quality inspection specification used for single defect determination, the candidate defect determination region corresponding to the rule set is obtained and output as a single defect region.

[0013] In some embodiments, the step of establishing a relationship between the rule set and the encoding used in the configuration file further includes:

[0014] Different rule sets are set to different decimal codes so that the binary representation formed after decoding the decimal codes can accurately express the feature ordering in the rule sets;

[0015] The values ​​of the 32 binary bits in the binary representation correspond to the features in the rule set according to a preset rule.

[0016] In some embodiments, the preset rules are as follows:

[0017] The "1" in the binary bits is assigned to a feature in the rule set;

[0018] The features in the rule set are mapped one-to-one with the values ​​in the binary bits from right to left.

[0019] Based on the feature order in the rule set, the corresponding binary is selected for encoding.

[0020] In some embodiments, the step of calculating the values ​​of each feature of the candidate defect determination region to obtain a first feature value set further includes:

[0021] The region corresponding to the first factor of the candidate defect determination region having a parameter value greater than a first threshold and a parameter value of the second factor greater than a second threshold is selected as the first region after filtering; the first factor is the factor with the highest frequency of use in the rule set, and the second factor has the second highest frequency of use;

[0022] The first region is sorted according to its area, and a first number of the first regions are selected as candidate regions.

[0023] The values ​​of each feature in the candidate region are calculated to obtain the first feature value set.

[0024] In some embodiments, when multiple defects exist in the defect region, the remaining region after removing the single defect region from the candidate defect determination region is the second region, and the method further includes:

[0025] Based on the adjacent distance in the corresponding rule set, the second region is merged so that regions in the second region with adjacent distances less than the third threshold are merged into a merged region.

[0026] Calculate the value of each feature in the merged region to obtain a second feature value set; wherein the features in the second feature value set are of the same type as the features in the corresponding rule set;

[0027] Once each feature value in the second feature value set corresponds to the corresponding data parameter in the quality inspection specification used for multi-defect determination, the merged region corresponding to the rule set is obtained and output as a multi-defect region.

[0028] In some embodiments, in the step of merging the second region based on the adjacent distance in the corresponding rule set, the type of the merged region is the same as the number of types of the adjacent distance.

[0029] In some embodiments, the single defect region and / or the multiple defect regions are determined by a deep learning classification model. When the single defect region and / or the multiple defect regions are determined to be real defects by the deep learning classification model, the single defect region and / or the multiple defect regions are output as the final defect.

[0030] A second aspect of this application provides a defect detection system, comprising:

[0031] A feature rule module is constructed to determine the features used to describe defects. Based on the frequency of use of the features, the features are sorted. The sorted features form a rule set. Different rule sets are used to detect defects with different features.

[0032] A configuration relationship building module is used to establish a relationship between the rule set and the encoding used in the configuration file through preset rules, so that the features in the corresponding rule set can be successfully read after the configuration file is configured.

[0033] The image acquisition module is used to extract defect areas from the received image as candidate defect determination areas;

[0034] The feature value calculation module is used to calculate the value of each feature of the candidate defect determination region to obtain a first feature value set, wherein the features in the first feature value set are of the same type as the features in the corresponding rule set.

[0035] The defect region determination module is used to obtain the candidate defect determination region corresponding to the rule set after each feature value in the first feature value set corresponds to the corresponding data parameter in the quality inspection specification used for single defect determination, and output it as a single defect region.

[0036] In some embodiments, when establishing a relationship between the rule set and the encoding used in the configuration file, the module for building the configuration relationship is further configured to:

[0037] Different rule sets are set to different decimal codes so that the binary representation formed after decoding the decimal codes can accurately express the feature ordering in the rule sets;

[0038] The values ​​of the 32 binary bits in the binary representation correspond to the features in the rule set according to a preset rule.

[0039] In some embodiments, the preset rules are as follows:

[0040] The "1" in the binary bits is assigned to a feature in the rule set;

[0041] The features in the rule set are mapped one-to-one with the values ​​in the binary bits from right to left.

[0042] Based on the feature order in the rule set, the corresponding binary is selected for encoding.

[0043] The beneficial effects of this application are as follows: By establishing a relationship between the rule set and the encoding used in the configuration file based on preset rules, it is possible to effectively control and flexibly adjust the defect benchmarks in different quality inspection specifications without changing the encoding. This can also effectively shorten the change cycle. Furthermore, through file configuration, subsequent processes can calculate the feature values ​​in the rule set and match them with the corresponding data parameters in the quality inspection specifications. This eliminates the need to change the code to make the testing software suitable for detecting multiple defects, thus helping to efficiently and accurately identify various types of defects. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 Here is a flowchart of a defect detection method according to some embodiments of this application;

[0046] Figure 2 Example diagram of a single defect;

[0047] Figure 3 Example diagram of multiple defects;

[0048] Figure 4 Here is a flowchart of a defect detection method according to other embodiments of this application;

[0049] Figure 5 This is a schematic diagram of the structure of a defect detection system according to one or more embodiments of this application;

[0050] Figure 6 This is a schematic diagram of the structure of a defect detection device according to one or more embodiments of this application. Detailed Implementation

[0051] To make the objectives, implementation methods and advantages of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the described exemplary embodiments are only some embodiments of this application, and not all embodiments.

[0052] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.

[0053] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.

[0054] The terms “include” and “have”, and any variations thereof, are intended to cover but not exclusively include, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.

[0055] Figure 1 This is a flowchart illustrating a defect detection method. (For example...) Figure 1 As shown, the defect detection method includes the following steps:

[0056] In step 100, features used to describe defects are determined, and the features are sorted based on their frequency of use. The sorted features form a rule set, and the order of the sorted features remains unchanged. Different rule sets are used to detect defects with different features.

[0057] Among them, the defects include Figure 2 The single defect shown and Figure 3The multiple defects shown refer to at least two defects that conform to a set of rules within a certain adjacent distance. Features in the set of rules include, but are not limited to, different combinations of features such as area, length, width, contrast, aspect ratio, angle, curvature, roundness, quantity, and adjacent distance. Because defect shapes and quantities vary considerably, different feature combination rule sets are needed to control defects. For example, single-point defect control features include area and contrast; multi-point defect control features include area, contrast, adjacent distance, and quantity; similarly, line defects also require rule sets formed by combining multiple features for control. It is understandable that for different defects, the defect type can be precisely determined by limiting the parameters in the corresponding features. For example, setting the area parameter of the area feature in the rule set to 100-200 indicates that defects with an area of ​​100-200 need to be screened later. Therefore, the rule set is scalable; a set of rules can have multiple sets of feature parameters to detect defects with different feature values.

[0058] In step 200, a relationship is established between the rule set and the encoding used in the configuration file through preset rules, so that the features in the corresponding rule set can be successfully read after configuring the configuration file.

[0059] In some embodiments, different rule sets can be set to different decimal encodings so that the binary representation formed after decimal encoding decoding can accurately express the feature order in the rule set. Since an `Int` variable in the C++ programming language occupies 32 bits in binary, the features in the rule set can be mapped to the 32-bit values ​​in the binary representation according to a preset rule. This preset rule can be manually set. For example, in some embodiments, the preset rule is: setting "1" in the binary bits to correspond to a feature in the rule set; then mapping the features in the rule set to the values ​​in the binary bits from right to left; and selecting the corresponding binary representation for encoding based on the feature order in the rule set. For example, a single-point feature rule set consisting of area and contrast can be represented by binary 0b1001. In this case, the area is the first bit and the contrast is the fourth bit. Converting 0b1001 to decimal gives 9. For a multi-point feature rule set consisting of area, contrast, adjacent distance, and quantity, it can be represented by binary 0b1100001001. In this case, the area is the first bit, the contrast is the fourth bit, the quantity is the ninth bit, and the adjacent distance is the tenth bit. Converting 0b1100001001 to decimal gives 309.

[0060] In summary, when the value of the 32-bit binary code is mapped to the features in the rule set according to the aforementioned preset rules, the corresponding binary code can be converted into the corresponding decimal code and stored in the configuration file. That is, in the configuration file, different rule sets are set to different decimal codes according to the quality inspection specifications. After reading the decimal code, the software can convert it into a binary code set according to the aforementioned preset rules based on a fixed order of features (area, length, width, contrast, aspect ratio, angle, curvature, roundness, quantity, adjacent distance), and then decode it in reverse to obtain the corresponding combination of features including area, length, etc. For example, the configuration file may contain the following configuration:

[0061] In the Algconfig.ini file:

[0062] [Rule Set 1]

[0063] Single point = 9

[0064] [Rule Set 2]

[0065] Multiple points = 309

[0066] By reading the rule set encoding in the configuration file and converting it from decimal to binary, such as the encoding of a single point being 9, which is 0b1001 in binary, the features are decoded as area and contrast. The encoding of multiple points is 309, which is Ob1100001001 in binary, and the features of multiple points are decoded as area, contrast, quantity, and adjacent distance.

[0067] Obviously, by encoding in decimal, only those who know the decoding rules can modify the configuration file, ensuring its confidentiality. It should also be noted that the configuration file can be other file types such as XML and TXT, and is not limited to INI files.

[0068] It's important to note that once the rule set and the encoding used in the configuration file are established, the configuration file can determine which features should be used for different defects in subsequent processing steps. The configuration file is only used when configuring parameters; subsequent calculations are independent of it. Throughout the process, no further software code modifications are required; only the file configuration based on the quality inspection specifications used to determine defects and the selection of parameters for subsequent processing steps are needed, making it quite convenient.

[0069] In step 300, the defect region in the received image is extracted as the candidate defect determination region.

[0070] The received image can have an area of ​​16900 pixels × 1400 pixels, and the resolution of a single pixel can be 10 μm. A defect extraction algorithm can then be used to extract candidate defect regions from the image. It should be noted that due to differences in defect types, shapes, brightness polarities, locations, and image backgrounds, various defect extraction algorithms are required. These include, but are not limited to, fixed threshold extraction algorithms, dynamic threshold extraction algorithms, edge gradient extraction algorithms, weak contrast defect extraction algorithms, and deep learning segmentation algorithms. This embodiment uses a dynamic threshold algorithm as an example to extract the defect region and obtain the candidate defect region A0s.

[0071] In step 400, the values ​​of each feature in the candidate defect determination region are calculated to obtain a first feature value set. The features in the first feature value set are of the same type as the features in the corresponding rule set.

[0072] In some embodiments, the candidate defect determination regions A0s can be simply filtered. The regions where the parameter value of the first factor in the candidate defect determination regions A0s is greater than a first threshold, and the parameter value of the second factor is greater than a second threshold, are used as the filtered first regions A1s. The first factor is the most frequently used factor in the rule set, and the second factor is the next most frequently used. For example, when the first factor is area and the second factor is length, and the first threshold is 10 pixels and the second threshold is 3 pixels, the area and length of the candidate defect determination regions A0s are calculated, and regions with an area less than 10 pixels and a length less than 3 pixels are filtered out. The remaining region is the filtered first region A1s. It should be noted that the specific values ​​of the first and second thresholds need to be determined according to the type of defect to be detected, and the first and second thresholds can also be represented by actual physical distances in millimeters or micrometers.

[0073] The first regions A1s are sorted according to their areas, and a first number of first regions A1s are selected as candidate regions A2s. In some embodiments, the first regions A1s are sorted in descending order of their areas, and the top N first regions A1s with the largest areas are selected as candidate regions A2s. N is the first number, for example, N can be 100. If the number of first regions A1s is less than 100, the first regions A1s are not sorted again, and all first regions A1s are retained. When the number of first regions A1s is greater than 100, the first regions A1s are sorted, and the top 100 candidate regions A2s with the largest areas are retained for subsequent steps. This step can filter out most of the small-area interference regions, accelerating the subsequent processing and calculation process.

[0074] It is understandable that, for the first region A1s, the first region A1s can generally be sorted according to its area to select a first number of first regions A1s as candidate regions A2s. In some special cases, the first region A1s can also be sorted according to its length to select a first number of first regions A1s as candidate regions A2s.

[0075] By performing the above post-processing on the defect detection region A0s, more interference items can be filtered out, which not only simplifies the post-processing process but also helps to improve the accuracy of defect detection.

[0076] It should be noted that, in order to save computation time and ensure the accuracy of the calculation results, not all features such as area, length, width, contrast, aspect ratio, angle, curvature, roundness and quantity in the candidate region A2s will be calculated. Instead, only the values ​​of the features in the candidate region A2s corresponding to the corresponding rule set will be calculated, and the feature values ​​will form the first feature value set.

[0077] In step 500, when each feature value in the first feature value set corresponds to the corresponding data parameter in the quality inspection specification used for single defect determination, the candidate defect determination area corresponding to the rule set is obtained and output as a single defect area.

[0078] It is understandable that there will generally be a single serious defect in the quality inspection specification. A single defect can be either a point defect or a line defect. Therefore, when the values ​​of each feature in the first feature value set meet the corresponding data parameters in the quality inspection specification, the corresponding candidate region A2s can be considered as a single defect region after post-processing of the candidate defect judgment region, and is denoted as NG-S.

[0079] In industrial inspection processes, besides serious single defects, there are often situations where multiple defects need to be detected. Therefore, in some embodiments, when multiple defects exist in a defect area, such as... Figure 4 As shown, the defect detection method also includes the following steps:

[0080] In step 610, the remaining region after removing the single defect region NG-S in the candidate region A2s is the second region A3s. Based on the adjacent distance in the corresponding rule set, the second region A3s is merged so that the regions in the second region A3s with an adjacent distance less than the third threshold are merged into a merged region.

[0081] In some embodiments, the merging process is achieved by constructing a structural element expansion region using adjacent distances as radii, and then performing connectivity calculations. In other embodiments, the merged region Us can also be obtained by extracting connected components from the image, merging these connected components, and obtaining multiple merged regions generated during the merging process. kThrough the merging process, it becomes clear that regions within the same local area belong to the same range, while regions outside this range will not be merged. Since rules in different rule sets will have different adjacent distances in step 100 (for example, the adjacent distance values ​​for multi-point and multi-line rules are different), the number of different adjacent distances determines the number of different mergeable regions Us. k In some embodiments, region Us1 is obtained by merging regions A3s according to the adjacent distance constraints in the multi-point class rule set, and region Us2 is obtained by merging regions A3s according to the adjacent distance constraints in the multi-line class rule set. Similarly, Us3....Us k (k = 1, 2, 3...n), where n is the number of adjacent distances in the rule set. It should be noted that the third threshold is also set manually based on actual circumstances.

[0082] In step 620, the values ​​of each feature in the merged region are calculated to obtain a second feature value set; wherein the features in the second feature value set are of the same type as the features in the corresponding rule set.

[0083] Understandably, this step is the same as the process of calculating the values ​​of each feature of the candidate region A2s in step 400, except that the values ​​of each merged region Us are calculated. k The values ​​of the features corresponding to the corresponding rule sets form a second set of feature values.

[0084] In step 630, once each feature value in the second feature value set corresponds to the corresponding data parameter in the quality inspection specification used for multi-defect judgment, the merged region corresponding to the rule set is obtained and output as the multi-defect region.

[0085] Among them, in the merged region Us k In this process, based on the feature thresholds in the multi-point rule set or the multi-line rule set, multi-defect regions are selected, which can be denoted as NG-M.

[0086] It should be noted that the single-defect region NG-S selected in step 500 and the multi-defect region NG-M selected in step 630 can be directly mixed and output as the final defect NG-Final, or they can be output separately as the final defects NG-Final.

[0087] In some embodiments, the extracted single defect region NG-S and multiple defect region NG-M may be considered as suspected defects. In this case, the single defect region NG-S and / or multiple defect region NG-M may be determined by a deep learning classification model. Only when the deep learning classification model determines that they are real defects will the single defect region NG-S and / or multiple defect region NG-M be used as the final defect output.

[0088] Understandably, the acquired single-defect region NG-S or multi-defect region NG-M can be individually evaluated by a deep learning classification model. Alternatively, the single-defect region NG-S and multi-defect region NG-M can be aggregated to form a third region NG-Med, which is then further evaluated by the deep learning classification model. If the deep learning classification model classifies it as a true defect NG, then the single-defect region NG-S and / or multi-defect region NG-M are used as the final defect NG-Final output. This re-evaluation process helps to improve the accuracy of the final defect output.

[0089] like Figure 5 As shown, the second aspect of this application also provides a defect detection system, specifically including a feature rule construction module, a configuration relationship construction module, an image acquisition module, a feature value calculation module, and a defect region determination module, specifically:

[0090] The feature rule building module is used to determine the features used to describe defects. Based on the frequency of use of the features, the features are sorted. The sorted features form a rule set, and different rule sets are used to detect defects with different features.

[0091] The configuration relationship building module is used to establish a relationship between the rule set and the encoding used in the configuration file through preset rules, so that the features in the corresponding rule set can be successfully read from the configuration file.

[0092] The image acquisition module is used to extract defect areas from the received image as candidate defect determination areas.

[0093] The feature value calculation module is used to calculate the value of each feature in the candidate defect judgment region to obtain the first feature value set. The features in the first feature value set are of the same type as the features in the corresponding rule set.

[0094] The defect region determination module is used to obtain the candidate defect determination region corresponding to the rule set after each feature value in the first feature value set corresponds to the corresponding data parameter in the quality inspection specification used for single defect determination, and output it as a single defect region.

[0095] In some embodiments, when establishing a relationship between a rule set and the encoding used in the configuration file, the configuration relationship building module is also used to set different rule sets to different decimal encodings so that the binary representation formed after the decimal encoding is decoded can accurately express the feature ordering in the rule set; wherein, the value of the 32 binary bits in the binary corresponds to the feature in the rule set according to a preset rule.

[0096] In some embodiments, the preset rules are as follows: set "1" in the binary bits to correspond to the features in the rule set; map the features in the rule set to the values ​​in the binary bits from right to left; select the corresponding binary bits for encoding according to the feature order in the rule set.

[0097] In some embodiments, when calculating the values ​​of each feature of the candidate defect determination region to obtain a first feature value set, the feature value calculation module is further used to obtain the region corresponding to the first factor of the candidate defect determination region having a parameter value greater than a first threshold and a parameter value of the second factor greater than a second threshold, as the first region after filtering; the first factor is the factor with the highest frequency of use in the rule set, and the second factor has the next highest frequency of use; the first regions are sorted according to the area of ​​the first region, and a first number of first regions are selected as candidate regions; the values ​​of each feature of the candidate region are calculated to obtain the first feature value set.

[0098] In some embodiments, the system further includes a merging module. When there are multiple defects in a defect area, the merging module is used to take the remaining area after removing the single defect area in the candidate defect determination area as the second area, and to merge the second area based on the adjacent distance in the corresponding rule set, so that the areas in the second area with an adjacent distance less than a third threshold are merged into a merged area. At this time, the feature value calculation module is also used to calculate the value of each feature in the merged area to obtain a second feature value set. The features in the second feature value set are of the same type as the features in the corresponding rule set. The defect area determination module is also used to obtain the merged area corresponding to the rule set when each feature value in the second feature value set corresponds to the corresponding data parameter in the quality inspection specification used for multiple defect determination, and output it as a multiple defect area.

[0099] In some embodiments, when merging a second region based on the adjacent distances in the corresponding rule set, the type of the merged region is the same as the number of adjacent distance types.

[0100] In some embodiments, the system further includes a re-judgment module, which is used to determine the single defect region and / or multiple defect regions through a deep learning classification model. When the single defect region and / or multiple defect regions are determined to be real defects by the deep learning classification model, the single defect region and / or multiple defect regions are output as the final defect.

[0101] Thirdly, such as Figure 6 As shown, this application also provides a defect detection device, specifically including: a memory and a processor, the memory being used for a defect detection program, and the processor running the defect detection program to cause the defect detection device to perform the defect detection method in the first aspect described above.

[0102] A fourth aspect of this application provides a computer-readable storage medium storing a defect detection program, which, when executed by a processor, implements the defect detection method of the first aspect.

[0103] The beneficial effects of this embodiment are that, by establishing a relationship between the rule set and the encoding used in the configuration file according to preset rules, it is possible to effectively control the defect benchmarks in different quality inspection specifications without changing the code, and it can effectively shorten the change cycle. Furthermore, through file configuration, subsequent processes calculate the feature values ​​in the rule set and match them with the corresponding data parameters in the quality inspection specifications, which helps to efficiently and accurately identify various types of defects. Furthermore, by setting different rule sets according to different types and configuring corresponding configuration files, it is possible to accurately detect defects of multiple forms or different quantity limits. Finally, by using a deep learning classification model to determine whether single defect regions and multiple defect regions are real defects, it ensures that the final detected defects are real defects.

[0104] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the discussion in some embodiments above is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the embodiments and various different variations of the embodiments suitable for specific application considerations.

Claims

1. A defect detection method characterized by, The method comprises the following steps: determining features for describing defects, sorting the features based on their frequency of use, the sorted features forming a rule set, different rule sets being used to detect defects with different features; establishing a relationship between the rule set and the encoding used by the configuration file through a preset rule, so that the corresponding features in the rule set can be successfully read out after the configuration file; extracting the defect area in the received image as a candidate defect judgment area; calculating the value of each feature of the candidate defect judgment area to obtain a first feature value set, the features in the first feature value set being of the same type as the features in the corresponding rule set; In the step of calculating the value of each feature of the candidate defect judgment area to obtain a first feature value set, the method further comprises the following steps: obtaining the corresponding region when the parameter value of the first factor of the candidate defect judgment area is greater than the first threshold value and the parameter value of the second factor is greater than the second threshold value, as the screened first region; the first factor is the factor with the highest frequency of use in the rule set, and the frequency of use of the second factor is the second; sorting the first regions according to their areas and selecting a first number of first regions as candidate regions; calculating the value of each feature of the candidate region to obtain the first feature value set; When there are multiple defects in the defect area, the remaining area after removing the single defect area in the candidate defect judgment area is the second area, and the method further comprises the following steps: Based on the adjacent distance in the corresponding rule set, the second area is merged to make the areas with an adjacent distance less than a third threshold value in the second area merge into a merged area; calculating the value of each feature in the merged area to obtain a second feature value set; wherein the features in the second feature value set are of the same type as the features in the corresponding rule set; When the feature values in the second feature value set correspond to the corresponding data parameters in the quality inspection specification for multiple defect judgment, the merged area corresponding to the rule set is obtained and output as a multiple defect area; The method further comprises the following steps: determining the single defect area and / or the multiple defect area through a deep learning classification model, and when the single defect area and / or the multiple defect area is determined as a real defect by the deep learning classification model, the single defect area and / or the multiple defect area is output as a final defect; When the feature values in the first feature value set correspond to the corresponding data parameters in the quality inspection specification for single defect judgment, the candidate defect judgment area corresponding to the rule set is obtained and output as a single defect area.

2. The method of claim 1, wherein the step of detecting defects is performed by a method comprising: In the step of establishing a relationship between the rule set and the encoding used by the configuration file, the method further comprises the following steps: setting different rule sets to different decimal encodings, so that the binary formed after decoding the decimal encoding can accurately express the feature sorting in the rule set; wherein the value of 32-bit binary in the binary corresponds to the features in the rule set according to a preset rule.

3. The defect detection method as described in claim 2, characterized in that, The preset rule is as follows: setting "1" in the binary bit to correspond to the features in the rule set; one-to-one correspondence between the features in the rule set and the values in the binary bit from right to left; selecting the corresponding binary for encoding according to the order of the features in the rule set.

4. The defect detection method as described in claim 1, characterized in that, In the merging processing step of the second region based on the adjacent distance in the corresponding rule set, the type of the merged region is the same as the number of categories of the adjacent distance.

5. A defect detection system, comprising: Comprise: A feature rule module is constructed to determine features for describing defects, sort the features based on the frequency of use of the features, and the sorted features constitute a rule set, and different rule sets are used to detect defects with different features; A configuration relationship module is constructed to establish a relationship between the rule set and the encoding used by the configuration file through a preset rule, so that the corresponding features in the rule set can be successfully read out after the configuration file; An image acquisition module is used to extract the defect region in the received image as a candidate defect judgment region; A feature value calculation module is used to calculate the value of each feature of the candidate defect judgment region to obtain a first feature value set, and the features in the first feature value set are the same as the types of the features in the corresponding rule set; In the step of calculating the value of each feature of the candidate defect judgment region to obtain a first feature value set, it further comprises: When the parameter value of the first factor of the candidate defect judgment region is greater than the first threshold value, and the parameter value of the second factor is greater than the second threshold value, the corresponding region is obtained as the first region after screening; the first factor is the factor with the highest frequency of use in the rule set, and the frequency of use of the second factor is next; The first region is sorted according to the area of the first region, and a first number of first regions are selected as candidate regions; The value of each feature of the candidate region is calculated to obtain the first feature value set; When there are multiple defects in the defect region, the remaining region after removing the single defect region in the candidate defect judgment region is a second region, and it further comprises: Based on the adjacent distance in the corresponding rule set, the second region is merged to make the regions with adjacent distance less than a third threshold value in the second region merged into a merged region; The value of each feature in the merged region is calculated to obtain a second feature value set; wherein the features in the second feature value set are the same as the types of the features in the corresponding rule set; When the feature values in the second feature value set correspond to the corresponding data parameters in the quality inspection specification for multiple defect judgment, the merged region corresponding to the rule set is obtained and output as a multiple defect region; Further comprising: determining the single defect region and / or the multiple defect region through a deep learning classification model, and when the single defect region and / or the multiple defect region is determined as a real defect by the deep learning classification model, the single defect region and / or the multiple defect region is output as a final defect; A defect region determination module is used to obtain the candidate defect judgment region corresponding to the rule set when the feature values in the first feature value set correspond to the corresponding data parameters in the quality inspection specification for single defect judgment, and output as a single defect region.

6. The defect detection system of claim 5, wherein, When the rule set and the encoding used by the configuration file are related, the configuration relationship module is further used to: Different rule sets are set as different decimal encodings, so that the binary formed after decoding the decimal encoding can accurately express the feature sorting in the rule set; The value of 32-bit binary bits in the binary corresponds to the features in the rule set according to a preset rule.

7. The defect detection system of claim 6, wherein The preset rule is as follows: The "1" in the binary bit corresponds to the features in the rule set; The features in the rule set and the values in the binary bits correspond from right to left one by one; According to the feature sequence in the rule set, the corresponding binary is selected for encoding.

Citation Information

Patent Citations

  • Method for extracting and recognizing nondestructive detecting defect based on radial damping energy field

    CN101201329A

  • Power equipment defect early warning method and system based on improved association rule, and medium

    CN115271263A