Surface defect detection method, device and storage medium

Through fuzzy clustering and in-group screening technology, the problem of surface detectors identifying continuous defects as independent small defects is solved, which improves the accuracy of surface defect detection and provides a more accurate basis for surface quality evaluation.

CN114066796BActive Publication Date: 2024-12-03ALIBABA GROUP HOLDING LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010732479.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-27
Publication Date
2024-12-03
Estimated Expiration
2040-07-27

AI Technical Summary

Technical Problem

Existing surface detectors are prone to identify continuous defects as independent small defects when detecting continuous defects, resulting in inaccurate surface quality statistical results.

Method used

Fuzzy clustering is used to form a defect group for the associated first-level defect areas, perform in-group screening and eliminate error clustering, and then perform defect area aggregation to improve the accuracy of the defect area.

Benefits of technology

It improves the accuracy of surface defect detection and provides a more accurate basis for surface quality evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114066796B_ABST
    Figure CN114066796B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a surface defect detection method, device and storage medium. In the embodiments of the present application, the first-level defect areas contained in the surface to be detected can be clustered to generate at least one defect group; the first-level defect areas that meet the preset conditions in at least one defect group are excluded respectively; based on the remaining first-level defect areas in at least one defect group, the second-level defect areas corresponding to each of the at least one defect group are determined respectively; and the detection result corresponding to the surface to be detected can be determined according to the second-level defect areas. Accordingly, in the embodiments of the present application, fuzzy clustering can be performed first to form defect groups with associated first-level defect areas; then, intra-group screening can be performed within the defect group to exclude the first-level defect areas that are incorrectly clustered; on this basis, defect area aggregation can be performed, which can effectively improve the accuracy of defect area aggregation, thereby improving the accuracy of surface defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a surface defect detection method, device and storage medium. Background Art

[0002] At present, surface detectors are usually used to detect surface defects of objects such as steel coils, aluminum coils, and cloth to detect the type and location of surface defects.

[0003] When evaluating surface quality, the quality impact caused by a single large defect is usually more serious than the quality impact caused by multiple small defects. However, due to the limitations of surface inspection instruments, it is often the case that a continuous defect is identified as multiple independent small defects, resulting in inaccurate surface quality statistics. Summary of the invention

[0004] Multiple aspects of the present application provide a surface defect detection method, device and storage medium to improve the accuracy of surface defect detection.

[0005] The present application provides a surface defect detection method, comprising:

[0006] In response to a defect detection instruction, clustering first-level defect regions included in the surface to be detected to generate at least one defect group;

[0007] Respectively excluding first-level defect regions meeting preset conditions in the at least one defect group;

[0008] Based on the remaining first-level defect regions in the at least one defect group, respectively determine the second-level defect regions corresponding to each of the at least one defect group;

[0009] According to the second-level defect area, a detection result corresponding to the surface to be detected is determined.

[0010] The embodiment of the present application also provides a computing device, including a memory and a processor;

[0011] The memory is used to store one or more computer instructions;

[0012] The processor is coupled to the memory and configured to execute the one or more computer instructions for:

[0013] In response to a defect detection instruction, clustering first-level defect regions included in the surface to be detected to generate at least one defect group;

[0014] Respectively excluding first-level defect regions meeting preset conditions in the at least one defect group;

[0015] Based on the remaining first-level defect regions in the at least one defect group, respectively determine the second-level defect regions corresponding to each of the at least one defect group;

[0016] According to the second-level defect area, a detection result corresponding to the surface to be detected is determined.

[0017] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the aforementioned surface defect detection method.

[0018] In an embodiment of the present application, the first-level defect areas contained in the surface to be inspected can be clustered to generate at least one defect group; the first-level defect areas that meet the preset conditions in at least one defect group are excluded respectively; based on the remaining first-level defect areas in at least one defect group, the second-level defect areas corresponding to each of the at least one defect group are determined respectively; and the inspection result corresponding to the surface to be inspected can be determined based on the second-level defect areas. Accordingly, in an embodiment of the present application, fuzzy clustering can be first performed to form defect groups with associated first-level defect areas; then, intra-group screening can be performed within the defect group to exclude the first-level defect areas that are incorrectly clustered; on this basis, defect area aggregation can be performed, which can effectively improve the accuracy of defect area aggregation, thereby improving the accuracy of surface defect detection, and further providing a more accurate basis for surface quality assessment. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 A schematic flow chart of a surface defect detection method provided for an exemplary embodiment of the present application;

[0021] Figure 2 A logic diagram of a surface defect detection method provided for an exemplary embodiment of the present application;

[0022] Figure 3 A schematic flow chart of another surface defect detection method provided for an exemplary embodiment of the present application;

[0023] Figure 4 A logical schematic diagram for determining straight line fit provided for an exemplary embodiment of the present application;

[0024] Figure 5 A schematic diagram of the distribution of first-level defect areas included in a target defect group provided by an exemplary embodiment of the present application;

[0025] Figure 6 A schematic diagram of the structure of a computing device provided for another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0027] At present, due to the limitations of surface detectors, a continuous defect is often identified as multiple independent small defects, resulting in inaccurate surface quality statistics. To improve these technical problems, in some embodiments of the present application: fuzzy clustering can be performed first to form defect groups with associated first-level defect areas; then, intra-group screening can be performed within the defect group to exclude the first-level defect areas that are incorrectly clustered; on this basis, defect area aggregation can be performed, which can effectively improve the accuracy of defect area aggregation, thereby improving the accuracy of surface defect detection, and thus providing a more accurate basis for surface quality assessment.

[0028] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0029] Figure 1 A schematic flow chart of a surface defect detection method provided for an exemplary embodiment of the present application. Figure 2 The following is a logic diagram of a surface defect detection method provided by an exemplary embodiment of the present application. The trajectory generation method provided by this embodiment can be executed by a trajectory generation device, which can be implemented as software or a combination of software and hardware, and the trajectory generation device can be integrated in a computing device. Figure 1 As shown, the method includes:

[0030] Step 100: In response to a defect detection instruction, clustering the first-level defect areas included in the surface to be detected to generate at least one defect group;

[0031] Step 101, respectively eliminating first-level defect areas that meet preset conditions in at least one defect group;

[0032] Step 102: based on the remaining first-level defect regions in at least one defect group, respectively determine the second-level defect regions corresponding to the at least one defect group;

[0033] Step 103: Determine the detection result corresponding to the surface to be detected according to the second-level defect area.

[0034] The surface defect detection method provided in the embodiment of the present application can be applied to various surface quality detection scenarios, for example, surface quality detection scenarios of steel coils, aluminum coils, cloth, parts, etc. This embodiment does not limit the application scenario.

[0035] In this embodiment, defect recognition can be performed on the surface to be detected to determine at least one first-level defect area contained in the surface to be detected. In practical applications, image feature extraction can be performed on the surface to be detected, and a classification model can be used to identify and classify the defect areas contained in the surface to be detected to obtain description information of at least one first-level defect area contained in the surface to be detected. Of course, it is also possible to directly use a surface detector to perform defect recognition on the surface to be detected, and receive description information of at least one first-level defect area contained in the surface to be detected provided by the surface detector. The description information here includes but is not limited to the probability that the first-level defect area is predicted to be each defect type, the predicted defect type, location attribute information, etc.

[0036] As for the defect type, in this embodiment, the defect type includes but is not limited to scratches, inclusions, roller marks, inclusions, abrasions, iron oxide scale, oil mud marks, etc. For example, for the i-th first-level defect area d in the surface to be detected i , the probability of being predicted as each defect type can be expressed as c i =[c i,0 ,c i,1 ,c i,2 ,…c i,N ], where N is the number of defect types.

[0037] For the position attribute information, in this embodiment, the position attribute information may include region coordinates, representative point coordinates, etc. For example, for the i-th first-level defect region d i , whose regional coordinates can be expressed as p i =[y i,t ,y i,b ,x i,l ,x i,r ], where y i,t ,y i,b ,x i,l ,x i,r Corresponding to the defect area d i The coordinates of the top, bottom, left and right positions of the . The center point can be selected as the representative point, and the coordinates of the center point can be expressed as q i =[y i ,x i ].

[0038] Based on the above defect identification process, the determined first-level defect area may be a defect area of ​​the minimum specification level. Of course, in this embodiment, the specification of the first-level defect area is not limited thereto.

[0039] refer to Figure 1 In step 100, in response to the defect detection instruction, the first-level defect regions included in the surface to be detected can be clustered to generate at least one defect group. The clustering process is a fuzzy clustering process, which can cluster the associated first-level defect regions into the same defect group. It is worth noting that in the clustering process, the same first-level defect region may be clustered into different defect groups, which does not affect the detection result in this embodiment.

[0040] Optionally, in this embodiment, the first-level defect areas included in the surface to be inspected may be clustered according to defect type and distance:

[0041] From the defect type dimension, a clustering operation can be performed for each defect type. For example, for a target defect type, similar defect types corresponding to the target defect type can be determined; with the target defect type as the clustering type, the first-level defect areas under the target defect type and its similar defect types are clustered into a defect set as the defect set corresponding to the target defect type. The target defect type can be any of various defect types. Based on this, defect sets corresponding to various defect types can be obtained.

[0042] Among them, the similar defect types of the target defect type may include defect types that the target defect type is easily misidentified as. For example, when the target defect type is "scratch", its similar defect types may include: inclusions, abrasions, iron oxide scale or oil mud marks, etc. In this way, when different defect types are used as target defect types, the determined similar defect types may not be exactly the same.

[0043] On this basis, the first-level defect areas contained in the defect set corresponding to the target defect type may be clustered according to the distance to obtain at least one defect group under the target defect type.

[0044] Considering that different clustering methods have different clustering characteristics, in this embodiment, different distance rules can be configured for different clustering methods. On this basis, the clustering method corresponding to the target defect type can be determined; based on the correspondence between the clustering method and the distance rule, the target distance rule corresponding to the target defect type can be determined; the preset parameter threshold under the target distance rule is obtained; according to the target distance rule and the preset parameter threshold, the first-level defect area contained in the defect set corresponding to the target defect type is clustered.

[0045] The clustering method may be a band-shaped distribution clustering method, which can cluster the defect types with band-shaped distribution together. For this clustering method, the distance rule can be configured as follows: the head-to-tail distance and the left-to-right distance between the defect areas do not exceed the corresponding lateral maximum aggregatable distance x th and the maximum longitudinal aggregation distance y th When , clustering can be performed. Among them, the maximum horizontal aggregable distance and the maximum vertical aggregable distance are the preset parameter thresholds corresponding to the clustering method.

[0046] For example, taking defect type A as an example, for each first-level defect area in the defect set corresponding to defect type A, the area coordinates can be converted into a position vector The head-to-tail distance between any two first-level defect areas in the defect set can be calculated to obtain the matrix Among them, the element y in the matrix Y i,j represents the absolute value of the difference between the top of the i-th defect area and the bottom of the j-th defect area in the defect set. The left-right distance between any two first-level defect areas in the defect set can also be calculated to obtain the matrix Among them, the element x in the matrix X i,j Represents the absolute value of the difference between the left side of the i-th defect area and the right side of the j-th defect area in the defect set. Get all the defects that meet the distance rule y th ,x th {i,j}, for any i,j, it satisfies: x i,j ≤x th And y i,j ≤y th Afterwards, a connectivity graph between {i, j} satisfying the distance rule may be calculated, and the first-level defect regions corresponding to {i, j} belonging to the same connectivity graph may be divided into the same defect group, thereby obtaining at least one defect group corresponding to defect type A.

