A scratch image recognition system for battery production appearance

By analyzing the connection domain characteristics of the battery surface image, scratches on the battery end surface are identified, and the error and missed detection problems caused by dense noise distribution are solved, the accuracy of battery detection is improved, and the safety of the battery is ensured.

CN118864481BActive Publication Date: 2024-12-13JIANGSU ZHANMING NEW ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411364371.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-12-13
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

The dense noise distribution during the battery production process leads to mis-checking and missed detection of battery end face image recognition. Deep scratches may lead to the leakage of some electrolyte in the battery, posing serious safety hazards.

Method used

By extracting the connection domain of the battery surface image, analyzing the connectivity and gradient direction of the connection domain, calculating the shrinkage value and probability of the connection domain, identifying the scratched connection domain, and reducing false detection and missed detection. The specific steps include obtaining the metal binary graph, analyzing the length and area of ​​the connecting domain, judging connectivity with the sliding window, calculating the gradient direction of the core point and the characteristic probability of the connecting domain, and finally performing scratch identification based on the probability.

Benefits of technology

Improve the accuracy of battery scratch defect detection, reduce false detection and missed detection, and ensure battery safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864481B_ABST
    Figure CN118864481B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image recognition technology, and proposes a scratch image recognition system for the appearance of battery production, including: obtaining a metal binary image; obtaining a connected domain of the metal binary image, obtaining a first straight line, obtaining a contraction value of the connected domain according to the length of the connected domain and the area of ​​the connected domain; obtaining the connectivity of the connected domain according to a sliding window; obtaining the edge points of each connected domain as core points, and obtaining the gradient direction of the core point according to the grayscale values ​​of the core point and its four neighborhoods; obtaining the possibility that the connected domain has the characteristics of a scratch connected domain according to the gradient direction and the contraction value; obtaining the probability that the connected domain is a scratch connected domain according to the possibility that the connected domain has the characteristics of a scratch connected domain and the connectivity; and performing scratch recognition according to the probability that the connected domain is a scratch connected domain. The present invention performs scratch recognition according to the characteristics of the scratch connected domain and the connectivity of two different connected domains to avoid false detection and missed detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a scratch image recognition system for battery production appearance. Background Art

[0002] The scratch defect on the battery end face is caused by blunt objects during the production, processing and transportation of the battery. Since the depth of the scratch defect is random, a deeper scratch may cause partial electrolyte leakage in the battery, posing a serious safety hazard during the use of the battery. In the process of image recognition of the appearance of battery production in the prior art, the noise distribution of the grayscale image of the battery end face is dense, which easily leads to the problem of false detection and missed detection.

[0003] In view of the above problems, the present invention extracts connected domains from the battery surface image, and analyzes the probability that the connected domain is a scratch connected domain based on the connectivity and gradient direction of the connected domain. Summary of the invention

[0004] The present invention provides a scratch image recognition system for battery production appearance to solve the problem that dense noise distribution easily causes false detection and missed detection. The technical solution adopted is as follows:

[0005] An embodiment of the present invention provides a battery production appearance scratch image recognition system, the system comprising the following modules:

[0006] Image acquisition module, to obtain metal binary image;

[0007] The shrinkage value and connectivity acquisition module acquires several connected domains of the metal binary graph, analyzes each connected domain to obtain a first straight line, obtains the length of the connected domain through the first straight line, and obtains the shrinkage value of the connected domain according to the length of the connected domain and the area of ​​the connected domain;

[0008] A sliding window of a preset size is obtained on the metal binary image, and the connectivity of the connected domain is obtained according to the sliding window;

[0009] The scratch connected domain probability acquisition module obtains the edge points of each connected domain as the core point, obtains the gradient direction of the core point according to the grayscale values ​​of the core point and its four neighborhoods; obtains the possibility that the connected domain has the characteristics of the scratch connected domain according to the gradient direction of the endpoints of the connected domain and the contraction value of the connected domain; obtains the probability that the connected domain is a scratch connected domain according to the possibility that the connected domain has the characteristics of the scratch connected domain and the connectivity of the connected domain;

