Defect identification method based on machine vision

By simulated and recognized multiple defect recognition algorithms, assigned weight values K1, K2 and K3, and selecting the most suitable algorithm for defect recognition, solving the problem of lack of targetedness in the prior art and improving the accuracy and efficiency of recognition.

CN120339199AInactive Publication Date: 2025-07-18YANGZHOU POLYTECHNIC INST
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510366691.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-07-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

There is a lack of a suitable and highly targeted defect identification algorithm in the prior art, and it is impossible to identify it based on the actual situation of the enterprise.

Method used

By simulated and recognized multiple defect recognition algorithms, we obtain the recognition time, wrong evaluation value and concurrent recognition value, assign these index weight values K1, K2 and K3, and select the most suitable algorithm for defect recognition based on the matching value.

Benefits of technology

It realizes the selection of the most appropriate defect identification method according to user needs, and improves the accuracy and efficiency of identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120339199A_ABST
    Figure CN120339199A_ABST
Patent Text Reader

Abstract

The invention discloses a defect identification method based on machine vision, which relates to the technical field of defect identification, and comprises the following steps of: performing simulation identification on all to-be-detected objects representing a defect identification algorithm by means of a plurality of experimental samples with known results to obtain an identification duration, a wrong evaluation value and a concurrent identification value representing an identification effect; setting weight values K1, K2 and K3 are given to the recognition duration, the wrong evaluation value and the concurrent recognition value, matching values are determined according to the recognition duration, the wrong evaluation value, the concurrent recognition value and the corresponding weight values, and the to-be-detected object with the highest matching value is determined to be marked as a use object according to the matching values; therefore, a proper defect identification method can be determined according to the actual demand of the user, so that the identification method can be selected from all dimensions in combination with the actual situation of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of defect recognition, and in particular is a defect recognition method based on machine vision. Background Art

[0002] The patent with publication number CN112488983A discloses a method for obtaining a defect recognition network, a defect recognition method and a level determination method. In the present invention, the method for obtaining a defect recognition network includes: using a feature parameter set to identify the type of defects in a defect image, and marking the contour according to the identified type to obtain the contour of the corresponding defect, the feature parameter set comes from the defect recognition network; using the defect image including the contour as a training sample, training the defect recognition network to update the feature parameter set in the defect recognition network; outputting the updated defect recognition network to make the defect detection process more automated.

[0003] However, there is a lack of relevant solutions for how to select appropriate and targeted algorithms for identification of defective products based on the actual situation of the enterprise. Based on this, a solution is provided. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art; To this end, the present invention proposes a defect recognition method based on machine vision, which includes: For all the objects to be tested that represent the defect recognition algorithm, simulated recognition is performed with the help of several experimental samples with known results to obtain the deemed recognition time, mis-evaluation value and concurrent recognition value representing the recognition effect. The deemed recognition time is determined by the recognition time of several experimental samples; the mis-evaluation value is determined by the number of recognition errors and the number of recognition misses. The number of recognition errors indicates the number of experimental samples of the object to be tested that are mis-identified as having defects, and the number of recognition misses indicates the number of experimental samples of the object to be tested that are mis-identified as having errors in the experimental samples or the defect positions are mis-identified; the concurrent recognition value refers to the maximum number of experimental samples that the user can recognize within a period less than the concurrent time. Assign a set weight value K1, K2 and K3 to the regarded recognition time, mis-evaluation value and concurrent recognition value, determine the matching value based on the regarded recognition time, mis-evaluation value, concurrent recognition value and the corresponding weight value, and mark the object to be tested with the highest matching value as the use object based on the matching value.

[0005] Furthermore, the deemed recognition duration is determined as follows: When obtaining several recognition times obtained by the object to be measured when recognizing each experimental sample, according to the dispersion degree of the several recognition times, the mean value of some or all of the recognition times is marked as the recognized duration, or the median value of the mean value and the maximum value of all recognition times is marked as the recognized duration, or the value obtained by multiplying the mean value of all recognition times by 0.85 is marked as the recognized duration.

