A cylindrical lithium battery surface defect detection method and device

By designing the MBneck module and optimizing the YOLO model using a channel attention mechanism, the problems of low efficiency and insufficient accuracy in lithium battery surface defect detection were solved, achieving efficient defect detection.

CN115526863BActive Publication Date: 2026-03-17HUAQIAO UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing methods for detecting surface defects in lithium batteries are inefficient and costly. Manual inspection is prone to missed or false detections, while machine vision inspection methods have poor generalization ability and are computationally complex. Deep learning algorithms have problems with small sample sizes and real-time performance.

Method used

The MBneck module is designed for feature extraction. It combines channel attention mechanism and multi-branch convolution, and optimizes the YOLO model through residual connections and depthwise separable convolution to improve detection speed and accuracy.

Benefits of technology

Without increasing inference speed, the model's detection accuracy and efficiency were improved, the small sample size and real-time performance issues were resolved, and efficient defect detection was achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115526863B_ABST
    Figure CN115526863B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for detecting surface defects in cylindrical lithium batteries, belonging to the field of target detection technology. The method includes: acquiring surface images of cylindrical lithium batteries and creating a defect dataset; inputting the defect images into a model for iterative training, saving the best model; using the trained YOLO model as a feature extractor to extract features from the images to be detected, locating the positions of surface defects in the lithium battery, and determining the defect type. The method and apparatus for detecting surface defects in cylindrical lithium batteries provided by this invention improves detection speed by designing an MBneck module for feature extraction in the model's backbone, and utilizes a channel attention mechanism to locate information of interest in the feature map while suppressing useless information. Furthermore, multi-branch convolution (MBC) improves model detection accuracy during deployment without increasing inference speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, and in particular to a method and apparatus for detecting surface defects in cylindrical lithium batteries. Background Technology

[0002] In recent years, with the development and promotion of new energy electric vehicles in China, the demand for lithium batteries has also increased. The lithium battery industry has risen rapidly, and quality issues in lithium battery manufacturing are currently a key aspect. Furthermore, the deep integration of new-generation information technology and manufacturing has triggered a significant transformation in the manufacturing industry, gradually shifting from quantity expansion to quality improvement. Improving product quality to produce high-value-added, high-profit products can achieve a leap in product competitiveness, making surface defect detection of lithium batteries an indispensable step. Currently, lithium-ion batteries are classified into three types based on their packaging: pouch, prismatic, and cylindrical. Cylindrical lithium-ion battery packs have mature manufacturing processes and lower PACK costs. Due to their large heat dissipation area, their heat dissipation performance is superior to prismatic batteries. Cylindrical batteries are easy to combine in various forms, making them suitable for efficient layout in electric vehicle space design. Cylindrical batteries are generally packaged in steel or aluminum shells, with an outer layer of plastic for packaging. During the manufacturing process, defects such as surface dents, scratches, and damage may occur.

[0003] Current methods for detecting surface defects in lithium batteries mainly consist of manual inspection and machine vision inspection. Due to the diversity of surface defect types and the importance of the inspection process, manual inspection remains the primary method. The main problems with manual inspection are its low efficiency, high time consumption, and extremely high labor costs under high inspection demands. Due to the limitations of visual inspection, many surface defects with inconspicuous features are easily overlooked, leading to missed or false detections. Traditional machine vision inspection methods include image structure methods and frequency domain analysis methods, but each has its limitations. For example, image structure methods have poor generalization ability and are only applicable to specific defect detection situations, while frequency domain analysis methods are computationally complex and time-consuming, making them unsuitable for situations with high real-time requirements.

[0004] There are two main problems with the application of deep learning detection algorithms in industrial defect detection. First, there's the small sample size problem. In real-world industrial environments, the available defect samples are too few, while deep learning requires training with a large number of defect samples to improve the model's detection capabilities. Second, there's the real-time performance problem. Current research in deep learning algorithms focuses more on the detection accuracy of the models, resulting in increasingly larger models, while neglecting the need for detection speed in practical industrial applications. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a method and device for detecting surface defects of cylindrical lithium batteries. By designing the MBneck module for feature extraction in the backbone of the model, the detection speed is improved. The channel attention mechanism is used to locate information of interest in the feature map and suppress useless information. The MBC multi-branch convolution improves the detection accuracy of the model during deployment without increasing the inference speed of the model.

