A classification method for surface defects of lithium battery electrodes

By combining preprocessing, coarse classification, and fine classification with Gabor filters and random forest classifiers, the accuracy and efficiency issues of lithium battery electrode surface defect classification were solved, achieving efficient classification of bright and dark defects.

CN113673552BActive Publication Date: 2024-11-08SOUTH CHINA UNIV OF TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110753377.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-02
Publication Date
2024-11-08
Estimated Expiration
2041-07-02

AI Technical Summary

Technical Problem

In the current technology, the classification of defects on the surface of lithium battery electrodes mainly relies on manual work, which results in low production efficiency and inaccuracy. In particular, the high similarity and close grayscale values ​​between bright and dark defects make it difficult to achieve efficient and accurate classification.

Method used

Using a preprocessing, coarse classification, and fine classification approach, the lithium battery electrode surface defect images are divided into bright defects and dark defects by least squares fitting, ring masking, and random forest classifier. Gabor filter is used for feature extraction, and then random forest classifier is used for fine classification within the large categories.

Benefits of technology

It improves the accuracy and efficiency of classifying defects on the surface of lithium battery electrodes, especially the distinction between bright and dark defects, thereby enhancing the accuracy and speed of classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113673552B_ABST
    Figure CN113673552B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for classifying surface defects of lithium battery electrodes. The steps of the method are as follows: first, the defect image is divided into a bright defect data set and a dark defect data set according to the grayscale value change of the specified area of ​​the defect image and the pixel distribution in the specific annular area obtained according to the defect shape; then the image features are extracted using a Gabor filter, and the two categories are further classified in detail using a random forest classifier. The present invention can accurately classify six types of lithium battery electrode surface defects, and has good robustness and rapidity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision detection, and in particular to a method for classifying surface defects of lithium battery electrodes. Background Art

[0002] At present, lithium batteries are gaining more and more attention in the fields of electric vehicles due to their advantages such as high energy density, long life, small size and no pollution. However, the safety hazards behind the convenience brought by lithium batteries to human life are also worthy of attention. In addition to the internal structure of lithium batteries and other reasons, the surface defects of electrodes generated during the production process can also cause certain safety hazards. Therefore, defect detection of lithium batteries is particularly important. It is worth noting that efficient and accurate defect classification can in turn greatly promote defect detection.

[0003] Nowadays, many researchers have focused their research on the detection of lithium battery defects and have proposed some relatively successful methods. However, in most workplaces, defect classification is mainly done manually, which is unreliable. Therefore, applying a series of machine learning techniques to automatically classify various defects on the electrode surface can significantly improve the production efficiency and quality of products.

[0004] At present, it is urgent to focus on the classification of surface defects in lithium battery electrodes, which is insufficient. In this study, the six types of defects are divided into bright defects and dark defects according to their ability to reflect or absorb light. Among them, bright spots, metal leakage, and bubbles are bright defects, while black spots, streaks, and decarburization are dark defects. Since the grayscale value of the defect is not much different from the grayscale value of the background area, and some defects of different categories are very similar, such as black spots and bubbles. Therefore, it is challenging to accurately classify these six types of defects. Summary of the invention

[0005] The purpose of the present invention is to solve the above-mentioned defects in the prior art and provide a method for classifying surface defects of lithium battery electrodes.

[0006] The purpose of the present invention can be achieved by adopting the following technical solutions:

[0007] A method for classifying surface defects of lithium battery electrodes is used to classify bright defects and dark defects on the surface of lithium battery electrodes, wherein bright defects include bright spots, metal leakage, and bubbles, and dark defects include black spots, streaks, and decarbonization. The classification method comprises the following steps:

[0008] S1. Preprocessing: Adjust the surface defect images of lithium battery electrodes to the same size and perform normalization processing;

[0009] S2. Coarse classification: First, the least squares method is used to fit the pixel changes in the specified area of ​​the lithium battery electrode surface defect image to separate the bright spots and metal leaks from the defect category. Then, bubbles are separated from dark defects based on a specific ring mask and random forest classifier, so that the lithium battery electrode surface defect image is divided into two major categories: bright defect data set and dark defect data set.

