Cylindrical battery end face quality detection method
By combining image processing and deep learning technology, the use of fast template matching, blob analysis and improved YOLOV8 model is solved, and the problem of difficulty in detecting end face defects of complex lithium batteries in the prior art is achieved, achieving high accuracy and robust detection effects.
Patent Information
- Application Number
- CN202510179011.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art is difficult to effectively detect defects in the end faces of complex lithium batteries, resulting in missed detection and misjudgment, and cannot meet the needs of modern industry.
Combining image processing and deep learning technology, multi-step detection is carried out through rapid template matching, blob analysis, circle fitting differential processing and improved model based on YOLOV8 to achieve accurate detection of end face defects of complex battery.
It significantly improves the accuracy of multiple inspection items during the inspection process, enhances the accuracy and robustness of inspection, and is suitable for complex battery end surfaces.
Smart Images

Figure CN120107205A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of lithium battery manufacturing, and in particular to a method for detecting the end surface quality of a cylindrical battery. Background Art
[0002] With the rapid rise of lithium battery new energy vehicles, energy storage devices and portable electronic products, cylindrical batteries have become the mainstream products in the lithium battery market due to their high energy density, stable performance and low manufacturing cost. However, the manufacturing process of lithium batteries is complex and requires extremely high precision. Especially in the battery winding process, whether the end surface of the tab after flattening is qualified will directly affect the subsequent process, and then affect the performance, service life and safety of the battery.
[0003] During the manufacturing process of lithium batteries, the tabs extend from the pole pieces to connect the battery to the external circuit. After the winding process, the battery forms a cylindrical structure, and the tabs usually need to be cut and flattened to ensure good contact with the battery's external shell. However, during this process, the tabs and end faces may have the following major defects:
[0004] (1) End face cracking: severe structural damage to the end face due to mechanical pressure or improper processing.
[0005] (2) Tab folding: Tabs may fold during the flattening process, causing them to protrude from the battery end face, thereby affecting the contact quality with the battery casing. In severe cases, this may even cause electrical failures.
[0006] (3) Internal folding: The tabs are not properly aligned during the winding and flattening process, resulting in local folding during the stacking process, which leads to a decrease in the electrical performance of the battery and even causes safety hazards.
[0007] (4) Internal wrinkles: Due to insufficient material tension or process problems, local ear wrinkles appear and cannot remain flat, resulting in black areas.
[0008] (5) The distance between the tab and the battery cell is too large: During the stacking process of the tab layer and the battery cell, the tab layer is not properly aligned or shifted during laying, causing the distance between the tab layer and the internal battery cell to be too large, which can easily lead to unstable electrical performance.
[0009] Traditional detection methods often use manual sampling, rely on the operator's experience, and are easily affected by personal emotions, fatigue and other factors, resulting in excessive subjectivity and poor stability, which cannot meet the needs of modern industry. On fully automated production lines, machine vision-based methods are often used for real-time detection. For example, scholar Guo Shaotao proposed a method based on machine vision combined with a simple BP neural network to complete the detection task of lithium battery end face pits in the article "Detection Method of End Face Defects of Cylindrical Lithium Batteries" (Journal of Scientific Instrumentation, 2022, 43(03): 230-239. DOI: 10.19650 / j.cnki.c jsi.J2109094.), but this method is only applicable to relatively simple battery end faces and has poor adaptability to complex battery end face situations. At present, there is still no more reliable detection method on the market. They mostly rely on traditional image algorithm detection schemes, which are prone to missed detection and misjudgment. Summary of the invention
[0010] In order to overcome or alleviate one or more of the above technical problems, the purpose of the present invention is to provide a cylindrical battery end face quality inspection method, which combines image processing and deep learning technology, is suitable for complex battery end face conditions, and greatly improves the accuracy of multiple inspection items during the inspection process.
[0011] The present invention provides the following technical solutions:
[0012] A method for detecting the end surface quality of a cylindrical battery comprises the following steps in sequence:
[0013] S0: Collect images, collect the end face image of the cylindrical battery to be tested, and enter S1 after obtaining the initial image;
[0014] S1: Determine whether the end face is cracked by fast template matching. The fast template is selected from the cross-correlation template. If it is determined that there is no obvious abnormal image on the end face, enter S2, otherwise it is directly determined to be bad;
[0015] S2: Detection of the distance between the tab and the cell. According to the image with no obvious abnormality on the end face, the distance between the tab and the cell is detected by Blob analysis. If the area of the central area of the cell is less than or equal to the set area threshold α, or the ratio of the major and minor axis radii of the area is less than or equal to 2, it means that the distance between the tab and the cell is qualified, and the process goes to S3. Otherwise, it is judged that the distance between the tab and the cell is too large and is judged as defective.
[0016] S3: Tab eversion detection: Based on the battery end face area segmented in S2, the approximate standard end face area is obtained by circle fitting and the actual area is subjected to differential processing. Then, feature screening is performed to determine whether the area of each small area after the difference is less than the area threshold β. If so, there is no eversion area, and S4 is entered. Otherwise, there is an eversion area, and it is judged as defective.
[0017] S4: Internal fold and wrinkle detection based on deep learning, the backbone network of YOLOV8 is replaced by the RepViT module, the Neck part is designed as a CCFM structure, and the improved YOLOV8 is pruned to obtain the final improved model; the initial image is input into the final improved model, if the segmented defect area is obtained, the area of the segmented defect area is calculated and compared with the threshold γ, and those exceeding the threshold γ are defective. The clustering algorithm is used to determine whether the remaining defects are internal fold and wrinkle clusters to obtain the final detection result.
[0018] According to some embodiments, step S1 specifically comprises the following steps:
[0019] S11: construct a standard end face sample library, using standard battery end face morphology images as templates;
[0020] S12: reading the end face image of the cylindrical battery to be tested acquired in step S1;
[0021] S13: performing a cross-correlation operation on the collected battery end face image and the standard template image. The cross-correlation operation is to match the image to be detected with the template image point by point, and calculate the similarity of each pixel point through formula 1 to generate a matching score:
[0022]
[0023] Where T(i,j) is the pixel value of the template image, i,j are the coordinate positions in the template image, I(x+i,y+j) is the pixel value of the image to be detected at the coordinate (x+i,y+j), and C(x,y) is the cross-correlation coefficient at the position (x,y);
[0024] S14: Setting a matching threshold. When the correlation coefficient is higher than the matching threshold, it means that the end face of the battery cell on the image to be detected is close to the standard template, the battery end face is normal, and the process goes to S2. Otherwise, it means that the end face is greatly deformed and cannot be matched to the target, and is judged as bad.
[0025] According to some embodiments, step S2 specifically comprises the following steps:
[0026] S21: inputting the end surface image without obvious abnormality outputted in step S1;
[0027] S22 splits the color image into R, G, and B single-channel images;
[0028] S23: Select the B channel image for Blob analysis, using the interval threshold segmentation method, see formula 2:
[0029]
[0030] I(x,y) is the pixel value at the position (x,y) of the image to be detected, and the battery end face in the image is separated from the background; then, the Blob area of the battery end face is detected based on connectivity; based on the results of Blob analysis, the ROI area of the battery end face is extracted; the extracted end face area is once again subjected to threshold segmentation;
[0031] S24: feature extraction and calculation, performing area calculation on the battery cell center region obtained after the second threshold segmentation, calculating the number of pixels in the "battery cell center" region in the binary image, the sum of these pixels is the area of the region; setting the area threshold α, the unit is pixel;
[0032] S25: If the calculated area of the center area of the battery cell is less than or equal to the area threshold α, in pixels, or the ratio of the major and minor axis radii of the area is less than or equal to 2, it means that the spacing between the tab and the battery cell is qualified, and jump to S3; otherwise, it is judged that the spacing between the tab and the battery cell is too large, and it is determined to be NG.
[0033] According to some embodiments, the area threshold α is set to 52000 pixels.
[0034] According to some embodiments, step S3 specifically comprises the following steps:
[0035] S31: In step S2, the battery end face is segmented for the first time using the threshold value, and a set of pixel points at the contour boundary of the battery end face is extracted to obtain an extracted contour;
[0036] S32: performing circle fitting on the extracted contour, where the fitted circle represents the battery end face area where there is no tab eversion under ideal conditions;
[0037] S33: performing a differential operation on the fitted circle region and the actual end face region to obtain a differential region;
[0038] S34: The tabs on the turned-out end face are mostly rectangular in shape. After the differential area is connected by domain operation, feature screening is performed on each small area to determine whether the area of each small area after differentiation is less than the area threshold β, in pixels. If so, enter S4; if not, the area is the tab turned-out area, and the product is judged to be defective.
[0039] According to some embodiments, the area threshold β is 300 pixels.
[0040] According to some embodiments, step S4 specifically comprises the following steps:
[0041] S41: After training the improved YOLOV8 model, input the image to be detected;
[0042] S42: The improved model will segment the suspected defect area;
[0043] S43: Determine whether a defective area is segmented in step S42, if so, proceed to S44, if not, the product is qualified;
[0044] S44: Calculate the area of the segmented defective area. If the area pixels of a single area exceed the set threshold γ, it is directly judged as defective;
[0045] S45: If the area of each region is lower than the threshold value γ, a clustering algorithm is used to determine whether these regions appear in clusters. If so, the product is judged as defective; if not, the product is qualified.
[0046] According to some embodiments, the clustering algorithm in step S45 is selected from the DBSCAN clustering algorithm.
[0047] According to some embodiments, the improved YOLOV8 model backbone described in step S41 is pruned, and the pruning operation includes the following steps:
[0048] 1) First, evaluate the importance of the weight. This scheme uses the L1 norm as the importance metric. For the weight W of each layer of the backbone, calculate its L1 norm, where i is the index of a single weight:
[0049]
[0050] 2) Smaller weights have less impact on the output and are suitable for pruning. The global pruning threshold P is set to 0.2, and the weight thresholds of all layers are sorted to find the pruning threshold T, which is the percentile of the weight and is used to determine the boundary of pruning.
[0051] 3) For each layer of weight W, the pruning decision is:
[0052]
[0053] W′ is the weight after pruning, and the weight below the threshold is set to zero;
[0054] 4) After pruning, the model recovers performance by fine-tuning the learning rate. The loss function L during fine-tuning is expressed as
[0055] L=L YOLO +λR(W) (5)
[0056] L YOLO is the target detection task loss, and R(W) is the regularization term.
[0057] According to some embodiments, in step S0, a dual-light source collaborative lighting technology is used in combination with a glass cover flattening device to achieve uniform and efficient imaging of the battery end surface.
[0058] Compared with the prior art, the present invention has the following beneficial effects:
[0059] 1. Traditional methods often rely on manually designed feature extraction, which is easily affected by external factors such as image noise and illumination changes, resulting in misjudgment or missed judgment. The cylindrical battery end face quality inspection method provided by the present invention combines deep learning with traditional methods, automatically learns complex features through deep learning, and effectively improves the accuracy and robustness of defect detection.
[0060] 2. The detection method provided by the present invention replaces the backbone network of YOLOV8 with the RepViT module, designs the Neck part into a CCFM structure, and prunes the improved YOLOV8, thereby improving the traditional YOLOV8 model, reducing the amount of calculation, and speeding up the detection speed.
[0061] 3. The detection method provided by the present invention opens multiple parameter thresholds such as area and field radius, which can be flexibly adjusted according to actual task requirements and has strong portability. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 A schematic structural diagram of a cylindrical battery end face collection system provided in an embodiment of the present invention.
[0063] Figure 2 A flow chart of a cylindrical battery end surface quality detection method provided in an embodiment of the present invention.
[0064] Figure 3 A flow chart of end face crack detection provided by an embodiment of the present invention.
[0065] Figure 4 A flowchart of the tab-cell spacing detection provided in an embodiment of the present invention.
[0066] Figure 5 A flowchart of tab eversion detection provided in an embodiment of the present invention.
[0067] Figure 6 This is a structural diagram of the improved YOLOv8 model provided by an embodiment of the present invention.
[0068] Figure 7 A flow chart of internal fold and wrinkle detection based on deep learning provided in an embodiment of the present invention.
[0069] Figure 8 This is a defect detection effect diagram provided by an embodiment of the present invention.
[0070] In the figure:
[0071] Cylindrical battery 1; optical glass cover 2; spherical integrating light source 3; coaxial light source 4; lens 5; camera 6. DETAILED DESCRIPTION
[0072] The present invention is described in detail below in conjunction with the embodiments and drawings, but it should be understood that the embodiments and drawings are only used to exemplify the present invention and do not constitute any limitation on the protection scope of the present invention. All reasonable changes and combinations within the scope of the inventive concept of the present invention fall within the protection scope of the present invention.
[0073] The present invention will be further described below in conjunction with the accompanying drawings.
[0074] Example 1
[0075] like Figure 1 This embodiment provides a cylindrical battery end face acquisition system, hereinafter referred to as the acquisition system. A dual light source combined imaging solution is adopted, and the structure of the acquisition system is as follows:
[0076] The acquisition system includes two bilaterally symmetrical optical glass cover plates 2, two spherical integrating light sources 3, two coaxial light sources 4, two sets of cameras 6 and lenses 5, which are respectively assembled on the positive and negative sides of the cylindrical battery 1 to be tested for photo detection.
[0077] First, a high-transmittance optical glass cover plate 2 is used to apply slight pressure to the end face of the cylindrical battery 1 to flatten the pole ear of the battery end face, ensuring that a uniform and interference-free image is obtained in subsequent image acquisition. A spherical integral light source 3 is used as the main light source and installed on the outer side of the optical glass cover plate 2. It is connected to the optical glass cover plate 2 through a fixed frame and fixed in position to ensure that the entire battery end face is in the light field where the two light sources work together. A hole is left at the top of the spherical integral light source 3, and the coaxial light source 4 is installed as an auxiliary light source in the center of the spherical integral light source 3. The light enters through the hole, so that the light of the coaxial light source 4 enters the detection area coaxially with the optical axis of the camera 6. The synchronous triggering and adjustment of the light source and the camera 6 are realized by the industrial computer. Each time a photo is taken, the spherical integral light source 3 and the coaxial light source 4 work simultaneously to ensure the uniformity of the light and the clarity of the image, and reduce the impact of the reflection of the lithium battery end face. Through this acquisition system, high-quality battery end face images can be acquired, which is convenient for subsequent algorithm detection and analysis.
[0078] This embodiment also provides a method for detecting the end surface quality of a cylindrical battery, which comprises the following steps in sequence:
[0079] S0: First, use the cylindrical battery end face acquisition system provided in this embodiment to acquire an image of the end face of the cylindrical battery to be measured;
[0080] S1: Rapid template matching to determine whether the end face is cracked:
[0081] End face cracking means that a large area of damage occurs on the surface of the battery cell, which will directly cause the cylindrical battery 1 to be scrapped. In this embodiment, the first step in the detection process is to determine whether the end face is normal. If it is normal, it will enter the subsequent detection stage, otherwise it will be directly judged as bad (NG). In this embodiment, cross-correlation template matching is used to quickly screen unqualified end faces. Specifically, Figure 3 , S11: Before testing, build a standard end face sample library, in which the standard battery end face morphology image is used as a template; S12: Read the collected cylindrical battery end face image to be tested; S13: During the testing process, the collected battery end face image and the standard template image are cross-correlated. The cross-correlation process is to match the image to be tested with the template image point by point, and calculate the similarity of each pixel point through formula 1 to generate a matching score:
[0082]
[0083] Where T(i,j) is the pixel value of the template image, i,j are the coordinate positions in the template image, I(x+i,y+j) is the pixel value of the image to be detected at the coordinate (x+i,y+j), and C(x,y) is the cross-correlation coefficient at the position (x,y);
[0084] S14: Set a matching threshold of 0.6. When the correlation coefficient is higher than 0.6, it means that the end face of the battery cell on the image to be tested is close to the standard template. At this time, the end face of the battery cell is normal and the subsequent test is continued. Otherwise, it means that the end face is greatly deformed and cannot be matched to the target, and it is directly judged as NG.
[0085] S2: Tab-cell distance detection:
[0086] After the above-mentioned quick matching, the image with no obvious abnormality on the end face is used to detect the distance between the tab and the battery cell. Figure 4 , S21: Input the end face image without obvious abnormality output by step S1, S22 splits the color image into R, G, B single channel images; S23: Select the B channel image for Blob analysis, use the interval threshold segmentation method, see formula (2), to separate the battery end face in the image from the background. Then, the Blob area of the battery end face is detected based on connectivity. Based on the results of the Blob analysis, the ROI area of the battery end face is extracted. The extracted end face area is threshold segmented again.
[0087]
[0088] I(x,y) is the pixel value of the image to be detected at the position (x,y). Since the grayscale values of the central battery cell part and the part not covered by the lug on the battery end face are usually low, while the grayscale value of the part covered by the lug is high, the difference in grayscale values can be used to distinguish the lug part from the battery cell part. This area represents the part of the battery cell not covered by the lug. S24: Feature extraction and calculation, the area of the battery cell center area obtained after the second threshold segmentation is calculated. Specifically, the number of pixels in the "battery cell center" area in the binary image is calculated, and the sum of these pixels is the area of the area. At this time, it is necessary to set an area threshold α (in this embodiment, α is set to 52000 pixels). This value is the average value obtained by statistically analyzing a large number of test samples of normal batteries, and needs to be dynamically adjusted according to the installation distance of the camera and the size of the battery. S25: If the calculated area of the center region of the battery cell is less than or equal to the set threshold, or the ratio of the major and minor axis radii of the region is less than or equal to 2, it means that the spacing between the tab and the battery cell is qualified, and jump to S3; otherwise, it is judged that the spacing between the tab and the battery cell is too large and is determined to be NG.
[0089] S3: Detection method of tab eversion:
[0090] like Figure 5 , S31: Use the threshold value to segment the battery end face for the first time in step S2, and extract the contour boundary pixel point set of the battery end face; S32: Perform circle fitting on the extracted contour, and the fitted circle represents the battery end face area where there is no tab eversion under ideal circumstances; S33: Differentiate the fitted circle area with the actual end face area to obtain the differential area; S34: The tabs of the turned-out end face are mostly rectangular. After the differential area is connected to the domain, feature screening is performed on each small area to determine whether the area of each small area after the difference is less than the area threshold β (in this embodiment, β is set to 300 pixels). β needs to be dynamically adjusted according to the installation distance of the camera and the size of the battery. If so, enter the internal folding and wrinkle detection process and jump to step S4; if not, the area is the tab eversion area, and the product is judged as NG.
[0091] S4: Internal fold and wrinkle detection based on deep learning:
[0092] Inside the end face of the cylindrical battery, since the tabs form a complex "scale-like" structure during the stacking process, traditional image processing algorithms such as edge detection and morphological operations are easily disturbed by these complex textures, making it difficult to accurately identify and segment internal defects. Therefore, the deep learning YOLOV8 algorithm is used for detection. The YOLOV8 model can effectively learn the characteristics of defects and adaptively identify defective areas without complex preprocessing steps. However, the backbone network design of YOLOv8 is relatively general and may not be able to fully capture tiny features in complex structures, resulting in reduced detection accuracy. In industrial environments, efficiency requirements are extremely high, so this embodiment improves the model. The specific improvement method is as follows:
[0093] (1) The traditional YOLOV8 backbone network is replaced with the RepViT module. The RepViT module can better capture the global context information in the image and adopt lightweight re-parameterization technology in the inference stage, which greatly reduces the amount of calculation and improves the detection efficiency.
[0094] (2) The Neck part of the model is designed as a CCFM (Cross-Scale Feature Fusion Module) structure. By lightweight fusion of features of different scales, the model's ability to capture multi-scale defect features is enhanced, thereby increasing detection accuracy.
[0095] (3) In order to further increase the detection efficiency, appropriate pruning operations are performed on the main part of the improved YOLOV8 model to remove branches that have little contribution to the model:
[0096] 1) First, evaluate the importance of the weights. This scheme uses the L1 norm as the importance metric. For the weight W of each layer of the backbone, calculate its L1 norm, where i is the index of a single weight:
[0097]
[0098] 2) Smaller weights have less impact on the output and are suitable for pruning. The global pruning threshold P is set to 0.2, and the weight thresholds of all layers are sorted to find the pruning threshold T, where T is the percentile of the weight and is used to determine the boundary of pruning.
[0099] 3) For each layer of weight W, the pruning decision is:
[0100]
[0101] W′ is the weight after pruning, and the weight below the threshold is set to zero;
[0102] 4) After pruning, the model recovers performance by fine-tuning the learning rate. The loss function L during fine-tuning is expressed as
[0103] L=L YOLO +λR(W) (5)
[0104] L YOLO is the target detection task loss, and R(W) is the regularization term. The pruned model can reduce latency during reasoning. The specific improved model structure diagram is shown in Figure 6 .
[0105] like Figure 7 , step S4 of this embodiment is specifically the following steps:
[0106] S41: After training the improved YOLOV8 model, input the image to be detected;
[0107] S42: The improved model will segment the suspected defect area;
[0108] S43: Determine whether a defective area is segmented in step S42, if yes, proceed to S44 for further determination, if no, the product has no internal folding defect;
[0109] S44: further calculating the area of the segmented defective area. If the area pixels of a single area exceed a set threshold value γ (γ=500 in this embodiment, γ needs to be dynamically adjusted according to the installation distance of the camera and the size of the battery), it is directly determined as NG;
[0110] S45: If the area of each region is lower than the threshold γ, the DBSCAN clustering algorithm is used to determine whether these regions appear in clusters. A single or small amount of folds and wrinkles will not significantly weaken the mechanical strength of the battery in structure, especially when they are evenly distributed and not concentrated in key areas. They usually do not have a significant negative effect on battery performance, so this situation is not judged as NG. However, when multiple wrinkle defects appear densely in a certain area of the battery, a clustering effect may be triggered, causing local uneven heat dissipation. We need to perform cluster analysis on the detected internal defects. This embodiment uses the DBSCAN clustering algorithm, and the specific steps are as follows:
[0111] 1) Calculate the centroid (x_i, y_i) of each defect area, which will be used as input data for clustering;
[0112] 2) Set the neighborhood radius ∈ to θ (θ is set to 200 in the present invention), θ needs to be dynamically adjusted according to the installation distance of the camera and the size of the battery. Set the minimum number of samples to 3;
[0113] 3) Perform DBSCAN clustering to group the areas with densely distributed centroids into one cluster;
[0114] 4) Count the number of defects in each cluster. If the number of defects in a cluster exceeds the set threshold of 4, the product is judged as NG.
[0115] Through the above steps S1 to S4, all defect types of the end faces of cylindrical batteries can be identified, and more comprehensive and accurate quality inspection of cylindrical batteries can be performed.
[0116] like Figure 8 .a is the ear eversion. Figure 8 .b is end face cracking, Figure 8 .c The distance between the tab and the cell is too large. Figure 8 .d Internal fold, Figure 8 All are judged as NG.
[0117] The above embodiments are only preferred implementations of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A cylindrical battery end surface quality detection method, characterized in that: The following steps are included in sequence: S0: Collect images, collect the end face image of the cylindrical battery to be tested, and enter S1 after obtaining the initial image; S1: Determine whether the end face is cracked by fast template matching. The fast template is selected from the cross-correlation template. If it is determined that there is no obvious abnormal image on the end face, enter S2, otherwise it is directly determined to be bad; S2: Detection of the distance between the tab and the cell. According to the image with no obvious abnormality on the end face, the distance between the tab and the cell is detected by Blob analysis. If the area of the central area of the cell is less than or equal to the set area threshold α, or the ratio of the major and minor axis radii of the area is less than or equal to 2, it means that the distance between the tab and the cell is qualified, and the process goes to S3. Otherwise, it is judged that the distance between the tab and the cell is too large and is judged as defective. S3: Tab eversion detection: Based on the battery end face area segmented in S2, the approximate standard end face area is obtained by circle fitting and the actual area is subjected to differential processing. Then, feature screening is performed to determine whether the area of each small area after the difference is less than the area threshold β. If so, there is no eversion area, and S4 is entered. Otherwise, there is an eversion area, and it is judged as defective. S4: Internal fold and wrinkle detection based on deep learning, the backbone network of YOLOV8 is replaced by the RepViT module, the Neck part is designed as a CCFM structure, and the improved YOLOV8 is pruned to obtain the final improved model; the initial image is input into the final improved model, if the segmented defect area is obtained, the area of the segmented defect area is calculated and compared with the threshold γ, and those exceeding the threshold γ are defective. The clustering algorithm is used to determine whether the remaining defects are internal fold and wrinkle clusters to obtain the final detection result.
2. The cylindrical battery end surface quality detection method according to claim 1, characterized in that: Step S1 specifically includes the following steps: S11: construct a standard end face sample library, using standard battery end face morphology images as templates; S12: reading the end face image of the cylindrical battery to be tested acquired in step S1; S13: performing a cross-correlation operation on the collected battery end face image and the standard template image. The cross-correlation operation is to match the image to be detected with the template image point by point, and calculate the similarity of each pixel point through formula 1 to generate a matching score: Where T(i,j) is the pixel value of the template image, i,j are the coordinate positions in the template image, I(x+i,y+j) is the pixel value of the image to be detected at the coordinate (x+i,y+j), and C(x,y) is the cross-correlation coefficient at the position (x,y); S14: Setting a matching threshold. When the correlation coefficient is higher than the matching threshold, it means that the end face of the battery cell on the image to be detected is close to the standard template, the battery end face is normal, and the process goes to S2. Otherwise, it means that the end face is greatly deformed and cannot be matched to the target, and is judged as bad.
3. The cylindrical battery end surface quality detection method according to claim 2, characterized in that: Step S2 specifically includes the following steps: S21: inputting the end surface image without obvious abnormality outputted in step S1; S22: split the color image into R, G, B single channel images; S23: Select the B channel image for Blob analysis, using the interval threshold segmentation method, see formula 2: I(x,y) is the pixel value at the position (x,y) of the image to be detected, and the battery end face in the image is separated from the background; then, the Blob area of the battery end face is detected based on connectivity; based on the results of Blob analysis, the ROI area of the battery end face is extracted; the extracted end face area is once again subjected to threshold segmentation; S24: feature extraction and calculation, performing area calculation on the cell center region obtained after the second threshold segmentation, calculating the number of pixels in the "cell center" region in the binary image, the sum of these pixels is the area of the region; setting the area threshold α, the unit is pixel; S25: If the calculated area of the center area of the battery cell is less than or equal to the area threshold α, in pixels, or the ratio of the major and minor axis radii of the area is less than or equal to 2, it means that the spacing between the tab and the battery cell is qualified, and jump to S3; otherwise, it is judged that the spacing between the tab and the battery cell is too large, and it is determined to be NG.
4. The cylindrical battery end surface quality detection method according to claim 3, characterized in that: The area threshold α is set to 52000 pixels.
5. The cylindrical battery end surface quality detection method according to claim 3, characterized in that: Step S3 specifically includes the following steps: S31: In step S2, the battery end face is segmented for the first time using the threshold value, and a set of pixel points at the contour boundary of the battery end face is extracted to obtain an extracted contour; S32: performing circle fitting on the extracted contour, where the fitted circle represents the battery end face area where there is no tab eversion under ideal conditions; S33: performing a differential operation on the fitted circle region and the actual end face region to obtain a differential region; S34: The tabs on the turned-out end face are mostly rectangular in shape. After the differential area is connected by domain operation, feature screening is performed on each small area to determine whether the area of each small area after differentiation is less than the area threshold β, in pixels. If so, enter S4; if not, the area is the tab turned-out area, and the product is judged to be defective.
6. The cylindrical battery end surface quality detection method according to claim 5, characterized in that: The area threshold β is set to 300 pixels.
7. The cylindrical battery end surface quality detection method according to claim 5, characterized in that: Step S4 specifically includes the following steps: S41: After training the improved YOLOV8 model, input the image to be detected; S42: The improved model will segment the suspected defect area; S43: Determine whether a defective area is segmented in step S42, if so, proceed to S44, if not, the product is qualified; S44: Calculate the area of the segmented defective area. If the area pixels of a single area exceed the set threshold γ, it is directly judged as defective; S45: If the area of each region is lower than the threshold value γ, a clustering algorithm is used to determine whether these regions appear in clusters. If so, the product is judged as defective; if not, the product is qualified.
8. The cylindrical battery end surface quality detection method according to claim 7, characterized in that: The clustering algorithm in step S45 is selected from the DBSCAN clustering algorithm.
9. The cylindrical battery end surface quality detection method according to claim 7, characterized in that: The improved YOLOV8 model backbone described in step S41 is pruned, and the pruning operation includes the following steps: 1) First, evaluate the importance of the weight. This scheme uses the L1 norm as the importance metric. For the weight W of each layer of the backbone, calculate its L1 norm, where i is the index of a single weight: 2) Smaller weights have less impact on the output and are suitable for pruning. The global pruning threshold P is set to 0.2, and the weight thresholds of all layers are sorted to find the pruning threshold T, which is the percentile of the weight and is used to determine the boundary of pruning. 3) For each layer of weight W, the pruning decision is: W′ is the weight after pruning, and the weight below the threshold is set to zero; 4) After pruning, the model recovers performance by fine-tuning the learning rate. The loss function L during fine-tuning is expressed as L=L YOLO +λR(W) (5) L YOLO is the target detection task loss, and R(W) is the regularization term.
10. The cylindrical battery end surface quality inspection method according to any one of claims 1 to 9, characterized in that: In step S0, dual light source collaborative lighting technology is used in combination with a glass cover flattening device to achieve uniform and efficient imaging of the battery end face.
Citation Information
Cited By
Detection method of cylindrical battery double current collecting discs, electronic equipment and storage medium
CN120765584A