[0006] In a first aspect, the present invention provides a method for detecting surface defects in a cylindrical lithium battery, comprising:

[0007] Step 1: Obtain images of surface defects in lithium batteries, create a defect dataset, and then perform data preprocessing to increase the number of defect datasets.

[0008] Step 2: Input the defect data images into the improved YOLO model for training, and save the best model;

[0009] The improved YOLO model includes a backbone feature extraction network, a feature fusion network, and a classification, regression, and prediction network; the backbone feature extraction network includes multiple stacked MBneck modules, the feature fusion network includes an FPN network, and the classification, regression, and prediction network includes multiple decoupled head detection heads.

[0010] The MBneck module uses a residual connection structure, consisting of two parts: direct mapping and residual edges. The direct mapping part splits into two branches after a multi-branch convolutional (MBC) operation. One branch first undergoes global max pooling, then a fully connected layer and an activation function to obtain weights for each feature map channel dimension. These weights are multiplied by the feature map output from the other branch, reweighting the feature map channel dimension. The weighted result is then convolved and stacked with the output of the residual edges at the channel scale to obtain the final output. The multi-branch convolutional (MBC) operation includes multiple branches. During the model training phase, different branches with varying scales and complexities are combined to enrich the feature space and enhance the model's feature extraction capabilities.

[0011] Step 3: Input the image of the cylindrical lithium battery to be detected into the deployed model, detect and locate the location of the defect in the image and determine the type of defect; in the deployed model, the multi-branch convolution MBC of the MBneck module is a single convolution that uses reparameterization to equivalently convert multiple branches into a single convolution.

[0012] Furthermore, the multi-branch convolution (MBC) includes three branches: the first branch undergoes a 1×1 convolution operation; the second branch undergoes a 1×1 convolution and a K×K convolution operation, where K is an adjustable kernel size; and the third branch undergoes a K×K convolution operation. Each convolution operation is followed by a normalization operation.

[0013] Furthermore, the convolutions in the MBneck module are depth-separable convolutions, consisting of DW convolutions and PW convolutions.

[0014] Furthermore, after the feature map is input into the Decoupled Head detection head via the FPN network, it is divided into two branches for convolution operations. One branch, Cls, is used to predict the probability of a certain defect type corresponding to each feature point; the other branch, Reg, is used to determine the regression parameters of the predicted bounding box coordinates corresponding to each feature point. After adjusting the regression parameters, the predicted bounding box can be obtained. Iou is used to determine whether each feature point contains a defect target.

[0015] Furthermore, the multiple stacked MBneck modules specifically include a five-layer structure connected in sequence: the first layer consists of one MBneck module, the second layer consists of two MBneck modules, the third layer consists of three MBneck modules, the fourth layer consists of four MBneck modules, and the fifth layer consists of five MBneck modules.

[0016] In a second aspect, the present invention provides a cylindrical lithium battery surface defect detection device, comprising: a data processing module, a training module, and a detection module;

[0017] The data processing module is used to acquire images of defects on the surface of lithium batteries, create a defect dataset, and then perform data preprocessing to increase the number of defect datasets.

[0018] The training module is used to input defect data images into the improved YOLO model for training and save the best model.

[0019] The improved YOLO model includes a backbone feature extraction network, a feature fusion network, and a classification, regression, and prediction network; the backbone feature extraction network includes multiple stacked MBneck modules, the feature fusion network includes an FPN network, and the classification, regression, and prediction network includes multiple decoupled head detection heads.

[0020] The MBneck module uses a residual connection structure, consisting of two parts: direct mapping and residual edges. The direct mapping part splits into two branches after a multi-branch convolutional (MBC) operation. One branch first undergoes global max pooling, then a fully connected layer and an activation function to obtain weights for each feature map channel dimension. These weights are multiplied by the feature map output from the other branch, reweighting the feature map channel dimension. The weighted result is then convolved and stacked with the output of the residual edges at the channel scale to obtain the final output. The multi-branch convolutional (MBC) operation includes multiple branches. During the model training phase, different branches with varying scales and complexities are combined to enrich the feature space and enhance the model's feature extraction capabilities.

[0021] The detection module is used to input the image of the cylindrical lithium battery to be detected into the deployed model, detect and locate the location of the defect in the image and determine the type of defect; in the deployed model, the multi-branch convolution MBC of the MBneck module is a single convolution that uses reparameterization to equivalently convert multiple branches into a single convolution.

