Lithium-battery weld seam defect detection method and system, and storage medium
Through the processing of depth images and 2D grayscale maps, a three-dimensional point cloud is generated and combined with a fast convex hull algorithm and AI model to automatically detect the weld defects of lithium batteries, solving the problems of poor detection results and inefficiency in the existing technology. , realizes efficient and accurate detection of lithium battery welds.
Patent Information
- Application Number
- PCT/CN2024/076282
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-19
- Filing Date
- 2024-02-06
- Publication Date
- 2024-11-28
AI Technical Summary
In the prior art, the detection effect of lithium battery weld defects is poor and the efficiency is low. It is impossible to effectively detect defects such as weld offset, pinholes and small spikes. Relying on manual visual inspection results lead to inconsistent detection results, which cannot meet the needs of the new energy industry. Requirements for battery weld quality inspection.
Depth image and 2D grayscale map are used for filtering, defect detection areas are extracted, three-dimensional linear point clouds are generated, and different types of Defects are calculated and detected in parallel to realize automated detection of weld offsets, concave and convex defects.
It realizes refined automatic detection of defects in lithium battery welds, improves detection efficiency and accuracy, reduces labor costs, can quickly and accurately extract battery cell defects, and has better detection effect, covering the industry's lithium battery welds Testing requirements.
Smart Images