[0047] The clustering method may also be a densely distributed clustering method, which can cluster densely distributed defect types together. For this clustering method, the distance rule can be configured as the defect area d i Its closest β th The distance between defect areas is less than or equal to δ th When , clustering can be performed. Among them, the maximum distance between defect areas δ th and distance δ th The number of defective regions contained in th This is the preset parameter threshold corresponding to this clustering method.

[0048] For example, taking defect type A as an example, for each first-level defect area in the defect set corresponding to defect type A, the center point distance between any two first-level defect areas in the defect set can be calculated, and the distance between the i-th defect area in the defect set and its nearest β th Is the distance between the defective areas less than or equal to δ? th If so, the i-th defect area can be connected to its nearest β th The numbers of the defect regions are recorded as {i, j, k...}. After that, the connectivity graph between {i, j, k...} that satisfies the distance rule can be calculated, and the first-level defect regions corresponding to the numbers belonging to the same connectivity graph are divided into the same defect group, so that at least one defect group corresponding to defect type A can be obtained.

[0049] Of course, the above two clustering methods are only exemplary. In this embodiment, other clustering methods may be used and corresponding distance rules may be configured to determine the defect groups corresponding to each defect type.

[0050] In addition, in this embodiment, other clustering schemes may be used to cluster the first-level defect regions included in the surface to be inspected, but this embodiment is not limited thereto.

[0051] refer to Figure 2 , so far, at least one defect group can be generated. Figure 2 As shown, defect groups 1, 2, and 3 may be obtained, and each defect group may contain a first-level defect area.

[0052] In step 101, the first level defect areas meeting the preset conditions in at least one defect group can be excluded respectively. This process is a correction process for the fuzzy clustering result in step 100.

[0053] In step 101, the first-level defect regions that are incorrectly clustered into the defect group may be excluded, so that the remaining first-level defect regions in the defect group have a higher correlation. Figure 2 In the figure, after defect group 1 is excluded, the first-level defect area B is excluded.

[0054] Thus, in step 102, the second-level defect regions corresponding to at least one defect group can be determined based on the remaining first-level defect regions in at least one defect group. The remaining first-level defect regions in a single defect group can be aggregated into a second-level defect region. For example, Figure 2 The defect group 1 in contains three first-level defect regions A, B and C, then the three first-level defect regions A, B and C can be aggregated into one second-level defect region J. It is worth noting that the aggregation here refers to identifying the remaining first-level defect regions in the defect group as a whole, that is, identifying multiple small-sized defect regions as a continuous large-sized defect region.

[0055] In this embodiment, in step 102, the position attribute information of the aggregated area corresponding to the defect group can be re-determined based on the remaining first-level defect areas in the defect group, and used as the position attribute information of the second-level defect areas corresponding to the defect group, so as to be output as the detection result.

[0056] refer to Figure 1 and Figure 2 In step 102, the inspection result corresponding to the surface to be inspected can be determined according to the second-level defect area generated in step 101.

[0057] In step 102, the second-level defect area and the first-level defect area outside the second-level defect area can be used as the detection result corresponding to the surface to be detected. Of course, in practical applications, the above-mentioned steps 100-101 can be performed again on the first-level defect area outside the second-level defect area to aggregate more second-level defect areas from the first-level defect area outside the second-level defect area. Of course, this embodiment is not limited to this.

[0058] In summary, in this embodiment, fuzzy clustering can be performed first to form defect groups with associated first-level defect areas; then, intra-group screening can be performed within the defect group to exclude the wrongly clustered first-level defect areas; on this basis, defect area aggregation can be performed, which can effectively improve the accuracy of defect area aggregation, thereby improving the accuracy of surface defect detection, and further providing a more accurate basis for surface quality assessment.

[0059] Figure 3 A schematic diagram of another surface defect detection method provided by an exemplary embodiment of the present application is shown in FIG. Figure 3 , the method comprising:

[0060] Step 300: In response to a defect detection instruction, cluster the first-level defect areas included in the surface to be detected to generate at least one defect group;

[0061] Step 301, extracting defect features corresponding to each of the first-level defect regions included in a target defect group, where the target defect group is any one of at least one defect group;

[0062] Step 302: if there is an invalid defect region in the target defect group, the invalid defect region is excluded from the target defect group, wherein the defect feature corresponding to the invalid defect region meets a preset condition;

[0063] Step 303: Based on the remaining first-level defect regions in at least one defect group, determine the second-level defect regions corresponding to each of the at least one defect group;

[0064] Step 304: Determine the detection result corresponding to the surface to be detected according to the second-level defect area;

[0065] Among them, step 300 and steps 303-304 can refer to the description in the above-mentioned embodiment, and will not be repeated here.

[0066] In this embodiment, first-level defect regions meeting preset conditions in at least one defect group may be excluded based on defect characteristics, including but not limited to type recognition index, linear fit, relative position index, aggregation degree index, etc.

[0067] The following describes step 301 by taking several exemplary defect characteristics as examples.

[0068] Type Identification Index

[0069] In step 301, the cluster type corresponding to the target defect group can be obtained; the probability that the defect type of the target defect area in the target defect group is actually the cluster type is determined as the type identification index corresponding to the target defect area; wherein the target defect area is any one of the first-level defect areas included in the target defect group.

[0070] As mentioned above, in step 300, a clustering operation can be performed for each defect type, and the defect type targeted by each clustering operation is the clustering type, so that each defect group corresponds to a clustering type. Of course, based on the clustering operation performed from the distance dimension, in this embodiment, different defect groups may correspond to the same clustering type.

[0071] For example, when the cluster type corresponding to the target defect group is defect type A, if after the clustering operation of step 300, the target defect group contains three first-level defect areas 1, 2 and 3, among which the first-level defect area 1 is predicted to be defect type A in step 300, the first-level defect area 2 is predicted to be defect type B (a similar defect type to A), and the first-level defect area 3 is predicted to be defect type C (a similar defect type to A), then the probabilities that the first-level defect areas 1, 2 and 3 are actually defect type A can be calculated respectively.

