Lithium battery top cover defect detection method based on machine vision

By using a machine vision-based lithium battery casing inspection method that combines depth image and 2D image analysis, defects in different areas of the lithium battery can be segmented and identified. This solves the problems of numerous inspection areas, limited speed, and insufficient equipment reusability in existing technologies, and achieves efficient and accurate defect detection.

CN122089702APending Publication Date: 2026-05-26XIAMEN WEIYA INTELLIGENT TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAMEN WEIYA INTELLIGENT TECHNOLOGY CO LTD
Filing Date
2025-11-19
Publication Date
2026-05-26

Smart Images

  • Figure CN122089702A_ABST
    Figure CN122089702A_ABST
Patent Text Reader

Abstract

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

Description

[0001] This invention is a divisional application. The original application has the application number 202511702222.2 and the application date is 2025.11.19. Technical Field

[0002] This invention relates to the field of general image processing or recognition, specifically to a method for detecting defects in the top cover of a lithium battery based on machine vision. Background Technology

[0003] Currently, lithium battery casing defect detection technology mainly faces the following difficulties and challenges: First, lithium batteries require visual inspection of numerous areas, including two large surfaces, two narrow surfaces, a bottom surface, the top patch area, and two terminal posts. The large number of inspection areas and overall size make comprehensive and detailed observation difficult for manual visual inspection, easily leading to over-inspection and under-inspection, resulting in high inspection risks. Simultaneously, the speed of manual inspection is limited, failing to meet production line cycle requirements and hindering overall production efficiency. Second, traditional vision-based inspection methods have certain limitations. Currently, industrial cameras combined with image processing algorithms are mainly used for defect identification. However, due to the diverse models and significant size differences of lithium battery products, a single-model 2D vision system cannot achieve multi-model compatible inspection, resulting in insufficient equipment reusability and adaptability. Furthermore, conventional 2D images cannot obtain the height and depth information of defects, affecting the accurate judgment of three-dimensional features such as dents, scratches, etc., thereby reducing the accuracy of defect classification and specification assessment. Summary of the Invention

[0004] The purpose of this invention is to provide a method for detecting defects in the top cover of lithium batteries based on machine vision, which aims to overcome the aforementioned problems existing in the prior art.

[0005] To achieve the objective, the present invention provides the following technical solution: A machine vision-based method for detecting defects in lithium battery casings 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.

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

[0007] 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.

[0008] Further, in step S200, for the polar region, the local texture features and depth distance features of the depth image of the polar region are calculated; the first defect set of the polar region is obtained by combining the local texture features and depth distance features, 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.

[0009] 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.

[0010] 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.

[0011] 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.

[0012] Step S205: Fit the obtained edge point set into a 3D circle to obtain the center point and radius of the circular polar region. Taking the center point of the circular polar region as the starting point and the radius of the circular polar region as the maximum radius R, Step is the progressive step size. Divide the circular polar region into R / Step annular regions along the radius direction.

[0013] 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 that exceed the distance threshold are regarded as suspicious defect points, and a set of suspicious defect points is obtained.

[0014] Step S207: Calculate the local texture feature value of each point in the polar region depth image in sequence; 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.

[0015] 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.

[0016] Furthermore, in steps S201 and S207, the calculation formula for local texture feature values ​​is as follows:

[0017] 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: .

[0019] Furthermore, in step S202, the formulas for calculating the neighborhood curvature and the neighborhood normal vector are as follows:

[0020]

[0021]

[0022] in, It is a 3×3 covariance matrix. The center of the neighborhood is k, and k is the number of points in the neighborhood. , , 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. .

[0023] Furthermore, in step 204, the formula for calculating the edge point score is as follows:

[0024] in, This represents the angle between the maximum normal vectors obtained in step S203.

[0025] Furthermore, 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.

[0026] 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 .

[0027] Step S303: Calculate the dynamic defect threshold The formula is as follows: .

[0029] 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.

[0030] 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.

[0031] 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.

[0032] Furthermore, 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.

[0033] Compared with the prior art, the present invention has the following advantages: This invention, based on computer vision technology, employs different technical approaches for different areas of the lithium battery under inspection. This targeted approach ensures optimal accuracy for each area, allowing for comprehensive inspection of the entire battery casing. This significantly improves the efficiency and accuracy of defect detection, thereby increasing product yield. Specifically, in defect detection of the terminal post area, this invention utilizes an algorithm based on ring segmentation and texture-distance fusion to effectively suppress interference from reflections and rough surfaces, accurately capturing pits and scratches on the terminal post. In defect detection of the casing and top patch area, this invention applies the LVAR (Low-Level Image Recognition) concept to a point cloud curvature detection method, automatically calculating dynamic detection thresholds. This addresses the issue of product deformation affecting threshold definition, enabling the detection method to adapt to the surface deformation of the product itself and effectively separating out true defects. Attached Figure Description

