A machine vision-based lithium battery shell defect detection method

By combining depth and 2D images with AI segmentation and 3D point cloud data, a machine vision-based method for detecting defects in lithium battery casings was developed. This method solves the problem of multi-region detection in lithium battery casings and achieves efficient and accurate defect identification and classification.

CN121169917BActive Publication Date: 2026-03-27XIAMEN WEIYA INTELLIGENT TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing lithium battery casing defect detection technologies suffer from problems such as numerous detection areas, difficulty in comprehensive and detailed manual inspection, limited detection speed, insufficient equipment reusability, difficulty in compatibility with multiple models, and inaccurate defect judgment.

Method used

A machine vision-based approach is used to acquire depth and 2D images of the lithium battery casing. By combining an AI segmentation model and 3D point cloud data, a dynamic defect threshold is calculated by combining local texture features and depth distance features, and an AI classification model is used to identify the defect type.

Benefits of technology

It enables comprehensive, efficient, and accurate defect detection of lithium battery casings, improving detection efficiency and accuracy. It can adapt to product surface deformation, reduce misjudgments, and improve product yield.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121169917B_ABST
    Figure CN121169917B_ABST
Patent Text Reader

Abstract

The application discloses a lithium battery shell defect detection method based on machine vision, relates to general image processing or recognition fields, and adopts different technical routes for different regions of a lithium battery to be detected; in defect detection of a pole region, a ring segmentation and texture-distance fusion algorithm is used for the pole region of a top cover, interference of reflection and rough surfaces can be effectively inhibited, and pits, scratches and the like on the pole can be accurately captured; in detection of a shell and a top patch region, an LVAR thought of an image is applied to a point cloud curvature detection method, a dynamic detection threshold is automatically calculated, a threshold definition problem influenced by product deformation is solved, the detection method can adapt to surface deformation of the product itself, and real defects can be effectively separated.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the general image processing or recognition field, and in particular to a lithium battery shell defect detection method based on machine vision. BACKGROUND

[0002] At present, the lithium battery shell defect detection technology mainly faces the following difficulties and challenges: first, the lithium battery needs to implement appearance detection in many areas, covering two large faces, two narrow faces, a bottom face, a top patch area of the top face, and two pole columns. The detection area is numerous and the overall size is large, which makes it difficult for manual visual inspection to observe in detail, and is prone to over-inspection and missed inspection, with high detection risk. At the same time, the speed of manual detection is limited, which is difficult to meet the production line rhythm requirements, and restricts the improvement of overall production efficiency. Secondly, the traditional visual-based detection method has certain limitations. At present, industrial cameras combined with image processing algorithms are mainly used for defect recognition, but due to the diversity of lithium battery product models and significant size differences, a single 2D vision system cannot realize multi-model compatible detection, and the equipment reuse and adaptability are insufficient. In addition, the conventional 2D image cannot obtain the height and depth information of the defect, which affects the accurate judgment of three-dimensional features such as concave-convex and scratches, thereby reducing the accuracy of defect classification and specification evaluation. SUMMARY

[0003] The purpose of the present application is to provide a lithium battery shell defect detection method based on machine vision, which aims to overcome the above-mentioned problems existing in the prior art.

[0004] To achieve the purpose, the present application provides the following technical scheme:

[0005] A lithium battery shell defect detection method based on machine vision, comprising the following steps:

[0006] Step S100: Obtain the depth image and two-dimensional image of all shell surfaces of the lithium battery to be detected; wherein all shell surfaces include the outer surface of the top cover and the outer surface of the shell.

[0007] Step S200: segment the top patch area and the pole column area from the top cover depth image through an AI segmentation model to obtain the top patch area depth image and the pole column area depth image; for the pole column area, calculate the local texture feature and depth distance feature of the pole column area depth image; and obtain the first defect set of the pole column area by combining the texture feature and the depth distance feature.