[0010] S3. Fine classification: In the results obtained from the coarse classification, the Gabor filter is used to extract the features of the surface defect images of the lithium battery electrode, and then the random forest classifier is used to classify the two major categories of bright defect data set and dark defect data set to obtain the final classification results.

[0011] Furthermore, the specific process of preprocessing the lithium battery electrode surface defect image in step S1 is as follows:

[0012] S1.1. The size of the surface defect image of the lithium battery electrode is uniformly adjusted to M×N;

[0013] S1.2. Normalize the surface defect image of the lithium battery electrode. The normalization method is as follows:

[0014] f(i,j)=(I(i,j)-g min ) / (g max -g min )

[0015] Among them, I(i,j) is the grayscale value of the original lithium battery electrode surface defect image at (i,j), f(i,j) is the grayscale value of the normalized lithium battery electrode surface defect image at (i,j), g max and g min They are respectively the maximum and minimum grayscale values ​​in the original lithium battery electrode surface defect image.

[0016] Furthermore, the specific process of roughly classifying the lithium battery electrode surface defect image in step S2 is as follows:

[0017] S2.1. Use the least squares method to fit the pixel gray value change curve I in the specified area of ​​the defect image c Get straight line I l ;

[0018] S2.2. Calculation curve I c The peak and trough of the wave to the straight line I l The difference in vertical distance Δ:

[0019] Δ=α-β

[0020] Where α is the curve I c From the peak to the straight line I l The vertical distance of curve Ic The trough to the straight line I l The vertical distance;

[0021] S2.3. Set a first threshold value T. When Δ is greater than the first threshold value T, the corresponding defects are bright spots and metal leakage; when Δ is less than the first threshold value T, the corresponding defects are the other four types of defects except bright spots and metal leakage. The value of the first threshold value T is adaptively obtained according to the following formula:

[0022]

[0023] Among them, M LM 、M BS 、M DS 、M DE 、M ST 、M BB They represent the average difference Δ of the six defect data sets, namely metal leakage, bright spot, black spot, decarburization, streak and bubble, respectively. min(·) represents the minimum operator, and Avg(·) represents the average operator;

[0024] S2.4. Adaptively obtain the annular mask M according to the defect shape r , in the ring mask M r Under the action of, each lithium battery electrode surface defect image is divided into three areas: the inner ring area AIR, the upper ring area AAR and the outer ring area AOR;

[0025] S2.5, Equal angle segmentation annular mask M r , and obtain two masks T1 and T2, dividing the area on the ring AAR and the area outside the ring AOR into s small connected domains respectively and

[0026] S2.6. Calculate each small connected domain and The mean and variance of the grayscale values ​​in i=1,2,…,s, and the proportion of pixels with grayscale value 0 are calculated respectively. and Finally, a feature with good discrimination is obtained:

[0027]

[0028] Respectively represent the gray value mean of the area above the ring and the area outside the ring, Respectively represent the gray value variance of the area above the ring and the area outside the ring, Respectively represent the proportion of 0 pixels in the area above the ring and the area outside the ring, where Each and The total number of pixels, The numbers of 0 pixels in the small connected domains corresponding to the area on the ring AAR and the area outside the ring AOR, Each and The proportion of 0 pixels in the image;

[0029] S2.7. Use the random forest classifier to classify the feature F obtained in the previous step, separate the bubbles from the three dark defects including black spots, streaks, and decarburization, thereby obtaining a bright defect data set and a dark defect data set.

[0030] Furthermore, the specific process of subdividing the lithium battery electrode surface defect image in step S3 is as follows:

[0031] S3.1, using Gabor filter to extract features of lithium battery electrode surface defect image (f c1 ,f c2 ,…f cn ), where c = 1, 2, 3, 4, 5, and n is the dimension of the feature vector extracted using the Gabor filter;

[0032] S3.2. Use the random forest classifier to further classify the features obtained in step S3.1 in the bright defect data set and the dark defect data set to obtain the final classification result.

[0033] Furthermore, in step S2.4, the ring mask M is adaptively obtained. r The process is as follows:

[0034] S2.4.1. Define two 200*1 matrices C and P, where C represents the grayscale value change of a specified area of ​​the image, and P is the position corresponding to each grayscale value in C;

