A method, device and system for detecting defects in lithium batteries
By performing downsampling, binarization, and weighted fusion operations on lithium battery electrode images, combined with a lightweight classification network model, automated detection of lithium battery electrode defects was achieved. This solved the problem of low efficiency in traditional manual inspection, and improved detection accuracy and production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional manual inspection methods for lithium battery electrode defects are inefficient and susceptible to subjective biases, making them unsuitable for different production environments and complex defect types, resulting in inconsistent inspection practices and low production efficiency.
A lithium battery defect detection method is adopted, which performs downsampling, binarization, upsampling and weighted fusion operations on electrode images, and combines a lightweight classification network model to segment and determine abnormal regions in electrode images, thereby achieving automated defect detection.
It improves the accuracy and efficiency of lithium battery electrode defect detection, can quickly adapt to different production environments, reduce human error, and improve production efficiency.
Smart Images

Figure CN116681677B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, and more particularly to a method, apparatus and system for detecting defects in lithium batteries. Background Technology
[0002] The stable chemical properties and reliable safety performance of lithium batteries have made them the preferred energy storage device for various new energy vehicle manufacturers. Electrodes are the core components inside lithium batteries that handle charging and discharging. Their quality directly affects the stability and safety of the lithium battery. Electrode production involves multiple steps, including coating, rolling, and cutting. During production, defects such as scratches, under-rolling, and aluminum leakage may occur on the surface of the electrodes, directly leading to quality problems in the lithium battery. Therefore, defect detection is a crucial step in the production process. By conducting defect detection, on the one hand, defective electrodes can be prevented from entering the market, causing safety accidents and economic losses; on the other hand, by analyzing the location and type of defects, the main influencing factors and production processes causing the defects can be identified, thereby improving the production process and increasing production efficiency.
[0003] Traditional manual inspection methods require highly skilled personnel, are time-consuming, labor-intensive, and costly; inspection results are easily influenced by individual subjectivity and work experience, resulting in inconsistent standards. Defect inspection methods based on traditional defect matching or segmentation have strict requirements for lighting and shooting angles, making them unsuitable for different production environments and complex and diverse defect types; for new production lines, significant time is often required for debugging to adapt to the new production environment, which is not conducive to rapid production needs.
[0004] Therefore, there is an urgent need for a lithium battery defect detection strategy to solve the problem of low efficiency in lithium battery defect detection. Summary of the Invention
[0005] This invention provides a lithium battery defect detection method, apparatus, and system to improve the detection efficiency of lithium battery defects.
[0006] To address the above problems, one embodiment of the present invention provides a lithium battery defect detection method, comprising:
[0007] Acquire electrode images of the lithium battery to be tested, and perform downsampling operations on the electrode images to obtain each image to be processed;
[0008] The binarization threshold is calculated based on the pixel value of each image to be processed and the preset pixel difference threshold.
[0009] Binarize each of the images to be processed according to the binarization threshold to obtain a binarized image corresponding to each image to be processed. Perform upsampling and weighted fusion operations on each of the binarized images to obtain a fused image.
[0010] Based on a preset segmentation threshold, regions in the fused image with pixel values greater than the segmentation threshold are segmented to determine the corresponding segmented regions of the fused image;
[0011] Based on the positional relationship and size of each segmented region in the fused image, the polarimetric image is segmented to obtain images of each abnormal region of the polarimetric image. Each abnormal region image is then input into a preset classification network model so that the classification network model outputs a defect determination result corresponding to each abnormal region image. The classification network model is trained by inputting several defect images with labeled defect types into a lightweight classification network.
[0012] As an improvement to the above scheme, the image to be processed includes: an polarimetric image, a first sampled image, and a second sampled image; the downsampling operation on the polarimetric image to obtain each image to be processed includes:
[0013] The electrode image is downsampled to obtain a first sampled image corresponding to the electrode image;
[0014] Perform a downsampling operation on the first sampled image to obtain a second sampled image corresponding to the first sampled image;
[0015] By combining the polarimetric image, the first sampled image, and the second sampled image, each image to be processed is obtained.
[0016] As an improvement to the above scheme, before calculating the binarization threshold based on the pixel values of each image to be processed and a preset pixel difference threshold, the method further includes:
[0017] In the electrode image, several first image blocks of a preset size are randomly selected;
[0018] Based on the positional relationship of several first image blocks in the polarimetric image, several second image blocks of preset size corresponding to the first sampled image and several third image blocks of preset size corresponding to the second sampled image are determined; wherein, the number of first image blocks, the number of second image blocks and the number of third image blocks are the same.
[0019] As an improvement to the above scheme, the step of calculating the binarization threshold based on the pixel value of each image to be processed and a preset pixel difference threshold includes:
[0020] Based on the pixel values of each of the images to be processed, calculate the first pixel average value of each first image block, the second pixel average value of each second image block, and the third pixel average value of each third image block;
[0021] Summarize all the first pixel averages, all the second pixel averages, and all the third pixel averages, and arrange them in descending order to obtain a pixel average sequence;
[0022] Calculate the average pixel difference between the average values of two adjacent pixels in the pixel average value sequence, and select the average pixel difference that is less than the pixel difference threshold as the target average pixel difference. Calculate the average value of several target average pixel differences to obtain the binarization threshold.
[0023] As an improvement to the above scheme, the step of performing upsampling and weighted fusion operations on each of the binarized images to obtain a fused image includes:
[0024] Upsample the binarized image corresponding to the first sampled image to obtain the first upsampled binarized image;
[0025] The binarized image corresponding to the second sampled image is upsampled to obtain the second upsampled binarized image;
[0026] The binarized image corresponding to the pole image, the first upsampled binarized image, and the second upsampled binarized image are substituted into a preset weighting formula for weighted fusion to obtain a fused image; wherein the binarized image corresponding to the pole image, the first upsampled binarized image, and the second upsampled binarized image have the same size; the weighting formula is as follows:
[0027] P = λ1P1 + λ2P ′ 2+λ3P ′ 3
[0028] In the formula, P is the fused image, P1 is the binarized image corresponding to the polarimetric image, and P ′ 2 represents the first upsampled binarized image, P ′ 3 represents the second upsampled binarized image, and λ1, λ2, and λ3 are preset weighting weights.
[0029] As an improvement to the above scheme, the step of segmenting regions in the fused image with pixel values greater than a preset segmentation threshold, and determining the corresponding segmented regions of the fused image, includes:
[0030] In the fused image, regions with pixel values greater than a preset segmentation threshold are selected as target regions using a preset segmentation formula; wherein, the segmentation formula is specifically:
[0031]
[0032] In the formula, P ′ T is an image composed of various target regions. ′This is the segmentation threshold;
[0033] Based on the leftmost, rightmost, topmost, and bottommost pixels of each target region, a rectangular region corresponding to each target region is determined, and each of these rectangular regions is used as a segmentation region of the fused image.
[0034] As an improvement to the above scheme, the defect determination result includes: normal region, defect region, and the defect type corresponding to the defect region; after the classification network model outputs the defect determination result corresponding to each abnormal region image, it includes:
[0035] For each defect determination result, the following steps are performed: if it is a normal area, the abnormal area image corresponding to the normal area is marked as a normal image using a marking machine; if it is a defective area, the abnormal area image corresponding to the defective area is recorded, and the defect type corresponding to the defective area is marked on the abnormal area image corresponding to the defective area using the marking machine.
[0036] As an improvement to the above solution, before acquiring the electrode image of the lithium battery to be tested, the following step is also included:
[0037] Receive pulse signal data transmitted by a position encoder, and calculate the moving distance of the lithium battery under test based on the pulse signal data;
[0038] When the moving distance is greater than or equal to the distance threshold, the linear array camera is controlled to take pictures of the electrode of the lithium battery to be detected, so that the linear array camera can transmit the acquired electrode image.
[0039] Accordingly, one embodiment of the present invention also provides a lithium battery defect detection device, including: a data acquisition module, a data calculation module, a binarization module, a segmentation module, and a data judgment module;
[0040] The data acquisition module is used to acquire electrode images of the lithium battery to be tested, and to perform downsampling operations on the electrode images to obtain each image to be processed.
[0041] The data calculation module is used to calculate the binarization threshold based on the pixel value of each image to be processed and a preset pixel difference threshold.
[0042] The binarization module is used to binarize each of the images to be processed according to the binarization threshold to obtain a binarized image corresponding to each of the images to be processed, and to perform upsampling and weighted fusion operations on each of the binarized images to obtain a fused image.
[0043] The segmentation module is used to segment regions in the fused image whose pixel values are greater than the preset segmentation threshold according to the preset segmentation threshold, and to determine the segmentation regions corresponding to the fused image.
[0044] The data judgment module is used to segment the polarimetric image according to the positional relationship and size of each segmented region in the fused image, obtain images of each abnormal region of the polarimetric image, and input each abnormal region image into a preset classification network model so that the classification network model outputs the defect judgment result corresponding to each abnormal region image; wherein, the classification network model is obtained by training a lightweight classification network by inputting several defect images with labeled defect types.
[0045] As an improvement to the above scheme, the image to be processed includes: an polarimetric image, a first sampled image, and a second sampled image; the downsampling operation on the polarimetric image to obtain each image to be processed includes:
[0046] The electrode image is downsampled to obtain a first sampled image corresponding to the electrode image;
[0047] Perform a downsampling operation on the first sampled image to obtain a second sampled image corresponding to the first sampled image;
[0048] By combining the polarimetric image, the first sampled image, and the second sampled image, each image to be processed is obtained.
[0049] As an improvement to the above scheme, before calculating the binarization threshold based on the pixel values of each image to be processed and a preset pixel difference threshold, the method further includes:
[0050] In the electrode image, several first image blocks of a preset size are randomly selected;
[0051] Based on the positional relationship of several first image blocks in the polarimetric image, several second image blocks of preset size corresponding to the first sampled image and several third image blocks of preset size corresponding to the second sampled image are determined; wherein, the number of first image blocks, the number of second image blocks and the number of third image blocks are the same.
[0052] As an improvement to the above solution, the data calculation module includes: a pixel average value calculation unit, a pixel average value sorting unit, and a pixel average value calculation difference unit;
[0053] The pixel average value calculation unit is used to calculate the first pixel average value of each first image block, the second pixel average value of each second image block, and the third pixel average value of each third image block based on the pixel value of each image to be processed.
[0054] The pixel average value sorting unit is used to summarize all the first pixel average values, all the second pixel average values, and all the third pixel average values, and arrange them in descending order to obtain a pixel average value sequence;
[0055] The pixel average difference unit is used to calculate the pixel average difference between the average values of two adjacent pixels in the pixel average sequence, and select the pixel average difference less than the pixel difference threshold as the target pixel average difference, calculate the average of several target pixel average differences, and obtain the binarization threshold.
[0056] As an improvement to the above scheme, the step of performing upsampling and weighted fusion operations on each of the binarized images to obtain a fused image includes:
[0057] Upsample the binarized image corresponding to the first sampled image to obtain the first upsampled binarized image;
[0058] The binarized image corresponding to the second sampled image is upsampled to obtain the second upsampled binarized image;
[0059] The binarized image corresponding to the pole image, the first upsampled binarized image, and the second upsampled binarized image are substituted into a preset weighting formula for weighted fusion to obtain a fused image; wherein the binarized image corresponding to the pole image, the first upsampled binarized image, and the second upsampled binarized image have the same size; the weighting formula is as follows:
[0060] P = λ1P1 + λ2P ′ 2+λ3P ′ 3
[0061] In the formula, P is the fused image, P1 is the binarized image corresponding to the polarimetric image, and P ′ 2 represents the first upsampled binarized image, P ′ 3 represents the second upsampled binarized image, and λ1, λ2, and λ3 are preset weighting weights.
[0062] As an improvement to the above solution, the segmentation module includes: a region segmentation unit and a rectangular region unit;
[0063] The region segmentation unit is used to select regions with pixel values greater than a preset segmentation threshold as target regions in the fused image using a preset segmentation formula; wherein, the segmentation formula is specifically:
[0064]
[0065] In the formula, P ′ T is an image composed of various target regions.′ This is the segmentation threshold;
[0066] The rectangular region unit is used to determine the rectangular region corresponding to each target region based on the leftmost, rightmost, topmost, and bottommost pixels of each target region, and to use each rectangular region as a segmentation region of the fused image.
[0067] As an improvement to the above scheme, the defect determination result includes: normal region, defect region, and the defect type corresponding to the defect region; after the classification network model outputs the defect determination result corresponding to each abnormal region image, it includes:
[0068] For each defect determination result, the following steps are performed: if it is a normal area, the abnormal area image corresponding to the normal area is marked as a normal image using a marking machine; if it is a defective area, the abnormal area image corresponding to the defective area is recorded, and the defect type corresponding to the defective area is marked on the abnormal area image corresponding to the defective area using the marking machine.
[0069] As an improvement to the above solution, before acquiring the electrode image of the lithium battery to be tested, the following step is also included:
[0070] Receive pulse signal data transmitted by a position encoder, and calculate the moving distance of the lithium battery under test based on the pulse signal data;
[0071] When the moving distance is greater than or equal to the distance threshold, the linear array camera is controlled to take pictures of the electrode of the lithium battery to be detected, so that the linear array camera can transmit the acquired electrode image.
[0072] Accordingly, one embodiment of the present invention also provides a lithium battery defect detection system, including: a lithium battery to be tested, a lithium battery defect detection device, a conveyor belt, a first light source, a second light source, a first line array camera, a second line array camera, a position encoder, and a marking machine; the lithium battery defect detection device applies the lithium battery defect detection method described in the present invention; the lithium battery to be tested is located on the upper surface of the conveyor belt; the lithium battery defect detection device is connected to the first light source, the second light source, the first line array camera, the second line array camera, the position encoder, and the marking machine respectively; the marking machine, the first light source, and the first line array camera are located above the conveyor belt; the second light source and the second line array camera are located below the conveyor belt; the position encoder is located inside the conveyor belt.
[0073] As can be seen from the above, the present invention has the following beneficial effects:
[0074] This invention provides a lithium battery defect detection method. After acquiring an electrode image of the lithium battery to be tested, the method performs a downsampling operation on the electrode image to obtain images of different scales. A binarization threshold is calculated based on the pixel values of the images and a preset pixel difference threshold. Each image is then binarized using the binarization threshold to obtain a corresponding binarized image. The binarized images are then upsampled and weighted fusion operations are performed to obtain a fused image. In the fused image, regions with pixel values greater than a preset segmentation threshold are segmented to determine the segmented regions. Based on the positional relationship and size of the segmented regions in the fused image, the electrode image is segmented to obtain images of various abnormal regions. Each abnormal region image is input into a preset classification network model, which outputs a defect determination result corresponding to each abnormal region image, thus completing the lithium battery defect detection. This invention binarizes images of lithium-ion battery electrodes at different scales, initially identifying and segmenting regions larger than a segmentation threshold as abnormal areas. These segmented abnormal areas are then input into a classification network model for defect determination. This ensures that the classification network model processes small abnormal areas and a low number of abnormalities per iteration, thereby improving the efficiency of the model in identifying defects in the lithium-ion battery electrodes. In summary, this invention accurately locates defects and achieves high efficiency in defect determination. Attached Figure Description
[0075] Figure 1 This is a schematic flowchart of a lithium battery defect detection method provided in an embodiment of the present invention;
[0076] Figure 2 This is a schematic diagram of the structure of a lithium battery defect detection device provided in an embodiment of the present invention;
[0077] Figure 3 This is a schematic diagram of the structure of a lithium battery defect detection system provided in an embodiment of the present invention;
[0078] Figure 4 This is a schematic diagram of the process for generating abnormal region images according to an embodiment of the present invention;
[0079] Figure 5 This is a schematic diagram of the defect type classification results provided in an embodiment of the present invention;
[0080] Figure 6 This is a schematic diagram of a terminal device structure provided in an embodiment of the present invention. Detailed Implementation
[0081] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0082] Example 1
[0083] See Figure 1 , Figure 1 This is a flowchart illustrating a lithium battery defect detection method according to an embodiment of the present invention, as shown below. Figure 1 As shown, this embodiment includes steps 101 to 105, and the specific steps are as follows:
[0084] Step 101: Obtain the electrode image of the lithium battery to be tested, and perform a downsampling operation on the electrode image to obtain each image to be processed.
[0085] In this embodiment, the image to be processed includes: an polarimetric image, a first sampled image, and a second sampled image; the downsampling operation on the polarimetric image to obtain each image to be processed includes:
[0086] The electrode image is downsampled to obtain a first sampled image corresponding to the electrode image;
[0087] Perform a downsampling operation on the first sampled image to obtain a second sampled image corresponding to the first sampled image;
[0088] By combining the polarimetric image, the first sampled image, and the second sampled image, each image to be processed is obtained.
[0089] In one specific embodiment, the captured polarimetric image is acquired from a linear array.
[0090] In one specific embodiment, the polarimetric image is downsampled twice, with each downsampling reducing the image size to half of its original size, thereby obtaining three images of different scales: P1 (the polarimetric image described in this invention), P2 (the first sampled image described in this invention), and P3 (the second sampled image described in this invention).
[0091] Step 102: Calculate the binarization threshold based on the pixel value of each image to be processed and the preset pixel difference threshold.
[0092] In this embodiment, before calculating the binarization threshold based on the pixel values of each image to be processed and a preset pixel difference threshold, the method further includes:
[0093] In the electrode image, several first image blocks of a preset size are randomly selected;
[0094] Based on the positional relationship of several first image blocks in the polarimetric image, several second image blocks of preset size corresponding to the first sampled image and several third image blocks of preset size corresponding to the second sampled image are determined; wherein, the number of first image blocks, the number of second image blocks and the number of third image blocks are the same.
[0095] In one specific embodiment, the preset pixel difference threshold is determined based on the average pixel value of the corresponding electrode of different models of defect-free lithium batteries.
[0096] In a specific embodiment, 16 first image blocks of 8x8 (i.e., the preset size described in this invention) are randomly selected in P1, and second and third image blocks are cropped at corresponding positions in P2 and P3 through position mapping relationship, so as to facilitate the calculation of the average pixel value of each image block; since most areas of the electrode are non-defective areas, the average value of most image blocks is close to the average value of the normal area.
[0097] In this embodiment, calculating the binarization threshold based on the pixel values of each image to be processed and a preset pixel difference threshold includes:
[0098] Based on the pixel values of each of the images to be processed, calculate the first pixel average value of each first image block, the second pixel average value of each second image block, and the third pixel average value of each third image block;
[0099] Summarize all the first pixel averages, all the second pixel averages, and all the third pixel averages, and arrange them in descending order to obtain a pixel average sequence;
[0100] Calculate the average pixel difference between the average values of two adjacent pixels in the pixel average value sequence, and select the average pixel difference that is less than the pixel difference threshold as the target average pixel difference. Calculate the average value of several target average pixel differences to obtain the binarization threshold.
[0101] In one specific embodiment, the 16 average values AVE1 (i.e., the first pixel average value described in this invention), 16 average values AVE2 (i.e., the second pixel average value described in this invention), and 16 average values AVE3 (i.e., the third pixel average value described in this invention) of three different scales (corresponding to 16 image blocks) are sorted from largest to smallest, and then the difference between adjacent values is calculated. The average value of the difference value is found to be less than a set value T (i.e., the pixel difference threshold described in this invention), and the average value is used as the binarization threshold.
[0102] Step 103: Binarize each of the images to be processed according to the binarization threshold to obtain the binarized image corresponding to each image to be processed. Perform upsampling and weighted fusion operations on each of the binarized images to obtain the fused image.
[0103] In this embodiment, performing upsampling and weighted fusion operations on each of the binarized images to obtain a fused image includes:
[0104] Upsample the binarized image corresponding to the first sampled image to obtain the first upsampled binarized image;
[0105] The binarized image corresponding to the second sampled image is upsampled to obtain the second upsampled binarized image;
[0106] The binarized image corresponding to the pole image, the first upsampled binarized image, and the second upsampled binarized image are substituted into a preset weighting formula for weighted fusion to obtain a fused image; wherein the binarized image corresponding to the pole image, the first upsampled binarized image, and the second upsampled binarized image have the same size; the weighting formula is as follows:
[0107] P = λ1P1 + λ2P ′ 2+λ3P ′ 3
[0108] In the formula, P is the fused image, P1 is the binarized image corresponding to the polarimetric image, and P ′ 2 represents the first upsampled binarized image, P ′ 3 represents the second upsampled binarized image, and λ1, λ2, and λ3 are preset weighting weights.
[0109] Step 104: Based on a preset segmentation threshold, segment each region in the fused image whose pixel value is greater than the segmentation threshold, and determine each segmented region corresponding to the fused image.
[0110] In one specific embodiment, the first sampled image and the second sampled image are upsampled to the size of the polarimetric image to obtain the first upsampled binarized image and the second upsampled binarized image, which are then substituted into a weighting formula for weighted fusion.
[0111] In one specific embodiment, since defects are significant at low scales, the binarized image of the third sampled image is used as the main reference for selecting the defect location. Therefore, λ1 is set to 0.3, λ2 is set to 0.6, and λ3 is set to 0.8.
[0112] In this embodiment, the step of segmenting regions in the fused image with pixel values greater than a preset segmentation threshold, and determining the corresponding segmented regions of the fused image, includes:
[0113] In the fused image, regions with pixel values greater than a preset segmentation threshold are selected as target regions using a preset segmentation formula; wherein, the segmentation formula is specifically:
[0114]
[0115] In the formula, P ′ T is an image composed of various target regions. ′ This is the segmentation threshold;
[0116] Based on the leftmost, rightmost, topmost, and bottommost pixels of each target region, a rectangular region corresponding to each target region is determined, and each of these rectangular regions is used as a segmentation region of the fused image.
[0117] In one specific embodiment, based on the characteristics that defects are significant at low scales and the spatial correlation of multi-scale images, areas that are significant only at high scales are not true defects, so the segmentation threshold is set to 0.3.
[0118] In one specific embodiment, please refer to Figure 4 After determining that each region has a pixel value greater than a preset segmentation threshold as a target region, the image P is formed. ′ Where 1 represents white and 0 represents black; the target region is irregular in shape and prone to errors during scaling. Therefore, it is necessary to calculate the minimum bounding rectangle of the target region based on the leftmost, rightmost, topmost, and bottommost pixels of each target region to obtain each segmented region and form the image P. ″ Because of image P ″ It includes the size of each segmented region and its position in the image. Since the fused image is created by fusing the polarimetric images according to their dimensions, it is obtained by following the image P... ″ The white areas in the image are cut out in the polarimetric image to obtain images of abnormal areas.
[0119] Step 105: Based on the positional relationship and size of each segmented region in the fused image, the polarimetric image is segmented to obtain images of each abnormal region of the polarimetric image. Each abnormal region image is then input into a preset classification network model so that the classification network model outputs the defect determination result corresponding to each abnormal region image. The classification network model is obtained by training a lightweight classification network by inputting several defect images with labeled defect types.
[0120] In this embodiment, the defect determination result includes: normal region, defect region, and the defect type corresponding to the defect region; after the classification network model outputs the defect determination result corresponding to each abnormal region image, it includes:
[0121] For each defect determination result, the following steps are performed: if it is a normal area, the abnormal area image corresponding to the normal area is marked as a normal image using a marking machine; if it is a defective area, the abnormal area image corresponding to the defective area is recorded, and the defect type corresponding to the defective area is marked on the abnormal area image corresponding to the defective area using the marking machine.
[0122] In one specific embodiment, a large number of abnormal region images are manually labeled with categories, and a lightweight classification network - MobileNetV2 (i.e., the classification network model described in this invention) is trained using the labeled data; the trained lightweight classification network - MobileNetV2 is used to classify the abnormal region images; if it is determined to be a normal region, the determined region is deleted from the candidate region; if it is determined to be a defective region, the determined region is recorded; finally, the region determined to be defective and its category are output.
[0123] In one specific embodiment, such as Figure 5 As shown, it can accurately locate and classify six types of surface defects (bulges, black spots, indentations, scratches, exposed metal, and wrinkles) on electrode sheets, each of which is illustrated in the figure below. These categories are defined based on the actual testing process of electrode sheet manufacturers, taking into account factors such as the area of the defect, the material it contains, and differences in brightness.
[0124] In this embodiment, before acquiring the electrode image of the lithium battery to be tested, the method further includes:
[0125] Receive pulse signal data transmitted by a position encoder, and calculate the moving distance of the lithium battery under test based on the pulse signal data;
[0126] When the moving distance is greater than or equal to the distance threshold, the linear array camera is controlled to take pictures of the electrode of the lithium battery to be detected, so that the linear array camera can transmit the acquired electrode image.
[0127] In one specific embodiment, the following steps are performed in sequence:
[0128] Step 1: The position encoder sends out a pulse signal and transmits it to the industrial computer via the I / O card;
[0129] Step 2: The industrial control computer calculates the distance the electrode moves on the conveyor belt using an algorithm;
[0130] Step 3: Determine the relationship between the distance the electrode moves and the set value; if the distance the electrode moves is less than the set value, return to Step 1; if the distance the electrode moves is greater than or equal to the set value, return to Step 4.
[0131] Step 4: The recorded image data is then returned to the camera via the image acquisition card.
[0132] See Figure 2 , Figure 2 This is a schematic diagram of the structure of a lithium battery defect detection device according to an embodiment of the present invention, including: a data acquisition module 201, a data calculation module 202, a binarization module 203, a segmentation module 204, and a data judgment module 205;
[0133] The data acquisition module 201 is used to acquire electrode images of the lithium battery to be tested, and to perform downsampling operations on the electrode images to obtain each image to be processed.
[0134] The data calculation module 202 is used to calculate a binarization threshold based on the pixel value of each image to be processed and a preset pixel difference threshold.
[0135] The binarization module 203 is used to binarize each of the images to be processed according to the binarization threshold to obtain a binarized image corresponding to each of the images to be processed, and to perform upsampling and weighted fusion operations on each of the binarized images to obtain a fused image.
[0136] The segmentation module 204 is used to segment each region in the fused image whose pixel value is greater than the segmentation threshold according to a preset segmentation threshold, and to determine each segmentation region corresponding to the fused image.
[0137] The data judgment module 205 is used to segment the polarimetric image according to the positional relationship and size of each segmented region in the fused image, obtain images of each abnormal region of the polarimetric image, and input each abnormal region image into a preset classification network model so that the classification network model outputs the defect judgment result corresponding to each abnormal region image; wherein, the classification network model is obtained by training a lightweight classification network by inputting several defect images with labeled defect types.
[0138] As an improvement to the above scheme, the image to be processed includes: an polarimetric image, a first sampled image, and a second sampled image; the downsampling operation on the polarimetric image to obtain each image to be processed includes:
[0139] The electrode image is downsampled to obtain a first sampled image corresponding to the electrode image;
[0140] Perform a downsampling operation on the first sampled image to obtain a second sampled image corresponding to the first sampled image;
[0141] By combining the polarimetric image, the first sampled image, and the second sampled image, each image to be processed is obtained.
[0142] As an improvement to the above scheme, before calculating the binarization threshold based on the pixel values of each image to be processed and a preset pixel difference threshold, the method further includes:
[0143] In the electrode image, several first image blocks of a preset size are randomly selected;
[0144] Based on the positional relationship of several first image blocks in the polarimetric image, several second image blocks of preset size corresponding to the first sampled image and several third image blocks of preset size corresponding to the second sampled image are determined; wherein, the number of first image blocks, the number of second image blocks and the number of third image blocks are the same.
[0145] As an improvement to the above solution, the data calculation module 202 includes: a pixel average value calculation unit, a pixel average value sorting unit, and a pixel average value calculation difference unit;
[0146] The pixel average value calculation unit is used to calculate the first pixel average value of each first image block, the second pixel average value of each second image block, and the third pixel average value of each third image block based on the pixel value of each image to be processed.
[0147] The pixel average value sorting unit is used to summarize all the first pixel average values, all the second pixel average values, and all the third pixel average values, and arrange them in descending order to obtain a pixel average value sequence;
[0148] The pixel average difference unit is used to calculate the pixel average difference between the average values of two adjacent pixels in the pixel average sequence, and select the pixel average difference less than the pixel difference threshold as the target pixel average difference, calculate the average of several target pixel average differences, and obtain the binarization threshold.
[0149] As an improvement to the above scheme, the step of performing upsampling and weighted fusion operations on each of the binarized images to obtain a fused image includes:
[0150] Upsample the binarized image corresponding to the first sampled image to obtain the first upsampled binarized image;
[0151] The binarized image corresponding to the second sampled image is upsampled to obtain the second upsampled binarized image;
[0152] The binarized image corresponding to the pole image, the first upsampled binarized image, and the second upsampled binarized image are substituted into a preset weighting formula for weighted fusion to obtain a fused image; wherein the binarized image corresponding to the pole image, the first upsampled binarized image, and the second upsampled binarized image have the same size; the weighting formula is as follows:
[0153] P = λ1P1 + λ2P ′ 2+λ3P ′ 3
[0154] In the formula, P is the fused image, P1 is the binarized image corresponding to the polarimetric image, and P ′ 2 represents the first upsampled binarized image, P ′ 3 represents the second upsampled binarized image, and λ1, λ2, and λ3 are preset weighting weights.
[0155] As an improvement to the above solution, the segmentation module 204 includes: a region segmentation unit and a rectangular region unit;
[0156] The region segmentation unit is used to select regions with pixel values greater than a preset segmentation threshold as target regions in the fused image using a preset segmentation formula; wherein, the segmentation formula is specifically:
[0157]
[0158] In the formula, P ′ T is an image composed of various target regions. ′ This is the segmentation threshold;
[0159] The rectangular region unit is used to determine the rectangular region corresponding to each target region based on the leftmost, rightmost, topmost, and bottommost pixels of each target region, and to use each rectangular region as a segmentation region of the fused image.
[0160] As an improvement to the above scheme, the defect determination result includes: normal region, defect region, and the defect type corresponding to the defect region; after the classification network model outputs the defect determination result corresponding to each abnormal region image, it includes:
[0161] For each defect determination result, the following steps are performed: if it is a normal area, the abnormal area image corresponding to the normal area is marked as a normal image using a marking machine; if it is a defective area, the abnormal area image corresponding to the defective area is recorded, and the defect type corresponding to the defective area is marked on the abnormal area image corresponding to the defective area using the marking machine.
[0162] As an improvement to the above solution, before acquiring the electrode image of the lithium battery to be tested, the following step is also included:
[0163] Receive pulse signal data transmitted by a position encoder, and calculate the moving distance of the lithium battery under test based on the pulse signal data;
[0164] When the moving distance is greater than or equal to the distance threshold, the linear array camera is controlled to take pictures of the electrode of the lithium battery to be detected, so that the linear array camera can transmit the acquired electrode image.
[0165] Accordingly, see Figure 3 , Figure 3 A lithium battery defect detection system according to an embodiment of the present invention includes: a lithium battery to be tested 301, a lithium battery defect detection device 302, a conveyor belt 303, a first light source 304, a second light source 305, a first line array camera 306, a second line array camera 307, a position encoder 308, and a marking machine 309; the lithium battery defect detection device 302 applies the lithium battery defect detection method as described in the present invention; the lithium battery to be tested 301 is located on the upper surface of the conveyor belt 303; the lithium battery defect detection device 302 is connected to the first light source 304, the second light source 305, the first line array camera 306, the second line array camera 307, the position encoder 308, and the marking machine 309 respectively; the marking machine 309, the first light source 304, and the first line array camera 306 are located above the conveyor belt 303; the second light source 305 and the second line array camera 307 are located below the conveyor belt 303; and the position encoder 308 is located inside the conveyor belt 303.
[0166] In one specific embodiment, the lithium battery defect detection device 302 includes an I / O card 3021 and an image acquisition card 3022;
[0167] In one specific embodiment, the lithium battery defect detection device 302 can be an industrial control computer;
[0168] In one specific embodiment, the first and second light sources are: pure white light generated by bar light sources for supplementary lighting, illuminating the surface of the electrode within the camera's shooting area. Since both sides of the electrode need to be inspected, a bar light source is installed on each side. The light sources are programmable. An industrial control computer, via an I / O card, can control the light sources to turn off and adjust their brightness, thereby achieving step-by-step brightness adjustment. This step-by-step brightness adjustment allows the lithium battery defect detection system to adapt to different electrode production environments, thus improving the equipment's adaptability to production environments.
[0169] In one specific embodiment, the line scan camera is: a lithium battery defect detection system with one line scan camera (8192 dpi resolution, maximum line frequency 140 MHz) installed on each side of the electrode. The line scan camera uses external hardware to automatically take pictures based on the distance the electrode moves on the rollers. The line scan camera transmits the acquired image information to an industrial control computer via an image acquisition card for image processing.
[0170] In one specific embodiment, the position encoder is mounted on the rotating shaft of the roller and is used to calculate the distance the electrode moves on the roller. The pulse signal of the position encoder is transmitted to the line scan camera through the I / O card of the industrial control computer, on the one hand to realize the external triggering of the line scan camera; on the other hand, it facilitates the industrial control computer to record the total distance the electrode moves.
[0171] In one specific embodiment, the marking machine is configured such that when a defect is detected in the electrode sheet, the industrial control computer controls the marking machine to mark the defective electrode sheet at an appropriate position via an IO card, so that the defective electrode sheet can be selected out by the worker.
[0172] This embodiment obtains images of the electrode sheet of the lithium battery to be tested by downsampling the electrode sheet images to obtain images of different scales. A binarization threshold is calculated based on the pixel values of the images and a preset pixel difference threshold. Each image is then binarized using the binarization threshold to obtain a corresponding binarized image. The binarized images are then upsampled and weighted fusion to obtain a fused image. In the fused image, regions with pixel values greater than a preset segmentation threshold are segmented to determine the segmented regions. Based on the position and size of the segmented regions in the fused image, the electrode sheet image is segmented to obtain images of various abnormal regions. Each abnormal region image is input into a preset classification network model, which outputs a defect judgment result for each abnormal region image, thus completing the lithium battery defect detection. This embodiment uses an adaptive thresholding method for segmentation to obtain abnormal region images for preliminary defect localization; it operates quickly and ensures high accuracy in determining non-candidate regions, guaranteeing the detection effect. The image classification method utilizes the pre-trained lightweight classification network MobileNetV2 to classify images of abnormal regions. This serves two purposes: firstly, it performs secondary filtering to improve the accuracy of defect region localization; secondly, it enables rapid classification of defect regions, facilitating the improvement of production processes. The adaptive thresholding method eliminates the need for manual parameter setting, avoiding the lengthy debugging required by traditional algorithms. It also boasts fast execution speed and reduces the size of the image patches used for classification, further accelerating the process and resolving the slow classification speed issue inherent in deep learning-based classification algorithms.
[0173] Example 2
[0174] See Figure 6 , Figure 6 This is a schematic diagram of the terminal device structure provided in an embodiment of the present invention.
[0175] One terminal device in this embodiment includes: a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor 601. When the processor 601 executes the computer program, it implements the steps of the various lithium battery defect detection methods described above in this embodiment, for example... Figure 1 All steps of the lithium battery defect detection method shown. Alternatively, when the processor executes the computer program, it implements the functions of each module in the above-described device embodiments, for example: Figure 2 All modules of the lithium battery defect detection device shown.
[0176] In addition, embodiments of the present invention also provide a computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the lithium battery defect detection method as described in any of the above embodiments.
[0177] Those skilled in the art will understand that the schematic diagram is merely an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the diagram, or combine certain components, or different components. For example, the terminal device may also include input / output devices, network access devices, buses, etc.
[0178] The processor 601 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. The processor 601 is the control center of the terminal device, connecting various parts of the terminal device through various interfaces and lines.
[0179] The memory 602 can be used to store the computer programs and / or modules. The processor 601 implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0180] Wherein, if the modules / units integrated in the terminal device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, it can implement the steps of the various method embodiments described above. Wherein, the computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0181] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0182] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for detecting defects in lithium batteries, characterized in that, include: Acquire electrode images of the lithium battery to be tested, and perform downsampling operations on the electrode images to obtain each image to be processed; A binarization threshold is calculated based on the pixel values of each image to be processed and a preset pixel difference threshold. This calculation includes: calculating the first pixel average of each first image block, the second pixel average of each second image block, and the third pixel average of each third image block based on the pixel values of each image to be processed; summarizing all the first pixel averages, all the second pixel averages, and all the third pixel averages, arranging them in descending order to obtain a pixel average sequence; calculating the pixel average difference between pairs of adjacent pixel averages in the pixel average sequence, selecting pixel average differences less than the pixel difference threshold as target pixel average differences, and calculating the average of several target pixel average differences to obtain the binarization threshold. Binarize each of the images to be processed according to the binarization threshold to obtain a binarized image corresponding to each image to be processed. Perform upsampling and weighted fusion operations on each of the binarized images to obtain a fused image. Based on a preset segmentation threshold, regions in the fused image with pixel values greater than the segmentation threshold are segmented to determine the corresponding segmented regions of the fused image; Based on the positional relationship and size of each segmented region in the fused image, the polarimetric image is segmented to obtain images of each abnormal region of the polarimetric image. Each abnormal region image is then input into a preset classification network model so that the classification network model outputs a defect determination result corresponding to each abnormal region image. The classification network model is trained by inputting several defect images with labeled defect types into a lightweight classification network.
2. The lithium battery defect detection method according to claim 1, characterized in that, The images to be processed include: an polarimetric image, a first sampled image, and a second sampled image; the downsampling operation on the polarimetric image to obtain each image to be processed includes: The electrode image is downsampled to obtain a first sampled image corresponding to the electrode image; Perform a downsampling operation on the first sampled image to obtain a second sampled image corresponding to the first sampled image; By combining the polarimetric image, the first sampled image, and the second sampled image, each image to be processed is obtained.
3. The lithium battery defect detection method according to claim 2, characterized in that, Before calculating the binarization threshold based on the pixel values of each image to be processed and a preset pixel difference threshold, the method further includes: In the electrode image, several first image blocks of a preset size are randomly selected; Based on the positional relationship of several first image blocks in the polarimetric image, several second image blocks of preset size corresponding to the first sampled image and several third image blocks of preset size corresponding to the second sampled image are determined; wherein, the number of first image blocks, the number of second image blocks and the number of third image blocks are the same.
4. The lithium battery defect detection method according to claim 2, characterized in that, The step of performing upsampling and weighted fusion operations on each of the binarized images to obtain a fused image includes: Upsample the binarized image corresponding to the first sampled image to obtain the first upsampled binarized image; The binarized image corresponding to the second sampled image is upsampled to obtain the second upsampled binarized image; The binarized image corresponding to the pole image, the first upsampled binarized image, and the second upsampled binarized image are substituted into a preset weighting formula for weighted fusion to obtain a fused image; wherein the binarized image corresponding to the pole image, the first upsampled binarized image, and the second upsampled binarized image have the same size; the weighting formula is as follows: In the formula, To merge images, This is the binarized image corresponding to the polarimetric image. For the first upsampled binarized image, This is the second upsampled binarized image. , and The weighting is the preset weight.
5. The lithium battery defect detection method according to claim 3, characterized in that, The step of segmenting regions in the fused image with pixel values greater than a preset segmentation threshold, and determining the corresponding segmented regions of the fused image, includes: In the fused image, regions with pixel values greater than a preset segmentation threshold are selected as target regions using a preset segmentation formula; wherein, the segmentation formula is specifically: In the formula, An image composed of various target regions. The segmentation threshold; Based on the leftmost, rightmost, topmost, and bottommost pixels of each target region, a rectangular region corresponding to each target region is determined, and each of these rectangular regions is used as a segmentation region of the fused image.
6. The lithium battery defect detection method according to claim 3, characterized in that, The defect determination result includes: normal regions, defective regions, and the defect type corresponding to the defective regions; after the classification network model outputs the defect determination result corresponding to each abnormal region image, it includes: For each defect determination result, the following steps are performed: if it is a normal area, the abnormal area image corresponding to the normal area is marked as a normal image using a marking machine; if it is a defective area, the abnormal area image corresponding to the defective area is recorded, and the defect type corresponding to the defective area is marked on the abnormal area image corresponding to the defective area using the marking machine.
7. The lithium battery defect detection method according to claim 1, characterized in that, Before acquiring the electrode image of the lithium battery to be tested, the method further includes: Receive pulse signal data transmitted by a position encoder, and calculate the moving distance of the lithium battery under test based on the pulse signal data; When the moving distance is greater than or equal to the distance threshold, the linear array camera is controlled to take pictures of the electrode of the lithium battery to be detected, so that the linear array camera can transmit the acquired electrode image.
8. A lithium battery defect detection device, characterized in that, include: The module includes a data acquisition module, a data calculation module, a binarization module, a segmentation module, and a data judgment module. The data acquisition module is used to acquire electrode images of the lithium battery to be tested, and to perform downsampling operations on the electrode images to obtain each image to be processed. The data calculation module is used to calculate a binarization threshold based on the pixel values of each image to be processed and a preset pixel difference threshold. The calculation of the binarization threshold based on the pixel values of each image to be processed and the preset pixel difference threshold includes: calculating the first pixel average value of each first image block, the second pixel average value of each second image block, and the third pixel average value of each third image block based on the pixel values of each image to be processed; summarizing all the first pixel average values, all the second pixel average values, and all the third pixel average values, arranging them in descending order to obtain a pixel average value sequence; calculating the pixel average difference between the average values of any two adjacent pixels in the pixel average value sequence, selecting the pixel average difference less than the pixel difference threshold as the target pixel average difference, and calculating the average of several target pixel average differences to obtain the binarization threshold. The binarization module is used to binarize each of the images to be processed according to the binarization threshold to obtain a binarized image corresponding to each of the images to be processed, and to perform upsampling and weighted fusion operations on each of the binarized images to obtain a fused image. The segmentation module is used to segment regions in the fused image whose pixel values are greater than the preset segmentation threshold according to the preset segmentation threshold, and to determine the segmentation regions corresponding to the fused image. The data judgment module is used to segment the polarimetric image according to the positional relationship and size of each segmented region in the fused image, obtain images of each abnormal region of the polarimetric image, and input each abnormal region image into a preset classification network model so that the classification network model outputs the defect judgment result corresponding to each abnormal region image; wherein, the classification network model is obtained by training a lightweight classification network by inputting several defect images with labeled defect types.
9. A lithium battery defect detection system, characterized in that, include: The system comprises a lithium battery to be tested, a lithium battery defect detection device, a conveyor belt, a first light source, a second light source, a first line array camera, a second line array camera, a position encoder, and a marking machine; the lithium battery defect detection device applies the lithium battery defect detection method as described in any one of claims 1 to 7; the lithium battery to be tested is located on the upper surface of the conveyor belt; The lithium battery defect detection device is connected to the first light source, the second light source, the first line scan camera, the second line scan camera, the position encoder, and the marking machine, respectively; the marking machine, the first light source, and the first line scan camera are located above the conveyor belt; the second light source and the second line scan camera are located below the conveyor belt; and the position encoder is located inside the conveyor belt.
Citation Information
Patent Citations
Battery coating defect detection method and device and storage medium
CN113592845A