Battery defect detection method based on YOLOv8 model, medium, detection system and equipment

By improving the battery defect detection method of the YOLOv8 model and utilizing techniques such as the BiFormer attention module and multi-scale attention module, the accuracy and recall of battery cell defect detection are improved, solving the problem of low detection accuracy in existing technologies and reducing computational load.

CN121504790APending Publication Date: 2026-02-10CANADIAN SOLAR SUNENERGY (SUQIAN) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411088758.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing technologies for detecting defects in solar cells have low accuracy and recall rates, with a high rate of missed detections and false detections. In particular, they are not mature enough for detecting minute cracks, stains, or localized discoloration.

Method used

A battery defect detection method based on the YOLOv8 model is adopted. By adding a BiFormer attention module before the SPPF layer of the Backbone network and embedding a multi-scale attention module in the C2f module of the Neck network, and replacing some convolutional modules with the Mish loss function and AKConv module, an improved model is constructed, trained and optimized.

Benefits of technology

It improves the accuracy and recall of cell defect detection, reduces missed and false detections, and reduces the computational load of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121504790A_ABST
    Figure CN121504790A_ABST
Patent Text Reader

Abstract

The invention discloses a battery defect detection method based on a YOLOv8 model, a medium, a detection system and equipment wherein the battery defect detection method based on the YOLOv8 model comprises the following steps: obtaining a data set containing battery defect data; the method comprises the following steps of: establishing a battery defect initial detection model which comprises an input end, a Backbone network, a Neck network and a detection head and is based on a YOLOv8 model, and adding a BiFormer (Vision Transformation with Bi-Level Routing Attention) attention module in front of an SPPF (Fast Space Pyramid Pooling) layer in the Backbone network in the initial detection model so as to obtain an improved model of the battery defect initial detection model; training and optimizing the improved model according to the data set to obtain a battery defect detection model based on a YOLOv8 model; and detecting a to-be-detected battery by using the battery defect detection model based on the YOLOv8 model and obtaining a detection result. According to the battery defect detection method, the detection capability of the model on tiny defects in the battery piece can be improved, and the situations of missing detection, false detection and the like are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of battery detection, in particular to a battery defect detection method based on a YOLOv8 model, a medium, a detection system and equipment. BACKGROUND

[0002] In recent years, the photovoltaic industry has expanded rapidly driven by economic factors, and China has long been a global leader in photovoltaic manufacturing and application. With the development of image detection technology, photovoltaic detection has emerged as the times require. Photovoltaic cell defect detection helps ensure that the quality of the cell meets the standards, and can quickly and accurately identify problems, reducing production delays and cost waste.

[0003] In the prior art, the accuracy and recall rate of battery defect detection are low, and the false detection rate is high. The detection technology for small cracks, stains or local color differences in battery pieces is not mature enough, and there is an urgent need for a detection method for small defects in battery pieces. SUMMARY

[0004] The present application aims to at least solve one of the technical problems existing in the prior art. To this end, the first object of the present application is to propose a battery defect detection method based on a YOLOv8 model, which can improve the detection capability of the model for small cracks, stains or local color differences in battery pieces, thereby improving the accuracy and recall rate of battery defect detection, reducing false detection and reducing the amount of model calculation.

[0005] The second object of the present application is to propose a non-volatile computer readable storage medium.

[0006] The third object of the present application is to propose a battery defect detection system.

[0007] The fourth object of the present application is to propose an electronic device.

[0008] In order to achieve the above-mentioned object, the battery defect detection method based on the YOLOv8 model according to the first aspect of the present application comprises: obtaining a data set containing battery defect data; establishing a battery defect initial detection model based on a YOLOv8 model comprising an input end, a Backbone network, a Neck network and a detection head, adding a BiFormer attention module before the SPPF layer in the Backbone network in the initial detection model to obtain an improved model of the battery defect initial detection model; training and optimizing the improved model according to the data set to obtain a battery defect detection model based on the YOLOv8 model; and detecting the battery to be detected using the battery defect detection model based on the YOLOv8 model and obtaining a detection result.