[0035] S2.4.2. Set the second threshold value T', record the points in the matrix C whose grayscale values ​​are greater than the second threshold value T', store their corresponding position values ​​in P in a one-dimensional array I, and use the position of the horizontal axis of the center of the image as the boundary to obtain the one-dimensional array I1 and the one-dimensional array I2 from the one-dimensional array I:

[0036] I1=[I t1 ],I t1 <100,I t1 ∈I

[0037] I2=[I t2 ],I t2 >100,I t2 ∈I

[0038] Among them, [] means traversing the one-dimensional array I and returning all the values ​​I that meet the conditions t1 or I t2 Take it out to form new one-dimensional arrays I1 and I2, I t1 and I t2 All of them are elements in the one-dimensional array I. The one-dimensional array I1 stores the pixel points in the upper half of the image that are greater than the threshold T', and the one-dimensional array I2 stores the pixel points in the lower half of the image that are greater than the threshold T';

[0039] S2.4.3. Traverse the values ​​of the one-dimensional array I1 from large to small, and mark the value of the absolute discontinuity point as r1 1 At the same time, the values ​​of the one-dimensional array I2 are traversed from small to large, and the value of the absolute discontinuity point is marked as The absolute discontinuity point is generated because the image pixels are very dense at the defect location and become sparse at the junction of the defect and the background;

[0040] S2.4.4. Calculate the inner and outer diameters of the annular mask:

[0041]

[0042]

[0043] Where H is the height of the defect image on the surface of the lithium battery electrode;

[0044] S2.4.4. Set a H*H zero matrix, with the center of the matrix as the center of the ring, r1 and r2 as the inner and outer diameters of the ring to form a ring, and the grayscale value of the pixels in the ring area is set to 1, thus forming a ring mask M r .

[0045] Compared with the prior art, the present invention has the following advantages and effects:

[0046] (1) The present invention combines the annular mask to process the image, obtains a set of features with high inter-class discrimination, and promotes classification;

[0047] (2) Among the six types of defects on the surface of lithium battery electrodes, some defects have extremely high similarity, and the grayscale values ​​of the defects and the background are very close, which makes classification difficult. The present invention uses coarse classification to first classify each image into bright defects and dark defects, and then performs detailed classification in the two major categories, thereby improving the classification accuracy;

[0048] (3) The present invention uses Gabor filter to extract features and then combines it with random forest to perform fine classification to quickly and accurately separate each type of defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1It is a flow chart of the method for classifying surface defects of lithium battery electrodes disclosed in the present invention;

[0050] Figure 2 is an example image of a sample of surface defects of a lithium battery electrode in the present invention; wherein,

[0051] Figure 2 (a) is a sample image of bright spot type;

[0052] Figure 2 (b) is a sample image of the leaky metal type;

[0053] Figure 2 (c) is a sample image of bubble type;

[0054] Figure 2 (d) is a sample image of streak type;

[0055] Figure 2 (e) is a sample image of decarburization type;

[0056] Figure 2 (f) is a sample image of black dot type;

[0057] Figure 3 It is a schematic diagram of the process of constructing a one-dimensional vector using the grayscale values ​​of pixels in a specified area;

[0058] Figure 4 It is a curve graph of the gray value change of a specified area represented by a vector;

[0059] Figure 5 is the result graph of dividing AAR and AOR into s connected domains using template graphs T1 and T2 respectively, where

[0060] Figure 5 (a) is the image to be processed;

[0061] Figure 5 (b) is the template image T1;

[0062] Figure 5 (c) is the template image T2;

[0063] Figure 5 (d) means Figure 5 (a) with Figure 5 (b) The result of multiplication;

[0064] Figure 5 (e) means Figure 5 (a) with Figure 5 (c) The result of multiplication;

[0065] Figure 6 It is a flowchart of the subdivision in the present invention. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0067] Example

