DEFECT DETECTION METHOD, APPARATUS AND SYSTEM

By constructing a mapping table and using it to identify suspected defect sub-images within an image, followed by a machine learning model, the method enhances defect detection speed and accuracy, addressing the slow preprocessing issues in existing technologies.

JP7569479B2Active Publication Date: 2024-10-18CONTEMPORARY AMPEREX TECHNOLOGY (HONG KONG) LIMITED
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2023552290
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-11-05
Publication Date
2024-10-18
Estimated Expiration
2041-11-05

AI Technical Summary

Technical Problem

Existing defect detection methods suffer from low speed due to lengthy preprocessing processes, particularly involving complex mathematical calculations, which slow down the overall detection process.

Method used

A method involving obtaining the average tone value of an image, constructing a mapping table with predefined values, and using this table to identify suspected defect sub-images, followed by inputting these sub-images into a machine learning model like a residual neural network to enhance detection speed and accuracy.

Benefits of technology

This approach significantly reduces preprocessing time by eliminating the need for complex calculations and improves defect detection speed and accuracy by focusing on sub-images, especially for large images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007569479000005
    Figure 0007569479000005
  • Figure 0007569479000006
    Figure 0007569479000006
  • Figure 0007569479000007
    Figure 0007569479000007
Patent Text Reader

Abstract

The embodiments of the present application provide a defect detection method, an apparatus and a system, which relate to the defect detection technical field, the method includes: obtaining an average gray level of an image of a detected object; constructing a mapping table, the elements of the mapping table including mapping values ​​corresponding to each gray level in a gray level range of the image, the mapping values ​​corresponding to gray levels equal to or greater than a reference value being a first value, the mapping values ​​corresponding to gray levels less than a reference value being a second value, the reference value being an absolute value of a difference between the average gray level and a pre-defined gray level; searching the mapping values ​​corresponding to gray levels of each pixel in the image from the mapping table; extracting at least one suspected defect sub-image from the image based on the mapping values ​​corresponding to the gray levels of each pixel, the mapping values ​​corresponding to the gray levels of each pixel in each suspected defect sub-image being the first value; and inputting the at least one suspected defect sub-image into a machine learning model to obtain a defect detection result.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present application relates to the field of defect detection technology, and in particular to a defect detection method, apparatus and system. [Background technology]

[0002] In industrial production, defects in an object will affect the performance of the object and ultimately lead to poor quality of the object, so it is necessary to detect defects in the object. Summary of the Invention

[0003] The inventors have noticed that the defect detection rate in related techniques is low.

[0004] The embodiments of the present application provide a defect detection method, apparatus, or system that can improve the defect detection speed.

[0005] According to a first aspect, the present application provides a defect detection method, the method comprising: obtaining an average gray level value of an image of a detected object; constructing a mapping table, elements of the mapping table including mapping values ​​corresponding to each gray level value in a gray level value range of the image, wherein a mapping value corresponding to a gray level value equal to or greater than a reference value is a first value, and a mapping value corresponding to a gray level value less than the reference value is a second value, the reference value being an absolute value of a difference between the average gray level value and a pre-set gray level value; searching for a mapping value corresponding to a gray level value of each pixel in the image from the mapping table; extracting at least one suspected defect sub-image from the image based on the mapping value corresponding to the gray level value of each pixel, wherein the mapping value corresponding to the gray level value of each pixel in each suspected defect sub-image is the first value; and inputting the at least one suspected defect sub-image into a machine learning model to obtain a defect detection result.

[0006] In the technical solution of the embodiment of the present application, on the one hand, the average gray value of the image is obtained, and then a mapping table is constructed according to the average gray value of the image and the gray value range of the image. Then, the mapping value corresponding to the gray value of each pixel of the image can be searched from the mapping table, without the need for mathematical calculation, and the defect detection speed can be improved. On the other hand, instead of the whole image of the processed object being input, the suspected defect sub-image is input to the machine learning model, which can also help improve the defect detection speed.

[0007] In some embodiments, obtaining a mean gray level value of an image of the detected object includes obtaining an original gray level value range of the image and performing contrast stretching on the image to expand the original gray level value range to the gray level value range, where the mean gray level value is the average gray level value of the image after the contrast stretching. The contrast stretching increases the gray level difference between defect and non-defect areas, thus improving the robustness and accuracy of the segmentation of suspected defect sub-regions, thereby improving the robustness and accuracy of defect detection under conditions of increased defect detection speed.

[0008] In some embodiments, performing contrast stretching on the image includes transforming an original grayscale value I1(x,y) of each pixel in the image to a grayscale value I2(x,y) according to the following formula:

[0009]

number

[0010] In some embodiments, the first value is d and the second value is c. In this way, the success rate of extracting suspected defect sub-images can be improved.

[0011] In some embodiments, c = 0 and d = 255. In this way, the success rate of extracting suspected defect sub-images can be further improved.

[0012] In some embodiments, the machine learning model includes a residual neural network model, and a total number of layers, including convolutional layers and fully connected layers, in the residual neural network model is 14. In this way, the accuracy of defect detection can be improved.

[0013] In some embodiments, the difference between the maximum and minimum original grayscale values ​​of non-defective areas other than defects in the image ranges from 35 to 50. In this way, the accuracy of defect detection can be further improved.

[0014] In some embodiments, the difference between the maximum and minimum original grayscale values ​​is 40. In this way, the accuracy of defect detection can be further improved.

[0015] In some embodiments, the maximum original tone value is 105 and the minimum original tone value is 75. In this manner, the accuracy of defect detection can be further improved.

[0016] In some embodiments, extracting at least one suspected defect sub-image from the image based on a mapping value corresponding to the gradation value of each pixel includes extracting a plurality of connected regions from the image based on a mapping value corresponding to the gradation value of each pixel, wherein the mapping value corresponding to the gradation value of each pixel in each connected region is the first value; merging the two adjacent connected regions into one suspected defect sub-image if two adjacent connected regions satisfy a predetermined condition, wherein areas of the two connected regions are a first area and a second area less than or equal to the first area, respectively, and an area of ​​an overlapping area of ​​the two connected regions is a third area, wherein the predetermined condition includes a ratio of the third area to the first area being greater than a predetermined ratio; and determining the two connected regions as two suspected defect sub-images if the two connected regions do not satisfy the predetermined condition. In these embodiments, in the process of extracting the suspected defect sub-images, if the ratio between the area of ​​the overlapping area of ​​two adjacent connected regions and the area of ​​the large connected region is greater than a preset ratio, the two connected regions are merged into one suspected defect sub-image, otherwise, the two connected regions are merged into two suspected defect sub-images. In this way, the number of suspected defect sub-images can be reduced, and the speed of obtaining the defect detection result by the machine learning model can be improved, thereby further improving the defect detection speed.

[0017] In some embodiments, the preset ratio is greater than 0.5 and less than 1. In this way, the number of suspected defect sub-images can be reduced while maintaining the accuracy of the suspected defect sub-images.

[0018] In some embodiments, the preset ratio is 0.8. In this way, the number of suspected defect sub-images can be reduced while the accuracy of the suspected defect sub-images can be better balanced.

[0019] In some embodiments, the data type of the elements in the mapping table is unsigned character.

[0020] In some embodiments, the defect detection result includes a defect type, thus making the defect detection result more accurate.

[0021] In some embodiments, the detected object comprises a battery plate. When the detected object is a battery plate, the defect detection means can be used to improve the speed of defect detection of the battery plate.

[0022] In some embodiments, the battery includes a lithium battery. When the detected object is a plate of a lithium battery, the defect detection means can be used to improve the speed of detecting defects in the plate of the lithium battery.

[0023] According to a second aspect, the present application provides a defect detection apparatus, the apparatus comprising: an acquisition module configured to acquire an average gray level value of an image of a detected object; a construction module configured to construct a mapping table, elements of the mapping table including mapping values ​​corresponding to each gray level value in a gray level value range of the image, where a mapping value corresponding to a gray level value equal to or greater than a reference value is a first value, a mapping value corresponding to a gray level value less than the reference value is a second value, and the reference value is an absolute value of a difference between the average gray level value and a pre-set gray level value; a search module configured to search for a mapping value corresponding to a gray level value of each pixel in the image from the mapping table; a cutout module configured to cut out at least one suspected defect sub-image from the image based on the mapping value corresponding to the gray level value of each pixel, where the cutout module has the first mapping value corresponding to the gray level value of each pixel in each suspected defect sub-image; and an input module configured to input the at least one suspected defect sub-image into a machine learning model to obtain a defect detection result. On the one hand, obtain the average gray level of the image, and then construct a mapping table based on the average gray level of the image and the gray level range of the image. Then, search the mapping value corresponding to the gray level of each pixel of the image from the mapping table, without needing to perform mathematical calculations, thus improving the defect detection speed. On the other hand, take the suspected defect sub-image as the input of the machine learning model instead of the entire image of the processed object as the input, which also helps to improve the defect detection speed.

[0024] According to a third aspect, the present application provides a defect detection apparatus, the apparatus including: a memory; and a processor coupled to the memory, the processor configured to execute the defect detection method according to any one of the above embodiments based on instructions stored in the memory.