[0009] According to the battery defect detection method based on the YOLOv8 model provided in the embodiments of the present application, by improving the basic YOLOv8 model, the BiFormer attention module is added before the SPPF layer in the Backbone network of the model, which can strengthen the extraction ability of the model for the small target feature information of the battery piece defect, and further improve the detection ability of the model for the tiny cracks, stains or local color differences in the battery piece, so as to improve the accuracy and recall rate of the battery piece defect detection of the battery defect detection model based on the YOLOv8 model, reduce the missed detection, false detection and other situations, and also reduce the model calculation amount.

[0010] In some embodiments of the present application, the Neck network part uses a BiFPN (Bidirectional Feature Network, weighted bidirectional feature pyramid) pyramid network.

[0011] In some embodiments of the present application, for the battery defect initial detection model, the battery defect detection method further comprises: embedding a multi-scale attention module in a C2f (Cross Stage Partial Network Bottleneck with 2 convolutions, cross-stage partial network bottleneck with 2 convolutions) module in the Neck network to construct a C2f-E module to obtain an improved model of the battery defect initial detection model.

[0012] In some embodiments of the present application, for the battery defect initial detection model, the battery defect detection method further comprises: using a Mish (activation function) loss function to replace the original loss function in the initial detection model to obtain an improved model of the battery defect initial detection model, wherein the Mish loss function is Mish(x)=x*tanh(softplus(x)), x is an input value, and softplus(x) is a soft positive function.

[0013] In some embodiments of the present application, for the battery defect initial detection model, the battery defect detection method further comprises: replacing at least one Conv (Convolution, convolution operation) module in the Backbone network with an AKConv (Convolutional Kernel with Arbitrary, variable convolution) module to obtain an improved model of the battery defect initial detection model.

[0014] In some embodiments of the present application, obtaining a data set containing battery defect data includes: obtaining a plurality of images containing the battery defect data; preprocessing a plurality of the images to form the data set containing the battery defect data; and distributing the data set into a training set, a validation set and a test set according to a preset ratio.

[0015] In some embodiments of the present application, the improved model is trained and optimized according to the data set to obtain a battery defect detection model based on a YOLOv8 model, including: training the improved model using the training set to obtain a trained improved model; optimizing the trained improved model using the validation set to obtain the battery defect detection model based on the YOLOv8 model; and evaluating the battery defect detection model based on the YOLOv8 model using the test set and obtaining an evaluation result.

[0016] To achieve the above purpose, the second aspect of the present application provides a non-volatile computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the battery defect detection method based on the YOLOv8 model according to any one of the above embodiments.

[0017] The non-volatile computer readable storage medium according to the embodiments of the present application has a computer program stored thereon, wherein the computer program is executed by a processor to implement the battery defect detection method based on the YOLOv8 model according to any one of the above embodiments, and an improved battery defect detection model based on the YOLOv8 model is proposed. By introducing the BiFormer attention module, the extraction ability of the small target feature information of the battery piece defect can be strengthened, and therefore the detection technology for the tiny cracks, stains or local color differences in the battery piece can be improved, so as to improve the accuracy and recall rate of the battery piece defect detection, reduce the missed detection and false detection, and reduce the model calculation amount.

[0018] To achieve the above purpose, the third aspect of the present application provides a battery defect detection system, including: a data acquisition module configured to obtain detection data of a battery to be detected; a detection module connected with the data acquisition module, wherein the detection module is provided with a battery defect detection model based on a YOLOv8 model, and is configured to detect the detection data and obtain a defect detection result; and a display module connected with the detection module, and configured to output the defect detection result.