[0068] This embodiment mainly proposes a classification method for surface defects of lithium battery electrodes, which is used to classify bright defects and dark defects on the surface of lithium battery electrodes, where bright defects include bright spots, metal leakage, and bubbles, and dark defects include black spots, streaks, and decarbonization. The classification method first uses the grayscale value change in the specified area and combines the annular mask method to classify the six types of defect images into bright defect data sets and dark defect data sets; then the Gabor filter extracts features from the defect images, and finally uses the random forest to perform sub-classification of the extracted features in the two major categories of bright defect data sets and dark defect data sets to obtain the final classification results.

[0069] Figure 1 This is a flow chart of a method for classifying surface defects of a lithium battery electrode disclosed in this embodiment, which is described below through a specific embodiment. The classification method in this embodiment includes the following steps:

[0070] S1. Preprocessing: Adjust the surface defect images of lithium battery electrodes to the same size and perform normalization processing;

[0071] S2. Coarse classification: First, the least squares method is used to fit the pixel changes in the specified area of ​​the lithium battery electrode surface defect image to separate the bright spots and metal leaks from the defect category. Then, bubbles are separated from dark defects based on a specific ring mask and random forest classifier, so that the lithium battery electrode surface defect image is divided into two major categories: bright defect data set and dark defect data set.

[0072] S3. Fine classification: In the results obtained from the coarse classification, the Gabor filter is used to extract the features of the surface defect images of the lithium battery electrode, and then the random forest classifier is used to classify the two major categories of bright defect data set and dark defect data set to obtain the final classification results.

[0073] The method for classifying surface defects of lithium battery electrodes proposed in the present invention is further implemented by the following technical solutions:

[0074] In this embodiment, the specific process of preprocessing the lithium battery electrode surface defect image in step S1 is as follows:

[0075] S1.1. The size of the lithium battery electrode surface defect image is uniformly adjusted to M×N, where M=N=200;

[0076] S1.2. Normalize the surface defect image of the lithium battery electrode. The normalization method is as follows:

[0077] f(i,j)=(I(i,j)-g min ) / (g max -g min )

[0078] Among them, I(i,j) is the grayscale value of the original lithium battery electrode surface defect image at (i,j), f(i,j) is the grayscale value of the normalized lithium battery electrode surface defect image at (i,j), g max and g min They are respectively the maximum and minimum grayscale values ​​in the original lithium battery electrode surface defect image.

[0079] In this embodiment, the specific process of roughly classifying the lithium battery electrode surface defect image in step S2 is as follows:

[0080] S2.1. Use the least squares method to fit the pixel gray value change curve I in the specified area of ​​the defect image c Get straight line I l ;

[0081] S2.2. Calculation curve I c The peak and trough of the wave to the straight line I l The difference in vertical distance Δ:

[0082] Δ=α-β

[0083] Where α is the curve I c From the peak to the straight line I l The vertical distance of curve I c From the peak to the straight line I l The vertical distance

[0084] S2.3. Set a first threshold value T. When Δ is greater than the first threshold value T, the corresponding defects are bright spots and metal leakage; when Δ is less than the first threshold value T, the corresponding defects are the other four types of defects except bright spots and metal leakage. The value of the first threshold value T is adaptively obtained according to the following formula:

[0085]

[0086] Among them, M LM , M BS , M DS , M DE , M ST , MBB They represent the average Δ of the six defect data sets, namely metal leakage, bright spots, black spots, decarburization, streaks and bubbles. min(·) represents the minimum operator, and Avg(·) represents the average operator. Figure 3 This section shows the processing process. Figure 4 It intuitively shows the difference between bright spots and metal leaks and the other four types of defects;

[0087] S2.4. Adaptively obtain the annular mask M according to the defect shape r , in M r Under the action of, each lithium battery electrode surface defect image is divided into three areas: the inner ring area (AIR), the upper ring area (AAR) and the outer ring area (AOR);

[0088] S2.5, Equal Angle Division M r , we get two masks T1 and T2, which divide AAR and AOR into s small connected domains respectively and Figure 5 The results of using templates to divide defect images into small connected domains are shown;

[0089] S2.6. Calculate each small connected domain and The mean and variance of the grayscale values ​​in (i=1,2,…,s), and the proportion of pixels with grayscale value 0 are calculated respectively and Finally, a feature with good discrimination is obtained:

[0090]