[0025] According to a fourth aspect, the present application provides a defect detection system, the system including a defect detection device according to any one of the above embodiments, and an imaging device configured to scan the detected object to obtain the image.

[0026] According to a fifth aspect, the present application provides a computer-readable storage medium comprising computer program instructions, which, when executed by a processor, realises the defect detection method according to any one of the embodiments described above.

[0027] According to a sixth aspect, the present application provides a computer program product including a computer program, which, when executed by a processor, implements the defect detection method according to any one of the above embodiments. [Brief description of the drawings]

[0028] In order to more clearly explain the technical solutions of the embodiments of the present application, the following will briefly describe the drawings that need to be used in the embodiments of the present application. It should be apparent that the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on the drawings without exerting creative efforts. [Figure 1] 1 is a flowchart of a defect detection method according to an embodiment of the present application. [Diagram 2] 4 is a flowchart of a defect detection method according to another embodiment of the present application. [Diagram 3] 4 is a flowchart of a defect detection method according to yet another embodiment of the present application. [Figure 4] FIG. 2 is a schematic diagram of a residual neural network model according to an embodiment of the present application. [Diagram 5] 1 is a schematic diagram of a defect detection apparatus according to an embodiment of the present application; [Figure 6] FIG. 2 is a schematic diagram of a defect detection apparatus according to another embodiment of the present application. [Figure 7] 1 is a schematic diagram of a defect detection system according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0029] The embodiments of the present application will be described in more detail below in conjunction with the drawings and examples. The detailed description of the following examples and the drawings are for illustrative purposes of the principles of the present application, but are not intended to limit the scope of the present application, i.e., the present application is not limited to the described examples.

[0030] It should be noted that in the description of this application, unless otherwise specified, "plurality" means two or more than two, and terms such as "first," "second," "third," etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance.

[0031] Unless otherwise specified, the relative arrangement of parts and steps, formulas and numerical values ​​described in these examples do not limit the scope of the present disclosure.

[0032] Techniques, methods and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, said techniques, methods and equipment should be considered as part of this specification.

[0033] In all examples described and discussed herein, any specific values ​​should be construed as illustrative only and not limiting, such that other examples of the example embodiments may have different values.

[0034] It should be noted that like symbols and letters represent like items in the following figures, so that once an item is defined in one figure, there is no need to further discuss it in subsequent figures.

[0035] Regarding the problem of low defect detection speed, the inventors have found through analysis that the pre-processing process of the object image in the related art takes a long time.

[0036] Through further analysis, the inventor finds that the pre-processing process requires complex mathematical calculation processes (such as subtraction, absolute value, comparison, etc.) for the grayscale value of each pixel in the image to determine whether the pixel belongs to a suspected defect, which makes the image pre-processing process take a long time and reduces the speed of defect detection. When the size of the image is very large, the pre-processing process takes a longer time.

[0037] In view of this, the embodiments of the present application provide the following technical solutions to improve the defect detection speed.

[0038] 1 is a flow chart of a defect detection method according to an embodiment of the present application. As shown in FIG. 1, the defect detection method includes steps 102 to 110.

[0039] In step 102, the average gray level of the image of the detected object is obtained.

[0040] Here, the image may be an image of a surface of the detected object. In some embodiments, the detected object includes a battery plate, for example a lithium battery plate. The image may be an image of a surface of the plate. However, it should be understood that embodiments of the present application are not limited thereto, and the detected object may be other workpieces.

[0041] In some implementations, the average tone value of the image is the average tone value of the original tone values ​​of the image. In other implementations, the average tone value of the image is the average tone value of the tone values ​​after contrast expansion is performed on the original tone values, which will be described in detail below in conjunction with some examples.

[0042] In step 104, a mapping table is constructed, whose elements contain mapping values ​​corresponding to each tone value within the tone value range of the image.

[0043] For ease of explanation, the absolute value of the difference between the average gray level of the image and a preset gray level is called the reference value. In the mapping table, the mapping value corresponding to the gray level equal to or greater than the reference value is the first value, and the mapping value corresponding to the gray level less than the reference value is the second value.

[0044] For example, the gradation value range of an image is 0 to 255. For each gradation value from 0 to 255, a corresponding mapping value is provided in the mapping table, i.e., there are mapping values ​​corresponding to a total of 266 gradation values ​​in the mapping table. If the reference value is 100, then the mapping values ​​corresponding to each gradation value from 100 to 255 are all first values, while the mapping values ​​corresponding to each gradation value from 0 to 99 are all second values. It should be understood that the second value is different from the first value.