[0008] Step S300: For the shell depth image and the top patch region depth image, the standard deviation, the mean value of the point cloud global curvature, and the neighborhood curvature standard deviation, the mean value of each point are calculated based on the three-dimensional point cloud data, and the dynamic defect threshold is calculated accordingly, the defect point cloud is extracted, and the second defect set of the shell and the top patch region is obtained; according to the second defect set, the region image is intercepted in the shell two-dimensional image and the top patch region two-dimensional image, and the AI classification model is used to identify the defect type.

[0009] Further, in the step S200, for the pole region, the local texture feature and the depth distance feature of the pole region depth image are calculated; the first defect set of the pole region is obtained by combining the local texture feature and the depth distance feature, specifically including the following sub-steps:

[0010] Step S201: The pole region depth image of the qualified lithium battery is pre-stored, and the local texture feature value, i.e., the standard local texture feature value, is calculated based on the three-dimensional point cloud data.

[0011] Step S202: The neighborhood curvature and the neighborhood normal vector of each point in the pole region point cloud of the lithium battery to be inspected are calculated.

[0012] Step S203: The normal vector included angle of the point and each point in the neighborhood is calculated, and the maximum normal vector included angle is taken.

[0013] Step S204: The neighborhood curvature and the maximum normal vector included angle are combined to judge the edge point, if the edge point score is greater than the preset edge point score threshold, the point is regarded as an edge point, and the edge point set is obtained.

[0014] Step S205: The obtained edge point set is fitted with a 3D circle, the center point and the radius of the circular pole region are obtained, the center point of the circular pole region is taken as the starting point, the radius of the circular pole region is the maximum radius R, Step is the progressive step length, and the circular pole region is divided into R / Step ring regions along the radial direction.

[0015] Step S206: The plane fitting is performed on each ring region respectively, the distance of each point in the ring region to the fitted plane is calculated; according to the preset distance threshold, the points exceeding the distance threshold are regarded as suspicious defect points, and the suspicious defect point set is obtained.

[0016] Step S207: The local texture feature value of each point in the suspicious defect point set in the pole region depth image is calculated; if the difference between the local texture feature value and the standard local texture feature value in step S201 is greater than the preset texture feature threshold, the point is regarded as a defect point, and the defect point set of the pole region depth image is obtained.

[0017] Step S208: According to the Euclidean partition method, the defect point set is divided into multiple cluster point cloud sets, i.e., a first defect set, according to the distance.

[0018] Further, in steps S201 and S207, the calculation formula of the local texture feature value is as follows:

[0019]

[0020] wherein, represents the center element in the 9*9 field, represents the pixel value of the center element, represents the pixel value of other elements in the neighborhood, and p represents the number of neighborhood pixels, (x) represents a sign function, which is defined as follows:

[0021]

[0022] Further, in step S202, the calculation formula of the neighborhood curvature and the neighborhood normal vector is as follows:

[0023]

[0024]

[0025]

[0026] wherein, is a 3*3 covariance matrix, is the center of the neighborhood, and k is the number of points in the neighborhood, , , is the eigenvalue of , is the neighborhood curvature of the point , is the eigenvector corresponding to the jth eigenvalue in the covariance matrix , and the eigenvector corresponding to the minimum eigenvalue is taken as the neighborhood normal vector .

[0027] Further, in step 204, the calculation formula of the edge point score is as follows:

[0028]

[0029] wherein, represents the maximum normal vector angle obtained in step S203.

[0030] Further, the step S300 specifically comprises the following steps:

[0031] Step S301: For the shell depth image and the top patch region depth image, the neighborhood curvature of each point in the point cloud is calculated respectively.

[0032] Step S302: Calculate the global curvature standard deviation , the global curvature mean and the neighborhood curvature standard deviation , the neighborhood curvature mean of each point.

[0033] Step S303: Calculate the dynamic defect threshold , the formula is as follows:

[0034]

[0035] Step S304: According to the automatically calculated dynamic defect threshold , it is judged whether each point is a defect point. If the neighborhood curvature of the point in step S301 is greater than the set threshold , the point is regarded as a defect point, and the defect point set is obtained.

[0036] Step S305: The defect point set obtained in step S304 is divided into multiple clustered point cloud sets, i.e. the second defect set, according to the Euclidean segmentation method and according to the distance.