[0019] The battery defect detection system provided by the embodiment of the present application is based on the architecture of a data acquisition module, a detection module and a display module, and the battery defect detection model based on the YOLOv8 model is configured in the detection module. By introducing the BiFormer attention module, the extraction capability of small target feature information of battery piece defects can be enhanced, and the battery defect detection method based on the YOLOv8 model in the above embodiment is executed, so that the detection technology for tiny cracks, stains or local color differences in the battery piece can be improved, thereby improving the accuracy and recall rate of battery piece defect detection, reducing missed detection, false detection and the like, and reducing the model calculation amount.

[0020] To achieve the above object, the electronic device provided by the fourth aspect of the present application comprises at least one processor, and a memory in communication connection with the at least one processor, wherein the memory stores a computer program, and the computer program is executed by the at least one processor to implement the battery defect detection method based on the YOLOv8 model according to any one of the above embodiments.

[0021] According to the electronic device provided by the embodiment of the present application, when the computer program stored in the memory is executed by the processor, the battery defect detection method based on the YOLOv8 model according to any one of the above embodiments is implemented, an improved battery defect detection model based on the YOLOv8 model is proposed, and the BiFormer attention module is introduced to enhance the extraction capability of small target feature information of battery piece defects, so that the detection technology for tiny cracks, stains or local color differences in the battery piece can be improved, thereby improving the accuracy and recall rate of battery piece defect detection, reducing missed detection, false detection and the like, and reducing the model calculation amount.

[0022] Additional aspects and advantages of the present application will be made apparent from the following description, which, taken in conjunction with the accompanying drawings, that will be part of this disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0023] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, taken in conjunction with the accompanying drawings, in which:

[0024] Figure 1 Flow chart of the battery defect detection method based on the YOLOv8 model according to an embodiment of the present application;

[0025] Figure 2 Schematic diagram of the battery defect detection model based on the YOLOv8 model according to an embodiment of the present application

[0026] Figure 3 Schematic diagram of the BiFormer attention module according to an embodiment of the present application;

[0027] Figure 4 A graph showing the relationship between the number of training sets and validation sets and the error in the model training process according to an embodiment of the present application;

[0028] Figure 5 A schematic diagram of a C2f-E module according to an embodiment of the present application;

[0029] Figure 6 A schematic diagram of part of a C2f-E module according to an embodiment of the present application;

[0030] Figure 7 A schematic diagram of an AKConv module according to an embodiment of the present application;

[0031] Figure 8 A flowchart of a battery defect detection method based on a YOLOv8 model according to another embodiment of the present application;

[0032] Figure 9 A block diagram of a battery defect detection system according to an embodiment of the present application;

[0033] Figure 10 A block diagram of an electronic device according to an embodiment of the present application.

[0034] Reference signs:

[0035] Electronic device 100;

[0036] Processor 101, memory 102;

[0037] Battery defect detection system 10;

[0038] Data acquisition module 1, detection module 2, display module 3. DETAILED DESCRIPTION

[0039] Embodiments of the present application are described in detail below, and the embodiments described with reference to the accompanying drawings are exemplary, and embodiments of the present application are described in detail below.

[0040] The YOLO series target detection model has the characteristics of lightweight, real-time, high precision, etc., and is the current mainstream target detection algorithm. The present application improves the small target detection and lightweight direction of the model based on the YOLOv8 model as the benchmark model. Below, the battery defect detection method based on the YOLOv8 model according to an embodiment of the present application is described with reference to the accompanying drawings. Figures 1-8 The battery defect detection method based on the YOLOv8 model according to an embodiment of the present application is described below.

[0041] In some embodiments of the present application, as Figure 1As shown, it is a flowchart of a battery defect detection method based on a YOLOv8 model according to an embodiment of the present application, wherein the battery defect detection method based on the YOLOv8 model at least includes steps S1-S4, which are as follows.

[0042] S1, obtaining a data set containing battery defect data.

[0043] Specifically, in some embodiments, when making the data set, first, a plurality of images containing battery defect data are obtained, which can be collected from the battery defect data on the production line, and then the plurality of images are preprocessed to form the data set containing the battery defect data. Specifically, the obtained images are preprocessed, such as denoising, image enhancement, etc., and data labeling is performed, for example, the battery defects in the images can be labeled using the data labeling software LabelImg, and a YOLO format is generated, thereby making the data set containing the battery defect data.