[0091] Respectively represent the gray value mean of the area above the ring and the area outside the ring, Respectively represent the gray value variance of the area above the ring and the area outside the ring, Respectively represent the proportion of 0 pixels in the area above the ring and the area outside the ring, where and Each and The total number of pixels, and It is the number of 0 pixels in the corresponding small connected domains of the on-ring area AAR and the outside-ring area AOR;

[0092] S2.7. Use the random forest classifier to classify the feature F obtained in the previous step, separate the bubbles from the three dark defects including black spots, streaks, and decarburization, thereby obtaining a bright defect data set and a dark defect data set.

[0093] In this embodiment, the specific process of subdividing the lithium battery electrode surface defect image in step S3 is as follows:

[0094] S3.1, using Gabor filter to extract features of lithium battery electrode surface defect image (f c1 ,f c2 ,…f cn ), where c = 1, 2, 3, 4, 5, n is the dimension of the feature vector extracted using the Gabor filter, Figure 6 It represents the extracted features;

[0095] S3.2. Use the random forest classifier to further classify the features obtained in S3.1 in the bright defect data set and the dark defect data set to obtain the final classification results.

[0096] In this embodiment, in step S2.4, the ring mask M is adaptively obtained. r The specific process is as follows:

[0097] S2.4.1. Define two 200*1 matrices C and P, where C represents the grayscale value change of a specified area of ​​the image, and P is the position corresponding to each grayscale value in C;

[0098] S2.4.2. Set the threshold T', record the points in the matrix C whose grayscale values ​​are greater than T', and store their corresponding position values ​​in P in a one-dimensional array I. Take the position of the horizontal axis of the center of the image as the boundary, and obtain the one-dimensional array I1 and one-dimensional array I2 from the one-dimensional array I:

[0099] I1=[I t1 ](I t1 <100),I t1 ∈I

[0100] I2=[I t2 ](I t2 >100),I t2 ∈I

[0101] Among them, [] means traversing the one-dimensional array I and returning all the values ​​I that meet the conditions t1 or I t2 Take it out to form new one-dimensional arrays I1 and I2, I t1 and I t2 All of them are elements in the one-dimensional array I. The one-dimensional array I1 stores the pixel points in the upper half of the image that are greater than the threshold T', and the one-dimensional array I2 stores the pixel points in the lower half of the image that are greater than the threshold T';

[0102] S2.4.3. Traverse the values ​​of the one-dimensional array I1 from large to small, and mark the value of the absolute discontinuity point as r11 At the same time, the values ​​of the one-dimensional array I2 are traversed from small to large, and the value of the absolute discontinuity point is marked as The absolute discontinuity point is generated because the image pixels are very dense at the defect location and become sparse at the junction of the defect and the background;

[0103] S2.4.4. Calculate the inner and outer diameters of the annular mask:

[0104]

[0105]

[0106] Wherein, H is the height of the surface defect image of the lithium battery electrode, and here, H = 200;

[0107] S2.4.4. Set a H*H zero matrix, with the center of the matrix as the center of the ring, r1 and r2 as the inner and outer diameters of the ring to form a ring, and the grayscale value of the pixels in the ring area is set to 1, thus forming a ring mask M r ,like Figure 5 (c) as shown.

[0108] In this embodiment, a total of 2158 defect images were selected for the experiment, of which 1165 were bright defects, 283 bright spots, 377 metal leaks and 505 bubbles respectively. As for dark defects, there were 993 images in total, of which 215 were black spots, 602 were decarburization, and only 176 were streaks. In the experiment, we selected 20%, 15%, 10% and 5% of each category as test set samples, and the rest were used as training set samples. In the embodiment, three methods were compared with the method (PM) proposed in the present invention. The first method was the discriminant elastic network regularized linear regression (DENLR), the second method was the marginal elastic network regularized linear regression (MENLR), and the optimized SVM classification method (SVM+) was the last method.

[0109] The classification method proposed in the present invention will obtain a classification accuracy rate in each of the two major categories of bright defects and dark defects. In order to make a more reasonable comparison with other methods, the following formula is used to combine the two classification results to obtain the final classification accuracy:

[0110]