[0045] As can be understood, the above-mentioned preset grayscale value is a standard of how far the grayscale value of each pixel of an image deviates from the average grayscale value, and the specific value thereof may be set according to actual circumstances.

[0046] In some embodiments, the data type of the elements in the mapping table is unsigned char.

[0047] In step 106, the mapping table is retrieved for a mapping value that corresponds to the tone value of each pixel in the image.

[0048] Take the reference value still as 100 for example, if the gradation value of a pixel is 80, the corresponding mapping value searched from the mapping table is a second value (e.g., 0), and if the gradation value of a pixel is 120, the corresponding mapping value searched from the mapping table is a first value (e.g., 255). By traversing each pixel in the image, the mapping value corresponding to the gradation value of each pixel can be directly searched from the mapping table.

[0049] In step 108, at least one suspected defect sub-image is segmented from the image based on the mapping values ​​corresponding to the grayscale values ​​of each pixel.

[0050] Here, the mapping values ​​corresponding to the grayscale values ​​of each pixel in each suspected defective sub-image are all first values, in other words, the absolute values ​​of the differences between the grayscale values ​​of each pixel in each suspected defective sub-image and the average grayscale value of the entire image are all greater than a preset grayscale value.

[0051] In step 110, at least one suspected defect sub-image is input into a machine learning model to obtain a defect detection result.

[0052] It should be understood that the at least one suspected defect sub-image herein is obtained from step 108. If only one suspected defect sub-image is obtained from step 108, the suspected defect sub-image is input to the machine learning model, and if multiple suspected defect sub-images are obtained from step 108, the multiple suspected defect sub-images obtained are input to the machine learning model.

[0053] It should be further understood that the machine learning model can be trained with different sample images as inputs and different detection results as outputs to enable the machine learning model to obtain defect detection results based on suspected defect sub-images, e.g., training a machine learning model with sample defect images as inputs and defect types of the sample defect images as outputs, and training a machine learning model with sample non-defect images as inputs and non-defect results as outputs, for example.

[0054] In some embodiments, the machine learning model includes, but is not limited to, a residual neural network model.

[0055] In some embodiments, the defect detection result is no defect. In other embodiments, the defect detection result is defective. In some embodiments, if the defect detection result is defective, the defect detection result further includes a defect type. Taking a battery plate as an example, the defect type may include, but is not limited to, exposed metal, cracks, dark spots, bubbles, pits, unknown, etc.

[0056] In the above embodiment, on the one hand, the average gray level of the image is obtained, and then a mapping table is constructed according to the average gray level of the image and the gray level range of the image. Then, the mapping value corresponding to the gray level of each pixel of the image can be searched from the mapping table, without the need for mathematical calculation, which improves the defect detection speed. On the other hand, instead of the whole image of the processed object being input, the suspected defect sub-image is input to the machine learning model, which also helps to improve the defect detection speed.

[0057] FIG. 2 is a flow chart of a defect detection method according to another embodiment of the present application.

[0058] 2, the defect detection method includes steps 102 to 110, and step 102 includes steps 1021 and 1022. The following will focus on the implementation process of only some of the steps (e.g., steps 1021 and 1022), and the other steps can be described by referring to the description of the embodiment shown in FIG.

[0059] In step 1021, the original range of tone values ​​of the image is obtained.

[0060] For example, an image of a target object can be obtained by scanning and imaging the surface of the target object, and the range of gradation values ​​of the image is the same as the range of the original gradation values.

[0061] Take the plate of a lithium battery as an example, by controlling the illuminance to be constant, the original grayscale range of the plate surface image can be obtained. As can be seen, the normal area of ​​the plate surface is smooth and has a consistent surface texture and color, and if the entire surface of the plate is irradiated with uniform light, the grayscale value of the normal area of ​​the obtained image will be close.

[0062] In step 1022, contrast extension is performed on the image to expand the original grey level range to a grey level range, where the average grey level of the image is the average grey level of the image after contrast extension.

[0063] In some embodiments, image contrast enhancement may be performed by the following scheme. The original gradation value I1(x,y) of each pixel in the image is converted to gradation value I2(x,y) based on the following formula:

[0064]

number

[0065] In step 104, a mapping table is constructed, and the elements of the mapping table include a mapping value corresponding to each gray level in the gray level range of the image, where in the mapping table, the mapping value corresponding to the gray level values ​​equal to or greater than the reference value is a first value, and the mapping value corresponding to the gray level values ​​less than the reference value is a second value.