[0022] Furthermore, in the training module, the multi-branch convolution (MBC) includes three branches: the first branch undergoes a 1×1 convolution operation; the second branch undergoes a 1×1 convolution and a K×K convolution operation, where K is an adjustable kernel size; and the third branch undergoes a K×K convolution operation. Each convolution operation is followed by a normalization operation.

[0023] Furthermore, the convolutions in the MBneck module are depth-separable convolutions, consisting of DW convolutions and PW convolutions.

[0024] Furthermore, after the feature map is input into the Decoupled Head detection head via the FPN network, it is divided into two branches for convolution operations. One branch, Cls, is used to predict the probability of a certain defect type corresponding to each feature point; the other branch, Reg, is used to determine the regression parameters of the predicted bounding box coordinates corresponding to each feature point. After adjusting the regression parameters, the predicted bounding box can be obtained. Iou is used to determine whether each feature point contains a defect target.

[0025] Furthermore, the multiple stacked MBneck modules specifically include a five-layer structure connected in sequence: the first layer consists of one MBneck module, the second layer consists of two MBneck modules, the third layer consists of three MBneck modules, the fourth layer consists of four MBneck modules, and the fifth layer consists of five MBneck modules.

[0026] The technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:

[0027] 1. Multiple stacked MBneck modules are designed for feature extraction in the backbone of the model. Channel attention mechanism and residual connection are used in the module to make the model pay more attention to the more important information in the feature map, and the gradient vanishing problem during backpropagation is reduced by residual connection.

[0028] 2. The MBneck module uses multi-branch convolution (MBC), which enriches the feature space by combining different branches of different scales and complexities. It also uses reparameterized structures and separable convolution operations, which only increases the computational cost during model training. During model inference, it can be equivalently converted into a single convolution for deployment, thus meeting the requirements of lightweight parameters and computational cost. This improves the detection accuracy of the model without increasing the inference speed of the model.

[0029] 3. The MBneck module uses depthwise separable convolution to replace ordinary convolution, reducing the number of model parameters and improving detection speed. It also uses channel attention mechanism to locate information of interest in the feature map and suppress useless information.

[0030] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0031] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0032] Figure 1 This is a diagram of the overall architecture of the improved YOLO model according to an embodiment of the present invention;

[0033] Figure 2 This is a schematic diagram of the MBneck module and the multi-branch convolutional MBC structure in an embodiment of the present invention;

[0034] Figure 3 This is a schematic diagram of the Decoupled Head detection head structure according to an embodiment of the present invention;

[0035] Figure 4 This is a flowchart illustrating the method in Embodiment 1 of the present invention;

[0036] Figure 5 This is a schematic diagram of the device in Embodiment 2 of the present invention. Detailed Implementation

[0037] This application provides a method and apparatus for detecting surface defects in cylindrical lithium batteries. By designing an MBneck module for feature extraction in the backbone of the model, the detection speed is improved. The channel attention mechanism is used to locate information of interest in the feature map and suppress useless information. Multi-branch convolution (MBC) improves the detection accuracy of the model during deployment without increasing the inference speed of the model.

[0038] The overall concept of the technical solutions in the embodiments of the present invention is as follows:

[0039] The YOLO model is one of the models in the field of deep learning object detection. It is a one-stage object detection model, characterized by its fast detection speed compared to other object detection models. This invention primarily designs an MBneck module for feature extraction in the model's backbone. The module employs channel attention, residual connections, separable convolutions, and reparameterization. The MBneck module uses depthwise separable convolutions instead of ordinary convolutions to reduce the number of model parameters and improve detection speed. It also utilizes channel attention to locate information of interest in the feature map and suppress useless information. The MBneck module also incorporates a multi-branch convolution (MBC) structure, which enriches the feature space by combining branches of different scales and complexities. The MBC only increases the computational cost during model training; during inference, it can be equivalently converted to a single convolution, improving detection accuracy without increasing inference speed.

[0040] To achieve the above objectives, this invention proposes a method for detecting surface defects in cylindrical lithium batteries based on the YOLO model, such as... Figure 4 As shown, it may include the following steps:

[0041] a) Obtain images of surface defects in lithium batteries;