[0072] If the cluster type corresponding to the target defect group is represented as A 实际 The defect type predicted for each first-level defect area in the target defect group is represented by X 预测 , then the probability that the defect type of the target defect area is actually the cluster type can be expressed as:

[0073] P'(A 实际 |X 预测 )=P'(A 实际 ,X 预测 ) / P'(X 预测)≈P(X 预测 ,A 实际 ) / P'(X 预测 )

[0074] Among them, P'(X 预测 ) represents the predicted probability corresponding to the defect type predicted for the target defect area, P(X 预测 ,A 实际 ) represents the probability that the defect probability of the target defect area is predicted to be consistent with the clustering probability corresponding to the target defect group.

[0075] Optionally, P'(X 预测 ) can be obtained from the output of the classification model. As mentioned above, the classification model can predict the defect type of the target defect area and provide the predicted probability. 预测 ,A 实际 ), the proportion of target sample defect areas in the test set used to train the classification model can be calculated. The target sample defect areas are sample defect areas whose defect types predicted by the classification model are the cluster types corresponding to the target defect group and whose labeled defect types are the cluster types corresponding to the target defect group; the proportion is taken as P(X 预测 ,A 实际 ). For example, if the cluster type corresponding to the target defect group is defect type A, the test set contains 100 sample defect areas, of which 20 are labeled as defect type A, and among the 20 sample defect areas labeled as defect type A, 10 are predicted as defect type A by the classification model, then P(X 预测 ,A 实际 ) is 0.1. On this basis, P(X 预测 ,A 实际 ) and P'(X 预测 ) is taken as the probability that the defect type of the target defect area is actually the cluster type.

[0076] In this embodiment, the type recognition index can be used to reflect the type recognition accuracy of the target defect area. The higher the type recognition index, the greater the possibility that the target defect area should be clustered into the target defect group. Therefore, based on the type recognition index, the first-level defect area with defect type recognition errors in the defect group can be excluded from the dimension of type recognition accuracy.

[0077] Straight fit

[0078] In step 301, linear regression fitting can be performed on the coordinates of representative points of the first-level defect area included in the target defect group to obtain a fitting line corresponding to the target defect group; the degree of fit between the first-level defect area included in the target defect group and the fitting line is calculated as the straight line fit corresponding to each of the first-level defect areas included in the target defect group.

[0079] Optionally, the representative point coordinates may be the center point coordinates.

[0080] Figure 4 A logical diagram of determining the degree of linear fit provided by an exemplary embodiment of the present application. Figure 4 , after linear regression fitting, the corresponding fitting line y=a can be generated m x+b m . Figure 4 The coordinates of the representative points of the first-level defect area included in the target defect group are also shown ( Figure 4 multiple black dots in the image).

[0081] In order to calculate the degree of fit between the first-level defect area included in the target defect group and the fitting line, in this embodiment, taking any target defect area in the first-level defect area included in the target defect group as an example, the target distance between the representative point of the target defect area and the fitting line can be calculated; the degree of fit between the target defect area and the fitting line is determined according to the target distance.

[0082] In practical applications, the target reference distance parameter corresponding to the convergence direction of the target defect area can be determined based on the corresponding relationship between the convergence direction and the reference distance parameter; the fit between the target defect area and the fitting line can be determined based on the target distance and the target reference distance parameter. The convergence direction can be determined based on the direction of the fitting line. For example, if the fitting line is closer to the width direction of the target defect area, the convergence direction is the width direction, and if the fitting line is closer to the length direction of the target defect area, the convergence direction is the length direction.

[0083] Among them, following the different clustering methods mentioned above, in different clustering methods, the reference distance parameter corresponding to the aggregation direction can be determined according to the preset parameter threshold in the distance rule. For example, in the clustering method of band distribution, the maximum horizontal aggregation distance x th As the reference distance parameter when the aggregation direction is the width direction, the maximum vertical aggregation distance y th As the reference distance parameter when the aggregation direction is the length direction. Then the fit between the target defect area and the fitting line can be expressed as

[0084]

[0085] Among them, τ i,m represents the target distance between the representative point of the target defect area and the fitting line, τ represents the target reference distance parameter, and when the aggregation direction is the length direction, τ=y th When the polymerization direction is the length direction, τ=x th .

[0086] For another example, in a densely distributed clustering mode, the maximum distance between defect regions can be used as the reference distance parameter for all aggregation directions. Of course, other values ​​can also be used as the reference distance parameter corresponding to the aggregation direction according to actual needs.

[0087] In this embodiment, when the distance between the target defect area and the fitting line is closer, the direct fit is higher, and the possibility that the target defect area should be clustered into the target defect group is greater. Therefore, based on the straight line fit, the first-level defect area that is too far away from the fitting line in the defect group can be excluded.

[0088] Relative Position Index

[0089] In step 301, the position attribute information of the aggregated area covered by the first-level defect area included in the target defect group can be determined; based on the position attribute information and the representative point coordinates of the first-level defect area included in the target defect group, the relative position index between the first-level defect area included in the target defect group and the aggregated area is calculated.

[0090] In practical applications, the center point coordinates and length of the aggregation area can be determined based on the position attribute information of the aggregation area corresponding to the target defect group; the target distance between the center point coordinates of the target defect area and the center point coordinates of the aggregation area is calculated; and the ratio between the target distance and the length of the aggregation area is used as the relative position index between the target defect area and the aggregation area.

[0091] For example, for the target defect group F m , the location attribute information of the aggregation area may include the area coordinates p m =[y m,t ,y m,b ,x m,l ,x m,r ], the coordinates of the center point of the region q i =[y m ,x m ], the first width l m =y m,b -y m,t , the second width w m =x m,r -x m,l . Among them, the maximum of the first width and the second width is max[l m ,w m ], which can be used as the length of the aggregation area. Then the relative position index between the target defect area and the aggregation area can be expressed as:

[0092] v i,m =t i,m / max[l m ,w m ]

[0093] Among them, t i,m Indicates the target distance between the center point coordinates of the target defect area and the center point coordinates of the aggregation area.

[0094] Figure 5 A distribution diagram of the first-level defect areas included in a target defect group provided by an exemplary embodiment of the present application. Figure 5 , the target defect group contains three first-level defect areas, which are marked as defect 1, defect 2 and defect 3. Among them, defect 2 is closest to the center point of the aggregation area, so the relative position index corresponding to defect 2 is the lowest.

[0095] In this embodiment, the relative position index can be used to reflect the relative position between the target defect region and the aggregated region covered by the target defect group to which it belongs. The higher the relative position index, the lower the probability that the target defect region should be clustered into the target defect group. Therefore, based on the relative position index, the first-level defect region in the defect group that is far from the center point of the corresponding aggregated region can be excluded.

[0096] Degree of aggregation index

[0097] In step 301, the distance between the target defect region and the N first-level defect regions closest to it in the target defect group can be calculated; based on the distance, the aggregation degree index corresponding to the target defect region is determined; wherein N is a positive integer.

[0098] In this embodiment, N can be flexibly set according to actual needs. For example, N can be 30% of the total number of first-level defect regions included in the target defect group.

[0099] In practical applications, the average distance between the target defect area and the N first-level defect areas closest to it in the target defect group can be calculated based on the distance; the length of the aggregation area covered by the first-level defect areas included in the target defect group can be determined; the ratio of the average distance to the length of the aggregation area is used as the aggregation degree index corresponding to the target defect area. Then, the aggregation degree index corresponding to the target defect area can be expressed as:

[0100]

[0101] Among them, δ i,j is the distance from the target defect region i to the N nearest first-level defect regions j in the target defect group.

[0102] In this embodiment, the aggregation degree index can be used to reflect the aggregation degree between the target defect region and other first-level defect regions in the target defect group. The higher the aggregation degree index, the lower the aggregation degree between the target defect region and other first-level defect regions in the target defect group, and the lower the possibility that the target defect region should be clustered into the target defect group. Therefore, based on the aggregation degree index, the first-level defect regions with a low aggregation degree with other first-level defect regions in the defect group can be excluded.

[0103] In the above, several exemplary defect features are used as examples to illustrate the process of extracting defect features corresponding to the target defect area. However, in this embodiment, the defect features are not limited thereto, and the methods of extracting the above exemplary defect features are also not limited thereto.

[0104] On this basis, in step 302 , the invalid defect area in the target defect group can be determined.

[0105] In this embodiment, at least the following two implementation methods may be used to determine the invalid defect area in the target defect group.

[0106] In one implementation, an aggregate score of the target defect area may be calculated based on defect features corresponding to the target defect area; if the aggregate score is lower than a preset threshold, the target defect area is determined to be an invalid defect area.

[0107] An exemplary aggregate score may be expressed as:

[0108] δ i,m =P i, ' m (A 实际 |X 识别 )φ i,m / v i,m u i,m

[0109] The meaning of each parameter in the formula can be found in the previous description and will not be repeated here.

[0110] It is worth noting that the number and types of defect features involved in the calculation of the aggregate score in the above formula are exemplary, and this embodiment is not limited thereto.

[0111] In this implementation, an aggregation score threshold may be set, and if the aggregation score corresponding to the target defect area is lower than the aggregation score threshold, the target defect area is determined as an invalid defect area and excluded from the target defect group. That is, the aforementioned preset condition for determining an invalid defect area is that the corresponding aggregation score is lower than the aggregation score threshold.

[0112] In another implementation, the defect features corresponding to the target defect area can be input into the aggregation model; in the aggregation model, if the aggregation type corresponding to the defect features of the target defect area is predicted to be an invalid class based on the correspondence between the defect features and the aggregation types, the target defect area is determined to be an invalid defect area.

[0113] Among them, the training process of the aggregation model can be:

[0114] Obtaining a training set, which includes defect features and annotation information corresponding to several sample defect regions, and the annotation information includes aggregation types corresponding to the sample defect regions, and the aggregation types include valid classes and invalid classes;

[0115] The training set is input into the aggregation model so that the aggregation model can learn the correspondence between defect features and aggregation types.

[0116] In practical applications, the defect features corresponding to the sample defect area can be converted into feature vectors during the annotation process, for example The meaning of each parameter in the feature vector will not be repeated. The sample defect area is labeled by manual review, for example, the valid class is labeled as 1 and the invalid class is labeled as 0. After that, the feature vector and the labeled information are input into the aggregation model. Of course, the information related to the defect group can also be input into the aggregation model so that the aggregation model can learn the corresponding relationship between the defect features and the aggregation type.

[0117] In this way, based on the trained aggregation model, in step 302, the defect features corresponding to the extracted target defect area can be directly input into the aggregation model, and the aggregation model can output whether the target defect area is an invalid defect area.

[0118] Among them, the aggregation model can adopt a machine learning model, such as a vector machine, linear regression or random forest type of machine learning model, which is not limited in this embodiment.

[0119] In summary, in this embodiment, the defect features corresponding to the first-level defect areas included in the defect group can be extracted. Based on the defect features, it can be judged from multiple dimensions whether the first-level defect areas should be clustered into the defect group. Therefore, the first-level defect areas in the defect group that are incorrectly clustered into the defect group due to inaccurate defect types or too strict or too wide distance rules used in the clustering process can be excluded, thereby effectively improving the clustering accuracy of the remaining first-level defect areas in the defect group, thereby improving the accuracy of surface defect detection.

[0120] It should be noted that the execution subject of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 301 to 303 can be device A; for another example, the execution subject of steps 301 and 302 can be device A, and the execution subject of step 303 can be device B; and so on.

[0121] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel, and the sequence numbers of the operations, such as 301, 302, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0122] Figure 6 A schematic diagram of a computing device provided by another exemplary embodiment of the present application is shown in FIG. Figure 6 As shown, the computing device includes: a memory 60 and a processor 61 .