[0034] Figure 1 This is a schematic diagram of the present invention. Detailed Implementation

[0035] Specific embodiments of the present invention will now be described with reference to the accompanying drawings. Many details are described below to provide a comprehensive understanding of the invention; however, those skilled in the art will be able to implement the invention without these details.

[0036] like Figure 1 As shown, a machine vision-based method for detecting defects in lithium battery casings includes the following steps: Step S100: Obtain depth images and 2D images of all outer casing surfaces of the lithium battery to be inspected. All outer casing surfaces include the outer surface of the top cover and the outer surface of the casing. Depth images of all outer casing surfaces include the top cover depth image and the casing depth image.

[0037] Specifically, in step S100 above, a 3D camera sequentially acquires depth images and two-dimensional images of all outer surfaces of the lithium battery under inspection. The depth images contain three-dimensional spatial information, from which three-dimensional point cloud data of all outer surfaces of the lithium battery under inspection can be obtained. Defect detection primarily relies on physical features such as curvature, normal vectors, and distances, which need to be obtained through three-dimensional point cloud data. To further accurately identify defect types, this invention simultaneously acquires two-dimensional images to assist in defect type identification.

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

[0039] The pole region is mostly a circular metal surface, which is rough, highly reflective, and has a rounded transition. Therefore, if the distance to the reference plane is used alone for calculation, noise, transition areas, and rough areas are easily misjudged as defects. Introducing local texture features of the image can avoid the influence of grayscale changes. Combined with distance feature values, the depth changes of defects can be accurately obtained.

[0040] In one specific embodiment, in step S200 above, for the polar region, the local texture features and depth distance features of the depth image of the polar region are calculated; the first defect set of the polar region is obtained by combining the local texture features and depth distance features, 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 3D point cloud data. The formula for calculating local texture feature values ​​is as follows:

[0041] in, This represents the central element within a 9x9 grid. 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, which is defined as follows: .

[0043] 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. The calculation formula is as follows:

[0044]

[0045]

[0046] in, It is a 3×3 covariance matrix. The center of the neighborhood is k, and k is the number of points in the neighborhood. , , 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. .

[0047] 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. .

[0048] Step S204: Combine the neighborhood curvature and the angle between the maximum normal vectors to determine edge points. If the edge point score is greater than the preset edge point score threshold, then the point is considered an edge point, and the edge point set is obtained. The formula for calculating the edge point fraction is as follows: .

[0050] Step S205: Obtain the edge point set Perform 3D fitting of a circle to obtain the center point and radius of the circular polar region. Taking the center point of the circular polar region as the starting point and the radius of the circular polar region as the maximum radius R, Step is the asymptotic growth step. Divide the circular polar region into R / Step annular regions along the radial direction.

[0051] 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 d, points exceeding the distance threshold d are regarded as suspicious defect points, and the suspicious defect point set D is obtained.

[0052] Step S207: Calculate the local texture feature value of each point p in the polar region depth image for each suspected defect point set D. If local texture feature values Compared with the standard local texture feature values ​​in step S201 The difference is greater than the preset texture feature threshold. If point p is considered a defect point, then the defect point set E of the polar region depth image is obtained.

[0053] Step S208: According to the Euclidean segmentation method, the defect point set E is divided into multiple clustered point cloud sets based on distance, namely the first defect set {F}.

[0054] This invention employs a "double-insurance" mechanism: first, distance features are used for initial screening (step S206), and then Local Binary Pattern (LBP) texture features are used for secondary confirmation (step S207). A genuine defect typically exhibits abnormalities in both distance and texture, while simple reflective or rough spots may show slight variations in distance, but their texture features are consistent with those of qualified products. This invention, through steps S206 and S207 forming a "double-insurance" mechanism, effectively eliminates simple reflective or rough spots, thus solving the problem of "misjudging noise, transition areas, and rough areas as defects."

[0055] Furthermore, this fusion detection technology can detect not only defects with depth variations (such as dents and bumps), but also defects with subtle depth variations but abnormal surface textures (such as minor scratches and stains), thus improving the detection coverage.

[0056] 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.

[0057] In lithium battery defect detection, the casing is made of aluminum metal, which is easily deformed by the manufacturing process, forming complex curved metal surfaces. The degree of deformation varies for each lithium battery under inspection, making it difficult to detect defects using conventional methods based on the distance to a reference surface on a flat metal surface. Furthermore, there are many types of defects to be detected on the casing surface, requiring multiple technical approaches, which is time-consuming and involves complex algorithm implementation. Therefore, step S200 applies the concept of LVAR (Local Image Variance Intensity) to the point cloud curvature detection method, automatically calculating a dynamic detection threshold to solve the problem of threshold definition affected by product deformation, thereby locating the defect area. Secondly, an AI classification model method is introduced to classify defects in the detection area.

