Abnormality detection method for long surface of blade lithium battery housing
Through the combination of adaptive image segmentation and deep residual network model, combined with FastFlow model for normalized flow transformation, the annotation problems caused by poor model generalization performance and increased data volume in abnormal detection of long surface of blade lithium battery casing are solved. It solves the problem of increased workload and achieves higher detection accuracy and iteration speed.
Patent Information
- Application Number
- PCT/CN2024/076285
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-26
- Filing Date
- 2024-02-06
- Publication Date
- 2024-10-31
AI Technical Summary
When the existing technology detects abnormalities on the long surface of the blade lithium battery casing, the model generalization performance is poor and the problem of missed detection is prone to occur. When the amount of data increases, the annotation workload increases, which affects the detection accuracy.
The adaptive image segmentation method is used to segment the long surface image into square sub-images, the deep residual network model ResNet-18 is used for feature extraction, and the FastFlow model is used for normalized flow transformation, and the anomaly score is calculated to determine whether the image is abnormal.
By only training normal samples, the problem of missed detection caused by different defect characteristics is avoided, the accuracy and iteration speed of detection are improved, the area of the effective area is increased, and effective detection of long and narrow battery surfaces is achieved.
Smart Images

Figure CN2024076285_31102024_PF_FP_ABST
Abstract
Description
A method for detecting abnormalities on the long surface of a blade lithium battery casing
[0001] This invention claims priority date 2023-04-26 and priority number 2023104615945. Technical Field
[0002] The present invention relates to the field of industrial defect detection, and in particular to a method for detecting abnormalities on the long surface of a blade lithium battery shell. Background Art
[0003] Blade lithium batteries, a new energy battery type, are currently a mainstream battery type in the electric vehicle market. They are characterized by a high energy-to-volume ratio, are relatively safe, and are easy to assemble. The production process for lithium batteries is long, involves numerous steps, and operates in a complex environment. Due to production processes and other factors, defects such as pinholes, pits, cracks, bumps, and scratches may appear on the surface of lithium battery casings. These defects not only affect the quality of the finished battery, causing losses for battery manufacturers, but also, due to the electrochemical discharge properties of lithium batteries, severe defects can even cause safety accidents such as fires, endangering personal safety and property. In blade lithium batteries, the long surface area of the casing accounts for the vast majority of the battery's external surface area, making anomaly detection on this long surface of the battery casing particularly important. Traditional image-based defect detection methods are characterized by their speed and high interpretability.
[0004] Furthermore, with the development of artificial intelligence (AI), deep learning techniques can also be applied to defect detection, significantly improving the accuracy of image-based defect detection methods. However, in real-world production environments, the presence of welding debris such as weld burrs and slag during battery production leads to a wide variety of defect shapes. Models cannot learn the characteristics of all defects, leading to some defects not being detected.
[0005] In the existing technology, defect detection methods pay more attention to the characteristics of the defects themselves, while ignoring the overall distribution characteristics. When the amount of data is small, since the defect characteristics are also small, a relatively ideal result can be achieved. However, when the amount of data is too large, the number of defect categories generated also increases. In the case of no model update: the generalization performance of the model is poor and it is easy to miss detections; when the amount of data increases, the workload of annotation also increases accordingly, which not only increases the complexity of the model, but also increases the workload of iterative models; because the long surface of the blade lithium battery casing is generally divided into long side faces and large faces, a single face appears as a long and narrow shape on the image, and the number of pixels in the effective area accounts for a small proportion of the total image pixels, which is not conducive to model training and reasoning. Summary of the Invention
[0006] The purpose of the present invention is to provide a method for detecting abnormalities on the long surface of a blade lithium battery shell, which can better solve the problem of abnormality detection on the long surface of a blade lithium battery shell.
[0007] To achieve the above-mentioned purpose, the solution of the present invention is: a method for detecting abnormalities on the long surface of a blade lithium battery housing, comprising the steps of:
[0008] S1. Obtain the long surface image of the blade lithium battery, preprocess the image into sub-images, and construct a data set;
[0009] S2. Select defective images in the dataset as the test set and normal images as the training set;
[0010] S3, input the training set into the feature extraction model to obtain the feature vector;
[0011] S4. Input the extracted feature vector into the FastFlow model for training to obtain a normalized flow model;
[0012] S5. Input the training set image into the normalized flow model, calculate the maximum and minimum values of all feature map pixel values after conversion, and save the maximum and minimum values;
[0013] S6. Select a sub-image from the test set and input it into the feature extraction model and FastFlow model. Normalize the final output feature map with the previously calculated maximum and minimum values to obtain the anomaly score.
[0014] S7, comparing the anomaly score with a set threshold to determine whether the image is abnormal;
[0015] The step S1 adopts an adaptive image segmentation method to segment the long surface image of the battery shell into a plurality of square sub-images;
[0016] The feature extraction model in step S3 uses the deep residual network model ResNet-18 as the backbone network;
[0017] The FastFlow model used in steps S4 and S6 is constructed based on the regular flow model.
[0018] As a preferred solution, step S1 divides the long surface image of the blade lithium battery into a large surface and a long side surface, preprocesses each into sub-images, and constructs a data set for each.
[0019] As a preferred solution, defective sub-images are selected from the two data sets constructed in S1 as test sets, and normal images are used as training sets, that is, only normal image samples are trained.
[0020] As a preferred solution, since the surface of the battery casing has a relatively obvious boundary with the surrounding environment, the battery boundary can be separated by a threshold method, the image can be grayscaled, the image can be converted into a grayscale image, and the pixels in the non-battery area can be set to zero according to the threshold. In this way, whether it is a valid area of the battery can be determined based on the pixel value.
[0021] As a preferred solution, the adaptive image segmentation method adopted in step S1 is to create a sliding window whose height is equal to the width of the battery effective area. The sliding window traverses the sliding area to calculate the width of the effective area of the cell within the sliding window, and uses it as the height of the next sliding window. At the same time, the value of the sliding window movement is modified, and the iterative traversal is continuously performed until the entire image is traversed.
[0022] As a preferred solution, the algorithm for calculating width is as follows:
[0023]
[0024] in, Indicates the x-coordinate of the first column where the total number of pixel values greater than the threshold exceeds one-third in each column of pixels from right to left in the window. It represents the x-coordinate of the first column of pixels in each column from left to right within the window where the total number of pixel values greater than the threshold exceeds one-third. The value obtained by subtracting the two values is the width of the valid area. As mentioned above, this width is used as the height of the next sliding window, and the sliding window movement value is modified so that it can cover the bottom edge of the previous window. The formula is as follows:
[0025]
[0026] in, Indicates the value of the sliding window moving once, It represents the ratio of covering the previous window. In this embodiment, it is set to 0.01. The above operation is repeated to move the sliding window downward until it reaches the bottom edge of the image. The entire image is traversed to complete the image preprocessing, that is, to generate multiple square sub-images: the side of each sub-image is the effective width calculated by a slider window and the height of the next sliding window. Of course, the two are completely equal, so the sub-image is a square image.
[0027] As a preferred solution, the feature extraction model of step S3 uses the deep residual network model ResNet-18 as the backbone network, and only uses the outputs of the first network block, the second network block, and the third network block of the deep residual network model ResNet-18.
[0028] As a preferred solution, the FastFlow model used in steps S4 and S6 integrates multiple coupling layers to form a more complete generator, and the combined continuous transformation formula is:
[0029]
[0030]
[0031] Among them, X represents the probability distribution function of the original data, Z represents the probability distribution function of the data after transformation, H represents the probability distribution function during the transformation process, f represents a single block coupling layer, and the subscripts from 1 to K represent the number of transformations. Represents the inverse function of f.
[0032] As a preferred solution, step S6 selects an arbitrary sub-image from the test set, inputs it into the feature extraction model and the FastFlow model, and normalizes the final output feature map with the previously calculated maximum and minimum values to obtain an anomaly score.
[0033] As a preferred solution, step S7 compares the abnormality score with a set threshold to determine whether the image is abnormal: if the score is greater than the threshold, the image is abnormal; if the score is less than the threshold, the image is normal.
[0034] After adopting the above solution, the gain effect of the present invention is:
[0035] 1. Only normal samples are trained, and data with abnormal signals detected is classified as defective images. Because normal samples have relatively consistent features and are of a single type, without interference from data of different categories, this can avoid missed detections due to different defect characteristics and accelerate model iteration.
[0036] 2. Using an adaptive image segmentation method, the long surface image of the battery casing is divided into several square sub-images. This not only allows the data to maintain the same specifications, but also increases the area of the effective region in the image. It can also detect surface anomalies on the narrow and long battery surface presented in the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] FIG1 is a schematic diagram of the algorithm steps of the present invention;
[0038] FIG2 is a flow chart of the training and testing phases of the present invention;
[0039] Figure 3 is a schematic diagram of the ResNet-18 structure;
[0040] FIG4 is a schematic diagram of the training process of the present invention. Modes for Carrying Out the Invention
[0041] The invention is described in detail below with reference to Figures 1-4 and specific embodiments.
[0042] The present invention provides an abnormality detection method for a long surface of a blade lithium battery housing, comprising the following steps:
[0043] S1. Obtain the long surface image of the blade lithium battery, preprocess the image into sub-images, and construct a data set;
[0044] S2. Select defective images in the dataset as the test set and normal images as the training set;
[0045] S3, input the training set into the feature extraction model to obtain the feature vector;
[0046] S4. Input the extracted feature vector into the FastFlow model for training to obtain a normalized flow model;
[0047] S5. Input the training set image into the normalized flow model, calculate the maximum and minimum values of all feature map pixel values after conversion, and save the maximum and minimum values;
[0048] S6. Select a sub-image from the test set and input it into the feature extraction model and FastFlow model. Normalize the final output feature map with the previously calculated maximum and minimum values to obtain the anomaly score.
[0049] S7, comparing the anomaly score with a set threshold to determine whether the image is abnormal;
[0050] Regarding step S1, the long surface image of the blade lithium battery is divided into a large surface and a long side surface, and the large surface and the long side surface are image preprocessed respectively, and data sets are constructed respectively.
[0051] Regarding step S2, defective sub-images are selected from the two data sets constructed in S1 as test sets, and normal images are used as training sets, that is, only normal image samples are trained.
[0052] In the preprocessing stage, an adaptive segmentation method is used to segment the long surface image of the battery casing into several square sub-images. For a given long surface image, the image appears as a vertical strip. Because the battery casing surface has a clear boundary with the surrounding environment, a threshold method is used to separate the battery boundary. The image is then grayscaled and converted to a grayscale image. Pixels in non-battery areas are set to zero based on the threshold. This allows the pixel values to be used to determine whether the battery is within a valid area.
[0053] First, get the height of the starting sliding window: select the center point of the image, traverse the pixel values from left to right in the pixel row where the center point is located, and compare them with the threshold to obtain the width of the battery effective area. Create a sliding window and use this width as the height of the starting sliding window.
[0054] Slide the starting sliding window from left to right, traverse the pixels in the sliding area, and calculate the width of the effective area in this sliding window. In fact, after the sliding window traversal is completed, the sliding window moves down to become the next sliding window, and the width of the effective area calculated by the previous sliding window is used as the height of the next sliding window.
[0055] The algorithm for calculating the width is as follows:
[0056]
[0057] in, Indicates the x-coordinate of the first column where the total number of pixel values greater than the threshold exceeds one-third in each column of pixels from right to left in the window. This represents the x-coordinate of the first column of pixels in the window where the total number of pixel values greater than the threshold exceeds one-third. The difference between the two values is the width of the valid area. As mentioned above, this width is used as the height of the next sliding window, and the sliding window shift value is modified so that it covers the bottom edge of the previous window. The formula is as follows:
[0058]
[0059] in, Indicates the value of the sliding window moving once, It represents the ratio of covering the previous window. In this embodiment, it is set to 0.01. The above operation is repeated to move the sliding window downward until it reaches the bottom edge of the image. The entire image is traversed to complete the image preprocessing, that is, to generate multiple square sub-images: the side of each sub-image is the effective width calculated by a slider window and the height of the next sliding window. Of course, the two are completely equal, so the sub-image is a square image.
[0060] Regarding the feature extraction model of step S3, the deep residual network model ResNet-18 is used as the backbone network. The native structure of ResNet-18 is shown in Figure 3, including the input layer, the first network block, the second network block, the third network block, the fourth network block and the output layer, where each network block consists of 2 layers of residual network blocks. The number of convolution kernels in the input layer is 64, the convolution kernel width is 7, the convolution kernel height is 7, the stride is 2, the padding is 1, and the activation function is the Leaky Relu function; the first network block consists of a 3×3 maximum pooling layer and two residual blocks with 64 channels, and the output is a 64-dimensional vector; the second network block consists of 64 3×3 convolution kernels and two residual blocks with 128 channels, and the output is a 128-dimensional vector; the third network block consists of 128 3×3 convolution kernels and two residual blocks with 256 channels, and the output is a 256-dimensional vector; the fourth network block consists of 256 3×3 convolution kernels and two residual blocks with 512 channels, and the output is a 512-dimensional vector; the output layer consists of an average pooling layer and a fully connected layer.
[0061] However, this embodiment only uses the outputs of the first network block, the second network block, and the third network block, and inputs them into the corresponding FastFlow models respectively, thereby increasing the global feature extraction capability of the model.
[0062] Regarding step S4, the FastFlow model used in this embodiment is constructed on the basis of the regular flow model. Its essence is a variable transformation algorithm. Assuming that the original image obeys the x distribution, the regular flow transformation method can be used to transform it into the z distribution, as shown in the following formula:
[0063]
[0064] and Can be converted to each other, the main process is, assuming The distribution of obeys the normal distribution, and the probability distribution function can be obtained as shown below.
[0065]
[0066] Replace z with a function of x as shown in the following formula, where represents the Jacobian matrix, represents the absolute value of its Jacobian matrix, and D represents the number of data.
[0067]
[0068] Simplifying the calculation, taking the logarithm of both sides of the equation yields the following formula. Here, f(x) is the desired normalized flow model, as shown below. Its inverse function, G(x), is the generative model, which can transform a simple probability distribution into a complex one.
[0069]
[0070] in, The layer is a block coupling layer, which can be easily reversibly transformed. At the same time, the absolute value of its Jacobian matrix is easy to solve. The fitting ability of a single coupling layer is weak. Multiple coupling layers can be integrated together to form a more complete generator. The formula for combined continuous transformation is as follows.
[0071]
[0072]
[0073] Among them, X represents the probability distribution function of the original data, Z represents the probability distribution function of the data after transformation, H represents the probability distribution function during the transformation process, f represents a single block coupling layer, and the subscripts from 1 to K represent the number of transformations. Represents the inverse function of f.
[0074] Will regarded as , for the input , you can Divided into and in the form of and is an intermediate variable, Is the final output result. Among them, and are the outputs of two reversible neural networks respectively.
[0075]
[0076]
[0077]
[0078]
[0079] Regarding step S5, the training set image is input into the normalized flow model, the data distribution of all normal images after model conversion is counted, the maximum and minimum values of all feature map pixel values after conversion are calculated, and the maximum and minimum values are saved. The algorithm designed in this embodiment is to iteratively optimize the model through the training set, save the maximum and minimum values of the output for test set testing and formal use. It is known to those skilled in the art that the steps for anomaly detection using the algorithm of this embodiment are exactly the same when using the test set and the preprocessed formal image data set to be detected. Before that, the training of the model is the training stage. The flowchart of the training stage is shown in Figure 3.
[0080] Regarding step S6, the process of the training and testing phases is shown in Figure 2. A sub-image is randomly selected from the test set and input into the feature extraction model and the FastFlow model. The final output feature map is normalized with the previously calculated maximum and minimum values to obtain the anomaly score.
[0081] Regarding step S7, the abnormality score is compared with the set threshold to determine whether the image is abnormal: if it is compared with the set threshold, the image is abnormal if it is greater than the threshold, and the image is normal if it is less than the threshold.
[0082] It should be noted that the testing process is no different from the process of formally using the algorithm for anomaly detection. That is, after the test is completed, when it is formally used: the image to be detected is preprocessed and input into the feature extraction model and FastFlow model. The final output feature map is normalized with the previously calculated maximum and minimum values to obtain the anomaly score. The anomaly score is compared with the set threshold to determine whether the image is abnormal: the image is compared with the set threshold. Images greater than the threshold are abnormal images, and images less than the threshold are normal images.
[0083] The above description is only a preferred embodiment of the present invention and is not intended to limit the design of this case. Any equivalent changes made based on the key design of this case shall fall within the scope of protection of this case.
Claims
1. A method for detecting abnormalities on the long surface of a blade lithium battery housing, characterized in that: Includes steps: S1, obtain the long surface image of the blade lithium battery, pre-process the image into sub-images, and construct a data set; S2, select defective images in the data set as the test set, and select normal images as the training set; S3, input the training set into the feature extraction model to obtain a feature vector; S4, input the extracted feature vector into the FastFlow model for training to obtain a normalized flow model; S5, input the training set image into the normalized flow model, calculate the maximum and minimum values of all feature map pixel values after conversion, and save the maximum and minimum values; S6. Select a sub-image from the test set at random, input it into the feature extraction model and the FastFlow model, normalize the final output feature map with the previously calculated maximum and minimum values, and obtain the anomaly score; S7, comparing the abnormality score with the set threshold to determine whether the image is abnormal; The step S1 adopts an adaptive image segmentation method to segment the long surface image of the battery shell into a plurality of square sub-images; The feature extraction model of step S3 uses the deep residual network model ResNet-18 as the backbone network; The FastFlow model used in steps S4 and S6 is constructed on the basis of the regular flow model.
2. The method for detecting abnormalities on the long surface of a blade lithium battery housing according to claim 1, characterized in that: The step S1 divides the long surface image of the lithium-ion battery blade into a large surface and a long side surface, pre-processes each into sub-images, and constructs a data set for each.
3. The method for detecting abnormalities on the long surface of a blade lithium battery housing according to claim 2, characterized in that: In the two data sets constructed in S1, defective sub-images are selected as test sets, and normal images are used as training sets, that is, only normal image samples are trained.
4. The method for detecting abnormalities on the long surface of a blade lithium battery housing according to claim 1, characterized in that: Since the surface of the battery shell has a relatively obvious boundary with the surrounding environment, the threshold method can be used to distinguish the battery boundary, grayscale the image, convert the image into a grayscale image, and set the pixels in the non-battery area to zero according to the threshold. In this way, it is possible to determine whether it is a valid area of the battery based on the pixel value.
5. The method for detecting abnormalities on the long surface of a blade lithium battery housing according to claim 1, characterized in that: The adaptive image segmentation method adopted in step S1 is to create a sliding window whose height is equal to the width of the effective area of the battery. The sliding window traverses the sliding area to calculate the width of the effective area of the battery in the sliding window, and uses it as the height of the next sliding window. At the same time, the value of the sliding window movement is modified, and the traversal is iterated continuously until the entire image is traversed.
6. A method for detecting abnormalities on the long surface of a blade lithium battery housing as claimed in claim 5, characterized in that: The algorithm for calculating the width is as follows: in, It indicates the coordinate of the first column x in which the total number of pixel values greater than the threshold exceeds one third in each column of pixels from right to left in the window. It means that the x-coordinate of the first column where the total number of pixel values greater than the threshold exceeds one-third in each column of pixels from left to right in the window, the value obtained by subtracting the two values is the width of the valid area; as mentioned above, this width is used as the height of the next sliding window, and the sliding window movement value is modified so that it can cover the bottom edge of the previous window. The formula is as follows: in, Indicates the value of the sliding window moving once, It represents the ratio of covering the previous window. In this embodiment, it is set to 0.
01. The above operation is repeated to move the sliding window downwards until the lower edge of the image is reached. The entire image is traversed to complete the preprocessing of the image, that is, to generate multiple square sub-images: the side of each sub-image is the effective width calculated by a slider window and the height of the next sliding window. Of course, the two are completely equal, so the sub-image is a square image.
7. The method for detecting abnormalities on the long surface of a blade lithium battery housing according to claim 1, characterized in that: The feature extraction model of step S3 uses the deep residual network model ResNet-18 as the backbone network, and only uses the outputs of the first network block, the second network block, and the third network block of the deep residual network model ResNet-18.
8. The method for detecting abnormalities on the long surface of a blade lithium battery housing according to claim 1, characterized in that: The FastFlow model used in steps S4 and S6 integrates multiple coupling layers to form a more complete generator, and its combined continuous transformation formula is: Among them, X represents the probability distribution function of the original data, Z represents the probability distribution function of the data after transformation, H represents the probability distribution function during the transformation process, f represents a single block coupling layer, and the subscripts from 1 to K represent the number of transformations. Represents the inverse function of f.
9. The method for detecting abnormalities on the long surface of a blade lithium battery housing according to claim 1, characterized in that: The step S6 selects a sub-image from the test set at random, inputs it into the feature extraction model and the FastFlow model, and normalizes the feature map finally output with the maximum and minimum values previously calculated to obtain an anomaly score.
10. The method for detecting abnormalities on the long surface of a blade lithium battery housing according to claim 9, characterized in that: The step S7 compares the abnormality score with a set threshold to determine whether the image is abnormal: if the image is compared with the set threshold, an image greater than the threshold is an abnormal image, and an image less than the threshold is a normal image.
Citation Information
Patent Citations
Abnormality detection method and device, electronic equipment and storage medium
CN114049332A
Infrared thermal imaging defect detection method and device for transformer substation insulator
CN115290696A
Power transmission line bolt missing pin detection method fused with graph theory reasoning
CN115393714A
Abnormity detection method for long surface of blade lithium battery shell
CN116188467A
Cited By
Vision-based surface defect detection method and detection system
CN119151938A
Pole piece defect multi-feature fusion detection method and system for battery manufacturing
CN122335874A