[0042] During the manufacturing process of cylindrical lithium batteries, defects such as pits, breaks, and scratches may appear on the surface. These defects are small and difficult to detect with the human eye. The casing of lithium batteries is mostly made of metals such as aluminum and steel, where defects have low contrast with the surface and are not obvious. Furthermore, the smooth surface of metal makes it prone to reflection. Using an industrial line scan camera to acquire images of surface defects in lithium batteries under dark conditions reduces the impact of light reflection on imaging and enhances the distinction between defects and the background.

[0043] b) Creation of defect datasets;

[0044] The quality of the defect dataset directly impacts defect detection performance. Defect types on the cylindrical lithium-ion battery surface were manually defined and distinguished using annotation tools such as labelimg, confirming the number of defect types. Labels were created according to the PASCAL VOC dataset format, which includes three parts: JPEGImages, Annotations, and ImageSets. JPEGImages are JPG files containing defect images; Annotations are XML files storing the defect category and location coordinates within the images; and ImageSets divide all data into training, validation, and test sets for subsequent model training and testing.

[0045] c) Data preprocessing;

[0046] The reason why deep learning is rarely directly applied to surface defect detection is that there are too few industrial defect samples available in real industrial environments. Compared to the more than 14 million data in datasets such as ImageNet, a key problem faced by surface defects is the small sample size.

[0047] The following methods are commonly used for data preprocessing to increase the amount of data in a dataset: data augmentation, synthesis and generation. The most common augmentation methods are to perform operations such as mirroring, rotation, translation, distortion, filtering and contrast adjustment on the original image to obtain more samples, and to fuse and superimpose individual defects onto normal samples.

[0048] d) Input the defect data images into the improved YOLO model for training, and save the best model;

[0049] Using a pre-constructed dataset of lithium battery defects as input, the defect images are first compressed to a specific size before being fed into the model for training. Gradient descent is used during backpropagation to continuously reduce the loss function. Through iterative training, the model eventually converges, yielding the optimal model weights for subsequent inference. Figure 1 As shown, the entire YOLO model can be divided into three parts. The first part is the Backbone feature extraction network, which consists of stacked MBneck modules. The input image undergoes feature extraction in the Backbone network. During convolutional downsampling, the image size is continuously compressed and the dimensionality is continuously increased, finally obtaining three feature layers of different sizes to enter the next part of the model. The FPN (Feature Fusion Pyramid) enhances the feature extraction part, extracting three effective feature layers from the upper, middle, and lower layers of the model's backbone and fusing them in the FPN to combine feature information at different scales. Finally, classification and regression prediction are performed in the final Decoupled Head (detection head) part of the model. The prepared defect dataset is input into the model for iterative training to obtain the best-performing model.

[0050] e) The trained model is used as a feature extractor to extract features from the input defect image. The model will eventually predict the type of defect and the offset of the defect position. The model output is then processed to be converted into a way to display the defect on the detection image by using a rectangle to outline the defect, thus realizing the defect target detection task.

[0051] After the defect image is input into the model, it is first compressed to a size of 640×640 and then fed into the backbone network. A focus operation is then performed to increase the number of channels, resulting in a feature map with half the size. Next, a series of MBneck modules are used to downsample and continuously extract high-dimensional features. In the backbone network, feature maps from the high-level (80×80), mid-level (40×40), and low-level (20×20) layers are extracted and fed into the FPN feature fusion pyramid for further feature fusion. The (20×20) feature map undergoes Conv (convolution) and UpSampling2D (upsampling) operations, and is then concat (stacked) with the (40×40) feature map. After another convolution and upsampling, it is stacked with the (80×80) feature map, and after another convolution operation, it is input into the Decoupled Head for prediction. Simultaneously, the fused feature map from the upper layers continues to undergo a series of downsampling and stacking operations to form a pyramid structure. The three effective feature layers output by FPN are respectively input to three decoupled heads (prediction heads) to predict defects of different sizes in the image.

[0052] In one specific embodiment, the improvement to the YOLO model is as follows: First, the designed MBneck feature extraction module is used in the backbone network of the YOLO model. For example... Figure 2 As shown on the left, the convolutions (conv) in the MBneck module use depthwise separable convolutions. Conventional convolution operations often fail to meet the speed requirements of actual operation due to their large computational cost. Depthwise separable convolutions consist of depthwise (DW) convolutions and pointwise (PW) convolutions. This structure is similar to conventional convolutions and can be used to extract features, but it has a lower number of parameters and lower computational cost compared to conventional convolutions.