[0010] The scratch recognition module performs scratch recognition according to the probability that the connected domain is a scratch connected domain.

[0011] Preferably, the method for obtaining the metal binary image is:

[0012] The battery surface image is collected using an image acquisition device, and then the metal part in the battery surface image is obtained by using a neural network segmentation and recorded as a metal surface image. The metal surface image is segmented using Otsu threshold to obtain a metal binary image.

[0013] Preferably, the method of analyzing each connected domain to obtain a first straight line, obtaining the length of the connected domain through the first straight line, and obtaining the contraction value of the connected domain according to the length of the connected domain and the area of ​​the connected domain is:

[0014] For all the pixels of each connected domain, principal component analysis is used to obtain the principal component direction of the connected domain, where the principal component direction corresponding to the calculated maximum eigenvalue is the first principal component direction, and the straight line corresponding to the first principal component direction is the first straight line. The Euclidean distance of the two pixel points with the largest and smallest projection values ​​on the first straight line is the length of the connected domain, and the area of ​​the connected domain is all the pixels of the connected domain. The ratio of the length of the connected domain to the area of ​​the connected domain is taken as the contraction value of the connected domain.

[0015] Preferably, the method of calculating the length of the Euclidean distance connected domain between two pixel points with the largest and smallest projection values ​​on the first straight line is:

[0016] Draw a perpendicular line perpendicular to the first straight line for all the pixels of the connected domain. The intersection of the perpendicular line and the first straight line is used as the projection point of each pixel on the first straight line. The coordinate of the projection point on the x-axis is the projection value of the pixel on the first straight line. Find the pixel with the largest projection value, find the two projection points with the largest and smallest projection values ​​on the first straight line, and calculate the Euclidean distance between the two projection points to get the length of the connected domain.

[0017] Preferably, the method for obtaining the connectivity of the connected domain according to the sliding window is:

[0018] Set a union-find set. When the sliding window slides, if there is a connected domain pixel in the sliding window, the connected domain is stored in a union-find set and marked. The sliding window continues to slide. When a connected domain pixel appears again, first determine whether the connected domain pixel is the same as the connected domain in the union-find set. If so, continue sliding. If not, store a new connected domain in the union-find set and give it a new mark until all connected domains are saved in the union-find set.

[0019] After the sliding window slides once, all connected domains have been marked. If two pixels of different connected domains appear in the sliding window, the two connected domains are considered to be connected, and the connectivity is 1. If the connected domains are not connected, the connectivity is 0.

[0020] Preferably, the method for obtaining the gradient direction of the core point according to the grayscale values ​​of the core point and its four neighborhoods is:

[0021]

[0022] In the formula, represents the coordinates of the cth core point, Represents the grayscale value of the upper pixel of the four neighborhoods of the cth core point in the ith connected domain, Represents the grayscale value of the pixel point on the lower side of the four neighborhoods of the cth core point in the ith connected domain, Represents the grayscale value of the pixel on the left side of the four neighborhoods of the cth core point in the ith connected domain, Represents the gray value of the pixel on the right side of the four neighborhoods of the cth core point in the ith connected domain, Represents the gradient direction of the cth core point in the ith connected domain.

[0023] Preferably, the method for obtaining the possibility that the connected domain has the characteristics of the scratched connected domain according to the gradient direction of the endpoints of the connected domain and the contraction value of the connected domain is:

[0024] The gradient directions of the two endpoints of the connected domain are calculated, the absolute value of the gradient directions of the two endpoints is taken as the difference, the absolute value of the difference is taken as the negation and multiplied by the contraction value of the connected domain through exponential operation to obtain the possibility that the connected domain has the characteristics of the scratch connected domain.

[0025] Preferably, the endpoints of the connected domain are two projection points with the maximum and minimum projection values ​​found on the first straight line.