[0066] In some embodiments, the first value is an upper limit d of the range of gray values ​​after contrast extension, e.g., 255, and the second value is a lower limit c of the range of gray values ​​after contrast extension, e.g., 0. In this way, the success rate of subsequent extraction of suspected defective sub-images can be improved.

[0067] In step 106, the mapping table is retrieved for a mapping value that corresponds to the tone value of each pixel in the image.

[0068] In step 108, at least one suspected defect sub-image is segmented from the image based on the mapping values ​​corresponding to the grayscale values ​​of each pixel.

[0069] In step 110, at least one suspected defect sub-image is input into a machine learning model to obtain a defect detection result.

[0070] In the above embodiment, contrast stretching increases the gray level difference between defective and non-defective areas, thus improving the robustness and accuracy of the segmentation of suspected defect sub-areas, thereby improving the robustness and accuracy of defect detection under conditions of increased defect detection speed.

[0071] FIG. 3 is a flow chart of a defect detection method according to yet another embodiment of the present application.

[0072] 3, the defect detection method includes steps 102 to 110, and step 108 includes steps 1081 to 1083. The following will focus on the implementation process of only some of the steps (e.g., steps 1081 to 1083), and the other steps can be described by referring to the description of the embodiment shown in FIG.

[0073] In step 102, the average gray level of the image of the detected object is obtained.

[0074] In some implementations, step 102 may include steps 1021 and 1022 shown in FIG.

[0075] In step 104, a mapping table is constructed, and the elements of the mapping table include a mapping value corresponding to each gray level in the gray level range of the image, where in the mapping table, the mapping value corresponding to the gray level values ​​equal to or greater than the reference value is a first value, and the mapping value corresponding to the gray level values ​​less than the reference value is a second value.

[0076] In step 106, the mapping table is retrieved for a mapping value that corresponds to the tone value of each pixel in the image.

[0077] In step 1081, a plurality of connected regions are cut out from the image based on a mapping value corresponding to the grayscale value of each pixel, and the mapping value corresponding to the grayscale value of each pixel in each connected region is a first value.

[0078] For example, the connected region analysis can extract a number of rectangular connected regions from an image. In each connected region, the absolute value of the difference between the grayscale value of each pixel and the average grayscale value of the image is greater than a preset grayscale value. In other words, each connected region may be a defective region.

[0079] In step 1082, if two adjacent connected regions satisfy a preset condition, the two connected regions are merged into one suspected defect sub-image.

[0080] For ease of explanation, the areas of the two adjacent connected regions are called the first area and the second area, respectively, and the area of ​​the overlapping area of ​​the two adjacent connected regions is called the third area. The second area is equal to or smaller than the first area, that is, the areas of the two adjacent connected regions may be equal or unequal. The above-mentioned preset condition includes that the ratio of the third area to the first area is greater than a preset ratio.

[0081] In step 1083, if the two adjacent connected regions do not satisfy the preset condition, the two connected regions are determined as two suspected defect sub-images.

[0082] In some embodiments, the preset ratio is greater than 0.5 and less than 1, for example, the preset ratio is 0.8. In this manner, connected regions with an overlap ratio of 0.5 or less are not merged, thereby reducing the number of suspected defect sub-images while simultaneously improving the accuracy of the suspected defect sub-images.

[0083] Through steps 1082 and 1083, the connected regions that satisfy the preset condition are integrated into one suspected defect sub-image, and each connected region that does not satisfy the preset condition is a suspected defect sub-image, respectively, so that at least one suspected defect sub-image is obtained.

[0084] In step 110, at least one suspected defect sub-image is input into a machine learning model to obtain a defect detection result.

[0085] In the above embodiment, in the process of extracting the suspected defect sub-images, if the ratio between the area of ​​the overlapping area of ​​two adjacent connected regions and the area of ​​the large connected region is greater than a preset ratio, the two connected regions are merged into one suspected defect sub-image, otherwise, the two connected regions are merged into two suspected defect sub-images. In this way, the number of suspected defect sub-images can be reduced, and the speed of obtaining the defect detection result by the machine learning model can be improved, thereby further improving the defect detection speed.

[0086] In some embodiments, the pre-processing time for the steps prior to step 110 is 80 ms or less.

[0087] When detecting defects using the methods of the above embodiments, the inventor has sought a solution to improve the speed and accuracy of defect detection. The inventor has noticed that when a machine learning model includes a residual neural network model, the accuracy of defect detection changes accordingly by adjusting the total number of convolution layers and fully connected layers in the residual neural network model.

[0088] In some embodiments, the total number of convolutional layers and fully connected layers in the residual neural network model is 14. In this way, the defect detection speed can be improved, and the defect detection accuracy can also be improved.