[0037] Step S306: In the shell two-dimensional image and the top patch region two-dimensional image, the region image corresponding to each piece of point cloud in the second defect set is intercepted to obtain a region image set; the region image set is input into a pre-trained AI classification network model to identify the defect types of each defect.

[0038] Further, it further includes step S400: The first defect set of the pole region and the second defect set of the shell and the top patch region are summarized to obtain the overall defect set of the lithium battery to be inspected; the bounding box of the defect point cloud based on the overall defect set is quantitatively analyzed to calculate the defect feature information of each defect.

[0039] Compared with the prior art, the present application has the following beneficial effects:

[0040] The present application is based on computer vision technology, and different technical routes are adopted for different regions of the lithium battery to be detected. This targeted processing makes the detection of each region reach the optimal accuracy, and the whole shell of the lithium battery is detected in all directions, which greatly improves the efficiency and accuracy of defect detection and improves the yield of the product. Specifically, in the defect detection of the pole region, based on the algorithm of ring segmentation and texture-distance fusion, the interference of reflection and rough surface can be effectively suppressed, and the pits and scratches on the pole can be accurately captured. In the defect detection of the shell and the top patch region, the LVAR idea of the image is applied to the point cloud curvature detection method, the dynamic detection threshold is automatically calculated, the problem of threshold definition affected by product deformation is solved, the detection method can adapt to the surface deformation of the product itself, and the real defects can be effectively separated. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 The schematic diagram of the present application is shown. DETAILED DESCRIPTION

[0042] The specific embodiments of the present application will be described below with reference to the accompanying drawings. In order to fully understand the present application, many details are described below, but the present application can be implemented without these details for those skilled in the art.

[0043] As Figure 1 shown, a lithium battery shell defect detection method based on machine vision includes the following steps:

[0044] Step S100: Obtain the depth image and two-dimensional image of all shell surfaces of the lithium battery to be detected. Wherein, all shell surfaces include the outer surface of the top cover and the outer surface of the shell. The depth image of all shell surfaces includes the top cover depth image and the shell depth image.

[0045] Specifically, in the above step S100, a 3D camera is used to sequentially obtain the depth image and two-dimensional image of all shell surfaces of the lithium battery to be detected. The depth image is an image containing three-dimensional space information, from which three-dimensional point cloud data of all shell surfaces of the lithium battery to be detected can be obtained. The detection of defects mainly depends on physical characteristics such as curvature, normal vector, distance, etc., which need to be obtained through three-dimensional point cloud data. In order to accurately identify the defect type, the present application simultaneously collects two-dimensional images for auxiliary identification of the defect type.

[0046] Step S200: The top patch region and the pole region are segmented from the top cover depth image by an AI segmentation model to obtain the top patch region depth image and the pole region depth image. For the pole region, the local texture feature and the depth distance feature of the pole region depth image are calculated. The first defect set of the pole region is obtained by combining the local texture feature and the depth distance feature.

[0047] The pole column region is mostly a metal circular surface. The pole column region has a rough surface, a serious metal surface reflection, and a circular arc transition. Therefore, if only the reference surface distance is calculated, noise, transition regions, and rough regions are easily misjudged as defects. The introduction of local texture features of an image can avoid the influence of gray scale changes, and in combination with distance feature values, the depth changes of defects can be accurately obtained.

[0048] In a specific embodiment, in step S200, for the pole column region, the local texture feature and the depth distance feature of the pole column region depth image are calculated; the first defect set of the pole column region is obtained by combining the local texture feature and the depth distance feature, specifically including the following sub-steps:

[0049] Step S201: The pole column region depth image of a qualified lithium battery is pre-stored, and the local texture feature value, i.e., the standard local texture feature value, is calculated based on three-dimensional point cloud data. The calculation formula of the local texture feature value is as follows:

[0050]

[0051] wherein, represents the center element in the 9x9 domain, represents the pixel value of the center element, represents the pixel value of other elements in the neighborhood, and p represents the number of neighborhood pixels, (x) represents the sign function, which is defined as follows:

[0052]

[0053] Step S202: The neighborhood curvature and the neighborhood normal vector of each point in the point cloud of the pole column region of the lithium battery to be inspected are calculated, and the calculation formula is as follows:

[0054]

[0055]

[0056]

[0057] wherein, is a 3x3 covariance matrix, is the center of the neighborhood, and k is the number of points in the neighborhood, , , is the eigenvalue of , and is the neighborhood curvature of the point , and is the covariance matrix The eigenvector corresponding to the jth eigenvalue, and the eigenvector corresponding to the minimum eigenvalue is taken as the neighborhood normal vector .

[0058] Step S203: Calculate the angle between the normal vector of each point in the neighborhood and the point, and take the maximum normal vector angle .

[0059] Step S204: Integrate the neighborhood curvature and the maximum normal vector angle, and judge the edge point by weighting. If the edge point score is greater than the preset edge point score threshold, the point is regarded as an edge point, and the edge point set is obtained . The calculation formula of the edge point score is as follows:

[0060]

[0061] Step S205: The obtained edge point set is subjected to 3D fitting circle to obtain the center point and radius of the circular polar column region. The center point of the circular polar column region is taken as the starting point, the radius of the circular polar column region is the maximum radius R, Step is the progressive step length, and the circular polar column region is divided into R / Step annular regions along the radial direction.

[0062] Step S206: Plane fitting is performed on each annular region respectively, the distance of each point in the annular region to the fitted plane is calculated, and according to the preset distance threshold d, the points exceeding the distance threshold d are regarded as suspicious defect points, and the suspicious defect point set D is obtained.

[0063] Step S207: The local texture feature value of each point p in the suspicious defect point set D in the polar column region depth image is calculated in turn ; if the difference between the local texture feature value and the standard local texture feature value in step S201 is greater than the preset texture feature threshold , the point p is regarded as a defect point, and the defect point set E of the polar column region depth image is obtained.

[0064] Step S208: According to the Euclidean segmentation method, the defect point set E is segmented into multiple cluster point cloud sets according to the distance, that is, the first defect set {F}.

[0065] The application forms a "double insurance" mechanism by first screening (step S206) by distance features and then confirming (step S207) by using local binary pattern (LBP) texture features. A real defect usually shows abnormalities in both distance and texture, while a simple reflection point or rough point may have a slight change in distance, but its texture features are consistent with qualified products. The application forms a "double insurance" mechanism through steps S206 and S207, which can effectively exclude simple reflection points or rough points, i.e., solves the problem of "mistaking noise points, transition areas, and rough areas as defects".

[0066] In addition, this fusion detection technology can not only detect defects with depth changes (such as dents), but also detect defects with no obvious depth changes but abnormal surface texture (such as fine scratches and stains), thereby improving the coverage of detection.

[0067] Step S300: For the shell depth image and the top patch area depth image, the standard deviation and mean of the point cloud global curvature are calculated based on the three-dimensional point cloud data, as well as the neighborhood curvature standard deviation and mean of each point, and a dynamic defect threshold is calculated based on this to extract defect point clouds and obtain a second defect set of the shell and the top patch area; according to the second defect set, a region image is intercepted in the shell two-dimensional image and the top patch area two-dimensional image, and an AI classification model is used to identify the defect type.

[0068] In lithium battery defect detection, the shell is an aluminum metal surface that is easily deformed by process, forming a complex metal curved surface. The deformation degree of each lithium battery to be detected is different, making it difficult to detect defects using conventional reference surface distance detection methods for flat metal surfaces. In addition, the shell surface needs to detect a large number of defect categories, and multiple technical routes are used for detection, which is time-consuming and complex to implement algorithms. Therefore, step S200 applies the LVAR (local image variance intensity) idea of the image to the point cloud curvature detection method to automatically calculate a dynamic detection threshold, solves the problem of threshold definition affected by product deformation, and thereby locates the defect area. Secondly, an AI classification model method is introduced to classify the defects in the detection area.