[0006] Further, the specific method for determining the recognized duration is as follows: Calculate the discrete value W using the formula; ; If the value of W does not exceed the preset value X1, the mean value of all recognition times will be marked as the recognized duration.

[0007] Further, if the value of W exceeds X1, the values that cause the value of W to exceed X1 will be deleted in the order from largest to smallest of |Ti - P|, and then the deletion ratio of the number of deleted values to the total number is obtained; When the deletion ratio does not exceed the preset value X2, the mean value of the remaining recognition times after deletion will be marked as the recognized duration.

[0008] Further, when the deletion ratio exceeds the preset value X2, when the number of recognition times greater than the mean value is not less than the number of recognition times always less than the mean value, the median value of the mean value of the undelete recognition times and the maximum value in the recognition times will be marked as the recognized duration, otherwise the mean value of the undelete recognition times will be multiplied by 0.85 to obtain the recognized duration.

[0009] Further, the misjudgment value is obtained by adding the recognition error number and the recognition omission number after assigning weight values.

[0010] Further, the concurrent duration is B1 times the recognized duration, where B1 is a preset value.

[0011] Further, the weight values K1, K2, and K3 are set by the administrator according to actual needs and satisfy K1 + K2 + K3 = 1, and K1, K2, and K3 are all less than 1.

[0012] Further, K1, K2, and K3 are determined in the following manner: Obtain the detection frequency and the number of detections when the user performs product defect recognition. The detection frequency refers to how long it takes to detect the number of products corresponding to the detection number value, and the detection number refers to the number of products that need to be detected during a single detection process; Obtain the number of detections. Subtract the number of detections from the concurrent recognition value of all objects to be measured, and mark the number of values exceeding zero as the excess number. Divide the excess number by the number of objects to be measured and mark it as the excess ratio; Then subtract the recognition duration regarded as all objects to be measured from the detection frequency, and mark the number of values exceeding zero as the time exceeding value. Divide the time exceeding value by the number of objects to be measured to obtain the value marked as the time exceeding ratio. When both the exceeding ratio and the time exceeding ratio exceed B2, the values of K1 and K3 are both set to 0.3, and K2 is set to 0.4; B2 is a preset value. When the exceeding ratio does not exceed B2 and the time exceeding ratio exceeds B2, the values of K1 and K3 are sequentially set to 0.25 and 0.35, and K2 is set to 0.4. When the exceeding ratio exceeds B2 and the time exceeding ratio does not exceed B2, the values of K1 and K3 are sequentially set to 0.35 and 0.25, and K2 is set to 0.4. When both the exceeding ratio and the time exceeding ratio do not exceed B2, at this time, the values of K1 and K3 are sequentially set to 0.35 and 0.35, and K2 is set to 0.3.