[0044] Further, the data set is distributed into a training set, a validation set and a test set according to a preset ratio. Wherein, the preset ratio can be set according to the needs, which is not specifically limited here, in some embodiments of the present application, after data labeling, the splitDataSet function can be used to randomly distribute the data in the data set into the training set, the validation set and the test set according to the ratio of 8:1:1, so as to train and evaluate the subsequent model.

[0045] S2, establishing a battery defect initial detection model based on a YOLOv8 model including an input end, a Backbone network, a Neck network and a detection head, and adding a BiFormer attention module before the SPPF layer in the Backbone network in the initial detection model, so as to obtain an improved model of the battery defect initial detection model.

[0046] In some embodiments, the BiFormer attention module can be combined with the BiFPN pyramid network in the Neck network of the improved model. Figure 2 The battery defect detection model based on the YOLOv8 model of the embodiments of the present application, Figure 2 is a schematic diagram of a battery defect detection model based on a YOLOv8 model according to an embodiment of the present application, wherein the model can represent the structure of the improved model before training and optimization, and can also represent the structure of the final battery defect detection model based on the YOLOv8 model.

[0047] Wherein, the Neck network part of the model uses a BiFPN pyramid network, which can perform multi-scale feature fusion by using the BiFPN network, giving different weights to each layer for fusion, making the Neck network pay more attention to important levels, reducing unnecessary node connections of some layers, and making the model have better performance when detecting defects of battery pieces of different sizes, solving the problems of small target missed detection and false detection.

[0048] Furthermore, it can be combined with Figure 2 and Figure 3 Understanding the BiFormer attention module in this embodiment of the invention, Figure 3 This is a schematic diagram of the BiFormer attention module according to an embodiment of the present invention. The BiFormer attention module is introduced before the Spatial Pyramid Pooling Feature SPPF layer. DWConv3×3 (Depthwise Convolution) represents depthwise separable convolution with a 3×3 kernel; LN (Layer Normalization) represents the normalization computation of the model; Bi-level Routing Attention is a two-layer routing attention mechanism; and MLP (Multi-layer Perceptron) is a multilayer perceptron. By introducing the BiFormer attention mechanism before the Spatial Pyramid Pooling Feature SPPF layer, the model can enhance its ability to extract small target feature information of the battery and reduce the computational load of the model.

[0049] S3. Train and optimize the improved model based on the dataset to obtain a battery defect detection model based on the YOLOv8 model.

[0050] In some embodiments of the present invention, the improved model can be trained using a training set to obtain the trained improved model. Specifically, when training the improved YOLOv8 model using the training set, the training epoch can be set to 300 times to approach convergence. The improved model can be trained using an SGD optimizer with a momentum of 0.937 and a weight decay of 5e-4. By optimizing the loss function and attention mechanism in the improved model, a mosaic data augmentation method can be used to train the improved model end-to-end, ultimately obtaining the trained improved model.

[0051] Furthermore, the improved model after training is optimized using a validation set to obtain a battery defect detection model based on the YOLOv8 model.

[0052] Among them, it can be based on Figure 4 Understanding the model training and optimization process in embodiments of the present invention, Figure 4 This is a graph showing the relationship between the size of the training set and validation set and the error during model training according to an embodiment of the present invention, where curve A represents the training set and curve B represents the validation set. Figure 4It is evident that in the early stages of model training, optimization and generalization are related; the smaller the error on the training set, the smaller the error on the validation set, and the model's generalization ability gradually improves during this stage. In the later stages of model training, the error rate on the validation set no longer decreases, and the error begins to increase. This stage indicates overfitting, meaning the model begins to learn patterns that only relate to the training data. It is understandable that hyperparameters can include parameters such as the batch size and the number of epochs, and these parameters need to be set before training, which will not be elaborated here. Theoretically, the more data in the training set, the better the detection performance of the trained model. However, if all data is used for training, there is no data to verify whether the improved model is overfitting. That is, the improved model obtained after training may perform very well in detecting known defective images, but poorly in detecting other samples. Therefore, by dividing the data into a validation set, the goodness of fit of the improved model can be judged. Then, when optimizing the improved model using the validation set, in addition to checking the goodness of fit of the trained improved model, further adjustments can be made to parameters beyond those mentioned above.

