Deep learning algorithm-based echelon utilization cell appearance defect detection method
Through deep learning algorithms and Mask R-CNN model, the problem of insufficient detection accuracy and speed of the appearance defects of the retired power battery cell is solved, and accurate identification and real-time detection of complex defects are achieved, which improves detection efficiency and accuracy .
Patent Information
- Application Number
- CN202411083453.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-12
AI Technical Summary
In the process of using retired power batteries, the accuracy and speed of battery cell appearance defect detection are insufficient, making it difficult to meet the needs of efficient, fast and accurate detection, especially when facing scratch defects with complex grayscale changes. improve.
Using a cascade-based use of battery cell appearance defect detection method based on deep learning algorithm, through image acquisition, data set construction, model construction and training, the Mask R-CNN model is combined with a deep residual network and feature pyramid to achieve the surface defect of battery cell. Positioning and segmentation improves the generalization ability and accuracy of detection.
It significantly improves the speed and accuracy of surface defect detection of cable utilization batteries, can more accurately identify multiple defects, reduce image interference and noise impact, is suitable for large-scale data processing, and realizes real-time high-precision detection.
Smart Images

Figure CN118941544A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of comprehensive utilization of retired power batteries, specifically to the technical field of automated detection of appearance defects in recycled battery cells, and in particular to a method for detecting appearance defects in recycled battery cells based on a deep learning algorithm. Background Art
[0002] With the rapid development of the new energy vehicle industry, power batteries, as its core components, have seen an increase in installed capacity year by year. Based on the general service life of automotive power batteries of 5-8 years, it is predicted that power batteries will soon usher in a "retirement wave", and cascade utilization is considered to be the most energy-saving and environmentally friendly method to solve the problem of recycling retired power batteries. At present, the cascade utilization of retired power batteries faces problems such as real-time high-precision detection of appearance defects, residual energy estimation, and consistency assessment, which urgently need breakthroughs. Compared with new batteries, recycled retired power batteries will inevitably have differences in appearance, safety, performance, etc., especially in the cascade utilization of battery cells. During the use and disassembly of the battery cells, it is inevitable that surface defects such as scratches, pits, and dirt will occur. In 2021, the country issued a new national standard on "Recycling and Utilization of Automotive Power Batteries", which includes "Recycling and Utilization of Automotive Power Batteries Part 3: Requirements for Recycling" (GB / T 34015.3-2021). This standard has certain appearance requirements for recycled single cells, requiring that recycled cells should not have leakage, damage, or corrosion, and the surface should be flat without external injuries or dirt, and the markings should be clear and correct. Therefore, surface defect detection of retired power batteries has become an important part of assessing whether they can be recycled. There is an urgent need for fast, efficient and accurate defect detection technology to detect surface defects of retired power batteries before recycling, to accelerate the exploration of more efficient, safe and sustainable technologies and methods for the recycling of retired power batteries, and to promote the development and innovation of related technologies.
[0003] In the prior art, in order to efficiently, quickly and accurately identify the defects in the appearance of recycled battery cells, the battery appearance defect detection technology mainly relies on artificial vision or traditional image recognition algorithms. Xu Changlu et al. performed defect detection on lithium battery pole pieces by integrating Gamma correction to enhance defect features with LOG algorithm to segment defect areas, and used the Sobel operator to realize the positioning detection of five types of defects in lithium battery pole pieces. There is no way to classify the defects (Xu Changlu, Li Linsheng, Li Jiwei. Lithium battery pole piece defect detection method based on the fusion of Gamma correction and LOG algorithm [J]. Mechanical Design and Research, 2020, 36(06): 105-109). Huang Mengtao et al. proposed a defect detection method based on an improved Canny operator to detect defects with small contrast on the surface of lithium battery pole pieces. The method can classify three types of defects, and the accuracy of the final model is as high as 98%. However, when faced with scratch defect samples with complex grayscale changes, the defect detection accuracy of the model needs to be improved (Huang Mengtao, Lian Yixin. Surface defect detection of lithium battery pole pieces based on improved Canny operator [J]. Chinese Journal of Scientific Instruments, 2021, 42(10): 199-209). The above battery appearance defect detection methods based on traditional image processing methods have poor generalization ability for different types of defects, and the detection speed and accuracy are not high. Summary of the invention
[0004] The purpose of the present invention is to provide a method for detecting appearance defects of recycled battery cells based on a deep learning algorithm, which can accurately identify defects on the surface of recycled battery cells based on image acquisition, data set construction, algorithm improvement, model building and training, improve the speed and accuracy of surface defect detection of recycled battery cells, avoid the influence of image interference and noise interference on the detection results, and be suitable for large-scale data processing. The present invention is implemented by the following specific technical solutions.
[0005] A method for detecting appearance defects of recycled battery cells based on a deep learning algorithm comprises the following steps:
[0006] S1: Collect the appearance images of the battery cells in use and establish the original data set;
[0007] S2: Use image annotation tools to annotate defect information of images in the dataset;
[0008] S3: Data preprocessing: expand the number of data sets and divide the data sets into the required formats for training, validation, and test sets;
[0009] S4: Select the network structure of the detection model Mask R-CNN used;
[0010] S5: Use the training set to train and adjust the model parameters, and verify it with the validation set to select the detection model with the best training effect;
[0011] S6: Use the trained detection model to detect the test set to achieve appearance defect detection of recycled cells; wherein: in step S4, the network structure of Mask R-CNN includes four parts: backbone network Backbone, regional recommendation network RPN, region of interest feature aggregation network RoI Align and output network Output; wherein:
[0012] The backbone network Backbone consists of two parts: the deep residual network ResNet50 and the feature pyramid FPN. ResNet50 performs 5 downsamplings from bottom to top, with downsampling rates of 2, 4, 8, 16 and 32 respectively, and then obtains high-level features containing rich semantic information; FPN adopts top-down upsampling from the highest layer and combines the upsampling results with the feature maps of the same size generated from bottom to top in combination with lateral connections, and finally obtains five feature maps P2, P3, P4, P5 and P6;
[0013] The regional recommendation network RPN performs binary classification prediction and bounding box regression on the five feature maps P2, P3, P4, P5 and P6, and then uses the non-maximum suppression softNMS algorithm to select a certain number of prior box anchors as the final anchors to extract candidate boxes of different sizes and shapes;
[0014] The region of interest feature aggregation network RoI Align uses a bilinear interpolation algorithm to map the obtained candidate box feature maps of different sizes into feature maps of fixed size;
[0015] The output network Output includes a target classification and positioning module and a mask prediction module Mask. The target classification and positioning module, i.e. the positioning branch, is used to perform softmax multi-classification and coordinate regression on the candidate area on the feature map; the mask prediction module Mask, i.e. the segmentation branch, is used to perform full convolution on the candidate area corresponding to the candidate box, and combine the classification results of the target classification positioning module to extract defects for the mask binary classification.
[0016] In the present invention, in step S1, defects in the appearance images of the battery cells, including dirt, film damage, scratches, pits and leakage, are sequentially utilized to perform statistical analysis on the data set to determine the number of images containing different defects.
[0017] In the present invention, in step S2, the image annotation tool is Labelme, the annotation method is polygon annotation, the defects include scratches, dirt, pits, film damage and leakage, the above defects and the battery itself are annotated to obtain a JSON file.
[0018] In the present invention, in step S3, in order to obtain a model with stronger generalization and robustness, and to effectively prevent overfitting of the model, the original image and the annotation information generated by its annotation are expanded at the same time, and then the data set is divided.
[0019] In the present invention, in step S3, in step S3, the expanded data set consists of four parts: storing the original image pic before annotation, storing the .json file json, storing the json folder labelme_json, and storing the extracted .png image cv2_mask.
[0020] In the present invention, in step S4, the Mask R-CNN model adopts a two-stage defect detection algorithm to combine positioning and segmentation into one.
[0021] In the present invention, in step S5, the steps of model training and parameter adjustment are specifically as follows:
[0022] S501: Randomly extract some images of appearance defects of recycled battery cells from the training set to pre-train the ResNet50 convolutional neural network, and obtain a feature extractor dedicated to appearance defects of recycled battery cells;
[0023] S502: using the remaining images of the training set to optimize the parameters of the network model of the entire Mask R-CNN model, adjusting and recording the parameters of each training including the number of iterations, batch size, and learning rate, and observing and recording the speed and degree of model convergence. After multiple iterations of training and transfer learning adjustments, the optimal detection model for appearance defects of cascaded battery cells is obtained;
[0024] S503: Use the validation set images to evaluate and verify the training of the optimal model, and make fine adjustments to obtain the final Mask R-CNN appearance defect detection model.
[0025] In the present invention, the specific steps of step S6 are as follows:
[0026] The optimal detection model selected in step S5 is used to detect the sample data of the test set to obtain the accuracy and recall rate of the model. At the same time, the positions of the battery cells and defects are marked with rectangular frames, the battery cells and defect contours are segmented at the pixel level, and the information of the battery cells and defect types is marked.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] The present invention builds a data set of battery cell appearance images collected by building a light source transmission image acquisition test bench, uses the Mask R-CNN two-stage detection network to perform image processing and evaluation analysis, and gives the type of defects and defect segmentation detection results, and then determines whether the battery cell can be recycled. Compared with traditional computer vision methods, the present invention can detect defects of more forms and characteristics based on deep learning algorithms, and the model is an end-to-end process. Only pictures need to be input to get results. It is simple and fast, which greatly improves the accuracy and efficiency of the current industry's manual battery cell defect detection, and realizes real-time high-precision detection of appearance defects of recycled battery cells.
[0029] The present invention can detect the main appearance defects that affect the safety of the recycling process of retired lithium batteries, greatly improving the accuracy and efficiency of current manual detection, and realizing real-time and high-precision detection of appearance defects of recycled battery cells, which has excellent prospects for industrial application. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a flow chart of the present invention.
[0031] Figure 2 This is the Mask R-CNN network structure framework diagram.
[0032] Figure 3 This is the ResNet50-FPN network structure diagram in the Mask R-CNN model.
[0033] Figure 4 This is the RoI Align network structure diagram in the Mask R-CNN model.
[0034] Figure 5 Flowchart for Mask R-CNN model training.
[0035] Figure 6 This is the detection result diagram of the defect detection model based on Mask R-CNN. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the examples of this application to clearly and completely describe the technical solutions in the examples of this application. Obviously, the examples described are only part of the embodiments of this application, not all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present application and its application or use. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0037] Example 1
[0038] like Figure 1 As shown, the present invention provides a method for detecting appearance defects of recycled battery cells based on a deep learning algorithm, the method comprising the following steps:
[0039] S1: Collect the appearance images of the battery cells in use and establish the original data set;
[0040] S2: Use the Labelme image annotation tool to annotate the defect information of the images in the dataset;
[0041] S3: Data preprocessing, expanding the number of data sets and dividing the data sets into the required formats for training sets, validation sets, and test sets;
[0042] S4: Select the network structure of the detection model Mask R-CNN used;
[0043] S5: Use the training set to train and adjust the model parameters, and verify it with the validation set to select the detection model with the best training effect;
[0044] S6: Use the trained detection model to test the test set and obtain the detection accuracy and recall rate of the model as well as the detection effect diagram of the model.
[0045] The specific implementation of the present invention is described in detail below by taking a cylindrical secondary utilization battery cell as an example.
[0046] As an optimization scheme for the above embodiment, in the step S1, a simple light source transmission image acquisition test bench is built. The cylindrical recycled battery cells are retired 18650 and 21700 cylindrical battery cells. A mobile phone is used to manually collect 625 original images of appearance defects of the recycled battery cells. Dirt, film damage, scratches, pits and leakage are selected as defect detection objects. The data set is statistically analyzed to determine the number of images containing different defects.
[0047] As an optimization solution of the above embodiment, in step S2, the labeling tool is Labelme, the labeling method is polygonal labeling, the defects include scratches, dirt, pits, film damage and leakage, the above defects and the battery itself are labeled to obtain a JSON file. Each image generates a corresponding JSON format labeling file, which contains the ID of the battery cell and all defects in the image and the corresponding outer contour coordinates.
[0048] As an optimization solution of the above embodiment, in step S3, the data preprocessing steps are specifically as follows:
[0049] S301: The original data set and the generated JSON format annotation file are expanded by changing the random times through random methods including changing brightness, adding noise, adding random points, translation and flipping;
[0050] S302: Construct a data set according to the data format requirements of model training: obtain a corresponding json folder after batch processing of each expanded JSON format file, extract the label.png image in each json folder and place it in a new folder;
[0051] S303: Divide each image in the data set and its corresponding auxiliary information into a training set, a validation set, and a test set in a ratio of 8:1:1.
[0052] In a specific embodiment, the 625 original images are expanded to 3750, and the data set is divided into 3000 training sets, 375 validation sets and 375 test sets in a ratio of 8:1:1, and the data set consists of four parts: pic (storing the original images before annotation), json (storing .json files), labelme_json (storing json folders) and cv2_mask (storing the extracted .png images).
[0053] As an optimization solution of the above embodiment, in step S4, Figure 2 As shown in the figure, Mask R-CNN mainly consists of four parts: backbone network (Backbone), region recommendation network (RPN), region of interest feature aggregation network (RoI Align) and output network (Output);
[0054] Among them, the backbone network consists of two parts: the deep residual network ResNet50 and the feature pyramid FPN. Figure 3As shown in the figure, ResNet50 performs 5 downsamplings from bottom to top, with downsampling rates of 2, 4, 8, 16, and 32 respectively. The input image (size is 640×640) is passed through ResNet50 to obtain five layers of feature maps, with sizes of 320×320, 160×160, 80×80, 40×40, and 20×20, respectively. The number of channels is 128, 256, 512, 1024, and 2048, respectively, to obtain high-level features containing rich semantic information. ; FPN uses a top-down method to upsample from the highest layer. It first reduces the dimension through 1×1 convolution and changes the number of channels to 256. It then upsamples to the same size of the previous feature map and adds each element together to obtain the fused four feature maps M2, M3, M4 and M5. Then, a 3×3 convolution kernel is used to process the four fused feature maps to eliminate the aliasing effect and obtain P2, P3, P4 and P5. At the same time, M5 is downsampled by max pooling with a step size of 2 to obtain P6.
[0055] The regional recommendation network RPN performs binary classification prediction and bounding box regression on the five feature maps P2, P3, P4, P5 and P6, and then uses the softNMS non-maximum suppression algorithm to retain the candidate boxes that exceed the overlap threshold and replace them with small values to reduce the missed detection of small target defects in complex environments and select a certain number of anchors as the final anchors. The strategy formula of softNMS non-maximum suppression is:
[0056]
[0057] In the formula, s i is the candidate box score, m is the box with the highest confidence, and b i For all candidate boxes except m in the output box, iou m,b i is the intersection-over-union ratio between the box with the highest confidence and each candidate box, N t It is the NMS threshold, that is, the overlap threshold.
[0058] The RoI Align network module uses the bilinear interpolation method to calculate the values of the four fixed coordinate positions in each unit, and then performs a maximum pooling operation or an average pooling operation on these four points to map the obtained candidate box feature maps of different sizes into feature maps of fixed sizes.
[0059] The output network consists of two parts: the localization branch and the segmentation branch. The localization branch is used to obtain the location and category information in the image. The localization branch includes the classification branch and the regression frame branch, which are used to obtain the location and category information in the image. The segmentation branch is used to obtain the segmentation information of the defect target in the image; Figure 4As shown in the figure, the segmentation branch is essentially a fully convolutional network (FCN). The FCN algorithm is a classic semantic segmentation algorithm that can accurately segment the target in the image. It is an end-to-end network, and its core modules include convolution and deconvolution, that is, the image is first convolved and pooled to continuously reduce the size of its feature map. On this basis, the image is deconvolved to expand the feature map, and each pixel value is classified, finally achieving accurate segmentation of the input image.
[0060] As an optimization solution of the above embodiment, in step S5, the model is trained and optimized, and the process is as follows: Figure 5 As shown in the figure, 1000 pictures of cylindrical recycled battery cells with appearance defects are randomly selected from the 3000 data sets in the training set to pre-train the ResNet50 convolutional neural network and obtain a feature extractor exclusive to the appearance defects of cylindrical recycled battery cells; secondly, the remaining 2000 pictures in the training set are used to optimize the network model parameters of the entire Mask R-CNN model, and the parameters such as the number of iterations, batch size, and learning rate of each training are adjusted and recorded. At the same time, the speed and degree of model convergence are observed and recorded. After multiple iterative training and transfer learning adjustments, the optimal cylindrical recycled battery cell appearance defect detection model is obtained; finally, the 375 pictures in the validation set are used to evaluate and verify the training of the optimal model, and appropriate fine-tuning is made to obtain the final Mask R-CNN appearance defect detection model.
[0061] As an optimization solution of the above embodiment, in step S6, the above final Mask R-CNN appearance defect detection model is used to perform defect detection on 375 images in the test set, and the detection accuracy of the model is 97.44%, and the detection effect diagram of the model is as follows: Figure 6 shown.
[0062] Example 2
[0063] In this embodiment, a method for detecting appearance defects of recycled battery cells based on a deep learning algorithm is first performed, and then the original images are preprocessed and manually annotated, and then the annotated images are data enhanced to expand the image data volume of the recycled battery cell data set, and the data set is divided into a training set, a validation set, and a test set at an 8:1:1 ratio, and sent to the selected Mask R-CNN two-stage defect detection model for training and fine-tuning, and the model is evaluated to select the best model, and the model is used to detect pit defects on the appearance of recycled battery cells. The specific steps are as follows:
[0064] Step S1 collects appearance images of battery cells in use and establishes an original data set;
[0065] Step S2 uses the polygon annotation method in the Labelme image annotation tool to annotate the pit defect information of the image in the data set;
[0066] Step S3: data preprocessing, expanding the number of data sets and dividing the data sets into the required formats of training sets, validation sets and test sets;
[0067] Step S4 selects the network structure of the detection model Mask R-CNN used;
[0068] Step S5: train and adjust the model with the training set, and verify it with the validation set to select the detection model with the best training effect;
[0069] In step S6, 50 pictures of used battery cells containing pit defects are collected, and the 50 pictures are detected using the best detection model in step S5. It is found that the detection accuracy of the model for pit defects is 98.35%, which proves that the model performs well in detecting pit defects.
[0070] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting appearance defects of recycled battery cells based on a deep learning algorithm, characterized in that: The following steps are involved: S1: Collect the appearance images of the battery cells in use and establish the original data set; S2: Use image annotation tools to annotate defect information of images in the dataset; S3: Data preprocessing: expand the number of data sets and divide the data sets into the required formats for training, validation, and test sets; S4: Select the network structure of the detection model Mask R-CNN used; S5: Use the training set to train and adjust the model parameters, and verify it with the validation set to select the detection model with the best training effect; S6: Use the trained detection model to detect the test set to achieve appearance defect detection of recycled battery cells; where: In step S4, the network structure of Mask R-CNN includes four parts: backbone network Backbone, region recommendation network RPN, region of interest feature aggregation network RoI Align and output network Output; The backbone network Backbone consists of two parts: the deep residual network ResNet50 and the feature pyramid FPN. ResNet50 performs 5 downsamplings from bottom to top, with downsampling rates of 2, 4, 8, 16, and 32, respectively, to obtain high-level features containing rich semantic information; FPN uses top-down upsampling from the highest layer and combines lateral connections to fuse the upsampling results with the feature maps of the same size generated from bottom to top, and finally obtains five feature maps P2, P3, P4, P5 and P6; The regional recommendation network RPN performs binary classification prediction and bounding box regression on the five feature maps P2, P3, P4, P5 and P6, and then uses the non-maximum suppression softNMS algorithm to select a certain number of prior box anchors as the final anchors; The region of interest feature aggregation network RoI Align uses a bilinear interpolation algorithm to map the obtained candidate box feature maps of different sizes into feature maps of fixed size; The output network Output includes a target classification and positioning module and a mask prediction module Mask. The target classification and positioning module is used to perform softmax multi-classification and coordinate regression on the candidate area on the feature map; the mask prediction module Mask is used to perform full convolution on the candidate area, combine the classification results of the target classification and positioning module, extract defects from the mask binary classification, and realize segmentation and recognition.
2. The method for detecting appearance defects of recycled battery cells based on a deep learning algorithm according to claim 1, characterized in that: In step S1, defects in the appearance images of the battery cells, including dirt, film damage, scratches, pits and leakage, are sequentially used to perform statistical analysis on the data set to determine the number of images containing different defects.
3. The method for detecting appearance defects of recycled battery cells based on a deep learning algorithm according to claim 1, characterized in that: In step S2, the image annotation tool is Labelme, the annotation method is polygon annotation, the defects include scratches, dirt, pits, film damage and leakage, the above defects and the battery itself are annotated to obtain a JSON file.
4. The method for detecting appearance defects of recycled battery cells based on a deep learning algorithm according to claim 1, characterized in that: In step S3, the expanded data set consists of four parts: pic for storing the original image before annotation, json for storing the .json file, labelme_json for storing the json folder, and cv2_mask for storing the extracted .png image.
5. The method for detecting appearance defects of recycled battery cells based on a deep learning algorithm according to claim 1, characterized in that: In step S5, the steps of model training and parameter adjustment are as follows: S501: Randomly extract some images of appearance defects of recycled battery cells from the training set to pre-train the ResNet50 convolutional neural network, and obtain a feature extractor dedicated to appearance defects of recycled battery cells; S502: using the remaining images of the training set to optimize the parameters of the network model of the entire Mask R-CNN model, adjusting and recording the parameters of each training including the number of iterations, batch size, and learning rate, and observing and recording the speed and degree of model convergence. After multiple iterations of training and transfer learning adjustments, the optimal detection model for appearance defects of cascaded battery cells is obtained; S503: Use the validation set images to evaluate and verify the training of the optimal model, and make fine adjustments to obtain the final Mask R-CNN appearance defect detection model.
6. The method for detecting appearance defects of recycled battery cells based on a deep learning algorithm according to claim 1, characterized in that: The specific steps of step S6 are as follows: The optimal detection model selected in step S5 is used to detect the sample data of the test set to obtain the accuracy and recall rate of the model. At the same time, the positions of the battery cells and defects are marked with rectangular frames, the battery cells and defect contours are segmented at the pixel level, and the information of the battery cells and defect types is marked.