[0069] In a specific embodiment, step S300 specifically includes the following sub-steps:

[0070] Step S301: For the shell depth image and the top patch area depth image, the neighborhood curvature of each point in the point cloud is calculated based on three-dimensional point cloud data, respectively. The neighborhood curvature calculation formula is as follows:

[0071]

[0072]

[0073]

[0074] wherein, is a 3x3 covariance matrix, is the center of the neighborhood, k is the number of points within the neighborhood, , , is the eigenvalue of , is the neighborhood curvature value of .

[0075] Step S302: Calculate the global curvature standard deviation and the neighborhood curvature standard deviation of each point , the neighborhood curvature mean ;

[0076] Step S303: Calculate the dynamic defect threshold , the formula is as follows:

[0077] ;

[0078] Step S304: According to the automatically calculated dynamic defect threshold , judge whether each point is a defect point, if the neighborhood curvature of the point in step S301 is greater than the set threshold , the point is regarded as a defect point, and the defect point set B of the shell depth image and the top patch area depth image is obtained;

[0079] Step S305: The defect point set B obtained in step S304 is divided into a plurality of clustered point cloud sets, i.e., a second defect set {C}, according to the Euclidean segmentation method and according to the distance.

[0080] Step S306: In the shell two-dimensional image and the top patch area two-dimensional image, the region image corresponding to each piece of point cloud in the second defect set {C} is intercepted to obtain a region image set; the region image is input into a pre-trained AI classification network model to identify the defect type. Among them, the defect type is divided into scratch, pit, protrusion, bubble and the like.

[0081] The present application dynamically sets the defect threshold by calculating the neighborhood curvature mean and standard deviation of each point. The dynamic threshold τ will automatically increase in the area with large curvature fluctuation to avoid false positives; it will automatically decrease in the area with flat curvature to avoid missed detection. This makes the system more clearly separate the real and abnormal curvature changes from the normal and natural surface deformation, greatly improving the signal-to-noise ratio of the detection method on complex surfaces.

[0082] Step S400: Aggregate each defect set and perform quantitative analysis to calculate the defect feature information of each defect.

[0083] Specifically, the first defect set {F} of the pole area and the second defect set {C} of the shell and the top patch area are aggregated to obtain the overall defect set {E} of the lithium battery to be inspected; the bounding box of the defect point cloud based on the overall defect set {E} is quantitatively analyzed to calculate the defect feature information of each defect.

[0084] The above is only a specific embodiment of the present application, but the design concept of the present application is not limited thereto, and any non-essential modification of the present application using this concept shall be deemed to be an infringement of the protection scope of the present application.

Claims

1. A method for detecting defects in lithium battery casings based on machine vision, characterized in that, Includes the following steps: Step S100: Obtain depth images and two-dimensional images of all outer casing surfaces of the lithium battery to be inspected; wherein, all outer casing surfaces include the outer surface of the top cover and the outer surface of the casing. Step S200: Use an AI segmentation model to segment the top patch region and the pole region from the top cover depth image to obtain the top patch region depth image and the pole region depth image; For the polar region, calculate the local texture features and depth distance features of the depth image of the polar region; use a combination of texture features and depth distance features to obtain the first defect set of the polar region; specifically including the following sub-steps: Step S201: Pre-store the depth image of the electrode region of qualified lithium battery products, and calculate the local texture feature value, i.e. the standard local texture feature value, based on the three-dimensional point cloud data; Step S202: Calculate the neighborhood curvature and neighborhood normal vector of each point in the point cloud of the electrode region of the lithium battery under test; Step S203: Calculate the angle between the normal vector of the point and the normal vector of each point in the neighborhood, and take the maximum angle between the normal vectors; Step S204: Combine the neighborhood curvature and the angle between the maximum normal vectors to determine the edge points. If the edge point score is greater than the preset edge point score threshold, then the point is regarded as an edge point and the edge point set is obtained. Step S205: Fit the obtained edge point set into a 3D circle to obtain the center point and radius of the circular polar region. Take the center point of the circular polar region as the starting point, the radius of the circular polar region as the maximum radius R, and Step as the gradual step size. Divide the circular polar region into R / Step annular regions along the radius direction. Step S206: Perform plane fitting on each annular region and calculate the distance from each point in each annular region to the fitting plane; according to the preset distance threshold, points exceeding the distance threshold are regarded as suspicious defect points, and a set of suspicious defect points is obtained. Step S207: Calculate the local texture feature value of each point in the polar region depth image in the suspected defect point set in turn; if the difference between the local texture feature value and the standard local texture feature value in step S201 is greater than the preset texture feature threshold, then the point is regarded as a defect point, and the defect point set of the polar region depth image is obtained. Step S208: According to the Euclidean segmentation method, the defect point set is divided into multiple clustered point cloud sets based on distance, namely the first defect set; Step S300: For the shell depth image and the top patch area depth image, calculate the standard deviation and mean of the global curvature of the point cloud based on the 3D point cloud data, as well as the standard deviation and mean of the neighborhood curvature of each point, and calculate the dynamic defect threshold accordingly. Extract the defect point cloud to obtain the second defect set of the shell and top patch areas. Based on the second defect set, crop the area image from the shell 2D image and the top patch area 2D image, and use an AI classification model to identify the defect type.