[0111] N b and N d is the number of bright defects and dark defects in the test set, P b and P d are their corresponding classification accuracy rates, and P is the classification accuracy rate finally obtained according to the method proposed in this invention.

[0112] Table 1 shows the final classification accuracy of different methods. The bold part indicates that the corresponding algorithm has the highest mean accuracy (Mean) in each data set. The italic part indicates the smallest standard deviation (Std). The smaller the value, the better the robustness of the algorithm.

[0113] Table 1. Classification accuracy of different methods with different numbers of test set images (average ± standard deviation of ten experiments)

[0114] Alg DENLR MENLR SVM+ PM 5 0.8551±2.6 0.8767±2.1 0.9921±0.3 0.9903±0.5 10 0.9046±1.6 0.9014±1.4 0.9924±0.4 0.9857±0.3 15 0.9229±1.0 0.9418±1.3 0.9938±0.3 0.9941±0.2 20 0.9214±0.3 0.9251±0.3 0.9931±0.2 0.9930±0.1

[0115] According to the experimental results, it can be seen that the rough classification of defects into bright defects and dark defects proposed by the present invention greatly improves the accuracy of defect classification, and the classification accuracy of the algorithm optimized based on SVM is very close to that of PM, or even better than that of PM algorithm. As for why PM is better, Table 2 can give the answer. Considering that the production environment of an actual factory has extremely high requirements not only on classification accuracy but also on classification speed, we can see that in this data set, the SVM+ algorithm consumes a lot of time compared to PM. Therefore, its slight advantage in classification accuracy is almost negligible. In addition, it is obvious that PM has better robustness.

[0116] Table 2. Comparison of the time consumed by the two algorithms (seconds)

[0117]

[0118] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A method for classifying surface defects of lithium battery electrodes, for classifying bright defects and dark defects on the surface of lithium battery electrodes, wherein: Bright defects include bright spots, metal leakage, and bubbles, and dark defects include black spots, streaks, and decarburization. The classification method includes the following steps: S1. Preprocessing: Adjust the surface defect images of lithium battery electrodes to the same size and perform normalization. The process is as follows: The specific process of preprocessing the surface defect image of the lithium battery electrode in step S1 is as follows: S1.

1. The size of the surface defect image of the lithium battery electrode is uniformly adjusted to M×N; S1.

2. Normalize the surface defect image of the lithium battery electrode. The normalization method is as follows: f(i,j)=(I(i,j)-g min ) / (g max -g min ) Among them, I(i,j) is the grayscale value of the original lithium battery electrode surface defect image at (i,j), f(i,j) is the grayscale value of the normalized lithium battery electrode surface defect image at (i,j), g max and g min are the maximum and minimum grayscale values ​​in the original lithium battery electrode surface defect image; S2. Coarse classification: First, the least squares method is used to fit the pixel changes in the specified area of ​​the lithium battery electrode surface defect image to separate the bright spots and metal leaks from the defect category. Then, bubbles are separated from dark defects based on a specific ring mask and random forest classifier, so that the lithium battery electrode surface defect image is divided into two major categories: bright defect data set and dark defect data set. S3, fine classification: In the results obtained from the coarse classification, the Gabor filter is used to extract the features of the surface defect images of the lithium battery electrode, and then the random forest classifier is used to classify the two major categories of bright defect data set and dark defect data set to obtain the final classification results; The specific process of roughly classifying the surface defect image of the lithium battery electrode in step S2 is as follows: S2.

1. Use the least squares method to fit the pixel gray value change curve I in the specified area of ​​the defect image c Get straight line I l ; S2.

2. Calculation curve I c The peak and trough of the wave to the straight line I l The difference in vertical distance Δ: Δ=α-β Where α is the curve I c From the peak to the straight line I l The vertical distance of curve I c The trough to the straight line I l The vertical distance S2.

3. Set a first threshold value T. When Δ is greater than the first threshold value T, the corresponding defects are bright spots and metal leakage; when Δ is less than the first threshold value T, the corresponding defects are the other four types of defects except bright spots and metal leakage. The value of the first threshold value T is adaptively obtained according to the following formula: Among them, M LM 、M BS 、M DS 、M DE 、M ST 、M BB They represent the average difference Δ of the six defect data sets, namely metal leakage, bright spot, black spot, decarburization, streak and bubble, respectively. min(·) represents the minimum operator, and Avg(·) represents the average operator; S2.