[0053] Specifically, the hyperparameters of the improved model are tuned using a validation set to enhance its performance and generalization ability. Thus, through training and optimization of the improved model, a battery defect detection model based on YOLOv8 is ultimately obtained.

[0054] Furthermore, the YOLOv8-based battery defect detection model is evaluated using a test set, and the evaluation results are obtained. This means that the trained YOLOv8-based battery defect detection model is used to detect battery defects in the test set, and the performance of the model is objectively evaluated based on the detection results. For example, commonly used metrics such as precision, recall, and mean precision are employed to assess the model's performance and accuracy.

[0055] S4. Use a battery defect detection model based on the YOLOv8 model to detect the battery under test and obtain the detection results.

[0056] Specifically, at least one external image of the battery to be inspected can be directly acquired and used as input to a battery defect detection model based on the YOLOv8 model. This model detects and analyzes the external image and outputs the detection results. Based on this YOLOv8-based battery defect detection model, minute defects such as tiny cracks, stains, or localized discoloration on the battery in the external image can be identified, improving the accuracy of small-target defect detection in battery defects.

[0057] The battery defect detection method based on the YOLOv8 model proposed in this embodiment improves the basic YOLOv8 model by adding a BiFormer attention module before the SPPF layer in the backbone network. This enhances the model's ability to extract small target feature information of battery cell defects, thereby improving the model's ability to detect minute cracks, stains, or local discoloration in battery cells. As a result, the accuracy and recall of battery cell defect detection based on the YOLOv8 model are improved, reducing false negatives and false positives while also reducing the computational load of the model.

[0058] In some embodiments of the present invention, for the initial battery defect detection model, the battery defect detection method further includes embedding a multi-scale attention module in the C2f module of the Neck network to construct a C2f-E module, so as to obtain an improved model of the initial battery defect detection model.

[0059] Specifically, such as Figure 2 As shown, a C2f-E module can be constructed by embedding a multi-scale attention module (EMA) in C2f to further enhance the model's ability to extract battery defect features.

[0060] More specifically, it can be combined Figure 5 and Figure 6 Understand the C2f-E module of this embodiment of the invention. Figure 5 This is a schematic diagram of a C2f-E module according to an embodiment of the present invention; Figure 6 This is a schematic diagram of a portion of the structure of a C2f-E module according to an embodiment of the present invention. Figure 5 The dashed box shown represents the added Multi-Scale Attention (EMA) module, and as shown in the image... Figure 6 As shown, this is the expanded structure of the Cross-spatial learning layer in the multi-scale attention module.

[0061] The embodiments of the present invention further enhance the ability to extract cell defect features by embedding an efficient multi-scale attention module EMA in the C2f module of the Neck network to construct the C2f-E module, thereby improving the accuracy of the model in cell defect detection.

[0062] In some embodiments of the present invention, for the initial battery defect detection model, the battery defect detection method further includes: replacing the original loss function in the initial detection model with the Mish loss function to obtain an improved model of the initial battery defect detection model, wherein the Mish loss function is Mish(x) = x*tanh(softplus(x)), specifically, softplus(x) = ln(1+e x ); Where x is the input value, softplus(x) is the soft positive function, and tanh(x) is the hyperbolic tangent function.