[0053] When using ordinary convolution, given an input tensor of size DF×DF×M, and performing convolution operations with N convolution kernels of size Dk×Dk×M, the output is a tensor of size DG×DG×N. The computational cost and parameter count are as follows:

[0054] Computational complexity: Dk*Dk*M*Dg*Dg*N

[0055] Number of parameters: Dk*Dk*M*N

[0056] Depthwise separable convolution first transforms a DF×DF×M tensor into a DG×DG×M tensor using M Dk×Dk×1 convolution kernels through a depthwise convolution operation. Then, the DG×DG×M tensor is further transformed into a DG×DG×N tensor through pointwise convolution operations using N 1×1×M convolution kernels. The computational and parameter count formulas are as follows:

[0057] Computational complexity: Dk*Dk*1Dk*Dk*M*N+M*1*1*Dg*Dg*N

[0058] Number of parameters: Dk*Dk*M*1+N*M*1*1

[0059] This demonstrates that depthwise separable convolutions have lower computational overhead while achieving the same computational purpose.

[0060] Secondly, the MBneck module uses a residual connection structure, which consists of two parts: direct mapping and residual edges. After the feature map is input into MBneck, it branches into two branches. One branch is the output of the direct mapping part after multiple convolution operations, and the other branch is the direct output of the residual edges. The outputs of the two branches are stacked at the channel scale to obtain the final output. According to the chain rule, when a unit has a gradient of 0, the entire gradient becomes 0, causing parameters to fail to update. The chain rule formula is as follows:

[0061]

[0062] Furthermore, when using the Sigmoid activation function, its gradient will not exceed 0.25, which also leads to gradient vanishing after chain rule differentiation. The activation function formula is as follows:

[0063]

[0064] Connecting residual edges directly adds the input feature vector to the output, which helps solve the problems of vanishing and exploding gradients during training.

[0065] The channel attention mechanism involves the input feature map in the MBneck module being split into two branches after the multi-branch convolution (MBC) operation. One branch first goes through GMpooling (global max pooling) on ​​the left, then through two FCN (fully connected layers) and RULE and Sigmoid activation functions to obtain the weights of each channel dimension of the feature map. These weights are then multiplied with the feature map output from the second branch, reweighting the channel dimension of the feature map so that the model pays more attention to the regions of interest in the feature map.

[0066] like Figure 2The multi-branch convolution (MBC) shown on the right has three branches: the first branch undergoes a 1×1 convolution; the second branch undergoes a 1×1 convolution followed by a K×K convolution, where K is an adjustable kernel size; and the third branch undergoes a K×K convolution. Each convolution is followed by a batch normalization operation, and finally, a nonlinearity activation function is applied to obtain the output. During training, this combination of branches with different scales and complexities enriches the feature space and enhances the model's feature extraction capabilities. During inference, reparameterization can be used to effectively transform the three branches into a single convolution for deployment.

[0067] Fusion of convolution and batch normalization: The j-th channel of the output O after input I undergoes convolution F and batch normalization can be obtained according to the following formula:

[0068]

[0069] The j-th channel of the new convolution kernel F′ and bias b′ obtained by fusing convolution and BN can be obtained according to the following formula:

[0070]

[0071] Where, μ j , σ j γ j ,β j These are the mean, variance, scaling factor, and offset factor of the batch norm, respectively.

[0072] The formula for summing the results of multiple parallel convolutional branches of the same specification is as follows:

[0073] F'←F (1) +F (2) ,b'←b (1) +b (2)

[0074] Where F and b are the weights and biases of the convolution kernel, respectively.

[0075] like Figure 2 As shown, during the model inference stage, the multi-branch convolution is transformed into a single K×K convolution, which improves the model's detection accuracy without increasing the model's inference time.

[0076] Next, three effective feature layers are extracted from the upper, middle, lower, and lower layers of the model backbone network and fed into the network. Figure 3The FPN feature pyramid structure shown integrates feature layers of different shapes to combine high-dimensional and low-dimensional information.

