A battery pole piece detection method and system based on image recognition
By sliding the window in the battery pole area to obtain the grayscale abnormality feature values, filter and merge the abnormality windows, and perform clustering analysis, the problem that traditional detection methods cannot fully detect bubble defects, and efficient and accurate defect recognition is achieved.
Patent Information
- Application Number
- CN202510081059.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2045-01-20
AI Technical Summary
Traditional threshold segmentation algorithms or edge detection cannot fully detect bubble defects in the battery pole area because there are differences in grayscale values inside and outside the bubble defect.
Using an image recognition-based detection method, by collecting the surface image of the battery pole sheet, setting a sliding window to slide in the battery pole sheet area, obtaining the grayscale abnormality characteristic value of each sliding window, filtering out the abnormal window, combining adjacent abnormal windows to obtain the abnormal area, and clustering the pixel points in the abnormal area, and determining whether there is a bubble defect based on the characteristics of the clustering cluster.
Accurate positioning and identification of bubble defects in the battery pole area is achieved, and the efficiency and accuracy of defect detection are improved.
Smart Images

Figure CN119494839B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a battery pole piece detection method and system based on image recognition. Background Art
[0002] The production process of lithium batteries is quite complicated. Its structure is mainly composed of positive and negative electrodes, electrolyte, diaphragm and shell. The production process of electrode sheets generally includes the following four steps: slurry preparation, coating, rolling and slitting. Gas is mixed into the slurry during stirring or coating, so that the slurry is not completely coated on the surface of the lithium battery during coating to form air pockets, which will produce defects such as bubbles. The existence of these defects will cause extremely serious consequences. In order to reduce production losses and improve production efficiency, it is extremely necessary to accurately and efficiently detect these defects.
[0003] The patent document with the authorization announcement number CN102819841B discloses a global threshold segmentation method for target image segmentation. By continuously changing the threshold within the total threshold interval, the threshold corresponding to the maximum value of the number of 0-order class points on the target window set corresponding to the threshold is obtained, and an optimized threshold interval with the threshold as the endpoint is obtained, wherein the 0-order class point represents a pixel point with a surrounding index equal to 0, and the surrounding index is defined as the number of all foreground pixels except the foreground pixel point in the 3×3 pixel neighborhood of the foreground pixel point of the threshold image divided by 2 and then rounded; the extreme points of the smoothness operator SD(3, t) curve are calculated on the optimized threshold interval. If there are more than 2 extreme points, only the extreme points t31 and t32 corresponding to the two largest SD(3, t) values are retained; the integrity operators SN(2, t31) and SN(2, t32) are calculated, and the threshold corresponding to the larger value is used as the optimal threshold, and the threshold image corresponding to the optimal threshold is output.
[0004] It is known that the bubble defects in the battery pole area are circular, and there is a difference between the grayscale value inside the bubble defect and the grayscale value outside the bubble defect. Therefore, the bubble defects in the battery pole area cannot be completely detected using traditional threshold segmentation algorithms or edge detection. Summary of the invention
[0005] In order to solve the technical problem that the traditional threshold segmentation algorithm or edge detection cannot completely detect the bubble defects in the battery pole piece area due to the difference between the grayscale value inside the bubble defect and the grayscale value outside the bubble defect, the present invention provides a battery pole piece detection method and system based on image recognition.
[0006] In a first aspect, the present invention provides a battery pole piece detection method based on image recognition, which adopts the following technical solution:
[0007] A battery pole piece detection method based on image recognition comprises the following steps:
[0008] Collect the battery pole surface image to obtain the battery pole area; set the sliding window to slide in the battery pole area to obtain several sliding windows; obtain the grayscale abnormal feature value of each sliding window , Represents the grayscale abnormal feature value of the i-th sliding window; Represents the grayscale mean of all pixels in the i-th sliding window; Represents the grayscale mean of all pixels in the battery electrode area; represents the maximum grayscale difference between pixels in the i-th sliding window; || represents the absolute value symbol; norm() represents the linear normalization method; according to the grayscale abnormal feature value, the abnormal window is obtained; adjacent abnormal windows are merged to obtain several abnormal areas;
[0009] Cluster the pixels in each abnormal area to obtain two clusters for each abnormal area; obtain the possibility of each abnormal area containing bubble defects , Represents the possibility that the jth abnormal area contains a bubble defect; Represents the distance between the cluster centers of two clusters in the jth anomaly area; Represents the grayscale difference between the two clusters in the jth abnormal area; as well as The variances of the grayscale abnormal feature values of all abnormal windows of the first cluster and the second cluster respectively represent the j-th abnormal area; the bubble defect is identified according to the possibility of containing bubble defects in each abnormal area.
[0010] The innovation of the present invention lies in obtaining the grayscale abnormal characteristic value of each sliding window according to the grayscale characteristics of the bubble defect area, and then screening out the abnormal window according to the grayscale abnormal characteristic value, and then obtaining the abnormal area. The abnormal area is more likely to contain bubble defects, and the abnormal area can be accurately located, which is convenient for subsequent analysis to find the bubble defect area. Then, after clustering the pixel points in the abnormal area, the possibility of each abnormal area containing bubble defects is obtained according to the annular characteristics of the bubble defect, which is convenient for further screening and judgment, ensuring efficient and accurate defect identification.
[0011] Preferably, the sliding window is set to slide in the battery electrode area to obtain a plurality of sliding windows, including:
[0012] The default sliding window size is , the sliding step length is N, the sliding window is placed in the upper left corner of the battery electrode area, and the sliding window is slid from left to right and from top to bottom to obtain several sliding windows.
[0013] It is convenient to obtain the grayscale feature value in each sliding window.
[0014] Preferably, obtaining the abnormal window according to the grayscale abnormal characteristic value includes:
[0015] An abnormal threshold T is preset. If the grayscale abnormal characteristic value of any sliding window is greater than or equal to the abnormal threshold T, the sliding window is recorded as an abnormal window of the battery electrode area, and all abnormal windows of the battery electrode area are obtained.
[0016] It can preliminarily screen out abnormal windows containing bubble defects, making it easier to screen them again later.
[0017] Preferably, clustering the pixels in each abnormal region to obtain two clusters for each abnormal region includes:
[0018] The number of clusters is preset to 2, and the k-means clustering algorithm is used to cluster the pixels in each abnormal area to obtain two clusters for each abnormal area.
[0019] This facilitates the subsequent analysis of whether the features of the two clusters in each abnormal area are similar to the features of the two clusters after the bubble defect area is clustered, and the possibility of containing bubble defects in each abnormal area is obtained.
[0020] Preferably, obtaining the grayscale difference between two clusters in the abnormal area includes:
[0021] The grayscale mean of the pixels in each cluster in each abnormal region is obtained, and the absolute value of the difference between the grayscale means of the pixels in two clusters in each abnormal region is recorded as the grayscale difference between the two clusters in each abnormal region.
[0022] Preferably, the first cluster of the abnormal area and all abnormal windows of the second cluster include:
[0023] The abnormal window where all the pixels in the first cluster of each abnormal region are located is recorded as the abnormal window of the first cluster of each abnormal region; the abnormal window where all the pixels in the second cluster of each abnormal region are located is recorded as the abnormal window of the second cluster of each abnormal region.
[0024] Preferably, the step of identifying the bubble defect according to the possibility that each abnormal region contains the bubble defect comprises:
[0025] A possibility threshold T1 is preset. If the possibility of any abnormal region containing a bubble defect is greater than or equal to the possibility threshold T1, then the abnormal region contains a bubble defect.
[0026] Improved the accuracy of defect identification.
[0027] In a second aspect, the present invention provides a battery pole piece detection system based on image recognition, which adopts the following technical solution:
[0028] A battery pole piece detection system based on image recognition includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned battery pole piece detection method based on image recognition is implemented.
[0029] By adopting the above technical solution, the above-mentioned battery pole piece detection method based on image recognition is generated into a computer program and stored in a memory to be loaded and executed by a processor, so that a terminal device is made according to the memory and the processor for easy use.
[0030] The present invention has the following technical effects: the purpose of the present invention is to obtain the grayscale abnormal characteristic value of each sliding window according to the grayscale characteristics of the bubble defect area, and then filter out the abnormal window according to the grayscale abnormal characteristic value, and then obtain the abnormal area, which is more likely to contain bubble defects, and can accurately locate the abnormal area, which is convenient for subsequent analysis to find the bubble defect area, and then after clustering the pixel points in the abnormal area, the possibility of each abnormal area containing bubble defects is obtained according to the annular characteristics of the bubble defect, which is convenient for further screening and judgment, and ensures efficient and accurate defect identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.
[0032] Figure 1 It is a flow chart of a method for detecting battery pole pieces based on image recognition in an embodiment of the present invention. DETAILED DESCRIPTION
[0033] 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0034] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.
[0035] The embodiment of the present invention discloses a battery pole piece detection method based on image recognition, referring to Figure 1 , comprising steps S1 to S4:
[0036] S1: Collect the battery pole piece surface image, and obtain the battery pole piece area according to the battery pole piece surface image.
[0037] It should be noted that the purpose of the present invention is to detect bubble defects on battery pole pieces, so the present invention needs to first obtain the battery pole piece area.
[0038] In the implementation of the present invention, under uniform lighting conditions, a camera is used to shoot the surface of the battery pole piece to obtain an RGB image of the battery pole piece. In order to facilitate subsequent analysis, the RGB image of the battery pole piece is grayed to obtain a battery pole piece image, and then a Gaussian filter algorithm is used to denoise the battery pole piece image.
[0039] The canny edge detection algorithm is used to perform edge detection on the battery pole piece image to obtain the battery pole piece contour, and a mask is generated according to the battery pole piece contour to separate the battery pole piece area from the background to obtain the battery pole piece area.
[0040] S2: Setting a sliding window to slide in the battery electrode area to obtain a plurality of sliding windows, and obtaining a grayscale abnormal characteristic value of each sliding window; obtaining an abnormal window according to the grayscale abnormal characteristic value, merging adjacent abnormal windows, and obtaining a plurality of abnormal areas.
[0041] It should be noted that it is known that the bubble defect in the battery pole piece area is circular, and there is a difference between the grayscale value inside the bubble defect and the grayscale value outside the bubble defect. Therefore, the traditional threshold segmentation algorithm or edge detection cannot completely detect the bubble defect in the battery pole piece area; it is known that the grayscale value inside the bubble defect in the battery pole piece area is different from that outside the bubble defect, and both have a difference with the background grayscale value in the battery pole piece area. Therefore, in the present invention, a sliding window is set to slide in the battery pole piece area to obtain several sliding windows. If the grayscale mean of all pixels in the sliding window is significantly different from the background grayscale value in the battery pole piece area, it means that the sliding window may contain a bubble defect. Otherwise, the sliding window contains the background of the battery pole piece; and if the maximum grayscale difference between the pixels in the sliding window is larger, it means that the sliding window may be located at the junction of the outside of the bubble defect and the background of the battery pole piece area or the junction of the inside and outside of the bubble defect. At this time, it is determined that the sliding window contains a bubble defect. Therefore, according to the above characteristics, the grayscale abnormality characteristic value of each sliding window is obtained.
[0042] Since the bubble defects in the battery pole area only account for a small part, the grayscale mean of all pixels in the battery pole area is used to represent the background grayscale value in the battery pole area;
[0043] In the embodiment of the present invention, the preset sliding window size is , the sliding step is N, the sliding window is placed in the upper left corner of the battery electrode area, and the sliding window is slid from left to right and from top to bottom to obtain several sliding windows. It should be noted that if the sliding window slides to the edge of the battery electrode area and the number of pixels cannot form a sliding window, it is padded with 0. In the embodiment of the present invention, the preset sliding window size is In other embodiments, implementers may preset the value of the sliding window size according to the specific implementation.
[0044] Get the grayscale anomaly feature value of each sliding window:
[0045] ;
[0046] In the formula, Represents the grayscale abnormal feature value of the i-th sliding window; Represents the grayscale mean of all pixels in the i-th sliding window; Represents the grayscale mean of all pixels in the battery electrode area; Represents the maximum grayscale difference between pixels in the i-th sliding window; || represents the absolute value symbol; norm() represents the linear normalization method; The larger the value of is, the larger the grayscale difference between the pixels in the i-th sliding window is, which means that there is a greater possibility of bubble defects in the i-th sliding window, and the larger the grayscale abnormal characteristic value of the i-th sliding window is. Represents the degree of deviation of the grayscale mean of all pixels in the ith sliding window relative to the grayscale mean of all pixels in the battery electrode area. The greater the deviation, the more likely it is that there is a bubble defect in the ith sliding window, and the greater the grayscale abnormal characteristic value of the ith sliding window.
[0047] An abnormal threshold T is preset. If the grayscale abnormal characteristic value of any sliding window is greater than or equal to the abnormal threshold T, the sliding window is recorded as an abnormal window of the battery pole piece area, and all abnormal windows of the battery pole piece area are obtained. In an embodiment of the present invention, the grayscale abnormal threshold T is preset to 0.68. In other embodiments, the implementer can preset the abnormal threshold T according to the specific implementation situation.
[0048] Adjacent abnormal windows in the battery pole piece region are merged to obtain several abnormal regions in the battery pole piece region.
[0049] S3: Clustering the pixels in each abnormal region to obtain two clusters of each abnormal region, and obtaining the possibility of each abnormal region containing bubble defects according to the distance and grayscale difference between the cluster centers of the two clusters of each abnormal region.
[0050] It should be noted that in step S2, the grayscale features of the pixels in the sliding window are used to determine whether there is a bubble defect in the sliding window, which can only reflect the local features of the bubble defect. If there are other types of defects in the battery electrode area, it is likely that other types of defects will be identified as bubble defects. Therefore, it is impossible to directly use the grayscale abnormal feature value of the sliding window to determine whether there is a bubble defect in the sliding window. The present invention merges adjacent abnormal windows to obtain several abnormal areas, and can determine whether there is a bubble defect in each abnormal area based on the overall features of each abnormal area.
[0051] It is known that there is a difference between the grayscale value inside the bubble defect and the grayscale value outside the bubble defect. Therefore, the present invention can cluster the pixels in each abnormal area into two categories according to the grayscale value of the pixels. If there is a bubble defect in the abnormal area, the two clusters in the abnormal area are respectively the clusters composed of the pixels inside the bubble defect and the clusters composed of the pixels outside the bubble defect. Therefore, the cluster center points of the two clusters are both near the centroid point of the bubble defect. Therefore, the smaller the distance between the cluster centers of the two clusters, the more likely other defects do not meet this feature. If there is a bubble defect in the abnormal area, the greater the difference in grayscale value between the two clusters in the abnormal area, so the present invention first clusters the pixels in each abnormal area to obtain two clusters for each abnormal area. If the distance between the cluster centers of the two clusters in each abnormal area is small and the difference in grayscale value is large, the greater the possibility that each abnormal area contains a bubble defect.
[0052] Furthermore, since the smaller the difference between the grayscale feature values of all abnormal windows of each cluster in any abnormal region is, the better the clustering effect of the pixels in the abnormal region is, the more likely it is that the abnormal region contains bubble defects.
[0053] In the embodiment of the present invention, the number of clusters k is preset to 2, and the k-means clustering algorithm is used to cluster the pixels in each abnormal area to obtain two clusters in each abnormal area and the cluster centers of the two clusters in each abnormal area; the grayscale mean of the pixels in each cluster in each abnormal area is obtained, and the absolute value of the difference between the grayscale means of the pixels in the two clusters in each abnormal area is recorded as the grayscale difference between the two clusters in each abnormal area;
[0054] The abnormal window where all the pixels in each cluster of each abnormal region are located is recorded as the abnormal window of each cluster of each abnormal region;
[0055] Get the probability of each abnormal region containing a bubble defect:
[0056] ;
[0057] In the formula, Represents the possibility that the jth abnormal area contains a bubble defect; Represents the distance between the cluster centers of two clusters in the jth anomaly area; Represents the grayscale difference between the two clusters in the jth abnormal area; The variance of the grayscale abnormal feature values of all abnormal windows of the first cluster representing the jth abnormal area; The variance of the grayscale abnormal feature values of all abnormal windows of the second cluster representing the jth abnormal area; The smaller the value of is, the smaller the distance between the cluster centers of the two clusters in the j-th abnormal area is, which means that the j-th abnormal area is more likely to contain bubble defects; The larger the value of is, the greater the difference in the grayscale values of the two clusters in the jth abnormal region is, and the jth abnormal region is more likely to contain bubble defects; The product of the variance of the grayscale abnormal feature values of all abnormal windows of the two clusters representing the jth abnormal area, the smaller its value is, the smaller the difference between the grayscale feature values of all abnormal windows of each cluster of the jth abnormal area is, indicating that the clustering effect is better. The value of is more accurate, that is, the higher the reliability of distinguishing the upper and inner ring areas of bubble defects by clustering.
[0058] S4: Identify bubble defects according to the possibility that each abnormal area contains bubble defects.
[0059] It should be noted that the bubble defects are identified based on the possibility that each abnormal region contains a bubble defect.
[0060] In the embodiment of the present invention, a possibility threshold T1 is preset. If the possibility of any abnormal area containing a bubble defect is greater than or equal to the possibility threshold T1, then there is a bubble defect in the abnormal area, and the staff is notified to take corresponding measures.
[0061] An embodiment of the present invention further discloses a battery pole piece detection system based on image recognition, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a battery pole piece detection method based on image recognition according to the present invention is implemented.
[0062] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.
[0063] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory, a dynamic random access memory, a static random access memory, an enhanced dynamic random access memory, a high bandwidth memory, a hybrid storage cube, etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of the device or accessible or connectable to the device.
[0064] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
[0065] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A battery pole piece detection method based on image recognition, characterized in that: Includes steps: Collect the battery pole piece surface image, and then obtain the battery pole piece area; Set the sliding window to slide in the battery electrode area to obtain several sliding windows; obtain the grayscale abnormal feature value of each sliding window , Represents the grayscale abnormal feature value of the i-th sliding window; Represents the grayscale mean of all pixels in the i-th sliding window; Represents the grayscale mean of all pixels in the battery electrode area; Represents the maximum grayscale difference between pixels in the i-th sliding window; || represents an absolute value symbol; norm() represents a linear normalization method; according to the grayscale abnormal feature value, an abnormal window is obtained; Merge adjacent abnormal windows to obtain several abnormal regions; Cluster the pixels in each abnormal area to obtain two clusters for each abnormal area; obtain the possibility of each abnormal area containing bubble defects , Represents the possibility that the jth abnormal area contains a bubble defect; Represents the distance between the cluster centers of two clusters in the jth anomaly area; Represents the grayscale difference between the two clusters in the jth abnormal area; as well as The variances of the grayscale abnormal feature values of all abnormal windows of the first cluster and the second cluster respectively represent the j-th abnormal area; the bubble defect is identified according to the possibility of containing bubble defects in each abnormal area.
2. A battery pole piece detection method based on image recognition according to claim 1, characterized in that: The sliding window is set to slide in the battery electrode area to obtain a plurality of sliding windows, including: The default sliding window size is , the sliding step length is N, the sliding window is placed in the upper left corner of the battery electrode area, and the sliding window is slid from left to right and from top to bottom to obtain several sliding windows.
3. A battery pole piece detection method based on image recognition according to claim 1, characterized in that: The step of obtaining an abnormal window according to the grayscale abnormal feature value includes: An abnormal threshold T is preset. If the grayscale abnormal characteristic value of any sliding window is greater than or equal to the abnormal threshold T, the sliding window is recorded as an abnormal window of the battery electrode area, and all abnormal windows of the battery electrode area are obtained.
4. The battery pole piece detection method based on image recognition according to claim 1, characterized in that: The pixel points in each abnormal area are clustered to obtain two clusters for each abnormal area, including: The number of clusters is preset to 2, and the k-means clustering algorithm is used to cluster the pixels in each abnormal area to obtain two clusters for each abnormal area.
5. The battery pole piece detection method based on image recognition according to claim 1, characterized in that: The grayscale difference between two clusters in the abnormal area is obtained, including: The grayscale mean of the pixels in each cluster in each abnormal region is obtained, and the absolute value of the difference between the grayscale means of the pixels in two clusters in each abnormal region is recorded as the grayscale difference between the two clusters in each abnormal region.
6. A battery pole piece detection method based on image recognition according to claim 1, characterized in that: The first cluster of the abnormal area and all abnormal windows of the second cluster include: The abnormal window where all the pixels in the first cluster of each abnormal region are located is recorded as the abnormal window of the first cluster of each abnormal region; the abnormal window where all the pixels in the second cluster of each abnormal region are located is recorded as the abnormal window of the second cluster of each abnormal region.
7. A battery pole piece detection method based on image recognition according to claim 1, characterized in that: The step of identifying the bubble defect according to the possibility that each abnormal region contains the bubble defect comprises: A possibility threshold T1 is preset. If the possibility of any abnormal region containing a bubble defect is greater than or equal to the possibility threshold T1, then the abnormal region contains a bubble defect.
8. A battery pole piece detection system based on image recognition, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a battery pole piece detection method based on image recognition according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Global threshold partitioning method for partitioning target image
CN102819841B
Visual inspection method for precision cutting process of medium borosilicate glass tube
CN117952980A
Powder spraying defect detection method and system based on image processing
CN118429354A