[0026] Preferably, the method for obtaining the probability that the connected domain is a scratch connected domain according to the possibility that the connected domain has the characteristics of the scratch connected domain and the connectivity of the connected domain is:

[0027]

[0028] In the formula, Represents the connectivity of the i-th connected domain. When its value is 1, the connected domain has connectivity. When its value is 0, the connected domain has no connectivity. represents the possibility that the i-th connected domain has the characteristics of a scratch connected domain, represents an exponential function with a natural constant as base, represents the linear normalization function, represents the probability that the i-th connected domain is a scratch connected domain.

[0029] Preferably, the method for identifying scratches according to the probability that a connected domain is a scratch connected domain is:

[0030] A scratch threshold is preset, and the connected domain whose probability of being a scratch connected domain is greater than the scratch threshold is recorded as a scratch connected domain. All scratch connected domains are merged and extracted, and the merged scratch connected domain is the scratch after image recognition.

[0031] The beneficial effects of the present invention are as follows: the scratch defects of the battery are mainly distributed on the metal surface of the battery end face. Before detecting the scratch defects, in order to reduce unnecessary interference, the area of ​​the metal surface of the battery needs to be extracted first. Defect detection on the metal surface alone will improve the detection accuracy. The probability that two different connected domains are scratch connected domains is determined based on the characteristics of the scratch connected domain and the connectivity and gradient direction of the two different connected domains. The scratch area of ​​the metal surface of the battery is marked and the scratch is extracted based on the probability that the two different connected domains are scratch connected domains, thereby avoiding the problems of false detection and missed detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0033] Figure 1 A schematic diagram of a process flow of a scratch image recognition system for battery production appearance provided by an embodiment of the present invention;

[0034] Figure 2 Schematic diagram of metal binary image. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0036] See also Figure 1 , which shows a flow chart of a scratch image recognition system for battery production appearance provided by an embodiment of the present invention, the system includes: an image acquisition module, a shrinkage value and connectivity acquisition module, a scratch connected domain probability acquisition module, and a scratch recognition module.

[0037] Image acquisition module, scratch defects mainly appear on the metal surface of the battery, and leakage defects mainly occur in the metal pore area between the metal surfaces. In order to use image recognition technology to obtain battery scratch defects and to improve the accuracy of image recognition, neural network technology is used to perform a pre-image recognition on the image to obtain the image of the battery metal surface, reduce image recognition operations, and improve image recognition efficiency.

[0038] A CCD camera is used to collect battery images, and a neural network is used to segment the images at the pixel level. The pixels on the metal surface are marked as 1, and the remaining pixels are marked as 0. Multiple battery images are used for training, and the loss function used by the neural network is the cross entropy loss function. After the training is completed, the collected battery images are input into the neural network, and the output is an image containing only the metal surface, which is recorded as the metal surface image.

[0039] The metal surface image is sorted out using the Otsu threshold segmentation method to obtain a binary image. The Otsu threshold segmentation method is a well-known technology and will not be described in detail here. Therefore, the binary image is recorded as a metal binary image. The metal binary image is as follows: Figure 2 shown.

[0040] At this point, a metal binary map is obtained.

[0041] The shrinkage value and connectivity acquisition module uses a two-pass scanning method to extract connected domains from the metal binary image, and obtains several connected domains in the metal binary image.

[0042] After the connected area is determined, the scratch part needs to be extracted according to the characteristics of the connected area and the characteristics of the scratches are analyzed. Scratches are mostly distributed in lines on the metal surface of the battery, while the background interference is mostly distributed in disorderly points and clusters. Therefore, the area characteristics of the connected domain of the metal surface of the battery are extracted. Because the scratch defect is longer, the area occupied is larger, and the scratches are distributed in lines, so the length and area ratio of the scratch part can be extracted to obtain the shrinkage value, and then the connectivity of each connected domain is obtained according to the search of the connected domain.