[0089] The inventors also noticed that when the grayscale values ​​of non-defective areas other than defects in an image of a detected object change within different ranges, the accuracy of defect detection results for detecting defects using a residual neural network model having a total of 14 convolutional layers and fully connected layers varies.

[0090] In some embodiments, the difference between the maximum and minimum original grayscale values ​​of non-defective regions other than defects in an image of a detected object ranges from 35 to 50. In such a case, the defect detection result of detecting defects using a residual neural network model having a total of 14 layers including convolutional layers and fully connected layers becomes more accurate.

[0091] In some embodiments, the difference between the maximum original grayscale value of the non-defective area and the minimum original grayscale value of the non-defective area is 40. For example, the range of grayscale values ​​of the non-defective area is 75 to 105, that is, the maximum original grayscale value of the non-defective area is 105, and the minimum original grayscale value of the non-defective area is 75. In this case, the defect detection result of detecting defects using a residual neural network model with a total of 14 layers including convolution layers and fully connected layers is more accurate.

[0092] FIG. 4 is a schematic diagram of a residual neural network model according to an embodiment of the present application.

[0093] As shown in Figure 4, the residual neural network model includes three residual network units (ResNet Units) located between a maximum pooling layer and an average pooling layer, each residual network unit includes two residual blocks, and each residual block includes two convolution layers. In addition, the residual neural network model further includes a first convolution layer located before the maximum pooling layer and a fully connected layer located after the average pooling layer.

[0094] In some embodiments, the size of the convolution kernel of the first convolution layer is 7*7, the number of convolution kernels is 64, and the size of the image is halved through the first convolution layer. In some embodiments, the size of the image is halved through the max pooling layer. In some embodiments, the size of the convolution kernel of each convolution layer in each residual network unit is 3*3, the number of convolution kernels is 256, and the size of the image is unchanged through each convolution layer in the residual network unit.

[0095] In some embodiments, the residual neural network model utilizes the following loss function when training:

[0096]

number

[0097] In the above equation, focal loss is a loss function, y′ is the probability of a category, α is the weight of the category, and γ is a modulation factor.

[0098] The residual neural network model shown in Figure 4 may be realized by reducing one residual network unit based on the ResNet18 model. The residual neural network model shown in Figure 4 may be called the ResNet14 model.

[0099] In some embodiments, compared to the ResNet18 model, the ResNet14 model has a 75% smaller volume, a 25% faster defect detection speed, and a 5% higher defect detection accuracy. In some embodiments, the inference time of the ResNet14 model is less than 20 ms. In addition, using the ResNet14 model helps to achieve classification of low probability (0.1%) defects, reducing the chance of them being overlooked.

[0100] Each embodiment in this specification is described in a progressive manner, and the focus of each embodiment is the difference between each embodiment and other embodiments, and the same or similar parts between the embodiments can be referred to each other. As for the device embodiment, since it basically corresponds to the method embodiment, the description thereof is simplified, and the relevant parts can be referred to the description of some of the method embodiment.

[0101] FIG. 5 is a schematic diagram of a defect detection apparatus according to one embodiment of the present application.

[0102] As shown in FIG. 5, the defect detection apparatus includes an acquisition module 501, a construction module 502, a search module 503, a segmentation module 504, and an input module 505.

[0103] The acquisition module 501 is configured to acquire an average gray level value of an image of a detected object.

[0104] The construction module 502 is configured to construct a mapping table, and the elements of the mapping table include a mapping value corresponding to each gray level in a gray level range of the image, where the absolute value of the difference between the average gray level and a preset gray level is a reference value, the mapping value corresponding to a gray level equal to or greater than the reference value is a first value, and the mapping value corresponding to a gray level less than the reference value is a second value.

[0105] The lookup module 503 is configured to look up a mapping value from the mapping table that corresponds to the grayscale value of each pixel in the image.

[0106] The segmentation module 504 is configured to segment at least one suspected defect sub-image from the image based on a mapping value corresponding to the grayscale value of each pixel, where the mapping value corresponding to the grayscale value of each pixel in each suspected defect sub-image is a first value.

[0107] The input module 505 is configured to input at least one suspected defect sub-image into the machine learning model to obtain a defect detection result.

[0108] In the above embodiment, the average gray level of the image is obtained, and then a mapping table is constructed according to the average gray level of the image and the gray level range of the image, and then the mapping value corresponding to the gray level of each pixel of the image is retrieved from the mapping table, without the need for mathematical calculation, which greatly improves the defect detection speed.

[0109] In some embodiments, the acquisition module 501 is configured to acquire an average gray level value of the image of the detected object according to the scheme introduced above. In some embodiments, the segmentation module 504 is configured to segment at least one suspected defect sub-image from the image according to the scheme introduced above.