2. The method for detecting defects in lithium battery casing based on machine vision according to claim 1, characterized in that, In steps S201 and S207, the formulas for calculating local texture feature values ​​are as follows: in, This represents the central element within a 9x9 neighborhood. Represents the pixel value of the center element. This represents the pixel value of other elements in the neighborhood, where p represents the number of neighboring pixels. (x) represents the sign function, defined as follows: 。 3. The method for detecting defects in lithium battery casing based on machine vision according to claim 2, characterized in that, In step S202, the formulas for calculating the neighborhood curvature and the neighborhood normal vector are as follows: in, It is a 3×3 covariance matrix. The center of the neighborhood is k, and the number of points in the neighborhood is k. , , for eigenvalues, For point neighborhood curvature, Covariance matrix The eigenvector corresponding to the j-th eigenvalue is used as the neighborhood normal vector, and the eigenvector corresponding to the smallest eigenvalue is taken as the neighborhood normal vector. .

4. The method for detecting defects in a lithium battery casing based on machine vision according to claim 3, characterized in that, In step 204, the formula for calculating the edge point score is as follows: in, This represents the angle between the maximum normal vectors obtained in step S203.

5. The method for detecting defects in lithium battery casing based on machine vision according to claim 1, characterized in that, Step S300 specifically includes the following steps: Step S301: For the shell depth image and the top patch region depth image, calculate the neighborhood curvature of each point in the point cloud respectively; Step S302: Calculate the global curvature standard deviation Global curvature mean and the standard deviation of the neighborhood curvature at each point Neighborhood curvature mean ; Step S303: Calculate the dynamic defect threshold The formula is as follows: ; Step S304: Based on the automatically calculated dynamic defect threshold Determine whether each point is a defect point. If the neighborhood curvature of a point in step S301 is greater than a set threshold... If the point is a defect point, then the defect point set is obtained. Step S305: The defect point set obtained in step S304 is divided into multiple clustered point cloud sets, i.e., the second defect set, according to the Euclidean segmentation method and based on distance. Step S306: From the two-dimensional image of the shell and the two-dimensional image of the top patch region, extract the region image corresponding to each point cloud in the second defect set to obtain the region image set; input the region image set into the pre-trained AI classification network model to identify the defect type of each defect.

6. A method for detecting defects in lithium battery casing based on machine vision according to any one of claims 1-5, characterized in that, It also includes step S400: summarizing the first defect set of the electrode region and the second defect set of the casing and top patch region to obtain the overall defect set of the lithium battery to be inspected; performing quantitative analysis based on the defect point cloud bounding box of the overall defect set to calculate the defect feature information of each defect.

Citation Information

Patent Citations

  • Battery shell defect identification method

    CN116523923A

  • Lithium battery pole defect detection method, device and equipment

    CN116542967A