[0043] Specifically, for all the pixels in each connected domain, the principal component analysis algorithm is used to obtain the principal component direction of each connected domain, and the principal component direction corresponding to the maximum eigenvalue in the principal component direction obtained in the connected domain is taken as the first principal component direction, and the corresponding straight line is recorded as the first straight line. The projection value of the coordinate value corresponding to the pixel point in each connected domain on the coordinate of the first straight line is obtained, that is, a perpendicular line is made to each pixel point in the connected domain perpendicular to the first straight line, and the intersection of the perpendicular line and the first straight line is taken as the projection point of the pixel point on the first straight line, and the coordinate of the projection point is the projection value of the coordinate of the pixel point on the first straight line. The maximum and minimum values ​​of the projection value on the x-axis are obtained, and the coordinates of the projection point with the maximum and minimum projection values ​​on the first straight line are obtained, which correspond to two coordinates respectively, and the Euclidean distance of the two coordinates is calculated, and the Euclidean distance is the length value of the connected domain, and the number of pixels in each connected domain is counted as the area of ​​the connected domain.

[0044] The contraction value of the connected domain is obtained according to the area and length of each connected domain. The formula is as follows:

[0045]

[0046] In the formula, is the length of the i-th connected domain, is the area of ​​the i-th connected domain, is the contraction value of the i-th connected domain. The larger the contraction value of each connected domain, the more slender the connected domain is, and the greater the possibility that the connected domain is a scratch connected domain.

[0047] Set a metal binary map In this embodiment, the side length of the sliding window is is 3, and a sliding window is used in the metal binary image to slide and judge the connectivity between connected domains, as follows:

[0048] In the metal binary image, the sliding window starts to slide from the upper left corner, and moves one pixel at a time. After the first row is traversed, the sliding window moves to the far left. The first row of the sliding window is in the second row of the metal binary image, and so on. Before the sliding window slides, a union-find set is initialized, where the union-find set is used to store connected domains.

[0049] When the sliding window slides, if there is a connected domain pixel in the sliding window, the connected domain is stored in a union-find set and marked. The sliding window continues to slide. When a connected domain pixel appears again, first determine whether the connected domain pixel is the same connected domain as the connected domain in the union-find set. If so, continue sliding. If not, store a new connected domain in the union-find set and give it a new mark until all connected domains are saved in the union-find set. After the sliding window slides once, all connected domains have been marked. If two pixels of different connected domains appear in the sliding window, then the two connected domains are considered to be connected. At this time, both connected domains are marked and marked as , if the connected domain does not have connectivity, it is marked as .

[0050] At this point, the contraction value and connectivity of each connected domain are obtained.

[0051] The scratch connected domain probability acquisition module takes each edge point in each connected domain as a core point, and obtains the gradient direction of each core point based on the core point coordinates and the coordinates of the four neighborhoods around the core point. The formula is as follows:

[0052]

[0053] In the formula, represents the coordinates of the cth core point, Represents the grayscale value of the upper pixel of the four neighborhoods of the cth core point in the ith connected domain, Represents the grayscale value of the pixel point on the lower side of the four neighborhoods of the cth core point in the ith connected domain, Represents the grayscale value of the pixel on the left side of the four neighborhoods of the cth core point in the ith connected domain, Represents the gray value of the pixel on the right side of the four neighborhoods of the cth core point in the ith connected domain, Represents the gradient direction of the cth core point in the ith connected domain.

[0054] The direction value of each core point is taken as the gradient direction of each core point divided by π. This value can reflect the direction of each core point. Since the scratch is a long and thin line, the projection value of the coordinate value corresponding to the pixel point in each connected domain on the coordinate of the first straight line is obtained. The two coordinates corresponding to the maximum and minimum values ​​of the projection value of the x-axis are respectively recorded as the endpoints of the connected domain. These two pixel points are also on the edge line, so the difference in the gradient direction of these two pixel points is calculated. The difference in the gradient direction of the endpoints in each connected domain can, to a certain extent, represent the probability that the connected domain is a scratch connected domain.