[0077] Finally, the Decoupled Head detection head structure is used in the model output prediction section, such as... Figure 3 As shown, the final prediction information is obtained. In the localization and classification tasks of object detection, there is a spatial misalignment problem. This means that the two tasks in object detection focus on different aspects. Classification focuses more on which class the extracted features are most similar to in the existing categories, while localization focuses more on the position coordinates of the GTBox to correct the bounding box parameters. Therefore, using the same feature map for classification and localization will result in poor performance. A Decoupled Head is used instead of the original Yolohead. After the feature map extracted by the FPN feature fusion pyramid is input, it is divided into two branches and convolutional operations are performed separately. One branch, Cls(H×W×C), is responsible for predicting the probability of a certain defect type corresponding to each feature point, where C is the number of defect categories. The other branch, Reg(H×W×4), is responsible for determining the regression parameters of the predicted bounding box coordinates corresponding to each feature point. After adjusting the regression parameters, the predicted bounding box can be obtained. Iou(H×W×1) is used to determine whether each feature point contains a defect target.

[0078] Example 1

[0079] This embodiment provides a method for detecting surface defects in cylindrical lithium batteries, such as... Figure 4 As shown, it includes:

[0080] Step 1: Obtain images of surface defects in lithium batteries, create a defect dataset, and then perform data preprocessing to increase the number of defect datasets.

[0081] Step 2: Input the defect data images into the improved YOLO model for training, and save the best model;

[0082] The improved YOLO model includes a backbone feature extraction network, a feature fusion network, and a classification, regression, and prediction network; the backbone feature extraction network includes multiple stacked MBneck modules, the feature fusion network includes an FPN network, and the classification, regression, and prediction network includes multiple decoupled head detection heads.

[0083] The MBneck module uses a residual connection structure, consisting of two parts: direct mapping and residual edges. The direct mapping part splits into two branches after a multi-branch convolutional (MBC) operation. One branch first undergoes global max pooling, then a fully connected layer and an activation function to obtain weights for each feature map channel dimension. These weights are multiplied by the feature map output from the other branch, reweighting the feature map channel dimension. The weighted result is then convolved and stacked with the output of the residual edges at the channel scale to obtain the final output. The multi-branch convolutional (MBC) operation includes multiple branches. During the model training phase, different branches with varying scales and complexities are combined to enrich the feature space and enhance the model's feature extraction capabilities.

[0084] Step 3: Input the image of the cylindrical lithium battery to be detected into the deployed model, detect and locate the location of the defect in the image and determine the type of defect; in the deployed model, the multi-branch convolution MBC of the MBneck module is a single convolution that uses reparameterization to equivalently convert multiple branches into a single convolution.

[0085] In one possible implementation, the multi-branch convolution (MBC) includes three branches: the first branch undergoes a 1×1 convolution operation; the second branch undergoes a 1×1 convolution and a K×K convolution operation, where K is an adjustable kernel size; and the third branch undergoes a K×K convolution operation; each convolution operation is followed by a normalization operation.

[0086] The convolutions in the MBneck module are depth-separable convolutions, consisting of DW convolutions and PW convolutions.

[0087] The Decoupled Head detection head is fed into the feature map by the FPN network and then performs convolution operations on two branches. One branch, Cls, is used to predict the probability of a certain defect type corresponding to each feature point. The other branch, Reg, is used to determine the regression parameters of the predicted bounding box coordinates corresponding to each feature point. After adjusting the regression parameters, the predicted bounding box can be obtained. Iou is used to determine whether each feature point contains a defect target.

[0088] The stacked MBneck modules specifically comprise a five-layer structure connected in sequence: the first layer consists of one MBneck module, the second layer consists of two MBneck modules, the third layer consists of three MBneck modules, the fourth layer consists of four MBneck modules, and the fifth layer consists of five MBneck modules.

[0089] Based on the same inventive concept, this application also provides an apparatus corresponding to the method in Embodiment 1, as detailed in Embodiment 2.

[0090] Example 2

[0091] This embodiment provides a device for detecting surface defects in cylindrical lithium batteries, such as... Figure 5 As shown, it includes: a data processing module, a training module, and a detection module;

[0092] The data processing module is used to acquire images of defects on the surface of lithium batteries, create a defect dataset, and then perform data preprocessing to increase the number of defect datasets.

[0093] The training module is used to input defect data images into the improved YOLO model for training and save the best model.

[0094] The improved YOLO model includes a backbone feature extraction network, a feature fusion network, and a classification, regression, and prediction network; the backbone feature extraction network includes multiple stacked MBneck modules, the feature fusion network includes an FPN network, and the classification, regression, and prediction network includes multiple decoupled head detection heads.

