Battery defect detection method based on multi-level image processing and deep learning model cooperation
By collaborating multi-level image processing with deep learning models, using traditional algorithms for preliminary feature extraction and deep learning models for subsequent detection, the problems of insufficient accuracy and robustness in battery defect detection are solved, and efficient and accurate battery defect detection is achieved.
Patent Information
- Application Number
- CN202311137503.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-05
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-09-05
AI Technical Summary
Among existing battery defect detection methods, traditional image processing algorithms are unable to capture complex defect patterns, and deep learning methods are limited by labeled data, resulting in insufficient detection accuracy and robustness. In addition, a single detection algorithm lacks adaptability and is inefficient.
Multi-level image processing and deep learning models are used in collaboration, traditional algorithms are used for preliminary feature extraction and contour detection, and deep learning models are combined for subsequent defect detection. The Hough circle detection algorithm and image cropping are used to reduce background interference and improve detection accuracy and robustness.
It achieves efficient and accurate battery defect detection, improves detection efficiency and sensitivity, reduces the computational complexity of deep learning models, enhances the generalization ability and real-time performance of the model, and is suitable for real-time detection of battery production lines.
Smart Images

Figure CN117115125B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of battery manufacturing and industrial detection technology, and specifically relates to a battery defect detection method that collaborates with multi-level image processing and deep learning models. Background Art
[0002] Alkaline batteries, as a common power source, are widely used in industrial production for various portable electronic devices, sensors, remote controls, and other applications. However, inevitable defects during the production process can lead to degraded battery performance, shortened battery life, and even equipment failures and production line interruptions. Therefore, timely and accurate defect detection in industrial production lines is crucial for ensuring product quality, improving production efficiency, and reducing costs.
[0003] Against this backdrop, image processing and deep learning technologies have gradually become key technologies for battery defect detection in industrial production lines. However, the application of image processing and deep learning technologies in current battery defect detection methods has the following problems:
[0004] Traditional image processing algorithms are usually based on manually designed feature extractors, which cannot capture complex battery defect patterns, limiting the accuracy and robustness of defect detection methods. There are many types of appearance defects in batteries in industrial production lines, and traditional algorithms find it difficult to effectively detect and distinguish all types of defects. Deep learning technology has made significant progress in the field of image processing, but its application in industrial production lines is limited by labeled data. Obtaining sufficient labeled data is a time-consuming and expensive task, especially for various types of battery defects. The collection and annotation costs of labeled data are very high, which limits the practical application of deep learning methods in industrial production lines. In addition, current battery defect detection methods often only focus on a single detection algorithm, and in industrial production lines, the appearance characteristics of battery defects are irregular, so the use of a single-stage detection method has problems such as feature extraction limitations, insufficient adaptability, and low efficiency. Summary of the Invention
[0005] In response to the above-mentioned problems existing in the prior art, the purpose of the present invention is to provide a battery defect detection method that collaborates with multi-level image processing and deep learning models. The method uses traditional algorithms to process the original image and uses the Hough circle detection algorithm to extract the contour, and makes a preliminary judgment based on the extraction results; if the circle contour is extracted successfully, the image is cropped by the center of the circle, retaining only the battery area and removing the background, and the cropped battery image is input into the deep learning model for subsequent defect detection; this method fully utilizes the advantages of traditional algorithms in quickly locating battery contours, and improves detection accuracy and robustness through deep learning models, providing the battery manufacturing industry with an efficient and reliable quality control method.
[0006] The present invention provides the following technical solution: a battery defect detection method that collaborates with multi-level image processing and a deep learning model, comprising the following steps:
[0007] Step 1: Use the image acquisition system to collect battery production line data in real time and perform grayscale processing on the original battery samples;
[0008] Step 2: Extract the contour of the preprocessed image and make a preliminary judgment based on whether the contour exists;
[0009] Step 3: If the contour exists, crop the image based on the contour radius and coordinate information to remove the background information and retain the battery image area;
[0010] Step 4: Transform the cropped image to further reduce background information interference;
[0011] Step 5: Input the cropped battery image into the pre-trained deep learning model for subsequent defect detection.
[0012] Furthermore, in step 2, the specific process of performing contour extraction on the pre-processed image is as follows:
[0013] 1) Perform bilateral filtering on the grayscale processed image to effectively remove noise in the image while maintaining edge information and image clarity;
[0014] 2) Using the Canny operator, edge detection is performed based on the change of image gradient, and the edge pixel points are found to obtain the edge contour of the battery image;
[0015] 3) Perform Hough transform on the image processed in step 2) to detect circles in the image. By setting the min_radius and max_radius parameters, circles other than the battery sample outline are filtered out. The edge detection threshold is set to obtain the outermost circular outline of the battery sample and perform preliminary detection. If no circle is detected, it is judged as an NG sample.
[0016] Furthermore, in step 3, the specific process of performing image cropping according to the contour radius and coordinate information is as follows:
[0017] 1) Based on the identified circular contour of the battery image, the bounding rectangle function is used to obtain the position and size information of the maximum circumscribed rectangle of the circular contour;
[0018] The size information includes the X coordinate of the upper left corner of the outer rectangle, the Y coordinate of the upper left corner of the outer rectangle, the width W of the rectangle, and the height H of the rectangle;
[0019] 2) According to the information of the original image and the outer rectangle of the circle outline, and setting the size inclusion threshold r, calculate the coordinates of the cropping area (X min,Y min ,X max ,Y min );
[0020] 3) Crop the specified area from the original image and calculate the new center position (new_x_center, new_y_center) of the cropped area for subsequent operations;
[0021] 4) Calculate the maximum radius (max_radius) of the clipping area as the radius information of the circle for subsequent operations.
[0022] Furthermore, in step 4, the cropped image is transformed to extract the largest circular area to reduce the interference of background information. The specific steps include:
[0023] 1) Create a mask of the same size based on the image size information after cropping;
[0024] 2) Using the (new_x_center, new_y_center) obtained in step 3 as the new center coordinates and max_radius as the radius, draw a white (255, 255, 255) circle on the mask;
[0025] 3) Use the inclusion threshold to expand the size of the mask, and use the mask to perform a bitwise AND operation on the cropped image to extract the largest circular area and obtain a new battery image as the input of the subsequent model.
[0026] By adopting the above technology, compared with the prior art, the beneficial effects of the present invention are as follows:
[0027] 1) Comprehensive feature extraction: This invention combines traditional algorithms with deep learning models, fully leveraging the advantages of traditional algorithms for preliminary feature extraction and deep learning models for learning higher-level feature expressions to achieve comprehensive feature extraction, which can better capture the diversity and complexity of battery defects.
[0028] 2) Multi-stage determination: This invention adopts a multi-stage detection method, using traditional image processing algorithms for preliminary screening, removing obvious non-defective areas, and then using a deep learning model for in-depth judgment. Multi-stage determination can improve detection efficiency and reduce the computational load of the deep learning model, making defect detection more efficient and rapid, and significantly improving the accuracy and sensitivity of battery defect detection; this is crucial for ensuring battery quality and safety.
[0029] 3) Strong generalization capability: The present invention adopts a multi-stage detection strategy, which enables the deep learning model to better generalize to new battery defect samples, reducing the risk of overfitting, thereby improving the robustness and reliability of the model. Even when facing unknown types of defects, the method still has strong detection capabilities.
[0030] 4) Real-time and high efficiency: In the present invention, due to the advantages of multi-stage judgment and deep learning models, battery defect detection can be completed in a relatively short time. It is suitable for scenarios such as battery production lines that require real-time detection and can effectively improve the production efficiency of the production line. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is the overall structure flow chart of the present invention;
[0032] Figure 2 This is a schematic diagram of the collaborative detection of the traditional image processing algorithm and deep learning model of the present invention;
[0033] Figure 3 Schematic diagram of image transformation for contour extraction and cropping using Hough circle transform in the present invention;
[0034] Figure 4 These are example diagrams of battery standard image samples and typical defect samples processed in the dual-stage process in the present invention, where (a) is a standard sample, (b) is defect example 1, and (c) is defect example 2. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0036] On the contrary, the present invention covers any alternatives, modifications, equivalents, and solutions that fall within the spirit and scope of the present invention as defined by the claims. Furthermore, to facilitate a better understanding of the present invention, certain specific details are described in detail below in the detailed description of the present invention. Those skilled in the art will be able to fully understand the present invention without these details.
[0037] See also Figures 1-4 The battery defect detection method based on multi-level image processing and deep learning model includes the following steps:
[0038] Step 1: Use the image acquisition system to collect battery production line data in real time and perform grayscale processing on the original battery samples.
[0039] Step 2: Extract the contour of the preprocessed image and make a preliminary judgment based on whether the contour exists. The specific process of extracting the contour of the preprocessed image is as follows:
[0040] 1) Perform bilateral filtering on the grayscale processed image to effectively remove noise in the image while maintaining edge information and image clarity;
[0041] 2) Using the Canny operator, edge detection is performed based on the change of image gradient, and the edge pixel points are found to obtain the edge contour of the battery image;
[0042] 3) Perform Hough transform on the image processed in step 2) to detect circles in the image. By setting the min_radius and max_radius parameters, circles other than the battery sample outline are filtered out. The edge detection threshold is set to obtain the outermost circular outline of the battery sample and perform preliminary detection. If no circle is detected, it is judged as an NG sample.
[0043] Step 3: If a contour exists, crop the image based on the contour radius and coordinate information, removing the background information and retaining only the battery image area. The specific process is as follows:
[0044] Step 3.1: Convert the input image into a grayscale image and perform bilateral filtering on the grayscale image to remove noise and retain edge information. Use Canny edge detection to obtain the circle contour in the image.
[0045] Step 3.2: Traverse all the circle contours obtained in step 1, enclose the rectangles in turn, and obtain the position and size information (X, Y, W, H) of the largest outer rectangle, set the size inclusion threshold r, and obtain the coordinates of the cropping area (X min ,Y min ,X max ,Y min ), crop the image;
[0046] Where: (X min =X-residual, X max =X+residual,Y min =Y-residual,Y max =Y+residual)
[0047] Step 3.3. Calculate the center coordinates (new_x_center, new_y_center) and maximum radius (max_radius) of the cropped new image, create a mask the same size as the new image, and draw a white circle on the mask with the center coordinates of the new image as the center and (max_radius + residual) as the radius. This mask will be used to cut out the circular area of the battery and remove background information interference;
[0048] Step 3.4: Use bitwise operations to apply the mask to the cropped new image, and obtain the cropped circular area image as the input of the deep learning model for subsequent detection.
[0049] Step 4: Transform the cropped image to further reduce background interference, focus the subsequent deep learning model on the battery area, reduce the processing of irrelevant information, and improve the efficiency of the deep learning model. The specific steps are as follows:
[0050] Step 4.1: Create a mask of the same size based on the cropped image size information.
[0051] Step 4.2: Use (new_x_center, new_y_center) obtained in step 3 as the new center coordinates and max_radius as the radius to draw a white (255, 255, 255) circle on the mask.
[0052] Step 4.3: Use the inclusion threshold to expand the size of the mask, and use the mask to perform a bitwise AND operation on the cropped image to extract the largest circular area and obtain a new battery image as the input for the subsequent model.
[0053] Step 5: Input the cropped battery image into the pre-trained deep learning model for subsequent defect detection; the details are as follows:
[0054] In the subsequent detection stage, ResNet-50 is used as the architecture of the deep learning model, and the original fully connected layer is converted into a binary classification problem of OK and NG. The new battery cropped image obtained in step 4 is used as the model input, so that the model can focus more on specific tasks and avoid background information interference. The deep learning model can more accurately perform binary classification judgment on battery samples and determine whether they are NG samples, thereby achieving effective detection of battery defects.
[0055] The multi-stage alkaline battery defect detection method based on traditional image processing algorithms and deep learning in the present invention has many technical advantages such as real-time and high efficiency, adaptability, interpretability, data enhancement and transfer learning. These advantages together provide comprehensive and powerful support for battery defect detection, making this method a highly potential and competitive innovative technology, bringing substantial progress to battery manufacturing and application fields, and providing new possibilities for the efficient, accurate and reliable implementation of battery defect detection.
[0056] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A battery defect detection method based on multi-level image processing and deep learning model, characterized by: The following steps are involved: Step 1: Use the image acquisition system to collect battery production line data in real time and perform grayscale processing on the original battery samples; Step 2: Extract the contour of the pre-processed image and make a preliminary judgment based on whether the contour exists. In step 2, the specific process of extracting the contour of the pre-processed image is as follows: 1) Perform bilateral filtering on the grayscale processed image to effectively remove noise in the image while maintaining edge information and image clarity; 2) Use the Canny operator to perform edge detection based on the change of image gradient, find the edge pixel points and obtain the edge contour of the battery image; 3) Perform Hough transform on the image processed in step 2) to detect circles in the image. By setting the min_radius and max_radius parameters, filter out circles other than the battery sample outline. Set the edge detection threshold to obtain the outermost circle outline of the battery sample and perform preliminary detection. If no circle is detected, it is judged as an NG sample. Step 3: If the contour exists, the image is cropped based on the contour radius and coordinate information, removing the background information and retaining the battery image area. In step 3, the specific process of cropping the image based on the contour radius and coordinate information is as follows: 1) Based on the identified circular contour of the battery image, the bounding rectangle function is used to obtain the position and size information of the maximum circumscribed rectangle of the circular contour; The size information includes the X coordinate of the upper left corner of the outer rectangle, the Y coordinate of the upper left corner of the outer rectangle, the width W of the rectangle, and the height H of the rectangle; 2) According to the information of the original image and the outer rectangle of the circle outline, and setting the size inclusion threshold r, calculate the coordinates of the cropping area ( , , , ); 3) Crop the specified area from the original image and calculate the new center position (new_x_center, new_y_center) of the cropped area for subsequent operations; 4) Calculate the maximum radius of the clipping area (max_radius) as the radius information of the circle for subsequent operations; Step 4: Transform the cropped image to further reduce background information interference; In step 4, the cropped image is transformed to extract the largest circular area to reduce the interference of background information. The specific steps include: 1) Create a mask of the same size based on the cropped image size information; 2) Use the new x-center, y-center values obtained in step 3 as the new center coordinates and max_radius as the radius to draw a white (255, 255, 255) circle on the mask. 3) Expand the size of the mask using the inclusion threshold, and perform a bitwise AND operation on the cropped image using the mask to extract the largest circular area, obtaining a new battery image as input for subsequent models; Step 5: Input the cropped battery image into the pre-trained deep learning model for subsequent defect detection.
Citation Information
Patent Citations
Large-tow carbon fiber defect detection method and system based on combination of image processing and deep learning
CN116051502A
Deep-learning-based surface defect detection method for mobile phone battery
WO2023155069A1