[0063] Understandably, a Conv module includes standard convolution, Batch Normalization (BN), and an activation function, which is also the loss function. The loss function is a necessary step to enable non-linearity in neural networks, and the choice of loss function is diverse. Therefore, the loss function replaced by the Mish loss function in the initial detection model is the original loss function in the Conv module of the initial detection model. In object detection algorithms, features of the input image are extracted through convolutional layers, these feature values ​​are multiplied by their corresponding weights, summed, and then a bias term is added; this summates the sum and becomes the input value x of the loss function.

[0064] In some embodiments of the present invention, replacing the original loss function in the initial detection model with the Mish loss function can accelerate the convergence speed of model training while maintaining good accuracy. Furthermore, because the Mish loss function has better non-linear characteristics, it can better capture the complex features of the target and provide more accurate gradient information, thereby promoting the optimization and training process of the model.

[0065] In some embodiments of the present invention, for the initial battery defect detection model, the battery defect detection method further includes replacing at least one Conv module in the Backbone network with an AKConv module to obtain an improved model of the initial battery defect detection model.

[0066] Understandably, the backbone network is the main network in the model, primarily responsible for extracting basic features from the input image. The variable convolutional kernels of the AKConv module can adapt to features of different scales and shapes, thereby improving the accuracy and robustness of feature extraction and thus enhancing its feature extraction capabilities. Furthermore, because the backbone network needs to process large amounts of input data while maintaining a certain level of computational efficiency, and the parameters of the AKConv module can be linearly adjusted, it helps optimize computational efficiency under limited hardware resources, thus achieving parameter optimization.

[0067] Specifically, it can be combined with Figure 2and Figure 7 Understanding the AKConv module proposed in the embodiments of this invention, Figure 7 This is a schematic diagram of an AKConv module according to an embodiment of the present invention.

[0068] like Figure 2 As shown, for the initial battery defect detection model, the first layer of the Backbone network uses a Conv module, while the second, fourth, sixth, and eighth layers use AKConv, a variable kernel convolution module. This allows the convolution kernel to have any number of parameters and sampling conditions, enabling the convolution parameters to increase or decrease linearly according to the application's hardware environment, thus providing better adaptability and optimization performance for model improvement. Furthermore, the use of C2f modules in the third, fifth, seventh, and ninth layers of the Backbone network further lightweights the YOLOv8 network model.

[0069] Furthermore, although using the AKConv module in the Neck network can better adapt to features of different scales and improve feature fusion capabilities, the YOLOv8 baseline model in this embodiment of the invention uses a BiFPN (Bidirectional Feature Pyramid Network) structure in the Neck network. Through multi-scale feature fusion, it achieves the fusion of top-level features from top to bottom and bottom-level features from bottom to top, improving the feature fusion effect. The original model itself has an advantage in handling small object detection because there is no need to replace the Conv module in the Neck network. Also, the improved model in this embodiment of the invention already incorporates a BiFormer attention module in the Backbone network. Embedding a multi-scale attention module EMA in the C2f module of this network would lead to redundancy in the entire model and a significant computational burden. Therefore, this part of the improvement was not considered. Instead, improving the C2f module in the Neck network to a C2f-E module can improve feature fusion efficiency while maintaining a lower computational cost.

[0070] In some embodiments of the present invention, such as Figure 8 The diagram shows a flowchart of a battery defect detection method based on the YOLOv8 model according to another embodiment of the present invention. The battery defect detection method based on the YOLOv8 model includes steps S101-S105, as detailed below.

[0071] S101, Dataset Creation, Image Processing, Dataset Splitting. Specifically, the dataset can be randomly allocated into training, validation, and test sets in an 8:1:1 ratio.

[0072] S102, construct a lightweight initial detection model. The Neck network part uses the BiFPN pyramid network, and the original Conv module in the Backbone network is replaced with the AKConv module.

[0073] S103, add the BiFormer attention module before the SPPF layer in the Backbone network of the initial detection model.

[0074] S104. Replace the original loss function in the initial detection model with the Mish loss function to obtain an improved model of the initial detection model.