[0110] FIG. 6 is a schematic diagram of a defect detection apparatus according to another embodiment of the present application.

[0111] As shown in FIG. 6, the defect detection apparatus 600 includes a memory 601 and a processor 602 coupled to the memory 601, and the processor 602 is configured to execute the method of any one of the aforementioned embodiments based on instructions stored in the memory 601.

[0112] The memory 601 may include, for example, a system memory, a fixed non-volatile storage medium, etc. In the system memory, for example, an operating system, an application program, a boot loader, and other programs may be stored.

[0113] The defect detection apparatus 600 may further include an input / output interface 603, a network interface 604, a storage interface 605, etc. These interfaces 603, 604, and 605, and the memory 601 and the processor 602 may be connected to each other via, for example, a bus 606. The input / output interface 603 provides a connection interface for input / output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 604 provides an interface for various network devices. The storage interface 605 provides a connection interface for external storage devices such as an SD card and a U disk.

[0114] In some embodiments, the defect detection device is further configured to upload the defect detection results to the data platform and / or upload suspected defect sub-images for which the defect detection results are defective to a defect image library. Then, when training a machine learning model, the images in the image library may become training samples, thereby improving the accuracy of subsequent defect detection of the machine learning model.

[0115] FIG. 7 is a schematic diagram of a defect detection system according to one embodiment of the present application.

[0116] As shown in FIG. 7, the defect detection system includes a defect detection device 701 according to any one of the above embodiments and an imaging device 702.

[0117] The imaging device 702 is configured to scan the detected object to obtain an image of the detected object. In some embodiments, the imaging device 702 is a line scan camera. The defect detection device 701 obtains the image of the detected object from the imaging device 702, and performs defect detection according to the method introduced in the previous paragraph. After obtaining the defect detection result, a marking machine may be used to perform defect marking on the detected object.

[0118] An embodiment of the present application further provides a computer readable storage medium containing computer program instructions, which, when executed by a processor, implements the method of any one of the above embodiments.

[0119] An embodiment of the present application further provides a computer program product including a computer program, which, when executed by a processor, implements the method of any one of the above embodiments.

[0120] As can be seen, the improvement in defect detection speed achieved by the above embodiment is more significant when the image size is large, for example, the image size is 16K.

[0121] According to mass production tests on a hardware platform (e.g., 16-core CPU i9-9900K, NVIDIA RTX5000 GPU), the processing time of the defect detection process using the defect detection method of the above embodiment for a 16K image is less than 100 ms, and no oversights occurred.

[0122] Above, each embodiment of the present application has been described in detail. In order to avoid obscuring the concept of the present application, some details well known in the art have not been described. Those skilled in the art can fully understand how to implement the technical solution disclosed herein from the above description.

[0123] As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Thus, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. And, the present application may take the form of a computer program product embodied on one or more computer usable non-transitory storage mediums (including, but not limited to, magnetic disk memories, CD-ROMs, optical memories, etc.) containing computer usable program code.

[0124] The present application is described with reference to flowcharts and / or block diagrams of the method, apparatus (system), and computer program product of the embodiment of the present application. It should be understood that computer program instructions may implement the functions specified in one or more flows in the flowcharts and / or in one or more blocks in the block diagrams. These computer program instructions may 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, whereby the instructions executed by the processor of the computer or other programmable data processing device generate an apparatus for implementing the functions specified in one or more flows in the flowcharts and / or in one or more blocks in the block diagrams.

[0125] These computer program instructions may be stored in a computer-readable memory that can cause a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable memory generate an article of manufacture that includes an instruction apparatus, which implements the functions specified in a flow or flows of the flowcharts and / or a block or blocks of the block diagrams.

[0126] These computer program instructions may be installed on a computer or other programmable data processing device to cause the computer or other programmable device to execute a series of operational steps to generate a computer-implemented process, whereby the instructions executing on the computer or other programmable device provide steps for implementing the functions specified in a flow or flows of the flowcharts and / or in a block or blocks of the block diagrams.

[0127] Although the present application has been described with reference to the preferred embodiments, various improvements may be made thereto and the elements therein may be replaced with equivalents without departing from the scope of the present application. In particular, as long as there is no structural contradiction, each technical feature mentioned in each embodiment may be combined in any manner. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions included in the claims.

Claims