[0055] When the connected domain is a scratch connected domain, it means that the ratio of its connected domain length divided by its area should be larger and the gradient direction difference of the connected domain endpoints should be smaller. At this time, the connected domain is considered to be a scratch connected domain. Based on this, the possibility of the connected domain being a scratch connected domain is obtained, and the formula is as follows:

[0056]

[0057] In the formula, It represents the contraction value of the i-th connected domain, that is, the ratio of the length and area of ​​the i-th connected domain. represents the i-th connected domain, represents an exponential function with a natural constant as base, It indicates the possibility that the i-th connected domain has the characteristics of a scratch connected domain.

[0058] The larger the value is, the more likely the connected domain is a scratch connected domain. The smaller the value of is, the greater the possibility that the connected domain is a scratch connected domain.

[0059] If we only use the scratch connected domain feature to judge whether it is a scratch connected domain, there will be errors. In edge detection, the scratch connected domain may be broken. In order to ensure that the scratch connected domain can be better judged whether it is broken or not.

[0060] Therefore, the probability that the connected domain is a scratch connected domain can be obtained by the following method: First, Determine the possibility that the connected domain is a scratch connected domain, and then Determine the connectivity of the connected domain. When the connected domain has the characteristics of a scratch connected domain and is connected to a scratch connected domain, the connected domain is considered to be a scratch connected domain. The probability formula of a connected domain being a scratch connected domain is as follows:

[0061]

[0062] In the formula, Represents the connectivity of the i-th connected domain. When its value is 1, the connected domain has connectivity. When its value is 0, the connected domain has no connectivity. represents the possibility that the i-th connected domain has the characteristics of a scratch connected domain, represents an exponential function with a natural constant as base, represents the linear normalization function, represents the probability that the i-th connected domain is a scratch connected domain.

[0063] At this point, the probability that each connected domain is a scratch connected domain is obtained. The larger the value, the greater the probability that the connected domain is a scratch connected domain.

[0064] The scratch recognition module is given a scratch threshold U. In this embodiment, the scratch threshold U is 0.7. When the probability of each connected domain being a scratch connected domain is When , the connected domain is considered to be a scratch connected domain, and all the obtained scratch connected domains are merged and extracted. The merged scratch connected domain is the scratch after image recognition, thereby completing the image recognition of the scratch.

[0065] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0066] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A scratch image recognition system for battery production appearance, characterized in that: The system includes the following modules: Image acquisition module, to obtain metal binary image; The shrinkage value and connectivity acquisition module acquires several connected domains of the metal binary graph, analyzes each connected domain to obtain a first straight line, obtains the length of the connected domain through the first straight line, and obtains the shrinkage value of the connected domain according to the length of the connected domain and the area of ​​the connected domain; A sliding window of a preset size is obtained on the metal binary image, and the connectivity of the connected domain is obtained according to the sliding window; The scratch connected domain probability acquisition module obtains the edge points of each connected domain as the core point, and obtains the gradient direction of the core point according to the grayscale values ​​of the core point and its four neighborhoods; the possibility of the connected domain having the characteristics of the scratch connected domain is obtained according to the gradient direction of the endpoints of the connected domain and the contraction value of the connected domain; According to the possibility that the connected domain has the characteristics of the scratch connected domain and the connectivity of the connected domain, the probability that the connected domain is a scratch connected domain is obtained; A scratch recognition module performs scratch recognition based on the probability that a connected domain is a scratch connected domain; The method of analyzing each connected domain to obtain a first straight line, obtaining the length of the connected domain through the first straight line, and obtaining the contraction value of the connected domain according to the length of the connected domain and the area of ​​the connected domain is: For all the pixels of each connected domain, principal component analysis is used to obtain the principal component direction of the connected domain, where the principal component direction corresponding to the calculated maximum eigenvalue is the first principal component direction, the straight line corresponding to the first principal component direction is the first straight line, the Euclidean distance between the two pixel points with the largest and smallest projection values ​​on the first straight line is taken as the length of the connected domain, the area of ​​the connected domain is all the pixels of the connected domain, and the ratio of the length of the connected domain to the area of ​​the connected domain is taken as the contraction value of the connected domain; The method for obtaining the connectivity of the connected domain according to the sliding window is: Set a union-find set. When the sliding window slides, if there is a connected domain pixel in the sliding window, the connected domain is stored in a union-find set and marked. The sliding window continues to slide. When a connected domain pixel appears again, first determine whether the connected domain pixel is the same as the connected domain in the union-find set. If so, continue sliding. If not, store a new connected domain in the union-find set and give it a new mark until all connected domains are saved in the union-find set. After the sliding window slides once, all connected domains have been marked. If two pixels of different connected domains appear in the sliding window, the two connected domains are considered to be connected, and the connectivity is 1. If the connected domains are not connected, the connectivity is 0. The method for obtaining the possibility that the connected domain has the characteristics of the scratched connected domain according to the gradient direction of the endpoints of the connected domain and the contraction value of the connected domain is: Calculate the gradient direction of the two endpoints of the connected domain, take the absolute value of the difference between the two endpoints, take the opposite of the absolute value of the difference and multiply it by the contraction value of the connected domain through exponential operation to obtain the possibility that the connected domain has the characteristics of the scratch connected domain; The method for obtaining the probability that a connected domain is a scratch connected domain according to the possibility that the connected domain has the characteristics of a scratch connected domain and the connectivity of the connected domain is: In the formula, Represents the connectivity of the i-th connected domain. When its value is 1, the connected domain has connectivity. When its value is 0, the connected domain has no connectivity. represents the possibility that the i-th connected domain has the characteristics of a scratch connected domain, represents an exponential function with a natural constant as base, represents the linear normalization function, represents the probability that the i-th connected domain is a scratch connected domain.