[0058] In one specific embodiment, step S300 specifically includes the following sub-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 based on the 3D point cloud data; the neighborhood curvature calculation formula is as follows:

[0059]

[0060]

[0061] in, It is a 3×3 covariance matrix. The center of the neighborhood is k, and k is the number of points in the neighborhood. , , for eigenvalues, for The neighborhood curvature value.

[0062] Step S302: Calculate the global curvature standard deviation 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 each point Whether it is a defect point, if the neighborhood curvature of the point in step S301 is greater than the set threshold. If the point is a defect point, then the defect point set B is obtained from the shell depth image and the top patch area depth image. Step S305: The defect point set B obtained in step S304 is divided into multiple clustered point cloud sets according to the Euclidean segmentation method based on distance, namely the second defect set {C}.

[0064] 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 {C} to obtain the region image set; input the region image into the pre-trained AI classification network model to identify the defect type. Among them, the defect types are scratches, dents, bumps, bubbles, etc.

[0065] This invention dynamically sets the defect threshold by calculating the mean and standard deviation of the curvature of the neighborhood of each point. The dynamic threshold τ automatically increases in areas with large curvature fluctuations to avoid false alarms and automatically decreases in areas with flat curvature to avoid missed detections. This enables the system to more clearly separate real and abnormal curvature changes from normal and natural surface deformations, greatly improving the signal-to-noise ratio of the detection method on complex surfaces.

[0066] Step S400: Summarize the defect sets and perform quantitative analysis to calculate the defect characteristic information of each defect.

[0067] Specifically, the first defect set {F} of the electrode region and the second defect set {C} of the casing and top patch region are summarized to obtain the overall defect set {E} of the lithium battery under test. Based on the bounding box of the defect point cloud of this overall defect set {E}, quantitative analysis is performed to calculate the defect feature information of each defect. The defect feature information includes, but is not limited to, physical information such as location, length, width, and height.

[0068] The above are merely specific embodiments of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial modifications made to the present invention using this concept shall be considered as infringing upon the protection scope of the present invention.

Claims

1. A method for detecting defects in the top cover of a lithium battery 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; Step S200: The top patch region and the pole region are segmented from the top cover depth image using an AI segmentation model to obtain the depth images of the top patch region and the pole region; for the pole region, the local texture features and depth distance features of the pole region depth image are calculated; the first defect set of the pole region is obtained by combining the local texture features and depth distance features.

2. The method for detecting defects in the top cover of a lithium battery based on machine vision according to claim 1, characterized in that, Step S200 includes 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 3D 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. The calculation formula is as follows: in, It is a 3×3 covariance matrix. The center of the neighborhood is k, and k is the number of points in the neighborhood. , , 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. ; 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 edge points. If the edge point score is greater than the preset edge point score threshold, then the point is considered an edge point, and the edge point set is obtained. The formula for calculating the edge point fraction is as follows: 。 3. The method for detecting defects in the top cover of a lithium battery based on machine vision according to claim 2, characterized in that, Step S200 further includes the following sub-steps: Step S205: Obtain the edge point set Perform 3D fitting of a circle to obtain the center point and radius of the circular polar region. Taking the center point of the circular polar region as the starting point and the radius of the circular polar region as the maximum radius R, Step is the gradual step size. Divide the circular polar region into R / Step annular regions along the radial 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 d, points exceeding the distance threshold d are regarded as suspected defect points, and the set of suspected defect points D is obtained; Step S207: Calculate the local texture feature value of each point p in the polar region depth image for each suspected defect point set D. If local texture feature values Compared with the standard local texture feature values ​​in step S201 The difference is greater than the preset texture feature threshold. If point p is considered a defect point, then the defect point set E of the polar region depth image is obtained; Step S208: According to the Euclidean segmentation method, the defect point set E is divided into multiple clustered point cloud sets based on distance, namely the first defect set {F}.

4. The method for detecting defects in the top cover of a lithium battery based on machine vision according to claim 3, characterized in that, The formula for calculating local texture feature values ​​is as follows: in, This represents the central element within a 9x9 grid. 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, which is defined as follows: 。 5. A method for detecting defects in the top cover of a lithium battery based on machine vision according to any one of claims 1-4, characterized in that, It also includes the following steps: Step S300: For the depth image of the top patch region, 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 top patch region. Based on the second defect set, crop the region image in the 2D image of the top patch region and use an AI classification model to identify the defect type.

6. The method for detecting defects in the top cover of a lithium battery based on machine vision according to claim 5, characterized in that: Step S300 includes the following sub-steps: Step S301: For the depth image of the top patch region, calculate the neighborhood curvature of each point in the point cloud; 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: In 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.

7. The method for detecting defects in the top cover of a lithium battery based on machine vision according to claim 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 top patch region to obtain the overall defect set of the lithium battery to be inspected; performing quantitative analysis based on the bounding box of the defect point cloud of the overall defect set to calculate the defect feature information of each defect.