[0075] S105, train the improved model using the training set, optimize the model parameters using the validation set to obtain a battery defect detection model based on the YOLOv8 model, and evaluate the model using the test set.

[0076] The battery defect detection method based on the YOLOv8 model proposed in this embodiment of the invention introduces a BiFormer attention module on the basis of the YOLOv8 algorithm, which can enhance the extraction capability of small target feature information of battery cell defects and reduce the computational load of the model. The Conv module in the Backbone network of the model is replaced with the AKConv module, which allows the convolution kernel to have any number of parameters and sampling shape, and the convolution parameters can be linearly increased or decreased according to the hardware environment of the application. In the Neck network part, an efficient multi-scale attention module is embedded in the C2f module to construct a C2f-E module, which can further enhance the extraction capability of battery cell defect features. In addition, the Mish activation function is used to replace the original activation function, which can improve the convergence speed and performance of the model training process. Finally, the battery defect detection model based on the YOLOv8 model of this embodiment of the invention has a significantly reduced number of parameters compared with the original model in battery cell appearance defect detection, and the detection speed can meet the application requirements.

[0077] In some embodiments of the present invention, a non-volatile computer-readable storage medium is also proposed, on which a computer program is stored, which, when executed by a processor, implements a battery defect detection method based on the YOLOv8 model as described in any of the above embodiments.

[0078] According to the embodiments of the present invention, a non-volatile computer-readable storage medium on which a computer program is stored is executed by a processor to implement the battery defect detection method based on the YOLOv8 model as described in any of the above embodiments. An improved battery defect detection model based on the YOLOv8 model is proposed. By introducing the BiFormer attention module, the ability to extract small target feature information of battery cell defects is enhanced. Therefore, the detection technology for small cracks, stains or local discoloration in battery cells can be improved, thereby improving the accuracy and recall of battery cell defect detection, reducing missed detections and false detections, and reducing the computational load of the model.

[0079] In some embodiments of the present invention, a battery defect detection system is also proposed, such as... Figure 9 The diagram shown is a block diagram of a battery defect detection system according to an embodiment of the present invention, wherein the battery defect detection system 10 includes a data acquisition module 1, a detection module 2, and a display module 3.

[0080] The data acquisition module 1 is used to acquire the test data of the battery to be tested. The test data includes at least an image of the battery's appearance. The data acquisition module 1 may use an appearance camera as the image acquisition device to acquire at least one image of the battery to be tested.

[0081] The detection module 2 is connected to the data acquisition module 1. The detection module 2 is equipped with a battery defect detection model based on the YOLOv8 model, used to detect the data and acquire defect detection results. The appearance camera can also function as a memory, and the detection module 2 can act as a processor coupled to the memory. The processor contains the YOLOv8-based battery defect detection model, configured to execute the YOLOv8-based battery defect detection method described in the previous embodiment. The acquired image of the battery to be detected is used as input to the detection module 2, and the model calculates and directly outputs the defect detection result of the battery. The display module 3 is connected to the detection module 2 and can be a display screen used to output the defect detection results.

[0082] The battery defect detection system 10 proposed in this embodiment of the invention is based on an architecture of a data acquisition module 1, a detection module 2, and a display module 3. By configuring a battery defect detection model based on the YOLOv8 model in the detection module 2 and introducing the BiFormer attention module, it can enhance the extraction capability of small target feature information of battery cell defects and execute the battery defect detection method based on the YOLOv8 model in the above embodiment. This can improve the detection technology for small cracks, stains, or local discoloration in battery cells, thereby improving the accuracy and recall rate of battery cell defect detection, reducing missed detections and false detections, and reducing the computational load of the model.

[0083] In some embodiments of the present invention, an electronic device is also proposed. For example... Figure 10 The diagram shown is a block diagram of an electronic device according to an embodiment of the present invention. The electronic device 100 includes at least one processor 101 and a memory 102 communicatively connected to the at least one processor 101. The memory 102 stores a computer program. When the computer program is executed by the at least one processor 101, it is used to implement a battery defect detection method based on the YOLOv8 model as described in any of the above embodiments.

