Lithium battery surface defect detection method based on deep learning multi-channel fusion
Through a multi-channel fusion method based on deep learning, the YoLov8 neural network model was constructed, which solved the problems of low efficiency, low accuracy and poor applicability of lithium batteries, and achieved efficient and accurate defect detection, which was suitable for industrial applications.
Patent Information
- Application Number
- CN202411373413.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, lithium batteries have problems of low surface defect detection efficiency, low accuracy and poor applicability.
Using a multi-channel fusion method based on deep learning, the grayscale images and depth images of the lithium battery surface are collected, preprocessed and data enhancement are carried out, and the YoLov8 neural network model is constructed, training and testing is performed, and the surface defect detection model of lithium battery is generated. To detect defects on the surface of the lithium battery to be tested.
Improve the efficiency and accuracy of surface defect detection of lithium batteries, reduce the time and cost of manual inspection, overcome the problem of insufficient defect characteristics caused by light and other factors, enhance the model's ability to learn defect characteristics, and is suitable for different production environments. test under.
Smart Images

Figure CN119478486A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery defect detection, and in particular to a lithium battery surface defect detection method, system, terminal and computer-readable storage medium based on deep learning multi-channel fusion. Background Art
[0002] The production process of lithium batteries is a multi-stage operation process involving precision engineering and high automation, including the preparation of electrode materials, the production of pole pieces, the assembly of battery cells, the injection and aging, and finally the packaging and transportation. During the production, testing and transportation process, scratches, pits, convex bumps, breakage and other defects will appear on the surface of lithium batteries, which will affect the appearance of lithium battery products and even cause safety hazards. Therefore, it is very important to conduct defect detection on lithium batteries and evaluate their safety performance before leaving the factory for use.
[0003] The current methods for detecting surface defects of lithium batteries are mainly manual detection and machine vision detection. Manual detection is inefficient, time-consuming, and costly, and may lead to missed detections or false detections when the defect features are unclear or when people are tired. Machine vision detection relies on large amounts of high-quality data, which is very limited in small-batch production environments. Moreover, when the products or processes on the production line change, the system may need to be redesigned and adjusted, which makes it less applicable.
[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0005] The main purpose of the present invention is to provide a lithium battery surface defect detection method, system, terminal and computer-readable storage medium based on deep learning multi-channel fusion, aiming to solve the problems of low efficiency, low accuracy and poor applicability in the detection of lithium battery surface defects in the prior art.
[0006] To achieve the above-mentioned purpose of the invention, the present invention provides a lithium battery surface defect detection method based on deep learning multi-channel fusion, and the lithium battery surface defect detection method based on deep learning multi-channel fusion includes:
[0007] Collect grayscale images and depth images of the surface of lithium batteries with surface defects;
[0008] Preprocessing the grayscale image and the depth image to obtain an RGB image;
[0009] Performing data enhancement processing on the RGB image and performing defect annotation to obtain an image data set;
[0010] The YoLov8 neural network model is trained and tested according to the image data set to obtain a lithium battery surface defect detection model;
[0011] The surface image of the lithium battery to be tested is collected, the surface image of the lithium battery to be tested is input into the lithium battery surface defect detection model to perform lithium battery surface defect detection, and the lithium battery surface defect detection result is output.
[0012] Optionally, preprocessing the grayscale image and the depth image to obtain an RGB image specifically includes:
[0013] fusing the grayscale information of the grayscale image and the depth information of the depth image in a color channel manner to obtain a reconstructed RGB image;
[0014] The reconstructed RGB image is segmented to obtain a plurality of RGB images with a resolution less than a threshold.
[0015] Optionally, fusing the grayscale information of the grayscale image and the depth information of the depth image in a color channel manner to obtain a reconstructed RGB image specifically includes:
[0016] Respectively extracting grayscale information of the grayscale image and depth information of the depth image;
[0017] The grayscale information is used as the first channel and the third channel of the RGB color channel, and the depth information is normalized and then multiplied by a preset value as the second channel of the RGB color channel to obtain a reconstructed RGB image.
[0018] Optionally, performing data enhancement processing on the RGB image and performing defect annotation to obtain an image data set specifically includes:
[0019] Performing data enhancement processing on the RGB image by flip, hsv or copypaste data enhancement method to expand the RGB image data;
[0020] Using a labeling tool to label defects on the grayscale image, defining the category and location of each defect, and obtaining a defect label file;
[0021] Based on the RGB images and defect label files after data enhancement, an image dataset is constructed.
[0022] Optionally, the training and testing of the YoLov8 neural network model according to the image data set to obtain a lithium battery surface defect detection model specifically includes:
[0023] Dividing the image dataset into a training set and a test set;
[0024] Constructing a YoLov8 neural network model, training the YoLov8 neural network model using the training set, and continuously adjusting network parameters by monitoring the performance of the loss function and the test set;
[0025] After multiple iterations, when the YoLov8 neural network model reaches qualified performance indicators on the test set, the training process is ended and the optimal model is saved as the lithium battery surface defect detection model.
[0026] Optionally, the collecting the surface image of the lithium battery to be tested, inputting the surface image of the lithium battery to be tested into the lithium battery surface defect detection model to perform lithium battery surface defect detection, and outputting the lithium battery surface defect detection result specifically includes:
[0027] Acquire a surface image of the lithium battery to be tested, wherein the surface image of the lithium battery to be tested includes a grayscale image and a depth image of the surface of the lithium battery to be tested;
[0028] Inputting the grayscale image and the depth image of the surface of the lithium battery to be tested into the lithium battery surface defect detection model for detection, and detecting the type and position of the surface defects of the lithium battery to be tested;
[0029] The category and position of the surface defect of the lithium battery to be tested output by the lithium battery surface defect detection model are reprojected onto a grayscale image for display.
[0030] Optionally, the YoLov8 neural network model includes a backbone network, a feature pyramid network and a detection head, the backbone network includes a CBS module, a C2f module and an SPPF module, the backbone network is used to extract features; the feature pyramid network is used to fuse the features extracted by the backbone network; the detection head is an anchor-free and decoupled detection head, and the detection head is used to obtain the category and location information of the detection target based on the features extracted by the backbone network and the features fused by the feature pyramid network.
[0031] In addition, in order to achieve the above-mentioned purpose of the invention, the present invention also provides a lithium battery surface defect detection system based on deep learning multi-channel fusion, and the lithium battery surface defect detection system based on deep learning multi-channel fusion includes:
[0032] Data acquisition module: used to collect grayscale images and depth images of the surface of lithium batteries with surface defects;
[0033] Data preprocessing module: used to preprocess the grayscale image and the depth image to obtain an RGB image;
[0034] Data enhancement processing and defect annotation module: used to perform data enhancement processing on the RGB image and perform defect annotation to obtain an image data set;
[0035] A lithium battery surface defect detection model generation module is used to train and test the YoLov8 neural network model according to the image data set to obtain a lithium battery surface defect detection model;
[0036] Lithium battery surface defect detection module: used to collect the surface image of the lithium battery to be tested, input the surface image of the lithium battery to be tested into the lithium battery surface defect detection model to perform lithium battery surface defect detection, and output the lithium battery surface defect detection result.
[0037] In addition, to achieve the above-mentioned purpose of the invention, the present invention also provides a terminal, which includes: a memory, a processor, and a lithium battery surface defect detection program based on deep learning multi-channel fusion stored in the memory and run on the processor, and when the lithium battery surface defect detection program based on deep learning multi-channel fusion is executed by the processor, the steps of the lithium battery surface defect detection method based on deep learning multi-channel fusion as described above are implemented.
[0038] In addition, to achieve the above-mentioned purpose of the invention, the present invention also provides a computer-readable storage medium, which stores a lithium battery surface defect detection program based on deep learning multi-channel fusion. When the lithium battery surface defect detection program based on deep learning multi-channel fusion is executed by a processor, the steps of the lithium battery surface defect detection method based on deep learning multi-channel fusion as described above are implemented.
[0039] In the present invention, grayscale images and depth images of the surface of a lithium battery with surface defects are collected; the grayscale images and depth images are preprocessed to obtain RGB images; data enhancement processing is performed on the RGB images, and defects are annotated to obtain an image data set; the YoLov8 neural network model is trained and tested according to the image data set to obtain a lithium battery surface defect detection model; the surface image of a lithium battery to be tested is collected, and the surface image of the lithium battery to be tested is input into the lithium battery surface defect detection model to perform lithium battery surface defect detection, and the lithium battery surface defect detection result is output. The present invention effectively improves the efficiency and accuracy of lithium battery surface defect detection through a deep learning method, and reduces the time and cost of manual inspection; utilizes multi-channel fusion of depth information and grayscale information to overcome the problem that the features of defects in grayscale images are not obvious due to illumination or other factors, and utilizes depth information to better detect defects such as pits and convex hulls whose grayscale changes are not obvious, thereby compensating for the limitations of grayscale information and enhancing the model's learning ability for defect features, thereby improving the detection accuracy; through the application of data enhancement and complex network structures, the model has better generalization ability, can adapt to lithium battery surface defect detection in different production environments, and is more suitable for industrial applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a flow chart of a preferred embodiment of the lithium battery surface defect detection method based on deep learning multi-channel fusion of the present invention;
[0041] Figure 2 It is another flow chart of a preferred embodiment of the lithium battery surface defect detection method based on deep learning multi-channel fusion of the present invention;
[0042] Figure 3 It is a structural diagram of a preferred embodiment of the lithium battery surface defect detection system based on deep learning multi-channel fusion of the present invention;
[0043] Figure 4 It is a structural diagram of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. 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.
[0045] The rapid development of the global new energy vehicle market has increased the demand for lithium batteries and promoted the rapid rise of the lithium battery industry. In this process, quality control of lithium battery production has become a key issue. At the same time, the deep integration of new generation information technology and manufacturing is also driving the manufacturing industry to undergo a major transformation, gradually realizing the transition from quantity growth to quality improvement.
[0046] The production process of lithium batteries is a multi-stage operation process involving precision engineering and high automation, including the preparation of electrode materials, the production of pole pieces, the assembly of battery cells, the injection and aging of liquid, and finally the packaging and transportation. During the production, testing and handling process, scratches, pits, convex bumps, damage and other defects will appear on the surface of lithium batteries. These defects affect the appearance of lithium battery products and may even cause safety hazards. Therefore, it is very important to conduct defect detection on lithium batteries and evaluate their safety performance before leaving the factory. At present, the surface defect detection method of lithium batteries in industry is mainly manual detection. Quality inspectors carefully detect dents and pits on the surface of lithium batteries under strong light conditions, and the degree of intelligence is not high.
[0047] The current methods for detecting surface defects of lithium batteries are mainly manual inspection methods and machine vision inspection methods. Although manual visual inspection is simple, intuitive and highly flexible, it is inefficient, time-consuming and costly, and may cause missed detections or false detections when the defect features are unclear or when people are tired. Compared with manual inspection, machine vision inspection methods use neural networks to train and learn the collected images, automatically adapt to different types of defect features, and finally classify and detect defects. This method has good generalization capabilities. However, this method relies on a large amount of high-quality data, which is very limited in small-batch production environments, and when the products or processes on the production line change, the system may need to be redesigned and adjusted. In addition, the effect of machine vision inspection methods on complex scenes may not be as good as that of human eyes, such as when visual information is blurred or blocked.
[0048] In order to solve the above technical problems, the present invention provides a lithium battery surface defect detection method based on deep learning multi-channel fusion, which collects grayscale images and depth images of the surface of a lithium battery with surface defects; preprocesses the grayscale image and the depth image to obtain an RGB image; performs data enhancement processing on the RGB image, and performs defect annotation to obtain an image data set; trains and tests a YoLov8 neural network model according to the image data set to obtain a lithium battery surface defect detection model; collects the surface image of a lithium battery to be tested, inputs the surface image of the lithium battery to be tested into the lithium battery surface defect detection model to perform lithium battery surface defect detection, and outputs the lithium battery surface defect detection result. The present invention effectively improves the efficiency and accuracy of lithium battery surface defect detection through a deep learning method, and reduces the time and cost of manual inspection; utilizes multi-channel fusion of depth information and grayscale information to overcome the problem that the features of defects in grayscale images are not obvious due to illumination or other factors, and utilizes depth information to better detect defects such as pits and convex hulls whose grayscale changes are not obvious, thereby compensating for the limitations of grayscale information and enhancing the model's learning ability for defect features, thereby improving the detection accuracy; through the application of data enhancement and complex network structures, the model has better generalization ability, can adapt to lithium battery surface defect detection in different production environments, and is more suitable for industrial applications.
[0049] The application content is further explained below through the description of embodiments in conjunction with the accompanying drawings.
[0050] A preferred embodiment of the lithium battery surface defect detection method based on deep learning multi-channel fusion of the present invention is as follows: Figure 1 and Figure 2 As shown, specifically including:
[0051] S1. Collect grayscale images and depth images of the surface of a lithium battery with surface defects.
[0052] In one implementation of this embodiment, a high-precision industrial camera and a depth camera are used at the same location to collect images of the surface of a lithium battery with a large number of surface defects, and obtain grayscale images and depth images with 2000*3000 pixels.
[0053] The production process of lithium batteries is a multi-stage operation process involving precision engineering and high automation, including the preparation of electrode materials, the production of pole pieces, the assembly of battery cells, the injection and aging, and finally the packaging and transportation. During the production, testing and handling process, scratches, pits, convex hulls, breakage and other defects will appear on the surface of lithium batteries. These defects affect the appearance of lithium battery products and may even cause safety hazards. Therefore, it is very important to perform defect detection on lithium batteries and evaluate their safety performance before leaving the factory for use. In this embodiment, the data collected on the surface defects of lithium batteries include relatively many scratches, as well as a small number of pits, convex points, burst points and other uneven defects with obvious depth differences.
[0054] S2. Preprocess the grayscale image and the depth image to obtain an RGB image.
[0055] In an implementation of this embodiment, preprocessing the grayscale image and the depth image to obtain the RGB image specifically includes:
[0056] S21, fusing the grayscale information of the grayscale image and the depth information of the depth image in a color channel manner to obtain a reconstructed RGB image;
[0057] S22, performing segmentation processing on the reconstructed RGB image to obtain multiple RGB images with a resolution less than a threshold (in this embodiment, the threshold is set to 600*800).
[0058] Furthermore, the grayscale information of the grayscale image and the depth information of the depth image are fused in the form of color channels to obtain a reconstructed RGB image, which specifically includes:
[0059] Extracting grayscale information of the grayscale image and depth information of the depth image respectively;
[0060] The grayscale information is used as the first channel and the third channel of the RGB color channel, and the depth information is normalized and then multiplied by a preset value (the preset value is set to 255 in this embodiment) as the second channel of the RGB color channel to obtain a reconstructed RGB image.
[0061] Specifically, the grayscale image and the depth image of the same surface are first grouped, and one-dimensional grayscale information and depth information are extracted from the grayscale image and the depth image respectively, and then the grayscale information and depth information of the defect are fused in the form of color channels. Specifically, the grayscale is used as the first channel and the third channel of the RGB image, and the depth is normalized and multiplied by 255 as the second channel of the RGB image to obtain a new reconstructed (grey, depth, grey) RGB image, that is, the one-dimensional grayscale information and the one-dimensional depth information are normalized and then spliced into three-dimensional information (grey, depth, grey) on the color channel; this embodiment overcomes the problem that the features of the defect in the grayscale image are not obvious due to illumination or other factors through multi-channel fusion of depth information and grayscale information. The depth information can better detect defects such as pits and convex hulls whose grayscale changes are not obvious, make up for the limitations of grayscale information, enhance the model's learning ability for defect features, and thus improve the detection accuracy.
[0062] Since the RGB image obtained in the above steps has a large resolution and cannot well reflect the characteristics of the defects, it is necessary to cut the reconstructed RGB image and cut an image of 2000*3000 pixels into 4x5 images at equal intervals, each with 500*600 pixels.
[0063] S3. Perform data enhancement processing on the RGB image and mark defects to obtain an image data set.
[0064] In one implementation of this embodiment, data enhancement processing is performed on the RGB image, and defects are annotated to obtain an image data set, which specifically includes:
[0065] S31, performing data enhancement processing on the RGB image by flip, hsv or copypaste data enhancement method to expand the RGB image data;
[0066] S32, using a labeling tool to label defects on the grayscale image, defining the category and location of each defect, and obtaining a defect label file;
[0067] S33. Based on the RGB image and defect label file after data enhancement processing, an image dataset is constructed.
[0068] Due to the small sample problem, the data set needs to be enhanced. Each image with a pixel size of 500*600 obtained in the above steps is enhanced by flip, HSV and copypaste. Specifically, flip includes flipping in different directions, including horizontal flipping, vertical flipping and horizontal and vertical flipping; HSV sets reasonable parameters according to the defective image to change the hue, saturation and brightness of the image. In this embodiment, the HSV parameters are set to (0.2, 0.1, 0.1); Copypaste copies the defective pixels to other defect-free areas in the image according to the label mask. This embodiment increases the number of defects and expands the defective data set by data enhancement, solves the problem of small sample sizes of defective data, and makes the lithium battery surface defect detection model have better generalization ability, can adapt to lithium battery surface defect detection in different production environments, and is more suitable for industrial applications.
[0069] After data enhancement, the defects on the grayscale image are manually labeled using a labeling tool (Labelme), the category and location of each defect are defined, and a corresponding defect label file, such as a JSON format, is generated as a label for the data set. Specifically, a brush is used to stroke and classify the defects on the grayscale image. The stroke used in this embodiment is in the format of polygon vertices as the data label, and then the location information and category information of the defect stroke are programmatically generated in the JSON format required for the label file as the label of the data set.
[0070] S4. Train and test the YoLov8 neural network model based on the image data set to obtain a lithium battery surface defect detection model.
[0071] In one implementation of this embodiment, the YoLov8 neural network model is trained and tested according to the image data set to obtain a lithium battery surface defect detection model, which specifically includes:
[0072] S41, dividing the image data set into a training set and a test set;
[0073] S42, constructing a YoLov8 neural network model, training the YoLov8 neural network model using the training set, and continuously adjusting the network parameters by monitoring the performance of the loss function and the test set;
[0074] S43. After multiple iterations, when the YoLov8 neural network model reaches qualified performance indicators on the test set, the training process is terminated and the optimal model is saved as the lithium battery surface defect detection model.
[0075] The YoLov8 neural network includes BackBone, Neck and Head. The BackBone part is composed of CBS, C2f and SPPF modules. Through a series of convolution operations, residual connections and Bottleneck are used to reduce the size of the network and improve performance. The C2f module has fewer parameters than the C3 module and has a stronger ability to extract features. The Neck part adopts the PAN-FPN structure, and upsamples and connects horizontally from the top of the pyramid through FPN. FAN transfers high-level features from low-level features through convolution, and fuses the feature map of PAN at each layer to ensure that the features of each layer contain information of different scales. The Head part is responsible for target detection, including predicting bounding boxes, categories and confidences. The decoupling head is used to separate the tasks for feature maps of different scales. Two parallel branches are used to extract category features and position features respectively, and then a layer of 1×1 convolution is used to complete the classification and positioning tasks, which improves the accuracy of target detection and enhances the network's detection ability for small targets, which is particularly important in the detection of subtle defects.
[0076] Specifically, the image dataset is randomly divided into a training set and a test set in a 70:30 ratio; a network model of appropriate size is selected, and various network parameters such as learning rate and batch size are configured; during the training process, the network parameters such as learning rate and batch size are continuously adjusted by monitoring the loss function and the performance of the test set to optimize the model performance. When the model achieves satisfactory performance indicators on the test set, the training process is terminated and the optimal model is saved.
[0077] Among them, the parameters of the network model include learning rate, training cycle epochs, batch size batchsize and image size imagsz. The learning rate is a hyperparameter that controls the adjustment amplitude of the model weights and is used to update the network weights during the gradient descent process. In this embodiment, the learning rate is set to 0.01; the training cycle refers to the process of training the entire training data set through the neural network once. Multiple training cycles mean that the data will be used for training the model multiple times, which can usually improve the accuracy and generalization ability of the model. In this embodiment, epochs is set to 500; the batch size refers to the number of data processed at one time during the network training process. The selection of the batch size will affect the training efficiency and memory requirements of the model. A larger batch size can improve memory utilization and training speed, but may affect the final performance of the model, including accuracy and training stability. In this embodiment, the batch size is set to 32, which is related to the graphics card memory. A larger batch size can help better training; the image size refers to the size of the image input to the network model. The image size directly affects the dimension of the input layer of the model and the complexity of the model processing data. Selecting a suitable image size can ensure that the model can not only capture enough details for effective learning and feature extraction, but also take into account computational efficiency and performance. In this embodiment, imagsz is set to 640.
[0078] In one implementation of this embodiment, the YoLov8-seg model is used. The larger model provides high-precision detection and segmentation. The main parameters include imagsz=640, batch=32, epochs=500, iou=0.8, augment=true, momentum=0.937, lr0=0.01, lrf=0.01, etc. 32 images are randomly selected for training each time. The image data is compressed to 640*640 pixels and propagated forward in the neural network to calculate the predicted results; then the loss is calculated based on the predicted results and label annotations and different loss functions (the classification task uses the VFL loss function, and the positioning task uses the DFL and CIOU loss functions), and then back propagation is performed to calculate the gradient of the loss function to the network parameters; finally, the parameters are updated, and the network parameters are updated according to the gradient and the learning rate of 0.01; after 500 such iterations, the network training is completed. According to the training of the network and the detection results in the test set, the learning rate, batch size, number of iterations and other parameters are adjusted so that the network converges and performs well in the test set.
[0079] In step S43, the output results of the model are analyzed, and the overall performance of the model is evaluated according to the test results, including statistical indicators such as accuracy, recall, and F1 score, to ensure the practicality and reliability of the model. The calculation formulas for accuracy, recall, and F1 score are as follows:
[0080] The calculation formula of accuracy is: Precision = TP / (TP+FP);
[0081] The calculation formula of recall rate is: Recall = TP / (TP+FN);
[0082] The calculation formula of F1 is: F1 = 2*Precision*Recall / (Precision+Recall);
[0083] Among them, TP means the number of correct classes predicted as correct classes, FP means the number of negative classes predicted as correct classes, and FN means the number of correct classes predicted as negative classes.
[0084] In this embodiment, the data is divided proportionally and sent to the YoLov8 segmentation network for training. The training parameters are adjusted to achieve better detection results in the test set to obtain a detection model, which is a feature extractor of defects. Finally, the category and location of the surface defects of the lithium battery are detected by reasoning on the defect data to be tested.
[0085] S5. Collect the surface image of the lithium battery to be tested, input the surface image of the lithium battery to be tested into the lithium battery surface defect detection model to perform lithium battery surface defect detection, and output the lithium battery surface defect detection result.
[0086] In one implementation of this embodiment, a surface image of a lithium battery to be tested is collected, the surface image of the lithium battery to be tested is input into a lithium battery surface defect detection model to perform lithium battery surface defect detection, and a lithium battery surface defect detection result is output, specifically including:
[0087] S51, collecting a surface image of the lithium battery to be tested, where the surface image of the lithium battery to be tested includes a grayscale image and a depth image of the surface of the lithium battery to be tested;
[0088] S52, inputting the grayscale image and the depth image of the surface of the lithium battery to be tested into the lithium battery surface defect detection model for detection, and detecting the type and position of the surface defects of the lithium battery to be tested;
[0089] S53, reprojecting the category and position of the surface defect of the lithium battery to be tested output by the lithium battery surface defect detection model onto a grayscale image for display.
[0090] Specifically, the image is sent to the trained network model for reasoning, and the detection results are output to predict the defects on the surface of the lithium battery. The image for reasoning is the channel spliced image, which integrates the grayscale and depth information of the defects. However, for clear display, this embodiment re-projects the detection results onto a grayscale image.
[0091] In one implementation of this embodiment, the YoLov8 neural network model includes a backbone network, a feature pyramid network and a detection head. The backbone network includes a CBS module, a C2f module and an SPPF module. The backbone network is used to extract features; the feature pyramid network is used to fuse the features extracted by the backbone network; the detection head is an anchor-free and decoupled detection head, and the detection head is used to obtain the category and location information of the detection target based on the features extracted by the backbone network and the features fused by the feature pyramid network.
[0092] Specifically, the YoLov8 neural network is optimized based on the architecture of YoLov5, and continues the network structure idea of YoLov5. The C2f module replaces the C3 module in the backbone network; the detection head is optimized, and the decoupling head is sampled to separate the classification task and the positioning task, which improves the network performance. In addition, the Achor-Based method is abandoned, and the sampling method without anchor boxes is more compatible with the detection of small objects; and the loss functions of classification and regression are optimized. The VFL loss function is used for the classification task, and the DFL and CIOU loss functions are used for the positioning task.
[0093] The YoLov8 neural network includes BackBone, Neck and Head. The BackBone part is composed of CBS, C2f and SPPF modules. Through a series of convolution operations, residual connections and Bottleneck are used to reduce the size of the network and improve performance. The C2f module has fewer parameters than the C3 module and has a stronger ability to extract features. The Neck part adopts the PAN-FPN structure, and upsamples and connects horizontally from the top of the pyramid through FPN. FAN transfers high-level features from low-level features through convolution, and fuses the feature map of PAN at each layer to ensure that the features of each layer contain information of different scales. The Head part is responsible for target detection, including predicting bounding boxes, categories and confidences. The decoupling head is used to separate the tasks for feature maps of different scales. Two parallel branches are used to extract category features and position features respectively, and then a layer of 1×1 convolution is used to complete the classification and positioning tasks, which improves the accuracy of target detection and enhances the network's detection ability for small targets, which is particularly important in the detection of subtle defects.
[0094] In summary, this embodiment provides a lithium battery surface defect detection method based on deep learning multi-channel fusion, collects high-resolution grayscale images and depth images, and performs preprocessing operations on the data layer, including the fusion of grayscale information and depth information, image cutting, and data enhancement, so as to enhance the characteristic expression of defects. The YoLov8 segmentation network is used as a learning framework, and multi-level feature extraction automatically learns the features in the image. Through continuous training and learning, and adjusting parameters, it can finally effectively identify and classify different types of surface defects, such as scratches, pits, bubbles, etc.
[0095] This embodiment is suitable for the detection of scratches, pits, convex hulls, breakages and other defects on the surface of lithium batteries. Through deep learning methods, the efficiency and accuracy of lithium battery surface defect detection are greatly improved, and the time and cost of manual inspection are reduced. The multi-channel fusion of depth information and grayscale information is used to overcome the problem that the characteristics of defects in grayscale images are not obvious due to illumination or other factors. The depth information can be used to better detect defects such as pits and convex hulls with unclear grayscale changes, make up for the limitations of grayscale information, enhance the model's learning ability for defect features, and thus improve the detection accuracy. Through the application of data enhancement and complex network structures, the model has better generalization ability, can adapt to lithium battery surface defect detection in different production environments, and is more suitable for industrial applications.
[0096] In addition, based on the above-mentioned lithium battery surface defect detection method based on deep learning multi-channel fusion, the present invention also provides a lithium battery surface defect detection system based on deep learning multi-channel fusion, wherein a preferred embodiment of the lithium battery surface defect detection system based on deep learning multi-channel fusion is as follows: Figure 3 As shown, specifically including:
[0097] Data acquisition module 01: used to acquire grayscale images and depth images of the surface of lithium batteries with surface defects;
[0098] Data preprocessing module 02: used to preprocess the grayscale image and the depth image to obtain the RGB image;
[0099] Data enhancement processing and defect annotation module 03: used to perform data enhancement processing on RGB images and perform defect annotation to obtain image data sets;
[0100] Lithium battery surface defect detection model generation module 04: used to train and test the YoLov8 neural network model according to the image data set to obtain a lithium battery surface defect detection model;
[0101] Lithium battery surface defect detection module 05: used to collect the surface image of the lithium battery to be tested, input the surface image of the lithium battery to be tested into the lithium battery surface defect detection model to perform lithium battery surface defect detection, and output the lithium battery surface defect detection result.
[0102] In addition, based on the above-mentioned lithium battery surface defect detection method and system based on deep learning multi-channel fusion, the present invention also provides a terminal accordingly, wherein a preferred embodiment of the terminal is as follows: Figure 4 As shown, it specifically includes a processor 10, a memory 20 and a display 30. Figure 4 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0103] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk equipped on the terminal, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed on the terminal, such as program codes for installing the terminal. The memory 20 can also be used to temporarily store data that has been output or is to be output. In one embodiment, a lithium battery surface defect detection program 40 based on deep learning multi-channel fusion is stored on the memory 20, and the lithium battery surface defect detection program 40 based on deep learning multi-channel fusion can be executed by the processor 10, thereby realizing the lithium battery surface defect detection method based on deep learning multi-channel fusion in this application.
[0104] In some embodiments, the processor 10 can be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing a lithium battery surface defect detection method based on deep learning multi-channel fusion.
[0105] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other through a system bus.
[0106] In one embodiment, when the processor 10 executes the lithium battery surface defect detection program 40 based on deep learning multi-channel fusion in the memory 20, the steps of the lithium battery surface defect detection method based on deep learning multi-channel fusion as described above are implemented.
[0107] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a lithium battery surface defect detection program based on deep learning multi-channel fusion, and when the lithium battery surface defect detection program based on deep learning multi-channel fusion is executed by a processor, the steps of the lithium battery surface defect detection method based on deep learning multi-channel fusion as described above are implemented.
[0108] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or terminal including the element.
[0109] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
[0110] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A lithium battery surface defect detection method based on deep learning multi-channel fusion, characterized in that: The lithium battery surface defect detection method based on deep learning multi-channel fusion includes: Collect grayscale images and depth images of the surface of lithium batteries with surface defects; Preprocessing the grayscale image and the depth image to obtain an RGB image; Performing data enhancement processing on the RGB image and performing defect annotation to obtain an image data set; The YoLov8 neural network model is trained and tested according to the image data set to obtain a lithium battery surface defect detection model; The surface image of the lithium battery to be tested is collected, the surface image of the lithium battery to be tested is input into the lithium battery surface defect detection model to perform lithium battery surface defect detection, and the lithium battery surface defect detection result is output.
2. The lithium battery surface defect detection method based on deep learning multi-channel fusion according to claim 1 is characterized in that: The preprocessing of the grayscale image and the depth image to obtain the RGB image specifically includes: fusing the grayscale information of the grayscale image and the depth information of the depth image in a color channel manner to obtain a reconstructed RGB image; The reconstructed RGB image is segmented to obtain a plurality of RGB images with a resolution less than a threshold.
3. The lithium battery surface defect detection method based on deep learning multi-channel fusion according to claim 2 is characterized in that: The grayscale information of the grayscale image and the depth information of the depth image are fused in a color channel manner to obtain a reconstructed RGB image, which specifically includes: Respectively extracting grayscale information of the grayscale image and depth information of the depth image; The grayscale information is used as the first channel and the third channel of the RGB color channel, and the depth information is normalized and then multiplied by a preset value as the second channel of the RGB color channel to obtain a reconstructed RGB image.
4. The lithium battery surface defect detection method based on deep learning multi-channel fusion according to claim 1 is characterized in that: The step of performing data enhancement processing on the RGB image and performing defect annotation to obtain an image data set specifically includes: Performing data enhancement processing on the RGB image by flip, hsv or copypaste data enhancement method to expand the RGB image data; Using a labeling tool to label defects on the grayscale image, defining the category and location of each defect, and obtaining a defect label file; Based on the RGB images and defect label files after data enhancement, an image dataset is constructed.
5. The lithium battery surface defect detection method based on deep learning multi-channel fusion according to claim 1 is characterized in that: The YoLov8 neural network model is trained and tested according to the image data set to obtain a lithium battery surface defect detection model, specifically including: Dividing the image dataset into a training set and a test set; Constructing a YoLov8 neural network model, training the YoLov8 neural network model using the training set, and continuously adjusting network parameters by monitoring the performance of the loss function and the test set; After multiple iterations, when the YoLov8 neural network model reaches qualified performance indicators on the test set, the training process is ended and the optimal model is saved as the lithium battery surface defect detection model.
6. The lithium battery surface defect detection method based on deep learning multi-channel fusion according to claim 1 is characterized in that: The collecting of the surface image of the lithium battery to be tested, inputting the surface image of the lithium battery to be tested into the lithium battery surface defect detection model to perform lithium battery surface defect detection, and outputting the lithium battery surface defect detection result specifically includes: Acquire a surface image of the lithium battery to be tested, wherein the surface image of the lithium battery to be tested includes a grayscale image and a depth image of the surface of the lithium battery to be tested; Inputting the grayscale image and the depth image of the surface of the lithium battery to be tested into the lithium battery surface defect detection model for detection, and detecting the type and position of the surface defects of the lithium battery to be tested; The category and position of the surface defect of the lithium battery to be tested output by the lithium battery surface defect detection model are reprojected onto a grayscale image for display.
7. The lithium battery surface defect detection method based on deep learning multi-channel fusion according to claim 1, 5 or 6, characterized in that: The YoLov8 neural network model includes a backbone network, a feature pyramid network and a detection head. The backbone network includes a CBS module, a C2f module and an SPPF module. The backbone network is used to extract features; the feature pyramid network is used to fuse the features extracted by the backbone network; the detection head is an anchor-free and decoupled detection head, and the detection head is used to obtain the category and location information of the detection target based on the features extracted by the backbone network and the features fused by the feature pyramid network.
8. A lithium battery surface defect detection system based on deep learning multi-channel fusion, characterized in that: The lithium battery surface defect detection system based on deep learning multi-channel fusion includes: Data acquisition module: used to collect grayscale images and depth images of the surface of lithium batteries with surface defects; Data preprocessing module: used to preprocess the grayscale image and the depth image to obtain an RGB image; Data enhancement processing and defect annotation module: used to perform data enhancement processing on the RGB image and perform defect annotation to obtain an image data set; A lithium battery surface defect detection model generation module is used to train and test the YoLov8 neural network model according to the image data set to obtain a lithium battery surface defect detection model; Lithium battery surface defect detection module: used to collect the surface image of the lithium battery to be tested, input the surface image of the lithium battery to be tested into the lithium battery surface defect detection model to perform lithium battery surface defect detection, and output the lithium battery surface defect detection result.
9. A terminal, characterized in that: The terminal includes: a memory, a processor, and a lithium battery surface defect detection program based on deep learning multi-channel fusion stored in the memory and executable on the processor. When the lithium battery surface defect detection program based on deep learning multi-channel fusion is executed by the processor, the steps of the lithium battery surface defect detection method based on deep learning multi-channel fusion as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a lithium battery surface defect detection program based on deep learning multi-channel fusion, and when the lithium battery surface defect detection program based on deep learning multi-channel fusion is executed by a processor, the steps of the lithium battery surface defect detection method based on deep learning multi-channel fusion as described in any one of claims 1-7 are implemented.
Citation Information
Patent Citations
Model training method and device, storage medium, equipment and computer program product
CN115239734A
Steel coil end face defect detection method
CN115294039A
System and method for detecting surface defects of lithium battery pole piece
CN116934762A
Battery CT image defect detection method based on improved YOLOv8
CN118587158A
Cited By
Lithium battery surface defect intelligent detection method based on deep learning
CN120495764A
A deep learning-based intelligent detection method for surface defects of lithium batteries
CN120495764B
Battery cell appearance detection method and device based on multi-modal image fusion
CN120525855A
Pole piece detection method and pole piece detection equipment
CN120746953A