[0013] Compared with the prior art, the beneficial effects of the present invention are: In this application, for all objects to be measured representing the defect recognition algorithm, through the simulation recognition with several experimental samples with known results, the regarded recognition duration, misjudgment value, and concurrent recognition value representing the recognition effect are obtained. A set weight values K1, K2, and K3 are assigned to the regarded recognition duration, misjudgment value, and concurrent recognition value. The matching value is determined according to the regarded recognition duration, misjudgment value, concurrent recognition value, and the corresponding weight values. According to the matching value, the object to be measured with the highest matching value is marked as the used object; thus, a suitable defect recognition method can be determined according to the actual needs of the user, making this application more capable of combining the actual situation of the user and selecting the recognition method from various dimensions. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 is a flowchart of the present invention; Figure 2 is a flowchart of Embodiment 2 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0015] The technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0016] Please refer to Figure 1 - Figure 2 , this application provides a defect recognition method based on machine vision, including; Step 1: First, obtain all defect recognition algorithms suitable for the target object. The target object refers to the corresponding enterprise. Here, it means obtaining all recognition algorithms that the enterprise can deploy or that meet the defect recognition and detection cost budget of the enterprise, and marking them as objects to be tested. Several objects to be tested form a group of objects to be tested. For specific examples of objects to be tested, the following detection algorithms can be used: Edge detection algorithm: Utilize the abrupt change information of image grayscale to extract the edges of objects in the image by detecting the boundaries between different uniform regions; Threshold segmentation algorithm: Divide the grayscale levels of the image into several stages, assuming that the target and the background are in different grayscale intervals. By setting a threshold, pixel points are divided into a foreground set and a background set, thereby extracting the target objects of interest; Morphological operation algorithm. In defect detection, morphological operations can be used to process problems such as noise and holes in the image, improving the accuracy of defect recognition. For example, in textile defect detection, morphological operations can be used to remove noise interference in the fabric texture and highlight the defect area; Support Vector Machine (SVM): A classic machine learning algorithm that classifies defect and non-defect regions by constructing a hyperplane; it can find the optimal separation surface between different categories of data and has good effects on linearly separable data. In practical applications, it is necessary to first extract the features of the image, and then input the feature vectors into the SVM model for training and classification. For example, in metal surface defect detection, features such as the color and texture of the image can be used as inputs, and the SVM model is used to determine whether there are defects.

[0017] The above are just some examples, and existing technologies not mentioned can also be objects to be tested, and no exhaustive list is made here; Step 2: Conduct actual simulations on the group of objects to be tested to obtain several experimental samples with known results. Here, the experimental sample data should be large. The specific method is as follows: Arbitrarily select one object to be tested; Use several objects to be tested to identify several experimental samples one by one, obtain the recognition time of each experimental sample by the object to be tested, and at the same time obtain the number of recognition errors and the number of missed recognitions when the object to be tested conducts recognition. The number of recognition errors refers to the number of non-defective experimental samples misidentified as defective, and the number of missed recognitions refers to the number of experimental samples with errors that are not recognized or with incorrect defect positions recognized; Process the recognition time. The specific processing method is as follows: Mark all recognition times as Ti, i = 1,..., n, and then obtain the mean P of Ti, and calculate the discrete value W of all Ti using the formula. The specific calculation formula is: ; If the value of W does not exceed the preset value X1, automatically mark the value of P as the regarded recognition duration; otherwise, automatically sort the values of Ti in descending order according to |Ti - P|, then select the values of Ti in sequence. Each time a value is selected, it is deleted. After deletion, calculate the remaining values of Ti to obtain the value of W. If it still exceeds X1, then automatically select the next value of Ti in sequence and delete it until the value of W does not exceed X1. Obtain the number of deleted Ti values, divide it by n to get the deletion ratio. If the deletion ratio does not exceed the preset value X2 (here, X2 generally takes the value of 10% to facilitate controlling the quantity of interference data), then mark the mean value of the remaining Ti at this time as the regarded recognition duration; if the deletion ratio exceeds X2, at this time, automatically obtain the number of values of Ti that exceed P among the undeleted Ti, mark it as the upper average, and mark the values less than P as the lower average. When the upper average is not less than the lower average, mark the median of the mean value P of the undeleted Ti and the maximum value in Ti as the regarded recognition duration; otherwise, mark the value obtained by multiplying the mean value P of Ti by 0.85 as the regarded recognition duration; obtain the regarded recognition duration; Then analyze the misjudgment value of the object to be measured according to the number of recognition errors and the number of recognition omissions. Specifically: Misjudgment value = 0.39 * number of recognition errors + 0.61 * number of recognition omissions; In the formula, both 0.39 and 0.61 are preset weight values used to highlight the different importance of different factors; Then obtain the concurrent recognition value of the object to be measured. The concurrent recognition value refers to the maximum number of experimental samples that the user can recognize the result within less than the concurrent duration. The determination method of the concurrent duration is: Concurrent duration = regarded recognition duration × B1, where B1 is a preset value, generally taking the value of 1.85. Of course, the administrator can set it to other values according to requirements; Obtain the regarded recognition duration, misjudgment value, and concurrent recognition value of the object to be measured; Perform the same processing on all objects to be measured to obtain the recognition duration, misjudgment value, and concurrent recognition value of all objects to be measured; Step 3: Match the objects to be measured for defect recognition. The specific method is: Calculate the matching values of all objects to be measured according to the formula. The specific formula is: Matching value = K1 × regarded recognition duration + K2 × misjudgment value + K3 × concurrent recognition value; Here, K1, K2, and K3 are all values entered by the user according to actual needs, and they satisfy K1 + K2 + K3 = 1, and K1, K2, and K3 are all less than 1. When higher accuracy is required, the value of K2 is enlarged. In this case, if the user needs to process a large amount of data simultaneously, the specific values are set in the order of K2 > K3 > K1; otherwise, the specific values are set in the order of K2 > K1 > K3. The user can flexibly adjust the values to calculate the matching values of all objects to be tested. Mark the object to be tested with the highest matching value as the object to be used. Step 4: Use the object to be used to identify product defects.