[0095] The MBneck module uses a residual connection structure, consisting of two parts: direct mapping and residual edges. The direct mapping part splits into two branches after a multi-branch convolutional (MBC) operation. One branch first undergoes global max pooling, then a fully connected layer and an activation function to obtain weights for each feature map channel dimension. These weights are multiplied by the feature map output from the other branch, reweighting the feature map channel dimension. The weighted result is then convolved and stacked with the output of the residual edges at the channel scale to obtain the final output. The multi-branch convolutional (MBC) operation includes multiple branches. During the model training phase, different branches with varying scales and complexities are combined to enrich the feature space and enhance the model's feature extraction capabilities.

[0096] The detection module is used to input the image of the cylindrical lithium battery to be detected into the deployed model, detect and locate the location of the defect in the image and determine the type of defect; in the deployed model, the multi-branch convolution MBC of the MBneck module is a single convolution that uses reparameterization to equivalently convert multiple branches into a single convolution.

[0097] In one possible implementation, the training module includes a multi-branch convolution (MBC) consisting of three branches: the first branch undergoes a 1×1 convolution operation; the second branch undergoes a 1×1 convolution and a K×K convolution operation, where K is an adjustable kernel size; and the third branch undergoes a K×K convolution operation. Each convolution operation is followed by a normalization operation.

[0098] The convolutions in the MBneck module are depth-separable convolutions, consisting of DW convolutions and PW convolutions.

[0099] The Decoupled Head detection head is fed into the feature map by the FPN network and then performs convolution operations on two branches. One branch, Cls, is used to predict the probability of a certain defect type corresponding to each feature point. The other branch, Reg, is used to determine the regression parameters of the predicted bounding box coordinates corresponding to each feature point. After adjusting the regression parameters, the predicted bounding box can be obtained. Iou is used to determine whether each feature point contains a defect target.

[0100] Furthermore, the multiple stacked MBneck modules specifically include a five-layer structure connected in sequence: the first layer consists of one MBneck module, the second layer consists of two MBneck modules, the third layer consists of three MBneck modules, the fourth layer consists of four MBneck modules, and the fifth layer consists of five MBneck modules.

[0101] Since the apparatus described in Embodiment 2 of the present invention is an apparatus used to implement the method of Embodiment 1 of the present invention, those skilled in the art can understand the specific structure and variations of the apparatus based on the method described in Embodiment 1 of the present invention, and therefore will not be described again here. All apparatuses used in the method of Embodiment 1 of the present invention fall within the scope of protection of the present invention.

[0102] This invention designs multiple stacked MBneck modules for feature extraction in the backbone of the model. The modules employ channel attention and residual connections, allowing the model to focus on more important information in the feature map and mitigating the gradient vanishing problem during backpropagation. The MBneck modules utilize multi-branch convolution (MBC), combining branches of different scales and complexities to enrich the feature space. They also employ reparameterized structures and separable convolution operations, increasing computation only during training. During inference, this can be equivalently converted to a single convolution, achieving lightweight parameters and computation, thus improving detection accuracy without increasing inference speed. The MBneck modules use depthwise separable convolutions instead of ordinary convolutions to reduce model parameters and improve detection speed, and utilize channel attention to locate information of interest in the feature map while suppressing useless information.

[0103] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0104] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0105] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0106] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0107] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A cylindrical lithium battery surface defect detection method, characterized by, The application relates to a lithium battery surface defect detection method based on improved YOLO model. The method comprises the following steps: Step 1, acquiring a lithium battery surface defect image, making a defect data set, then performing data preprocessing, and increasing the number of defect data sets; Step 2, inputting the defect data image into an improved YOLO model for training, and saving the best model; The improved YOLO model comprises a main feature extraction network, a feature fusion network and a classification regression prediction network; The main feature extraction network comprises a plurality of stacked MBneck modules, the feature fusion network comprises an FPN network, and the classification regression prediction network comprises a plurality of Decoupled Head detection heads; the plurality of stacked MBneck modules specifically comprise a five-layer structure connected in sequence, the first layer is composed of one MBneck module, the second layer is composed of two MBneck modules, the third layer is composed of three MBneck modules, the fourth layer is composed of four MBneck modules, and the fifth layer is composed of five MBneck modules; The MBneck module uses a residual connection structure and is composed of direct mapping and a residual edge; the direct mapping part is divided into two branches after MBC operation, one branch is subjected to a global maximum pooling operation, then subjected to a full connection layer and an activation function, and then the weight of each feature map channel dimension is obtained; the weight is multiplied with the feature map output by the other branch, the feature map channel dimension is weighted, the weighted result is subjected to convolution operation, and then the output of the residual edge is stacked in the channel scale to obtain the final output; the MBC operation comprises a plurality of branches, and different branches with different scales and complexities are combined in the model training stage to enrich the feature space and enhance the feature extraction capability of the model; the convolution in the MBneck module is a depth separable convolution, which is composed of a DW convolution and a PW convolution; 2. The method of claim 1, wherein: Step 3, inputting a to-be-detected cylindrical lithium battery image into the deployed model to detect and locate the position of the defect in the image and judge the defect type; in the deployed model, the MBC of the MBneck module is converted into a single convolution by using reparameterization.