[0084] According to the electronic device 100 proposed in the embodiments of the present invention, when the computer program stored in the memory 102 is executed by the processor 101, it implements the battery defect detection method based on the YOLOv8 model as in any of the above embodiments, and proposes an improved battery defect detection model based on the YOLOv8 model. By introducing the BiFormer attention module, it can enhance the extraction capability of small target feature information of battery cell defects, thereby improving the detection technology for small cracks, stains or local discoloration in battery cells, thereby improving the accuracy and recall rate of battery cell defect detection, reducing missed detections and false detections, and reducing the computational load of the model.

[0085] Other configurations and operations of the battery defect detection system 10 and electronic device 100 according to embodiments of the present invention are known to those skilled in the art and will not be described in detail here.

[0086] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example.

[0087] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A battery defect detection method based on the YOLOv8 model, characterized in that, include: Obtain a dataset containing battery defect data; An initial battery defect detection model based on the YOLOv8 model is established, including an input end, a backbone network, a neck network, and a detection head. A BiFormer attention module is added before the SPPF layer in the backbone network of the initial detection model to obtain an improved model of the initial battery defect detection model. The improved model is trained and optimized based on the dataset to obtain a battery defect detection model based on the YOLOv8 model. The battery defect detection model based on the YOLOv8 model is used to detect the battery under test and obtain the detection results.

2. The battery defect detection method based on the YOLOv8 model according to claim 1, characterized in that, The Neck network portion uses a BiFPN pyramid network.

3. The battery defect detection method based on the YOLOv8 model according to claim 2, characterized in that, For the initial battery defect detection model, the battery defect detection method further includes: A multi-scale attention module is embedded in the C2f module of the Neck network to construct a C2f-E module, thereby obtaining an improved model of the initial battery defect detection model.

4. The battery defect detection method based on the YOLOv8 model according to claim 3, characterized in that, For the initial battery defect detection model, the battery defect detection method further includes: The original loss function in the initial detection model is replaced with the Mish loss function to obtain an improved model of the initial battery defect detection model. The Mish loss function is Mish(x) = x*tanh(softplus(x)), where x is the input value and softplus(x) is a soft positive function.

5. The battery defect detection method based on the YOLOv8 model according to claim 1, characterized in that, For the initial battery defect detection model, the battery defect detection method further includes: Replace at least one Conv module in the Backbone network with an AKConv module to obtain an improved model of the initial battery defect detection model.

6. The battery defect detection method based on the YOLOv8 model according to claim 1, characterized in that, Obtain a dataset containing battery defect data, including: Acquire multiple images containing the battery defect data; The images are preprocessed to form the dataset containing the battery defect data; The dataset is allocated into training set, validation set and test set according to a preset ratio.

7. The battery defect detection method based on the YOLOv8 model according to claim 6, characterized in that, The improved model is trained and optimized based on the dataset to obtain a battery defect detection model based on the YOLOv8 model, including: The improved model is trained using the training set to obtain the trained improved model; The trained improved model is optimized using the validation set to obtain the battery defect detection model based on the YOLOv8 model. The battery defect detection model based on the YOLOv8 model was evaluated using the test set, and the evaluation results were obtained.

8. A non-volatile computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the battery defect detection method based on the YOLOv8 model as described in any one of claims 1-7.

9. A battery defect detection system, characterized in that, include: The data acquisition module is used to acquire the test data of the battery under test; The detection module is connected to the data acquisition module. The detection module is equipped with a battery defect detection model based on the YOLOv8 model, which is used to detect the detection data and obtain defect detection results. The display module is connected to the detection module and is used to output the defect detection results.

10. An electronic device, characterized in that, include: At least one processor; A memory communicatively connected to at least one of the processors, the memory storing a computer program, which, when executed by at least one of the processors, is used to implement the battery defect detection method based on the YOLOv8 model as described in any one of claims 1-7.