1. 1. A defect detection method, comprising: Obtaining an average grayscale value of an image of a detected object; constructing a mapping table, the elements of the mapping table including mapping values ​​corresponding to each gray level within a gray level range of the image, where a mapping value corresponding to a gray level value equal to or greater than a reference value is a first value, a mapping value corresponding to a gray level value less than the reference value is a second value, and the reference value is an absolute value of a difference between the average gray level value and a preset gray level value; retrieving a mapping value from the mapping table that corresponds to a grayscale value of each pixel in the image; extracting at least one suspected defect sub-image from the image based on a mapping value corresponding to the grayscale value of each pixel, the mapping value corresponding to the grayscale value of each pixel in each suspected defect sub-image being the first value; and inputting the at least one suspected defect sub-image into a machine learning model to obtain a defect detection result.

2. Obtaining the average gray level of the image of the detected object obtaining an original tone value range of the image; performing contrast stretching on the image to expand the original range of tonal values ​​to the range of tonal values; The method of claim 1 , wherein the average tone value is the average tone value of the image after the contrast extension.

3. performing contrast enhancement on the image, and converting the original gradation value I1(x,y) of each pixel in the image to a gradation value I2(x,y) based on the following formula: [0045] 3. The method of claim 2, wherein a is the lower limit of the original range of tone values, b is the upper limit of the original range of tone values, c is the lower limit of the range of tone values, and d is the upper limit of the range of tone values.

4. The method of claim 3 , wherein the first value is d and the second value is c.

5. 5. The method of claim 3, wherein c=0 and d=255.

6. The method according to any one of claims 1 to 5, wherein the machine learning model includes a residual neural network model, and a total number of layers, including convolutional layers and fully connected layers, in the residual neural network model is 14.

7. 7. The method of claim 6, wherein the difference between the maximum and minimum original tone values ​​of non-defective areas other than the defects in the image is in the range of 35-50.

8. The method of claim 7 , wherein the difference between the maximum and minimum original tone values ​​is 40.

9. The method of claim 8 , wherein the maximum original tone value is 105 and the minimum original tone value is 75.

10. extracting at least one suspected defect sub-image from the image based on a mapping value corresponding to a gray level value of each pixel, extracting a plurality of connected regions from the image based on a mapping value corresponding to the gradation value of each pixel, the mapping value corresponding to the gradation value of each pixel in each connected region being the first value; Merging two adjacent connected regions into one suspected defect sub-image when the two connected regions satisfy a predetermined condition, in which areas of the two connected regions are a first area and a second area less than or equal to the first area, respectively, and an area of ​​an overlapping area of ​​the two connected regions is a third area, and the predetermined condition includes that a ratio of the third area to the first area is greater than a predetermined ratio; The method according to any one of claims 1 to 9, further comprising: if the two connected regions do not satisfy the preset condition, determining the two connected regions as two suspected defect sub-images.

11. The method of claim 10 , wherein the predetermined ratio is greater than 0.5 and less than 1.

12. The method of claim 11 , wherein the predetermined ratio is 0.

8.

13. The method according to any one of claims 1 to 12, wherein the data type of the elements in the mapping table is unsigned character type.

14. The method of any one of claims 1 to 13, wherein the defect detection result includes a defect type.

15. The method according to any one of claims 1 to 14, wherein the object to be detected comprises a battery plate.

16. The method of claim 15 , wherein the battery comprises a lithium battery.

17. A defect detection device, comprising: an acquisition module configured to acquire an average grey level of an image of a detected object; a construction module configured to construct a mapping table, the elements of the mapping table including mapping values ​​corresponding to each gray level within a gray level range of the image, where a mapping value corresponding to a gray level value equal to or greater than a reference value is a first value, a mapping value corresponding to a gray level value less than the reference value is a second value, and the reference value is an absolute value of a difference between the average gray level value and a preset gray level value; a lookup module configured to look up a mapping value from the mapping table that corresponds to a grayscale value of each pixel in the image; a segmentation module configured to segment at least one suspected defect sub-image from the image based on a mapping value corresponding to a grayscale value of each pixel, the mapping value corresponding to the grayscale value of each pixel in each suspected defect sub-image being the first value; and an input module configured to input the at least one suspected defect sub-image into a machine learning model to obtain a defect detection result.

18. Memory, A processor coupled to the memory configured to execute the defect detection method according to any one of claims 1 to 16 based on instructions stored in the memory.

19. A defect detection device according to claim 17 or 18, and an imaging device configured to scan the detected object to obtain the image.

20. A computer readable storage medium containing computer program instructions which, when executed by a processor, implements the defect detection method according to any one of claims 1 to 16.

21. A computer program product comprising a computer program, which, when executed by a processor, implements the defect detection method according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • Equipment for feature point extraction

    JP1997015165A

  • Image inspection device

    JP2020187657A