[0018] Certainly, as the second embodiment of this application, this embodiment is implemented on the basis of the first embodiment. The difference is that this application provides a method for determining the specific values of K1, K2, and K3. Obtain the detection frequency and the number of detections when the user is identifying product defects. The detection frequency refers to how long it takes to detect the number of products corresponding to the number of detections, and the number of detections refers to the number of products to be detected in a single detection process. The number of detections can be 1. Here, when the number of detections is obtained, subtract the number of detections from the concurrent identification values of all objects to be tested. Mark the number of values exceeding zero as the excess number, divide the excess number by the number of objects to be tested, and mark it as the excess ratio. Then subtract the regarded identification duration of all objects to be tested from the detection frequency. Mark the number of values exceeding zero as the time excess value, divide the time excess value by the number of objects to be tested, and obtain a value marked as the time excess ratio. When both the excess ratio and the time excess ratio exceed B2, the values of K1 and K3 are both set to 0.3, and K2 is set to 0.4; B2 is a preset value. When the excess ratio does not exceed B2 and the time excess ratio exceeds B2, the values of K1 and K3 are sequentially set to 0.25 and 0.35, and K2 is set to 0.4. When the excess ratio exceeds B2 and the time excess ratio does not exceed B2, the values of K1 and K3 are sequentially set to 0.35 and 0.25, and K2 is set to 0.4. When both the excess ratio and the time excess ratio do not exceed B2, at this time, the values of K1 and K3 are sequentially set to 0.35 and 0.35, and K2 is set to 0.3.

[0019] As the third embodiment of this application, this embodiment is used to fuse and implement the first embodiment and the second embodiment. Some of the data in the above formula are calculated by removing the dimension and taking their numerical values. The formula is obtained by software simulation of a large amount of collected data to get a formula closest to the actual situation. The preset parameters and preset thresholds in the formula are set by those skilled in the art according to the actual situation or obtained through simulation of a large amount of data.

[0020] The above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A defect recognition method based on machine vision, characterized in that, The method includes: For all objects to be tested representing defect recognition algorithms, perform simulated recognition with a number of experimental samples with known results to obtain the regarded recognition duration, misjudgment value, and concurrent recognition value representing the recognition effect. The regarded recognition duration is determined by the recognition durations of a number of experimental samples; the misjudgment value is determined by the number of recognition errors and the number of missed detections. The number of recognition errors represents the number of experimental samples that the object to be tested misidentifies as having defects, and the number of missed detections represents the number of experimental samples that the object to be tested fails to identify as having errors or misidentifies the defect positions; the concurrent recognition value refers to the maximum number of experimental samples that the user can identify within a concurrent duration. Assign a set weight value K1, K2, and K3 to the regarded recognition duration, misjudgment value, and concurrent recognition value. Determine the matching value based on the regarded recognition duration, misjudgment value, concurrent recognition value, and the corresponding weight values, and mark the object to be tested with the highest matching value as the object to be used according to the matching value.