Figure CN2024076282_28112024_PF_FP_ABST
Abstract
Description
A lithium battery weld defect detection method, system and storage medium
[0001] This invention claims priority with priority date 2023-05-19 and priority number 2023105657625. Technical Field
[0002] The present invention relates to the field of computer vision technology, and in particular to a lithium battery weld defect detection method, a lithium battery weld defect detection system using the method, and a computer-readable storage medium. Background Art
[0003] Lithium batteries are a type of battery that uses lithium metal or lithium alloys as the positive and negative electrodes and a non-aqueous electrolyte solution. With the development of microelectronics in the 20th century, miniaturized devices have become increasingly common, placing high demands on power sources. Consequently, lithium batteries have entered a period of widespread practical use, with widespread applications in mobile phones, laptops, power tools, electric vehicles, backup power supplies for street lights, navigation lights, and small household appliances.
[0004] Due to the highly reactive chemical properties of lithium metal, its processing, storage, and use place very high demands on the environment. Currently, weld defect detection in the lithium battery industry primarily relies on the experience of visual inspectors, or a combination of visual inspection equipment and manual inspection.
[0005] Manual visual inspection is difficult to clearly define due to the numerous and diverse defects produced during the lithium battery welding process. Furthermore, relying solely on visual inspectors to identify lithium battery weld defects is time-consuming and subjective. This can easily lead to inconsistent test results for the same lithium battery under the judgment of different visual inspectors, failing to provide sufficient assurance of product quality.
[0006] As for defect detection relying on visual inspection equipment, the visual inspection equipment on the market is insufficient in its ability to detect lithium battery welds and is mostly limited to the detection of concave and convex defects. Therefore, when faced with defects such as weld offset, pinholes, small spikes, and uneven welds, it is impossible to perform effective detection and can only rely on manual visual inspection as a supplementary means.
[0007] In summary, the existing technology has the problems of poor detection effect and low efficiency for lithium battery weld defects. Summary of the Invention
[0008] The main purpose of the present invention is to provide a lithium battery weld defect detection method system and storage medium, aiming to solve the technical problems of poor detection effect and low efficiency of existing lithium battery weld defect detection methods.
[0009] To achieve the above-mentioned objectives, the present invention provides a method for detecting weld defects in lithium batteries, which includes the following steps: S100. Acquire a depth image and a 2D grayscale image of a lithium battery cell and perform filtering processing; S200. Extract defect detection areas from the filtered cell depth image to obtain detection areas corresponding to various defects, and the detection areas include at least one of a concave-convex defect detection area, a weld offset detection area, and a pinhole defect detection area; S300. Generate a three-dimensional linear point cloud corresponding to each detection area based on the depth image; S400. Perform parallel calculations on the depth image and the three-dimensional linear point cloud of the detection area respectively to detect the corresponding defects, and S400 includes at least one of the following steps: S410. Detect the concave-convex defect detection area based on a fast convex hull algorithm and a nearest neighbor search method based on Euclidean distance; S420. Detect the weld offset detection area based on AI defect detection and 3D defect detection; S430. Detect the pinhole defect detection area based on a fast convex hull algorithm and a YOLO target detection network model.
[0010] Optionally, in step S100, the filtering process is specifically mean filtering process.
[0011] Optionally, when generating a point cloud based on the depth image, step S300 traverses each row and column of the depth image, converts each row of pixels into a point cloud, and stores them separately to obtain a three-dimensional single-row point cloud set for each detection area.
[0012] Optionally, the step S410 includes at least the following steps: S411. Based on the fast convex hull algorithm, the three-dimensional linear point cloud is converted into a patch structure, and uniform sampling is performed on the convex hull to generate a convex hull point cloud with the same number of points as the weld point cloud; S412. The nearest neighbor points of each point in the weld point cloud are obtained in the convex hull point cloud, and the distance between each point in the weld point cloud and its corresponding nearest neighbor point is calculated; S413. Whether the distance between each point in the weld point cloud and its corresponding nearest neighbor point is greater than a first preset threshold value, if so, it is regarded as a defect point, if not, it is regarded as a non-defect point; S414. The defect points are segmented by a nearest neighbor search method based on Euclidean distance, and the point cloud of the defect points is segmented into the same set to form a defect point set.
[0013] Optionally, the step S420 includes at least the following steps: S421. Calculate the curvature value corresponding to each point on the depth image to obtain a curvature image; S422. Perform color rendering processing on the 2D grayscale image according to the curvature value and image depth to form a pseudo-color image for recognition training of the AI model. The AI model learns the pre-collected defect data set through training to detect weld offset defects and obtain AI defect detection results; S423. Calculate the normal vector and curvature value of the point cloud in the weld offset detection area, and reorder the point cloud in the weld offset detection area to obtain an ordered point cloud; obtain the maximum value of the normal vector angle and the average value of the curvature change of a single row of point clouds, and determine whether the maximum value of the normal vector angle is greater than the second preset threshold, and whether the average value of the curvature change is greater than the third preset threshold. If so, retain the row of point clouds and use it as a suspected defect point cloud. If not, it is deemed that there is no suspected defect point cloud; S424. A row of point clouds is fitted with circles to obtain the distribution of the circle center, radius and weld height. Qualified circles are filtered according to the preset qualified parameters, and the suspicious defect point cloud judged as the suspicious defect point cloud in step S423 is judged for the second time. If the same row of point clouds is judged as a qualified circle, the suspicious defect point cloud is summarized as a qualified point cloud; S425. The center of the circle obtained by circle fitting of all qualified point clouds is used as the imaginary trajectory of the welding gun, and it is judged whether the imaginary trajectory is straight. If so, the welding trajectory is normal. If not, the welding trajectory is offset, and the 3D defect detection result is obtained, and step S426 is executed; S426. According to the straight line fitting, the distance between the center of each point and the straight line is calculated, and the calculated result is used as the offset. The maximum value of the offset is selected as the weld offset output value; S427. The AI defect detection result obtained in step S422 is merged with the 3D defect detection result obtained in step S425, and the same defect results are retained in the same set to obtain a defect point set.
[0014] Optionally, the circle fitting in step S424 or the line fitting in step S426 specifically includes the following steps: step a. input the point cloud to be fitted; step b. randomly select m data points; step c. calculate the circle model or the line model based on the m data points; step d. traverse the point cloud to be fitted and calculate the distance from each point to the circle model or the line model; step e. determine whether the distance is greater than a preset distance threshold. If the distance is greater than the preset distance threshold, the point does not belong to the point in the circle model or the line model; if the distance is less than or equal to the preset distance threshold, the point belongs to the point in the circle model or the line model; step f. determine whether the number of points in the circle model or the line model is greater than the preset point number threshold. If the number of points in the circle model or the line model is greater than the preset point number threshold, all points belonging to the circle model or the line model are selected as data points and the model is recalculated. If the number of points in the circle model or the line model is less than or equal to the preset point number threshold, return to step b.
[0015] Optionally, the step S430 includes at least the following steps: S431. Extracting the surface point cloud of the aluminum shell of the lithium battery, and obtaining the convex hull of the aluminum shell surface point cloud through a fast convex hull algorithm; S432. Determining whether there is a vertex in the convex hull that is higher than or lower than the plane of the aluminum shell, if so, executing step S433, if not, it is deemed that there is no defect point; S433. Taking the vertex as the center of the circle, all points within a preset radius are regarded as the first type of suspicious defect point cloud; S434. Calculating the normal vector angle and curvature characteristics of the first type of suspicious defect point cloud, and obtaining the second type of suspicious defect point cloud based on the region growing clustering algorithm. Defect point cloud; S435. Compare the two types of defect point clouds and retain the same point clouds to form a defect point set; S436. Calculate the defect information based on the defect point cloud bounding box, and segment the position area corresponding to the defect on the 2D image based on the defect point cloud, and input it into the YOLO target detection network model for defect detection; S437. According to the confidence and defect information of the YOLO target detection network model, comprehensively judge the defect detection score of the position area, and judge whether the defect detection score is greater than the fourth preset threshold. If so, it is deemed that there is an actual defect. If not, it is deemed that there is no actual defect.
[0016] Optionally, a clustering algorithm based on region growing is used to obtain a second type of suspicious defect point cloud, specifically: the aluminum shell surface point cloud is regarded as a smooth plane point cloud, and the normal vectors and curvature values of all points in the aluminum shell surface point cloud are calculated; any point in the aluminum shell surface point cloud is randomly selected as the initial point, and the normal vector angle and curvature difference between the initial point and the remaining points are compared in turn to determine whether the normal vector angle is greater than the fifth preset threshold, and whether the curvature difference is greater than the sixth preset threshold; if the normal vector angle is less than or equal to the fifth preset threshold, and the curvature difference is less than or equal to the sixth preset threshold, the points are of the same type, and the points of the same type are classified into the cluster set; the points with a normal vector angle greater than the fifth preset threshold and a curvature difference greater than the sixth preset threshold are classified as the second type of suspicious defect point cloud.
[0017] Optionally, it also includes step S500. Obtain different types of defect point clouds, calculate the secondary detection parameters of the defects, and confirm whether the lithium battery has corresponding defects, specifically including the following steps: S510. Obtain different types of defect point clouds and calculate the spatial bounding box of the defect point set; S520. Based on the spatial bounding box of the defect point set, calculate the secondary detection parameters of the defects. The secondary detection parameters include at least the length, width, height, projection surface area, and curvature value of the defect point set. The calculation process is specifically as follows: calculate the length, width, and height of the spatial bounding box, and use the calculation results as the length, width, and height of the defect point set; calculate the area of the two-dimensional projection surface of the defect point set, and the curvature value of each point in the defect point set, sum the curvature values of all points and take the average value, and use the calculation result as the curvature value of the defect point set; S530. According to the corresponding thresholds of the secondary detection parameters of the project specification and the defect point set, determine whether the secondary detection parameters are simultaneously greater than the corresponding thresholds. If so, confirm that the lithium battery has corresponding defects. If not, determine that the lithium battery does not have corresponding defects.
[0018] Corresponding to the lithium battery weld defect detection method, the present invention provides a lithium battery weld defect detection system, which includes: an image acquisition module, used to acquire the depth image and 2D grayscale image of the lithium battery cell and perform filtering processing; a detection area extraction module, used to extract the defect detection area from the filtered cell depth image to obtain the detection area corresponding to each defect, and the detection area includes at least one of the concave-convex defect detection area, the weld offset detection area, and the pinhole defect detection area; a point cloud generation module, used to generate a three-dimensional linear point cloud corresponding to each detection area according to the depth image; a defect detection module, used to extract the defect detection area from the filtered cell depth image to obtain the detection area corresponding to each defect. The depth image and three-dimensional linear point cloud of the detection area are respectively calculated in parallel to detect the corresponding defects, including at least one of a concave-convex defect detection module, a weld offset detection module, and a pinhole defect detection module; the concave-convex defect detection module is used to detect the concave-convex defect detection area based on a fast convex hull algorithm and a nearest neighbor search method based on Euclidean distance; the weld offset detection module is used to detect the weld offset detection area based on AI defect detection and 3D defect detection; the pinhole defect detection module is used to detect the pinhole defect detection area based on a fast convex hull algorithm and a YOLO target detection network model.
[0019] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a lithium battery weld defect detection program is stored. When the program is executed by a processor, the steps of the lithium battery weld defect detection method described above are implemented.
[0020] The beneficial effects of the present invention are:
[0021] (1) By extracting the defect detection area, different types of defects can be detected in different detection areas respectively, which can basically cover the industry's demand for lithium battery weld detection and realize the quality inspection requirements of battery welds in the new energy industry. It does not need to rely on manual visual inspection and realizes the refined automatic detection of lithium battery defects. It can quickly and accurately extract battery cell defects, achieve better detection results, save labor costs, and improve detection efficiency;
[0022] (2) Perform mean filtering on the depth image. The algorithm complexity is lower than that of the three-dimensional point cloud, which can save the algorithm running time. Since there are some tiny noise points (such as small burrs) in the depth image of the battery cell, the mean filtering method can effectively remove the noise and reduce the interference with the subsequent defect detection steps.
[0023] (3) Since point clouds are disordered, when generating point clouds based on depth images, the point clouds are stored in rows according to the rows and columns of the two-dimensional depth images to obtain ordered point clouds;
[0024] (4) By detecting the concave and convex defect detection area, it is possible to accurately determine whether there are concave defects or convex defects on the weld. Further, the defect points are segmented by the nearest neighbor search method based on Euclidean distance, and the defect point set can be quickly obtained;
[0025] (5) By detecting the weld offset detection area, the weld offset defect can be automatically detected. By combining 3D and AI detection, the detection effect and accuracy can be further improved.
[0026] (6) By detecting the pinhole defect detection area, it is possible to accurately define small defects such as slag, pinholes, and fine spikes that are easily generated during the battery cell welding process. The defects are initially located through 3D point cloud. The AI model-assisted judgment strategy can make a comprehensive judgment on the pinhole defect detection area, further improving the detection effect, accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0028] FIG1 is a simplified flow chart of a method for detecting weld defects in lithium batteries according to the present invention;
[0029] FIG2 is a simplified flow chart of the specific steps of circle fitting or line fitting of the present invention. Modes for Carrying Out the Invention
[0030] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0031] As shown in Figure 1, a lithium battery weld defect detection method of the present invention includes the following steps: S100. Acquire a depth image and a 2D grayscale image of a lithium battery cell and perform filtering processing; S200. Extract the defect detection area of the filtered cell depth image to obtain the detection area corresponding to each defect, and the detection area includes at least one of a concave-convex defect detection area, a weld offset detection area, and a pinhole defect detection area; S300. Generate a three-dimensional linear point cloud corresponding to each detection area based on the depth image; S400. Perform parallel calculation on the depth image and the three-dimensional linear point cloud of the detection area respectively to detect the corresponding defects, S400 includes at least one of the following steps: S410. Detect the concave-convex defect detection area based on a fast convex hull algorithm and a nearest neighbor search method based on Euclidean distance; S420. Detect the weld offset detection area based on AI defect detection and 3D defect detection; S430. Detect the pinhole defect detection area based on a fast convex hull algorithm and a YOLO target detection network model.
[0032] The present invention extracts defect detection areas and detects different types of defects in different detection areas. It can basically cover the industry's needs for lithium battery weld detection, realize the new energy industry's quality inspection requirements for battery welds, and realize the refined automatic detection of lithium battery defects. It does not need to rely on manual visual inspection, can quickly and accurately extract battery cell defects, has better detection effects, saves labor costs, and improves detection efficiency.
[0033] In this embodiment, in step S100 , the filtering process is specifically a mean filtering process.
[0034] The present invention performs mean filtering on a two-dimensional depth image, and the algorithm complexity is lower than that of a three-dimensional point cloud, which can save algorithm running time. Since there will be some tiny noise points (such as small burrs) in the depth image of the battery cell, the use of mean filtering can effectively remove the noise points and reduce interference with subsequent defect detection steps.
[0035] In this embodiment, when generating a point cloud based on a depth image, step S300 traverses each row and column of the depth image, converts each row of pixels into a point cloud, and stores them separately to obtain a three-dimensional single-row point cloud set for each detection area. Since the depth image stores pixels in a row and column distribution, each row and column of the depth image is traversed and each row of the depth image pixels is converted into a point cloud. Each row of the point cloud can be regarded as a separate point cloud, and the internal ordering of the point cloud depends on the columns of the image. For example, the first row and first column of the depth image is the first point of the first row of the point cloud, the second row and first column of the image is the first point of the second row of the point cloud, and so on.
[0036] Since point clouds are disordered, when generating point clouds based on depth images, the present invention arranges the point clouds in rows according to the rows and columns of the depth images to obtain ordered point clouds.
[0037] Concave-convex defect detection and weld offset detection are specifically for weld detection. During the welding process, it is easy for the weld to become uneven or incomplete due to problems such as energy changes, unstable welding gun equipment, and preset trajectory deviation.
[0038] In this embodiment, step S410 includes at least the following steps: S411. Based on the fast convex hull algorithm, the three-dimensional linear point cloud is converted into a patch structure, and uniform sampling is performed on the convex hull to generate a convex hull point cloud with the same number of points as the weld point cloud; S412. The nearest neighbor point of each point in the weld point cloud is obtained in the convex hull point cloud, and the distance between each point in the weld point cloud and its corresponding nearest neighbor point is calculated; S413. It is determined whether the distance between each point in the weld point cloud and its corresponding nearest neighbor point is greater than a first preset threshold. If so, it is regarded as a defect point, otherwise, it is regarded as a non-defect point; S414. The defect points are segmented by a nearest neighbor search method based on Euclidean distance, and the point cloud of the defect points is segmented into the same set to form a defect point set.
[0039] By detecting the concave and convex defect detection area, the present invention can accurately determine whether there are concave defects or convex defects on the weld. If there are concave defects or convex defects on the weld, a height difference will be formed at the defect and the convex hull point cloud, resulting in the convex hull point cloud at the defect being higher than the weld point cloud; therefore, further combined with the first preset threshold, the defect point can be quickly obtained.
[0040] Because the acquired defect points are spatially unordered point clouds, they cannot form a set. It's impossible to calculate the physical properties of a single defect point, such as length, width, and height. Therefore, we segment the defect points using a nearest neighbor search method based on Euclidean distance to quickly obtain a defect point set.
[0041] In this embodiment, step S420 includes at least the following steps: S421. Calculate the curvature value corresponding to each point on the depth image to obtain a curvature image; S422. Perform color rendering on the 2D grayscale image according to the curvature value and image depth to form a pseudo-color image for recognition training of the AI model. The AI model learns the pre-collected defect data set through training to detect weld offset defects and obtain AI defect detection results; S423. Calculate the normal vector and curvature value of the point cloud in the weld offset detection area, and reorder the point cloud in the weld offset detection area to obtain an ordered point cloud; obtain the maximum value of the normal vector angle and the average value of the curvature change of a single row of point clouds, and determine whether the maximum value of the normal vector angle is greater than the second preset threshold value, and whether the average value of the curvature change is greater than the third preset threshold value. If so, retain the row of point clouds and use it as a suspected defect point cloud. If not, it is deemed that there is no suspected defect point cloud; S424. Each row of point cloud is fitted with a circle to obtain the distribution of the circle center, radius and weld height. Qualified circles are filtered according to the preset qualified parameters, and the suspicious defect point cloud judged as the suspicious defect point cloud in step S423 is judged a second time. If the same row of point cloud is judged as a qualified circle, the suspicious defect point cloud is summarized as a qualified point cloud; S425. The center of the circle obtained by circle fitting for all qualified point clouds is used as the imaginary trajectory of the welding gun, and it is judged whether the imaginary trajectory is straight. If so, the welding trajectory is normal. If not, the welding trajectory is offset, and the 3D defect detection result is obtained, and step S426 is executed; S426. According to the straight line fitting, the distance between the center of each point and the straight line is calculated, and the calculated result is used as the offset. The maximum value of the offset is selected as the weld offset output value; S427. The AI defect detection result obtained in step S422 is merged with the 3D defect detection result obtained in step S425, and the same defect results are retained in the same set to obtain a defect point set.
[0042] Since the grayscale image only contains grayscale numerical information, the pseudo-color image can retain the grayscale information and also identify weld features through the depth and different colors of the pseudo-color. Therefore, color rendering of the 2D grayscale image to form a pseudo-color image is easier for AI model training.
[0043] Preferably, the point cloud of the weld offset detection area is reordered to obtain an ordered point cloud. Specifically, according to the row and column distribution of the depth image, each row of pixels is converted into a corresponding row of point cloud, which are stored separately to obtain an ordered point cloud.
[0044] The welding gun will form an arc-shaped weld during welding. Under normal circumstances, the weld curvature values are similar, there is no sudden change in curvature, the weld surface is smooth and higher than the top cover area, but for welds with weld offset defects, the welds are prone to sharp edges or straight welds, and the curvature changes greatly before and after. Therefore, based on this characteristic, the difference between the maximum curvature value and the minimum curvature value of a single row of point cloud can be calculated, and the average value of the curvature change can be obtained based on the number of points in a single row. Then, suspicious defect point cloud detection and circle fitting are performed, and the distribution of circle center, radius, and weld height is determined. Then, qualified circles can be filtered according to the preset qualified parameters, laying the foundation for subsequent judgment of whether the welding trajectory is normal.
[0045] Circle fitting is a two-dimensional fitting. Therefore, in step S424, circle fitting needs to be performed on each row of point cloud in the weld offset detection area. At this time, the point cloud input information is the x and z direction information. The number of circles corresponds to the number of rows of point cloud. The number of circles is equal to the number of rows of point cloud.
[0046] Preferably, the preset qualified parameters include at least a preset radius threshold and a preset welding height distribution requirement. By judging whether the radius meets the preset radius threshold and whether the weld height distribution meets the preset parameter requirements, qualified circles can be filtered.
[0047] In this embodiment, the curvature change refers to the curvature change trend of a row of point clouds. The curvature change trend is obtained by calculating the curvature values of this row of point clouds, and the curvature change average value is obtained by taking the average value of the curvature values of this row of point clouds.
[0048] The circle fitting in step S424 or the line fitting in step S426 specifically includes the following steps: step a. input the point cloud to be fitted; step b. randomly select m data points; step c. calculate the circle model or the line model based on the m data points; step d. traverse the point cloud to be fitted and calculate the distance from each point to the circle model or the line model; step e. determine whether the distance is greater than a preset distance threshold. If the distance is greater than the preset distance threshold, the point does not belong to the point in the circle model or the line model; if the distance is less than or equal to the preset distance threshold, the point belongs to the point in the circle model or the line model; step f. determine whether the number of points in the circle model or the line model is greater than the preset point number threshold. If the number of points in the circle model or the line model is greater than the preset point number threshold, all points belonging to the circle model or the line model are selected as data points and the model is recalculated. If the number of points in the circle model or the line model is less than or equal to the preset point number threshold, return to step b.
[0049] The circle model is a standard circle defined by the center and radius obtained by circle fitting. In step d, the distance from each point to the circle model is calculated as a basis for determining whether the point is close to the standard circle. Preferably, the distance between each point and the nearest point on the standard circle is calculated, or the distance from each point to the center of the circle is calculated.
[0050] For weld offset defects, the present invention adopts a 3D and AI joint detection method and performs defect data training through the YOLO target detection network model. The traditional grayscale image training method has limited data information that can be obtained, and the learned features are relatively abstract. It cannot obtain richer information such as curvature and gradient like 2D image processing technology. It is not effective for detecting welds with diverse defect shapes. The present invention can realize automated detection of weld offset defects. It can not only capture the grayscale, depth and other characteristic information of the defects and quantitative information such as the range and scale of the defects in 2D, but also obtain the curvature distribution information of the weld as learning data. Through the joint detection of 3D and AI, the detection effect and accuracy are further improved.
[0051] In this embodiment, step S430 includes at least the following steps: S431. Extracting the surface point cloud of the aluminum shell of the lithium battery, and obtaining the convex hull of the aluminum shell surface point cloud by a fast convex hull algorithm; S432. Determining whether there is a vertex in the convex hull that is higher than or lower than the plane of the aluminum shell, if so, executing step S433, if not, it is deemed that there is no defect point; S433. Taking the vertex as the center of the circle, all points within a preset radius are regarded as the first type of suspicious defect point cloud; S434. Calculating the normal vector angle and curvature characteristics of the first type of suspicious defect point cloud, and obtaining the second type of suspicious defect point cloud based on the region growing clustering algorithm. Defect point cloud; S435. Compare the two types of defect point clouds and retain the same point clouds to form a defect point set; S436. Calculate the defect information based on the defect point cloud bounding box, and segment the position area corresponding to the defect on the 2D image based on the defect point cloud, and input it into the YOLO target detection network model for defect detection; S437. According to the confidence and defect information of the YOLO target detection network model, comprehensively judge the defect detection score of the position area, and judge whether the defect detection score is greater than the fourth preset threshold. If so, it is deemed that there is an actual defect. If not, it is deemed that there is no actual defect.
[0052] In this embodiment, in step S436, the position area corresponding to the defect is segmented on the 2D image based on the defect point cloud. Specifically, based on the X and Y coordinates of each point in the defect point cloud, the corresponding pixel position on the 2D image is calculated by the camera resolution, thereby segmenting the position area corresponding to the defect.
[0053] Preferably, the preset radius range is 0.5 mm.
[0054] Due to issues with the welding process and equipment cleanliness, slag, pinholes, and tiny spikes are easily generated during the battery cell welding process. Pinhole defects can easily lead to battery cell leakage and serious safety accidents, while slag and spikes can mask defects or hinder subsequent battery cell packaging. These defects are often relatively small and widely distributed, making them difficult to accurately define. If 2D imaging technology is used for detection, the defect features can easily be blurred during the filtering process, resulting in missed detections. In addition, in industrial production, defect images are difficult to collect and samples are insufficient, which can easily lead to insufficient AI model training and a high misjudgment rate.
[0055] Therefore, the present invention uses a strategy of preliminary positioning defects through 3D point clouds and AI model-assisted judgment to accurately define small defects such as slag, pinholes, and fine spikes that are easily generated during the battery core welding process.
[0056] A typical lithium battery casing consists of three parts: the outer aluminum shell, the top cover, and the weld seam. Pinholes and tiny spikes often appear on the aluminum shell. The aluminum shell of a battery cell is typically rolled, resulting in a flat rectangular convex hull. However, due to tiny spikes and pinholes, the hull may appear higher or lower than the plane of the aluminum shell.
[0057] The present invention can make a comprehensive judgment on the pinhole defect detection area through preliminary positioning and auxiliary judgment, thereby further improving the detection effect, accuracy and efficiency.
[0058] In this embodiment, a clustering algorithm based on region growing is used to obtain a second type of suspicious defect point cloud, specifically: the aluminum shell surface point cloud is regarded as a smooth plane point cloud, and the normal vectors and curvature values of all points in the aluminum shell surface point cloud are calculated; any point in the aluminum shell surface point cloud is randomly selected as the initial point, and the normal vector angle and curvature difference between the initial point and the remaining points are compared in turn to determine whether the normal vector angle is greater than the fifth preset threshold and whether the curvature difference is greater than the sixth preset threshold; if the normal vector angle is less than or equal to the fifth preset threshold and the curvature difference is less than or equal to the sixth preset threshold, the points are of the same type and are classified into the cluster set; the points with a normal vector angle greater than the fifth preset threshold and a curvature difference greater than the sixth preset threshold are classified as the second type of suspicious defect point cloud.
[0059] The difference between the above-mentioned region growing-based clustering algorithm and step S423 is that step S423 uses a comparison method of multiple points within the region; the above-mentioned region growing-based clustering algorithm obtains the second type of suspicious defect point cloud by point-to-point comparison, so it does not need to obtain the maximum value of the normal vector angle, and only needs to calculate the normal vector angle between two points. The above-mentioned region growing-based clustering algorithm is used to find similar points. For a plane, the normal vector angle of adjacent points is extremely small, the normal vectors tend to be consistent, and the corresponding curvature values also tend to be consistent. Therefore, the above method can be used to obtain a normal plane point cloud, and the part that exceeds the threshold can be regarded as a suspicious defect point cloud.
[0060] In this embodiment, the lithium battery weld defect detection method also includes step S500. Obtaining different types of defect point clouds, calculating secondary detection parameters of the defects, and confirming whether the lithium battery has corresponding defects, specifically including the following steps: S510. Obtaining different types of defect point clouds and calculating the spatial bounding box of the defect point set; S520. Based on the spatial bounding box of the defect point set, calculating the secondary detection parameters of the defects, the secondary detection parameters include at least the length, width, height, projection surface area, and curvature value of the defect point set, and the calculation process is specifically as follows: calculating the length, width, and height of the spatial bounding box, and using the calculation results as the length, width, and height of the defect point set; calculating the area of the two-dimensional projection surface of the defect point set, and the curvature value of each point in the defect point set, summing the curvature values of all points and taking the average value, and using the calculation result as the curvature value of the defect point set; S530. According to the corresponding thresholds of the secondary detection parameters of the project specification and the defect point set, judging whether the secondary detection parameters are simultaneously greater than the corresponding thresholds, if so, confirming that the lithium battery has the corresponding defect, if not, determining that the lithium battery does not have the corresponding defect.
[0061] Preferably, the curvature value of the defect point set can also be controlled by the maximum curvature value, specifically by calculating the curvature value of each point in the defect point set, taking the maximum value, and using the maximum value as the curvature value of the defect point set.
[0062] Because customers have specific requirements for defect specifications, different measures are often required for defects of different specifications, and relatively small defects can be considered acceptable products. Therefore, the present invention calculates secondary inspection parameters and performs secondary inspection on the defect point set to confirm whether the lithium battery has the corresponding defects, further controlling and reducing the false positive rate.
[0063] Corresponding to the lithium battery weld defect detection method, the present invention provides a lithium battery weld defect detection system, which includes: an image acquisition module, used to acquire the depth image and 2D grayscale image of the lithium battery cell and perform filtering processing; a detection area extraction module, used to extract the defect detection area from the filtered cell depth image, and obtain the detection area corresponding to each defect, and the detection area includes at least one of the concave-convex defect detection area, the weld offset detection area, and the pinhole defect detection area; a point cloud generation module, used to generate a three-dimensional linear point cloud corresponding to each detection area according to the depth image; a defect detection module, used to classify The depth image and three-dimensional linear point cloud of the detection area are calculated in parallel to detect corresponding defects, including at least one of a concave-convex defect detection module, a weld offset detection module, and a pinhole defect detection module; the concave-convex defect detection module is used to detect the concave-convex defect detection area based on a fast convex hull algorithm and a nearest neighbor search method based on Euclidean distance; the weld offset detection module is used to detect the weld offset detection area based on AI defect detection and 3D defect detection; the pinhole defect detection module is used to detect the pinhole defect detection area based on a fast convex hull algorithm and a YOLO target detection network model.
[0064] An embodiment of the present invention further provides a computer-readable storage medium. This computer-readable storage medium may be included in the memory described in the above embodiment, or it may be a separate computer-readable storage medium not incorporated into the device. The computer-readable storage medium stores a lithium battery weld defect detection program, which, when executed by a processor, implements the steps of the lithium battery weld defect detection method described above. The computer-readable storage medium may be a read-only memory, a magnetic disk, or an optical disk.
[0065] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. For similar or identical parts between the various embodiments, reference can be made to each other. For the apparatus embodiments, device embodiments, and storage medium embodiments, since they are generally similar to the method embodiments, their descriptions are relatively simple. For relevant parts, reference can be made to the descriptions of the method embodiments.
[0066] Furthermore, in this document, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0067] While the foregoing description shows and describes preferred embodiments of the present invention, it should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. Rather, the present invention can be used in various other combinations, modifications, and environments, and can be modified within the scope of the present invention by the teachings herein or by techniques or knowledge in the relevant art. Modifications and variations made by those skilled in the art without departing from the spirit and scope of the present invention are intended to be within the scope of the appended claims.
Claims
1. A lithium battery weld defect detection method, characterized in that: The following steps are involved: S100. Obtaining a depth image and a 2D grayscale image of a lithium battery cell and performing filtering processing; S200. Extract the defect detection area from the filtered cell depth image to obtain the detection area corresponding to each defect, wherein the detection area includes at least one of a concave-convex defect detection area, a weld offset detection area, and a pinhole defect detection area; S300. Generate a three-dimensional linear point cloud corresponding to each detection area according to the depth image; S400. Perform parallel calculations on the depth image and the three-dimensional linear point cloud of the detection area to detect corresponding defects, S400 includes at least one of the following steps: S410. Detect the concave-convex defect detection area based on the fast convex hull algorithm and the nearest neighbor search method based on the Euclidean distance; S420. Based on AI defect detection and 3D defect detection, the weld offset detection area is detected; S430. Detect the pinhole defect detection area based on the fast convex hull algorithm and the YOLO target detection network model; The step S420 at least includes the following steps: S421. Calculate the curvature value corresponding to each point on the depth image to obtain a curvature image; S422. Perform color rendering on the 2D grayscale image according to the curvature value and the image depth to form a pseudo-color image for the recognition training of the AI model. The AI model learns the pre-collected defect data set through training to detect weld offset defects and obtain AI defect detection results; S423. Calculate the normal vector and curvature value of the point cloud in the weld offset detection area, and reorder the point cloud in the weld offset detection area to obtain an ordered point cloud; obtain the maximum value of the normal vector angle and the average value of the curvature change of a single row of point clouds, and determine whether the maximum value of the normal vector angle is greater than a second preset threshold, and whether the average value of the curvature change is greater than a third preset threshold. If so, retain the row of point clouds and use it as a suspected defect point cloud. If not, it is deemed that there is no suspected defect point cloud. S424. Perform circle fitting on each line of point cloud in the weld offset detection area to obtain the distribution of circle center, radius and weld height, filter qualified circles according to preset qualified parameters, and perform secondary judgment on the point cloud determined as suspected defect in step S423. If the same line of point cloud is determined as a qualified circle, the suspected defect point cloud is summarized as a qualified point cloud; S425. The center of the circle obtained by circle fitting calculation of all qualified point clouds is used as the imaginary trajectory of the welding gun, and it is determined whether the imaginary trajectory is straight. If so, the welding trajectory is normal, if not, the welding trajectory is offset, and the 3D defect detection result is obtained, and step S426 is executed; S426. According to the straight line fitting, the distance between the center of each point and the straight line is calculated, and the calculated result is used as the offset, and the maximum value of the offset is selected as the weld offset output value; S427. Combine the AI defect detection result obtained in step S422 with the 3D defect detection result obtained in step S425, retain the same defect results in the same set, and obtain a defect point set.
2. A lithium battery weld defect detection method according to claim 1, characterized in that: In the step S100, the filtering process is specifically a mean filtering process.
3. A lithium battery weld defect detection method according to claim 1, characterized in that: When generating a point cloud based on the depth image, step S300 traverses each row and column of the depth image, converts each row of pixels into a point cloud, and stores them separately to generate a three-dimensional single-row point cloud set corresponding to each detection area.
4. A lithium battery weld defect detection method according to claim 1, characterized in that: The step S410 at least includes the following steps: S411. Based on the fast convex hull algorithm, the three-dimensional linear point cloud is converted into a patch structure, and uniform sampling is performed on the convex hull to generate a convex hull point cloud with the same number of points as the weld point cloud; S412. Obtain the nearest neighbor point of each point in the weld point cloud in the convex hull point cloud, and calculate the distance between each point in the weld point cloud and its corresponding nearest neighbor point; S413. Determine whether the distance between each point in the weld point cloud and its corresponding nearest neighbor point is greater than a first preset threshold, if so, it is regarded as a defective point, if not, it is regarded as a non-defective point; S414. Segment the defect points by using a nearest neighbor search method based on Euclidean distance, and segment the point cloud of the defect points into the same set to form a defect point set.
5. A lithium battery weld defect detection method according to claim 1, characterized in that: The circle fitting in step S424 or the straight line fitting in step S426 specifically includes the following steps: Step a. Input the point cloud to be fitted; Step b. Randomly select m data points; Step c. Calculate a circle model or a straight line model based on m data points; Step d. traverse the point cloud to be fitted and calculate the distance from each point to the circle model or the line model; Step e. Determine whether the distance is greater than a preset distance threshold. If the distance is greater than the preset distance threshold, the point does not belong to a point in the circle model or the line model; if the distance is less than or equal to the preset distance threshold, the point belongs to a point in the circle model or the line model; Step f. Determine whether the number of points in the circular model or the straight line model is greater than the preset point threshold. If the number of points in the circular model or the straight line model is greater than the preset point threshold, select all points belonging to the circular model or the straight line model as data points and recalculate the model. If the number of points in the circular model or the straight line model is less than or equal to the preset point threshold, return to step b.
6. A lithium battery weld defect detection method according to claim 1, characterized in that: The step S430 at least includes the following steps: S431. Extracting the surface point cloud of the aluminum shell of the lithium battery, and obtaining the convex hull of the surface point cloud of the aluminum shell by a fast convex hull algorithm; S432. Determine whether there is a vertex in the convex hull that is higher than or lower than the plane of the aluminum shell. If so, execute step S433. If not, it is deemed that there is no defect point. S433. Taking the vertex as the center of the circle, all points within the preset radius are taken as the first type of suspected defect point cloud; S434. Calculate the normal vector angle and curvature characteristics of the first type of suspicious defect point cloud, and obtain the second type of suspicious defect point cloud based on the region growing clustering algorithm; S435. Compare the two types of defect point clouds and retain the same point clouds to form a defect point set; S436. Calculate defect information according to the defect point cloud bounding box, and segment the position area corresponding to the defect on the 2D image according to the defect point cloud, and input it into the YOLO target detection network model for defect detection; S437. According to the confidence and defect information of the YOLO target detection network model, comprehensively judge the defect detection score of the location area, and judge whether the defect detection score is greater than the fourth preset threshold. If so, it is deemed that there is an actual defect; if not, it is deemed that there is no actual defect.
7. A lithium battery weld defect detection method according to claim 6, characterized in that: Based on the clustering algorithm of region growing, the second type of suspicious defect point cloud is obtained, which is as follows: The aluminum shell surface point cloud is regarded as a smooth plane point cloud, and the normal vectors and curvature values of all points of the aluminum shell surface point cloud are calculated; Randomly select any point in the aluminum shell surface point cloud as the initial point, compare the normal vector angle and curvature difference between the initial point and the remaining points in turn, and determine whether the normal vector angle is greater than a fifth preset threshold and whether the curvature difference is greater than a sixth preset threshold; If the normal vector angle is less than or equal to the fifth preset threshold, and the points whose curvature difference is less than or equal to the sixth preset threshold are points of the same type, the points of the same type are classified into the cluster set; Points whose normal vector angle is greater than the fifth preset threshold and whose curvature difference is greater than the sixth preset threshold are classified as the second type of suspicious defect point cloud.
8. A lithium battery weld defect detection method according to claim 1, characterized in that: It also includes step S500. Obtain different types of defect point clouds, calculate the secondary detection parameters of the defects, and confirm whether the lithium battery has corresponding defects, which specifically includes the following steps: S510. Obtain different types of defect point clouds and calculate the spatial bounding box of the defect point set; S520. Based on the spatial bounding box of the defect point set, calculate the secondary detection parameters of the defects, the secondary detection parameters at least include the length, width, height, projection surface area, and curvature value of the defect point set, and the calculation process is specifically: calculate the length, width, and height of the spatial bounding box, and use the calculation results as the length, width, and height of the defect point set; Calculate the area of the two-dimensional projection surface of the defect point set and the curvature value of each point in the defect point set, sum the curvature values of all points and take the average value, and use the calculation result as the curvature value of the defect point set; S530. According to the project specification and the corresponding thresholds of the secondary detection parameters of the defect point set, determine whether the secondary detection parameters are simultaneously greater than the corresponding thresholds. If so, confirm that the lithium battery has the corresponding defect. If not, determine that the lithium battery does not have the corresponding defect.
9. A lithium battery weld defect detection system, characterized in that: include: An image acquisition module is used to acquire a depth image and a 2D grayscale image of a lithium battery cell and perform filtering processing; A detection area extraction module is used to extract defect detection areas from the filtered cell depth image to obtain detection areas corresponding to various defects, where the detection areas include at least one of a concave-convex defect detection area, a weld offset detection area, and a pinhole defect detection area; A point cloud generation module is used to generate a three-dimensional linear point cloud corresponding to each detection area based on the depth image; A defect detection module, used for respectively performing parallel calculations on the depth image and the three-dimensional linear point cloud of the detection area to detect corresponding defects, including at least one of a concave-convex defect detection module, a weld offset detection module, and a pinhole defect detection module; A concave-convex defect detection module is used to detect the concave-convex defect detection area based on a fast convex hull algorithm and a nearest neighbor search method based on Euclidean distance; The weld offset detection module is used to detect the weld offset detection area based on AI defect detection and 3D defect detection; it includes at least the following steps: S427. Merge the AI defect detection result obtained in step S422 and the 3D defect detection result obtained in step S425, retain the same defect results in the same set, and obtain a defect point set; The pinhole defect detection module is used to detect the pinhole defect detection area based on the fast convex hull algorithm and the YOLO target detection network model.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a lithium battery weld defect detection program, which, when executed by a processor, implements the steps of the lithium battery weld defect detection method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Lithium battery cell top cover weld appearance detection algorithm based on deep learning
CN114119464A
Top cover welding spot cloud defect detection method, device and equipment and storage medium
CN115239625A
Method for detecting appearance defects of laser welding seam
CN115797354A
Lithium battery weld defect detection method and system and storage medium
CN116309576A
Cited By
Fabricated pavement prefabricated slab flatness measuring method based on machine vision
CN119223216A
Battery pack defect detection method and device and battery pack defect detection equipment
CN119224020A
Vacuum cup surface defect automatic detection and classification system based on image recognition
CN119359711A
Automatic detection and evaluation method and system for insulating sheet
CN119648701A
Welding detection method in automobile machining process and related system
CN119672018A