3. The method of claim 1, wherein: The MBC comprises three branches, the first branch is subjected to a 1x1 convolution operation; the second branch is subjected to a 1x1 convolution and a KxK convolution operation, K is an adjustable convolution kernel size; the third branch is subjected to a KxK convolution operation; and each convolution operation is subjected to a normalization operation.

4. A cylindrical lithium battery surface defect detection device, characterized by, The DecoupledHead detection head is divided into two branches after the FPN network inputs the feature map and performs convolution operation, one branch Cls is used for predicting the probability of each feature point corresponding to a certain defect type; the other branch Reg is used for judging the regression parameters of the prediction frame coordinates corresponding to each feature point, the prediction frame can be obtained after the regression parameters are adjusted, and Iou is used for judging whether the defect target is contained in each feature point. The application further discloses a lithium battery surface defect detection method based on improved YOLO model. The method comprises the following steps: A data processing module, a training module and a detection module. The data processing module is used for acquiring a lithium battery surface defect image, making a defect data set, and then performing data preprocessing to increase the number of defect data sets; The training module is used for transmitting the defect data image into the improved YOLO model for training and saving the best model; The improved YOLO model comprises a main feature extraction network, a feature fusion network and a classification regression prediction network; The main feature extraction network comprises a plurality of stacked MBneck modules, the feature fusion network comprises an FPN network, and the classification regression prediction network comprises a plurality of Decoupled Head detection heads; the plurality of stacked MBneck modules specifically comprise a five-layer structure connected in sequence, the first layer is composed of one MBneck module, the second layer is composed of two MBneck modules, the third layer is composed of three MBneck modules, the fourth layer is composed of four MBneck modules, and the fifth layer is composed of five MBneck modules; The MBneck module uses a residual connection structure and is composed of direct mapping and a residual edge; the direct mapping part is divided into two branches after MBC operation, one branch is subjected to global maximum pooling operation, then subjected to a fully connected layer and an activation function to obtain the weight of each feature map channel dimension, the weight is multiplied with the feature map output by the other branch, the feature map channel dimension is reweighted, and the weighted result is subjected to convolution operation and stacked with the output of the residual edge in the channel dimension to obtain the final output; the MBC operation comprises a plurality of branches, and different branches with different scales and complexities are combined in the model training stage to enrich the feature space and enhance the feature extraction capability of the model; the convolution in the MBneck module is a depth separable convolution, which is composed of a DW convolution and a PW convolution; The detection module is used for inputting the image of the cylindrical lithium battery to be detected into the deployed model to detect and locate the position of the defect in the image and judge the defect type; in the deployed model, the MBC of the MBneck module is converted into a single convolution by reparameterization.

5. The apparatus of claim 4, wherein: In the training module, the MBC comprises three branches, the first branch is subjected to a 1×1 convolution operation; the second branch is subjected to a 1×1 convolution and a K×K convolution operation, K is an adjustable convolution kernel size; the third branch is subjected to a K×K convolution operation; and each convolution operation is subjected to a normalization operation.

6. The apparatus of claim 4, wherein: The Decoupled Head detection head is divided into two branches after the FPN network inputs the feature map and performs convolution operation, one branch Cls is used for predicting the probability of each feature point corresponding to a certain defect type; the other branch Reg is used for judging the regression parameter of the prediction frame coordinates corresponding to each feature point, and the prediction frame can be obtained after the regression parameter is adjusted, and Iou is used for judging whether the defect target is contained in each feature point.

Citation Information

Patent Citations

  • Wafer ID identification method and device based on deep learning

    CN112200182A

  • Welding joint defect detection method and device based on residual network

    CN113516651A