[0123] The memory 60 is used to store computer programs and can be configured to store various other data to support operations on the computing platform. Examples of such data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc.

[0124] The memory 60 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0125] The processor 61 is coupled to the memory 60 and is used to execute the computer program in the memory 60 to:

[0126] In response to a defect detection instruction, clustering first-level defect regions included in the surface to be detected to generate at least one defect group;

[0127] Eliminate first-level defect areas that meet preset conditions in at least one defect group;

[0128] Based on the remaining first-level defect regions in at least one defect group, respectively determine the second-level defect regions corresponding to the at least one defect group;

[0129] According to the second-level defect area, the detection result corresponding to the surface to be detected is determined.

[0130] In an optional embodiment, when the processor 61 respectively excludes the first level defect areas meeting the preset conditions in at least one defect group, it is configured to:

[0131] Extracting defect features corresponding to the first-level defect areas included in the target defect group;

[0132] If there is an invalid defect area in the target defect group, the invalid defect area is excluded from the target defect group, and the defect characteristics corresponding to the invalid defect area meet the preset conditions;

[0133] The target defect group is any one of the at least one defect group.

[0134] In an optional embodiment, the defect feature includes a type identification index, and the processor 61 is used to extract the defect features corresponding to the first-level defect areas included in the target defect group:

[0135] Get the cluster type corresponding to the target defect group;

[0136] Determine the probability that the defect type of the target defect area in the target defect group is actually the cluster type, as the type recognition index corresponding to the target defect area;

[0137] The target defect area is any one of the first-level defect areas included in the target defect group.

[0138] In an optional embodiment, when determining the probability that the defect type of the target defect area in the target defect group is actually a cluster type, the processor 61 is configured to:

[0139] Obtain the defect type and predicted probability of the target defect area provided by the classification model;

[0140] Calculate the proportion of target sample defect areas in the test set used to train the classification model, where the target sample defect areas are sample defect areas whose defect types predicted by the classification model are cluster types and whose labeled defect types are cluster types;

[0141] The ratio of the predicted probability and the proportion is taken as the probability that the defect type of the target defect area is actually the cluster type.

[0142] In an optional embodiment, the defect feature includes a straight line fit, and the processor 61 is used to extract the defect features corresponding to the first-level defect areas included in the target defect group:

[0143] Performing linear regression fitting on the coordinates of representative points of the first-level defect area included in the target defect group to obtain a fitting line corresponding to the target defect group;

[0144] The degree of fit between the first-level defect area included in the target defect group and the fitting line is calculated as the straight line fit corresponding to each of the first-level defect areas included in the target defect group.

[0145] In an optional embodiment, when calculating the fit between the first-level defect area included in the target defect group and the fitting line, the processor 61 is used to:

[0146] Calculate the target distance between the representative point of the target defect area and the fitting line;

[0147] Based on the corresponding relationship between the aggregation direction and the reference distance parameter, determining the target reference distance parameter corresponding to the aggregation direction of the target defect area;

[0148] Determine the fit between the target defect area and the fitting line according to the target distance and target reference distance parameters;

[0149] The target defect area is any one of the first-level defect areas included in the target defect group.

[0150] In an optional embodiment, the defect feature includes a relative position index, and the processor 61 is used to extract the defect features corresponding to the first-level defect areas included in the target defect group:

[0151] Determine location attribute information of an aggregated area covered by a first-level defect area included in a target defect group;

[0152] According to the position attribute information and the coordinates of the representative points of the first-level defect areas included in the target defect group, the relative position index between the first-level defect areas included in the target defect group and the aggregated area is calculated.

[0153] In an optional embodiment, when calculating the relative position index between the first-level defect area and the aggregated area included in the target defect group, the processor 61 is used to:

[0154] According to the location attribute information, determine the center point coordinates and length of the aggregation area;

[0155] Calculate the target distance between the center point coordinates of the target defect area and the center point coordinates of the aggregation area;

[0156] The ratio between the target distance and the length of the aggregation area is used as the relative position index between the target defect area and the aggregation area.

[0157] In an optional embodiment, the defect feature includes an aggregation degree index, and the processor 61 is used to extract the defect features corresponding to the first-level defect regions included in the target defect group:

[0158] Calculate the distance between the target defect area and the N first-level defect areas closest to it in the target defect group;

[0159] According to the distance, determine the aggregation degree index corresponding to the target defect area;

[0160] Wherein, N is a positive integer, and the target defect area is any one of the first-level defect areas included in the target defect group.

[0161] In an optional embodiment, when the processor 61 determines the aggregation degree index corresponding to the target defect area according to the distance, it is configured to:

[0162] According to the distance, the average distance between the target defect area and the N first-level defect areas closest to it in the target defect group is calculated;

[0163] Determining the length of the aggregated region covered by the first-level defect region included in the target defect group;

[0164] The ratio of the average distance to the length of the polymerization area is taken as the polymerization degree index corresponding to the target defect area.

[0165] In an optional embodiment, the processor 61 is further configured to:

[0166] Calculate the aggregation score of the target defect area according to the defect features corresponding to the target defect area;

[0167] If the aggregate score is lower than a preset threshold, the target defect area is determined to be an invalid defect area;

[0168] The target defect area is any one of the first-level defect areas included in the target defect group.

[0169] In an optional embodiment, the processor 61 is further configured to:

[0170] Inputting defect features corresponding to the target defect area into the aggregation model;

[0171] In the aggregation model, if the aggregation type corresponding to the defect feature of the target defect region is predicted to be an invalid class based on the correspondence between the defect feature and the aggregation type, the target defect region is determined to be an invalid defect region;

[0172] The target defect area is any one of the first-level defect areas included in the target defect group.

[0173] In an optional embodiment, the processor 61 is further configured to:

[0174] Obtaining a training set, which includes defect features and annotation information corresponding to several sample defect regions, and the annotation information includes aggregation types corresponding to the sample defect regions, and the aggregation types include valid classes and invalid classes;

[0175] The training set is input into the aggregation model so that the aggregation model can learn the correspondence between defect features and aggregation types.

[0176] In an optional embodiment, when clustering the first-level defect regions included in the surface to be inspected, the processor 61 is configured to:

[0177] Obtaining description information of the first-level defect area contained in the surface to be inspected, wherein the description information includes defect type and location attribute information;

[0178] According to the defect type and distance, the first-level defect areas contained in the surface to be inspected are clustered.

[0179] In an optional embodiment, when clustering the first-level defect areas included in the surface to be inspected according to the defect type and distance, the processor 61 is configured to:

[0180] For the target defect type, determine the similar defect type corresponding to the target defect type;

[0181] Taking the target defect type as the clustering type, clustering the first-level defect areas under the target defect type and similar defect types into a defect set as the defect set corresponding to the target defect type;

[0182] The first-level defect regions contained in the defect set corresponding to the target defect type are clustered according to the distance to obtain at least one defect group under the target defect type.

[0183] In an optional embodiment, when clustering the first-level defect areas included in the defect set corresponding to the target defect type according to the distance, the processor 61 is configured to:

[0184] Determine the clustering method corresponding to the target defect type;

[0185] Based on the correspondence between the clustering method and the distance rule, determine the target distance rule corresponding to the target defect type;

[0186] Get the preset parameter threshold under the target distance rule;

[0187] According to the target distance rule and the preset parameter threshold, the first-level defect areas contained in the defect set corresponding to the target defect type are clustered.

[0188] In an optional embodiment, before clustering the first-level defect regions included in the surface to be inspected, the processor 61 is further configured to:

[0189] Defect identification is performed on the surface to be processed to obtain description information of the first-level defect area contained in the surface to be detected.

[0190] In an optional embodiment, when the processor 61 determines the detection result corresponding to the surface to be detected according to the second-level defect area, it is used to:

[0191] The second level defect area and the first level defect area outside the second level defect area are taken as the detection results corresponding to the surface to be detected.

[0192] It is worth noting that the technical details in the above-mentioned embodiments of the computing device can refer to the relevant descriptions in the above-mentioned embodiments of the surface defect detection method. In order to save space, they will not be repeated here, but this should not cause loss of the protection scope of this application.

[0193] Further, if Figure 6 As shown, the computing device also includes: a communication component 62, a display 63, a power supply component 64 and other components. Figure 6 Only some components are shown schematically, and it does not mean that the computing device only includes Figure 6 Components shown.

[0194] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be executed by a computing device in the above method embodiment.

[0195] Above Figure 6 The communication component in is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0196] Above Figure 6The display in the embodiment includes a screen, and the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0197] Above Figure 6 The power supply component in the device provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.

[0198] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

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

[0200] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0201] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0202] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0203] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0204] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0205] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0206] The above is only the embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A surface defect detection method, characterized in that: include: Clustering the first-level defect regions contained in the surface to be inspected to generate at least one defect group; Extracting defect features corresponding to each of the first-level defect regions included in the target defect group, the target defect group being any one of the at least one defect group, the defect features comprising at least one of the following: a straight line fit between the first-level defect region and a fitting line corresponding to the target defect group to which it belongs, a relative position index between the first-level defect region and an aggregated region covered by it, or an aggregated degree index determined between the first-level defect region and the N first-level defect regions closest to it in the target defect group, wherein N is a positive integer; If there is an invalid defect area in the target defect group, the invalid defect area is excluded from the target defect group, and the defect feature corresponding to the invalid defect area meets the preset condition; Based on the remaining first-level defect regions in the at least one defect group, respectively determine the second-level defect regions corresponding to each of the at least one defect group; According to the second-level defect area, a detection result corresponding to the surface to be detected is determined.

2. The method according to claim 1, characterized in that: The defect feature also includes a type identification index. The defect features corresponding to the first-level defect areas included in the extracted target defect group include: Obtaining a cluster type corresponding to the target defect group; Determine the probability that the defect type of the target defect area in the target defect group is actually the cluster type as the type identification index corresponding to the target defect area; The target defect area is any one of the first-level defect areas included in the target defect group.

3. The method according to claim 2, characterized in that The determining the probability that the defect type of the target defect area in the target defect group is actually the cluster type includes: Obtaining the defect type and predicted probability of the target defect area provided by the classification model; Calculating the proportion of target sample defect areas in the test set used to train the classification model, the target sample defect areas are sample defect areas whose defect types predicted by the classification model are the cluster type and whose marked defect types are the cluster type; The ratio of the predicted probability to the proportion is taken as the probability that the defect type of the target defect area is actually the cluster type.

4. The method according to claim 1, characterized in that: The defect characteristics include straight line fit, and the defect characteristics corresponding to the first-level defect areas included in the extracted target defect group include: Performing linear regression fitting on the coordinates of representative points of the first-level defect area included in the target defect group to obtain a fitting line corresponding to the target defect group; The degree of fit between the first-level defect regions included in the target defect group and the fitting line is calculated as the straight line fit corresponding to each of the first-level defect regions included in the target defect group.

5. The method according to claim 4, characterized in that The calculating the degree of fit between the first-level defect area included in the target defect group and the fitting line includes: Calculating a target distance between a representative point of a target defect area and the fitting line; Based on the correspondence between the aggregation direction and the reference distance parameter, the target reference distance parameter corresponding to the aggregation direction of the target defect area is determined, the aggregation direction is the direction closer to the fitting line in the length direction and the width direction of the target defect area, and the reference distance parameter corresponding to the aggregation direction is determined according to the preset parameter threshold in the distance rule under the clustering method; Determining the degree of fit between the target defect area and the fitting line according to the target distance and the target reference distance parameter; The target defect area is any one of the first-level defect areas included in the target defect group.