2. The defect recognition method based on machine vision according to claim 1, wherein The regarded recognition duration is determined in the following way: When obtaining the recognition times of the object to be tested for each experimental sample, based on the dispersion degree of the several recognition times, mark the mean value of some or all of the recognition times as the regarded recognition duration, or mark the median value of the mean value and the maximum value of all recognition times as the regarded recognition duration, or mark the value obtained by multiplying the mean value of all recognition times by 0.85 as the regarded recognition duration.

3. A defect recognition method based on machine vision according to claim 1, characterized in that, The specific way to determine the regarded recognition duration is: Calculate the discrete value W using a formula; If the W value does not exceed the preset value X1, the mean value of all recognition times will be marked as the recognized duration.

4. The method for defect recognition based on machine vision according to claim 3, wherein If the value of W exceeds X1, then delete the values that cause the value of W to exceed X1 in descending order of |Ti - P|, and then obtain the deletion ratio of the number of deleted values to the total number; When the deletion ratio does not exceed the preset value X2, mark the mean value of the remaining recognition times after deletion as the regarded recognition duration.

5. The method for defect recognition based on machine vision according to claim 4, characterized in that, When the deletion ratio exceeds the preset value X2, when the number of recognition times greater than the mean value is not less than the number of recognition times always less than the mean value, mark the median value of the mean value of the undelete recognition times and the maximum value of the recognition times as the regarded recognition duration, otherwise mark the value obtained by multiplying the mean value of the undelete recognition times by 0.85 as the regarded recognition duration.

6. The defect recognition method based on machine vision according to claim 1, characterized in that, The misjudgment value is obtained by adding the weighted values of the number of recognition errors and the number of missed detections.

7. A defect recognition method based on machine vision according to claim 1, characterized in that The concurrent duration is B1 times the regarded recognition duration, and B1 is a preset value.

8. A defect recognition method based on machine vision according to claim 1, characterized in that, The set weight values K1, K2, and K3 are entered by the administrator according to actual needs and satisfy K1 + K2 + K3 = 1, and K1, K2, and K3 are all less than 1.

9. A defect recognition method based on machine vision according to claim 1, characterized in that, K1, K2, and K3 are determined in the following way: Obtain the detection frequency and the number of detections when the user performs product defect recognition. The detection frequency refers to how long it takes to detect the number of products corresponding to the detection number value, and the detection number refers to the number of products to be detected in a single detection process; Obtain the number of detections. Subtract the number of detections from the concurrent recognition values of all objects to be tested, and mark the number of values exceeding zero as the exceeding number. Divide the exceeding number by the number of objects to be tested and mark it as the exceeding ratio; Then subtract the recognition duration considered for all objects to be measured from the detection frequency, and mark the number of values exceeding zero as the time excess value. Divide the time excess value by the number of objects to be measured to obtain the value marked as the time excess ratio. When both the exceed ratio and the time excess ratio exceed B2, the values of K1 and K3 are both set to 0.3, and K2 is set to 0.

4. B2 is a preset value. When the exceed ratio does not exceed B2 and the time excess ratio exceeds B2, the values of K1 and K3 are sequentially set to 0.25 and 0.35, and K2 is set to 0.

4. When the exceed ratio exceeds B2 and the time excess ratio does not exceed B2, the values of K1 and K3 are sequentially set to 0.35 and 0.25, and K2 is set to 0.

4. When both the exceed ratio and the time excess ratio do not exceed B2, at this time, the values of K1 and K3 are sequentially set to 0.35 and 0.35, and K2 is set to 0.3.

Citation Information

Patent Citations

  • Defect identification network obtaining method, defect identification method and grade determination method

    CN112488983A