2. A battery production appearance scratch image recognition system according to claim 1, characterized in that: The method for obtaining the metal binary image is: The battery surface image is collected using an image acquisition device, and then the metal part in the battery surface image is obtained by using a neural network segmentation and recorded as a metal surface image. The metal surface image is segmented using Otsu threshold to obtain a metal binary image.

3. The battery production appearance scratch image recognition system according to claim 1, characterized in that: The method of using the Euclidean distance between the two pixel points with the largest and smallest projection values ​​on the first straight line as the length of the connected domain is: Draw a perpendicular line perpendicular to the first straight line for all the pixels of the connected domain. The intersection of the perpendicular line and the first straight line is used as the projection point of each pixel on the first straight line. The coordinate of the projection point on the x-axis is the projection value of the pixel on the first straight line. Find the pixel with the largest projection value, find the two projection points with the largest and smallest projection values ​​on the first straight line, and calculate the Euclidean distance between the two projection points to get the length of the connected domain.

4. A battery production appearance scratch image recognition system according to claim 1, characterized in that: The method for obtaining the gradient direction of the core point according to the grayscale values ​​of the core point and its four neighborhoods is: In the formula, represents the coordinates of the cth core point, Represents the grayscale value of the upper pixel of the four neighborhoods of the cth core point in the ith connected domain, Represents the grayscale value of the pixel point on the lower side of the four neighborhoods of the cth core point in the ith connected domain, Represents the grayscale value of the pixel on the left side of the four neighborhoods of the cth core point in the ith connected domain, Represents the gray value of the pixel on the right side of the four neighborhoods of the cth core point in the ith connected domain, Represents the gradient direction of the cth core point in the ith connected domain.

5. The battery production appearance scratch image recognition system according to claim 1, characterized in that: The endpoints of the connected domain are two projection points with the maximum and minimum projection values ​​found on the first straight line.

6. The battery production appearance scratch image recognition system according to claim 1, characterized in that: The method for identifying scratches according to the probability that a connected domain is a scratch connected domain is: A scratch threshold is preset, and the connected domain whose probability of being a scratch connected domain is greater than the scratch threshold is recorded as a scratch connected domain. All scratch connected domains are merged and extracted, and the merged scratch connected domain is the scratch after image recognition.