6. The method according to claim 1, characterized in that The defect feature includes a relative position index, and the defect features corresponding to the first-level defect areas included in the extracted target defect group include: Determining location attribute information of an aggregated area covered by a first-level defect area included in the target defect group; The relative position index between the first level defect area included in the target defect group and the aggregate area is calculated according to the position attribute information and the representative point coordinates of the first level defect area included in the target defect group.

7. The method according to claim 6, characterized in that The calculating the relative position index between the first level defect area included in the target defect group and the aggregation area includes: Determine the center point coordinates and length of the aggregation area according to the location attribute information; Calculating a target distance between the center point coordinates of the target defect area and the center point coordinates of the aggregation area; The ratio between the target distance and the length of the aggregation area is used as a relative position index between the target defect area and the aggregation area.

8. The method according to claim 1, characterized in that The defect characteristics include a polymerization degree index, and the defect characteristics corresponding to each of the first-level defect regions included in the extracted target defect group include: Calculating the distance between the target defect region and the N first-level defect regions closest to it in the target defect group; Determining a polymerization degree index corresponding to the target defect area according to the distance; Wherein, N is a positive integer, and the target defect area is any one of the first-level defect areas included in the target defect group.

9. The method according to claim 8, characterized in that Determining the polymerization degree index corresponding to the target defect area according to the distance includes: According to the distance, calculating the average distance between the target defect region and the N first-level defect regions closest to it in the target defect group; Determining the length of the aggregated region covered by the first level defect region included in the target defect group; The ratio of the average distance to the length of the polymerization area is used as the polymerization degree index corresponding to the target defect area.

10. The method according to claim 1, characterized in that Also includes: According to the defect characteristics corresponding to the target defect area, the aggregation score of the target defect area is calculated by adopting the strategy that the higher the linear fit degree, the higher the aggregation score, the higher the relative position index, the lower the aggregation score, and / or the higher the aggregation degree index, the lower the aggregation score; If the aggregate score is lower than a preset threshold, determining the target defect area as the invalid defect area; The target defect area is any one of the first-level defect areas included in the target defect group.

11. The method according to claim 1, characterized in that: Also includes: Inputting defect features corresponding to the target defect area into the aggregation model; In the aggregation model, if, based on the correspondence between the defect feature and the aggregation type, it is predicted that the aggregation type corresponding to the defect feature of the target defect region is an invalid class, then the target defect region is determined to be the invalid defect region; The target defect area is any one of the first-level defect areas included in the target defect group.

12. The method according to claim 11, characterized in that Also includes: Acquire a training set, wherein the training set includes defect features and annotation information corresponding to a number of sample defect regions, wherein the annotation information includes an aggregation type corresponding to the sample defect region, and the aggregation type includes a valid class and an invalid class; The training set is input into the aggregation model so that the aggregation model can learn the corresponding relationship between the defect features and the aggregation types.

13. The method according to claim 1, characterized in that The clustering of the first-level defect areas contained in the surface to be inspected comprises: Acquire description information of a first-level defect area contained in the surface to be inspected, wherein the description information includes defect type and location attribute information; The first-level defect areas contained in the surface to be inspected are clustered according to defect types and distances.

14. The method according to claim 13, characterized in that The clustering of the first-level defect areas contained in the surface to be inspected according to the defect type and distance includes: For a target defect type, determining a similar defect type corresponding to the target defect type; Taking the target defect type as a clustering type, clustering the first-level defect areas under the target defect type and similar defect types into a defect set as the defect set corresponding to the target defect type; Clustering the first-level defect regions contained in the defect set corresponding to the target defect type is performed according to the distance to obtain at least one defect group under the target defect type.

15. The method according to claim 14, characterized in that The clustering of the first-level defect regions contained in the defect set corresponding to the target defect type according to the distance includes: Determine a clustering method corresponding to the target defect type; Based on the correspondence between the clustering method and the distance rule, determining the target distance rule corresponding to the target defect type; Obtaining a preset parameter threshold under the target distance rule; According to the target distance rule and the preset parameter threshold, the first-level defect areas included in the defect set corresponding to the target defect type are clustered.

16. The method according to claim 13, characterized in that Before clustering the first-level defect regions included in the surface to be inspected, the method further includes: Defect identification is performed on the surface to be processed to obtain description information of the first-level defect area contained in the surface to be detected.

17. The method according to claim 1, characterized in that The step of determining the inspection result corresponding to the surface to be inspected according to the second-level defect area includes: The second-level defect area and the first-level defect area outside the second-level defect area are used as the detection results corresponding to the surface to be detected.

18. A computing device, characterized in that including memory and processor; The memory is used to store one or more computer instructions; The processor is coupled to the memory and configured to execute the one or more computer instructions for: In response to a defect detection instruction, clustering first-level defect regions included in the surface to be detected to generate at least one defect group; Extracting defect features corresponding to each of the first-level defect regions included in the target defect group, the target defect group being any one of the at least one defect group, the defect features comprising at least one of the following: a straight line fit between the first-level defect region and a fitting line corresponding to the target defect group to which it belongs, a relative position index between the first-level defect region and an aggregated region covered by it, or an aggregated degree index determined between the first-level defect region and the N first-level defect regions closest to it in the target defect group, wherein N is a positive integer; If there is an invalid defect area in the target defect group, the invalid defect area is excluded from the target defect group, and the defect feature corresponding to the invalid defect area meets the preset condition; Based on the remaining first-level defect regions in the at least one defect group, respectively determine the second-level defect regions corresponding to each of the at least one defect group; According to the second-level defect area, a detection result corresponding to the surface to be detected is determined.

19. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the surface defect detection method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Fuzzy clustering steel plate surface defect detection method based on pre classification

    CN104794491A

  • Fault detection method, fault detection system, fault detection equipment and storage medium

    CN110794227A

  • Method, device, and program for determination of continuous defect

    JP2010185868A