4. Adaptively obtain the annular mask M according to the defect shape r , in the ring mask M r Under the action of, each lithium battery electrode surface defect image is divided into three areas: the inner ring area AIR, the upper ring area AAR and the outer ring area AOR; S2.5, Equal angle segmentation annular mask M r , and obtain two masks T1 and T2, dividing the area on the ring AAR and the area outside the ring AOR into s small connected domains respectively and S2.

6. Calculate each small connected domain and The mean and variance of the grayscale values, and at the same time, the proportion of pixels with a grayscale value of 0 are calculated. and Finally, a feature with good discrimination is obtained: Respectively represent the gray value mean of the area above the ring and the area outside the ring, Respectively represent the gray value variance of the area above the ring and the area outside the ring, Respectively represent the proportion of 0 pixels in the area above the ring and the area outside the ring, where Each and The total number of pixels, The number of 0 pixels in the small connected domains corresponding to the ring area AAR and the ring area AOR, P 1i , P 2i Each and The proportion of 0 pixels in the image; S2.

7. Use the random forest classifier to classify the feature F obtained in the previous step, separate the bubbles from the three dark defects including black spots, streaks, and decarburization, thereby obtaining a bright defect data set and a dark defect data set.

2. The method for classifying surface defects of lithium battery electrodes according to claim 1, characterized in that: The specific process of subdividing the lithium battery electrode surface defect image in step S3 is as follows: S3.1, using Gabor filter to extract features of lithium battery electrode surface defect image (f c1 ,f c2 ,…f cn ), where c = 1, 2, 3, 4, 5, and n is the dimension of the feature vector extracted using the Gabor filter; S3.

2. Use the random forest classifier to further classify the features obtained in step S3.1 in the bright defect data set and the dark defect data set to obtain the final classification result.

3. The method for classifying surface defects of lithium battery electrodes according to claim 1, characterized in that: In step S2.4, the ring mask M is adaptively obtained. r The process is as follows: S2.4.

1. Define two 200*1 matrices C and P, where C represents the grayscale value change of a specified area of ​​the image, and P is the position corresponding to each grayscale value in C; S2.4.

2. Set the second threshold value T', record the points in the matrix C whose grayscale values ​​are greater than the second threshold value T', store their corresponding position values ​​in P in a one-dimensional array I, and use the position of the horizontal axis of the center of the image as the boundary to obtain the one-dimensional array I1 and the one-dimensional array I2 from the one-dimensional array I: I1=[I t1 ],I t1 <100,I t1 ∈I I2=[I t2 ],I t2 >100,I t2 ∈I Among them, [] means traversing the one-dimensional array I and returning all the values ​​I that meet the conditions t1 or I t2 Take it out to form new one-dimensional arrays I1 and I2, I t1 and I t2 All of them are elements in the one-dimensional array I. The one-dimensional array I1 stores the pixel points in the upper half of the image that are greater than the threshold T', and the one-dimensional array I2 stores the pixel points in the lower half of the image that are greater than the threshold T'; S2.4.

3. Traverse the values ​​of the one-dimensional array I1 from large to small, and mark the value of the absolute discontinuity point as At the same time, the values ​​of the one-dimensional array I2 are traversed from small to large, and the values ​​of the absolute discontinuity points are marked as The absolute discontinuity point is generated because the image pixels are very dense at the defect location and become sparse at the junction of the defect and the background; S2.4.

4. Calculate the inner and outer diameters of the annular mask: Where H is the height of the defect image on the surface of the lithium battery electrode; S2.4.

4. Set a H*H zero matrix, with the center of the matrix as the center of the ring, r1 and r2 as the inner and outer diameters of the ring to form a ring, and the grayscale value of the pixels in the ring area is set to 1, thus forming a ring mask M r .

Citation Information

Patent Citations

  • Lithium battery electrode surface defect classification method

    CN110598729A

  • Pattern recognizing device

    JP1993324839A