Lithium battery shell defect detection method, device, equipment and medium

By using neural network models to extract and adaptive expansion and convolution processing of the image to be detected in the lithium battery case, defect detection images are generated, and the problem of being unable to quickly and effectively batch detection of the lithium battery case in the prior art is solved, and efficient and accurate defect detection is achieved.

CN119722574APending Publication Date: 2025-03-28SHENZHEN HYMSON LASER INTELLIGENT EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411601568.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The prior art cannot quickly and effectively conduct batch inspection of lithium battery case, mainly due to problems such as lack of obvious characteristics and variable size of lithium battery case.

Method used

The preset neural network model is used to obtain the image to be detected in the lithium battery case through high-definition camera equipment, perform feature extraction and adaptive expansion convolution processing, generate defect detection images, and mark the defective lithium battery case and its location.

Benefits of technology

Real-time and efficient batch inspection of lithium battery case is realized, and defect locations can be quickly identified and marked, improving detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722574A_ABST
    Figure CN119722574A_ABST
Patent Text Reader

Abstract

The invention discloses a lithium battery shell defect detection method, device and equipment and a medium. The method comprises the steps that a to-be-detected image of a lithium battery shell is acquired in a lithium battery production line, and the to-be-detected image comprises a plurality of lithium batteries; performing feature extraction on the to-be-detected image through a preset neural network model to obtain a plurality of feature maps; and sampling and feature fusion are carried out on the feature map through adaptive expansion convolution in a preset neural network model, a defect detection image is generated, and a lithium battery shell with defects and defect positions are marked in the defect detection image. By implementing the method provided by the invention, the problem that the lithium battery shells cannot be efficiently detected in batches in the prior art can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of defect detection, and in particular to a method, device, equipment and medium for detecting defects in a lithium battery casing. Background Art

[0002] With the development of science and technology and the increase in people's needs, lithium batteries have gradually been widely used in electronic equipment, electric vehicles, energy storage, aerospace, and medical fields due to their high energy density, light weight, fast charging and discharging, and long life. However, in the mass production of lithium batteries, the shell is easily damaged, affecting performance and safety, so it is necessary to detect it in real time. With the development of computer vision, people gradually use defect detection models based on deep learning to replace manual inspection to improve inspection efficiency. However, model training in existing technologies requires a lot of upfront investment, and due to the unclear characteristics of lithium battery shells and variable sizes, it is impossible to quickly and effectively perform batch inspections on lithium battery shells. Summary of the invention

[0003] The embodiments of the present invention provide a lithium battery shell defect detection method, device, equipment and medium, aiming to solve the problem that lithium battery shells cannot be efficiently batch detected in the prior art.

[0004] In a first aspect, an embodiment of the present invention provides a method for detecting defects in a lithium battery shell, comprising: obtaining an image to be detected of a lithium battery shell in a lithium battery production line, wherein the image to be detected includes a plurality of lithium batteries; performing feature extraction on the image to be detected through a preset neural network model to obtain a plurality of feature maps; sampling and feature fusion of the feature maps through adaptive dilated convolution in the preset neural network model to generate a defect detection image, wherein the defective lithium battery shell and the defect position are marked in the defect detection image.

[0005] In the second aspect, an embodiment of the present invention also provides a lithium battery shell defect detection device, which includes: an acquisition unit, used to acquire an image to be detected of a lithium battery shell in a lithium battery production line, wherein the image to be detected includes a plurality of lithium batteries; an extraction unit, used to perform feature extraction on the image to be detected through a preset neural network model to obtain a plurality of feature maps; a generation unit, used to sample and fuse the feature maps through adaptive dilated convolution in a preset neural network model to generate a defect detection image, wherein the defective lithium battery shell and the defect position are marked in the defect detection image.

[0006] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.

[0007] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions can implement the above method when executed by a processor.

[0008] The embodiment of the present invention provides a method, device, equipment and medium for detecting defects in a lithium battery shell. The method comprises: obtaining an image to be detected of a lithium battery shell in a lithium battery production line, wherein the image to be detected includes a plurality of lithium batteries; extracting features of the image to be detected through a preset neural network model to obtain a plurality of feature maps; sampling and fusion of the feature maps through adaptive dilated convolution in the preset neural network model to generate a defect detection image, wherein the defective lithium battery shell and the defect position are marked in the defect detection image. The embodiment of the present invention obtains an image to be detected of a lithium battery shell at a lithium battery production line through a high-definition camera device, wherein there are a plurality of lithium batteries in the image to be detected, extracts features and fuses features of the image to be detected through a preset neural network model that is continuously iteratively updated, and generates a final defect detection image. The trained preset neural network model can directly generate a lithium battery shell with defects such as scratches and the position of the defects, so that the lithium battery shell can be batch-detected in real time and efficiently. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0010] Figure 1 A schematic diagram of a process for detecting defects in a lithium battery housing provided by an embodiment of the present invention;

[0011] Figure 2 A schematic diagram of a sub-process of a lithium battery housing defect detection method provided by an embodiment of the present invention;

[0012] Figure 3 A schematic diagram of a sub-process of a lithium battery housing defect detection method provided by an embodiment of the present invention;

[0013] Figure 4 A schematic diagram of a sub-process of a lithium battery housing defect detection method provided by an embodiment of the present invention;

[0014] Figure 5 A schematic diagram of a sub-process of a lithium battery housing defect detection method provided by an embodiment of the present invention;

[0015] Figure 6A schematic diagram of a sub-process of a lithium battery housing defect detection method provided by an embodiment of the present invention;

[0016] Figure 7 A schematic diagram of a sub-process of a lithium battery housing defect detection method provided by an embodiment of the present invention;

[0017] Figure 8 A schematic block diagram of a lithium battery housing defect detection device provided by an embodiment of the present invention;

[0018] Fig. 9 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0021] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0022] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0023] See also Figure 1 , Figure 1A flow chart of a lithium battery shell defect detection method provided in an embodiment of the present invention. The lithium battery shell defect detection method in this embodiment can be applied to real-time monitoring of a lithium battery production line. Specifically, the method can be applied to a high-definition camera device that monitors a lithium battery production line. The high-definition camera device can effectively perform batch detection of lithium batteries by applying the method of the present invention and feed back the detection results to the operator, so that the operator can pick out batteries with shell defects from the batch of batteries, thereby realizing efficient batch detection of lithium battery shells.

[0024] Figure 1 The figure is a flow chart of a lithium battery housing defect detection method provided by an embodiment of the present invention. As shown in the figure, the method includes the following steps S110-S130.

[0025] S110, obtaining an image to be inspected of a lithium battery casing in a lithium battery production line, wherein the image to be inspected includes a plurality of lithium batteries.

[0026] In this embodiment, the image to be detected is obtained by a high-definition camera installed at a lithium battery production line. Specifically, the high-definition camera can monitor the lithium battery production line, and each frame of image acquired by the monitoring is the image to be detected. There is no limitation on the specific camera model, and it is sufficient to be able to clearly obtain the monitoring video. It can be understood that since the high-definition camera can capture all lithium batteries produced in the production line, the image to be detected includes a number of lithium batteries. By obtaining the image to be detected of the lithium battery shell in the lithium battery production line, it is convenient to perform batch detection on a number of lithium batteries in the image to be detected.

[0027] In one embodiment, if Figure 2 As shown, the step S110 further includes steps S1101 - S1102 .

[0028] S1101, performing preprocessing operations of denoising, enhancing and adjusting brightness on the image to be detected;

[0029] S1102, inputting the preprocessed image to be detected into the preset neural network model.

[0030] In this embodiment, the denoising refers to removing unnecessary or interfering information from the image, such as noise points, spots or stripes. The denoising methods include mean filtering, median filtering and Gaussian filtering. In this embodiment, the mean filtering can be used to calculate the average value of the pixels in the image to be detected to replace the central pixel value to remove slight noise. The enhancement refers to the operation of highlighting the useful information in the image while suppressing unimportant information. Specifically, the image to be detected can be enhanced by contrast enhancement, sharpening and adaptive histogram equalization. In this embodiment, the brightness and contrast of the image can be adjusted by contrast enhancement to make the details in the image clearer. The brightness adjustment is to change the overall brightness level of the image to improve the visual effect or meet specific analysis requirements. For example, in the case of insufficient light, increasing the brightness can help identify the details in the image; while in the case of overexposure, reducing the brightness can avoid information loss. The image to be detected is preprocessed by denoising, enhancing and adjusting the brightness to optimize the quality of the image to be detected, thereby improving the accuracy and efficiency of the preset neural network model in its recognition and analysis.

[0031] S120, extracting features of the image to be detected through a preset neural network model to obtain a plurality of feature maps.

[0032] In this embodiment, the preset neural network model is a convolutional neural network model, which is a self-correcting adaptive expansion rate counting neural network model (ADSCNet) in this embodiment, wherein the self-correcting adaptive expansion rate counting neural network model is a neural network model designed for counting tasks, which can effectively analyze and process targets with scale changes. The image to be detected is subjected to feature extraction through the self-correcting adaptive expansion rate counting neural network model to obtain a feature map. Specifically, the image to be detected is subjected to the convolution layer in the preset neural network model to calculate the dot product between the convolution kernel and the local area of ​​the image, thereby extracting local features in the image to generate a feature map. Feature extraction is performed by the preset neural network model to obtain several feature maps, and subsequent target detection and other processing can be performed according to the feature maps, providing data support for the detection of the shell of the lithium battery.

[0033] In one embodiment, if Figure 3 As shown, the step S120 includes steps S121-S123.

[0034] S121, performing convolution calculation on the image to be detected through the convolution layer in the backbone network of the preset neural network model to extract features in the image to be detected, wherein the backbone network is a RepVGG network;

[0035] S122, performing nonlinear transformation on the extracted features through a preset activation function to obtain an output feature map;

[0036] S123, performing feature extraction and nonlinear transformation on the output feature map in different operation units in the backbone network to generate the feature map.

[0037] In this embodiment, the preset neural network model is a self-correcting adaptive expansion rate counting neural network model, and the self-correcting adaptive expansion rate counting neural network model includes a backbone network, wherein the backbone network is the core part of the neural network and is responsible for extracting features from the original input. The RepVGG network is used as the backbone network of the preset neural network model, wherein the RepVGG (Re-parameterizationVGG) network is a convolutional neural network that uses innovative structural parameter reconstruction technology to enable the network to adopt different structures in the training and reasoning stages to process data. The RepVGG network is composed of multiple RepVGG Blocks, each RepVGG Block is composed of a standard 3x3 convolutional layer and a RepVGG Block connected thereto, and the operation unit is a RepVGG Block. Before the image to be detected is input into the RepVGG network, the RepVGG network will be trained. Specifically, in the training stage, the RepVGG model updates the model parameters through the back propagation algorithm, wherein the back propagation algorithm is one of the most commonly used optimization algorithms in neural network training. Its core idea is to calculate the gradient of the loss function to the network parameters and propagate these gradients from the output layer back to each layer of the neural network, thereby updating the parameters to minimize the loss function. Specifically, the training image is preprocessed and input into the RepVGG model, and a new feature map is obtained by RepVGG Block convolution and ReLU activation, which is passed to the output layer to obtain the predicted value. The predicted value is compared with the true value, the loss value is calculated using the loss function, the gradient is calculated by back propagation and chain rule, and the parameters are updated using the optimization algorithm (such as SGD, Adam). Repeat the iteration until the performance of the validation set is satisfactory or reaches a preset number of times, and the RepVGG training is completed. Among them, the specific training process is not limited, and the preset neural network model can be effectively trained. The image to be detected is subjected to feature extraction through the RepVGG network in the preset neural network model after training, and the extracted features are subjected to nonlinear conversion in the RepVGG network through a preset activation function, such as a ReLU activation function, to obtain an output feature map, wherein the ReLU activation function (Rectified Linear Unit) is a commonly used activation function, mainly used for neurons in neural networks. And the output feature map generated by a RepVGG Block is passed between multiple RepVGG Blocks until it reaches the output layer of the RepVGG model, and the output layer outputs the feature map. The features in the image to be detected are extracted through the backbone network of the preset neural network model, and a feature map is generated to make the features in the image to be detected obvious, so as to facilitate the subsequent defect marking and processing of the lithium battery shell.

[0038] S130. Sampling and feature fusion of the feature map are performed through adaptive dilated convolution in a preset neural network model to generate a defect detection image, wherein the defective lithium battery casing and the defect position are marked in the defect detection image.

[0039] In this embodiment, the preset neural network model includes a neck network, wherein the neck network is used to further process and integrate the features extracted from the backbone network, that is, the adaptive dilated convolution is the neck network in the preset neural network model, which is used to further process and integrate the feature map. Specifically, the adaptive dilated convolution is a special convolution operation, and the adaptive dilated convolution can dynamically adjust the dilation factor according to the different input feature maps, thereby optimizing the receptive field size of the convolution kernel. This adaptive adjustment helps the network to better capture defect features of different scales, thereby improving the accuracy of defect detection. After bilinear sampling of the feature map by the adaptive dilated convolution in the preset neural network model, the sampled values ​​are weighted summed for feature fusion to generate a defect detection image, wherein the defective lithium battery shell and the defect position are marked in the defect detection image. Specifically, after adaptive dilated convolution and feature fusion, the preset neural network can extract the defect features on the lithium battery shell. These features include information such as the shape, size, and position of the defect. And according to the extracted defect features, the lithium battery shell is defect-detected, and the detected defects are marked with specific marks (such as rectangular frames, colors, etc.) in the generated defect detection image to indicate the location and range of the defects. The feature map is sampled and feature-fused through the adaptive dilated convolution in the preset neural network model to generate a defect detection image, and the defect detection image is displayed to the operator, so that the operator can quickly pick out batteries with shell defects in the batch of batteries, thereby realizing efficient batch detection of lithium battery shells.

[0040] In one embodiment, if Figure 4 As shown, the step S130 includes steps S131-S133.

[0041] S131, inputting the feature map into the adaptive dilated convolution for convolution processing and then outputting it through the preset activation function to obtain a dilation rate map;

[0042] S132, sampling the expansion rate map by bilinear interpolation to obtain sampling values, performing weighted summation on the sampling values ​​to obtain a target feature map;

[0043] S133. Output the target feature map through a preset output layer to obtain the defect detection image.

[0044] In this embodiment, the feature map is input into the adaptive dilation convolution to obtain a single-channel sub-dilation rate map of the same size as the original image through a 3×3 convolution layer, wherein the sub-dilation rate map refers to an image with a dimension of 2 or a third dimension of 1, also known as a grayscale image or a black and white image, and each pixel value on the dilation rate map represents the dilation rate of the corresponding position, and the sub-dilation rate map is passed through a preset convolution function (such as ReLU) to ensure that the values ​​on the dilation rate map are all non-negative numbers to obtain the final dilation rate map. The bilinear interpolation is a method of estimating pixel values ​​in a two-dimensional space, referring to the weights of the four surrounding pixels, so as to obtain a smoother interpolation result. The adaptive receptive field in the dilation rate map is sampled by bilinear interpolation according to the dilation rate value of the corresponding position to obtain a sampled value, and the sampled value is weighted summed to obtain the target feature map. Wherein, the receptive field refers to the area of ​​the input image that can be seen by a certain point on the feature map. The target feature map is output through a preset output layer to obtain the defect detection image, wherein the preset output layer is a head network layer in a neural network, and the head network layer includes a convolution layer and a fully connected layer for predicting object categories and bounding boxes. The image is classified or regressed through structures such as the fully connected layer to determine whether there are defects in the image and give the location of the defects. The defects are presented in the form of a bounding box, a segmentation mask or a label vector, so as to mark the defects in the image. Among them, the specific parameters in the preset output layer are not limited, and a clear defect detection image can be output. By inputting the feature map into the adaptive dilated convolution for processing and output, a clear defect detection image with defect markings is obtained, so as to facilitate batch and efficient detection of lithium battery casings.

[0045] In one embodiment, if Figure 5 As shown, step S130 includes steps S1301-S1302.

[0046] S1301, calculating the defect detection image and the preset manually annotated scratch image using a preset self-correction loss function;

[0047] S1302. Iteratively update the weights of the convolution kernels in the preset neural network model and the preset manual annotation graph according to the calculated loss function.

[0048] In this embodiment, the preset manually annotated scratch image is an image in which defect scratches are pre-marked by an operator. The self-correction loss function is a specially designed loss function. By introducing a correction mechanism, the self-correction loss function can dynamically update the target density map and correct the annotation deviation. Specifically, the defect detection image and the preset manually annotated scratch image are calculated by the preset self-correction loss function to obtain a loss function for quantifying the direct difference between the defect detection image and the preset manually annotated scratch image, and the loss function is minimized. By minimizing the loss function, the preset neural network model can learn more accurate target position and size information. Among them, the specific calculation process is not limited, and it is sufficient to obtain the loss function and optimize it. At the same time, the self-correction loss function can also balance the errors between different targets by supervising the weight coefficients of the convolution kernels in the preset neural network model, so as to iteratively update the weights of the convolution kernels in the preset neural network model, and replace the preset manually annotated scratch image with the defect scratch detection image whose defect detection effect is better than the preset manually annotated scratch image. The defect detection image and the preset manually annotated scratch image are calculated through a preset self-correction loss function to iteratively update the weights of the convolution kernel in the preset neural network model, thereby improving the overall detection performance of the model.

[0049] In one embodiment, if Figure 6 As shown, step S130 also includes steps S1303-S1304.

[0050] S1303, determining whether the defect detection image meets the preset detection standard, and if not, updating the preset neural network model by using a preset clustering pruning algorithm;

[0051] S13043. Acquire the defect detection image according to the updated preset neural network model.

[0052] In this embodiment, the preset detection standard is a standard for detecting whether the defect detection image is qualified, wherein the preset defect detection standard can be set according to specific detection requirements, and there is no limitation on this. If the defect detection image does not meet the preset detection standard, the preset neural network model is updated by a preset clustering pruning algorithm, wherein the clustering pruning algorithm is an algorithm for optimizing the structure of a neural network, which groups weights or neurons in the network to identify redundant or less important parts; and removes these redundant parts, thereby simplifying the network structure and improving performance. Specifically, the weight distribution of the model is analyzed by the clustering pruning algorithm, and those weights or convolution kernel neurons that have little effect on the prediction results are identified, and they are removed from the model to update the preset neural network model. After the model is updated, the preset neural network model is trained again, and the defect detection image is input into the updated neural network model to obtain a new prediction result. By judging whether the defect detection image meets the preset detection standard, the preset neural network model is updated by a preset clustering pruning algorithm to reduce the complexity of the preset neural network model and improve its generalization ability and detection accuracy.

[0053] In one embodiment, if Figure 7 As shown, the step S1303 also includes steps S13031-S13033.

[0054] S13031. Clustering the convolution kernels of the convolution layer of the backbone network by using the preset clustering pruning algorithm to obtain a plurality of cluster clusters;

[0055] S13032, obtaining the total weight value of all convolution kernels in each of the clusters, wherein each of the convolution kernels has a corresponding weight;

[0056] S13033. Determine whether the total weight value of each cluster exceeds a preset weight threshold; if not, delete the convolution kernel in the corresponding cluster.

[0057] In this embodiment, the preset weight threshold is a pre-set threshold used to judge the importance of the cluster. If the total weight value of the cluster is lower than this threshold, it is determined that the cluster contributes less to the model performance. The convolution kernels of the convolution layer of the backbone network are clustered by the preset cluster pruning algorithm to obtain a number of clusters. Specifically, the convolution kernels of each convolution layer are clustered according to the weight value: Let cluster X = [x1, x2, ..., x n ] T , X represents the convolution kernel corresponding to the i-th convolution layer in the network, where n represents the number of convolution kernels in the layer, and x j ∈R c×h×w(j=1,2,…,n) represents the jth convolution kernel in the i-th convolution layer, c, h, w represent the number of channels, height and width of the convolution kernel respectively. j Expanded into a one-dimensional convolution vector, we have x j '∈R s ,s=c×h×w, s is the product of the number of channels, height, and width. Then all the convolution kernel vectors x in the i-th layer are j 'Form a set, with X'=[x'1,x'2,…,x' n ], perform density peak clustering on X', and obtain CL=CL1∪CL2∪…∪CL m , where m is the number of clusters, Represents the set of convolution kernels contained in cluster k after all convolution kernels in layer i are clustered, where j i (i=1,2,…,|CL i |) represents the corresponding convolution kernel index value in the cluster.

[0058] |CL i | represents the number of convolution kernels contained in cluster i. By clustering the convolution kernels of the convolution layer of the backbone network, the above-mentioned several cluster clusters are obtained, and the total weight value of all the convolution kernels in each cluster cluster is obtained, wherein each of the convolution kernels has a corresponding weight, specifically, each convolution kernel has a set of weights, wherein these weights are optimized by the loss function during the training process. It is determined whether the total weight value of each cluster cluster exceeds the preset weight threshold, and if not, the convolution kernel in the corresponding cluster cluster is deleted. The convolution layer of the backbone network is pruned by a preset clustering pruning algorithm to effectively remove those convolution kernels that contribute less to the model performance, thereby simplifying the model structure, reducing the amount of calculation and improving the operation efficiency.

[0059] Figure 8 is a schematic block diagram of a lithium battery housing defect detection device 200 provided in an embodiment of the present invention. Figure 8 As shown, corresponding to the above lithium battery shell defect detection method, the present invention also provides a lithium battery shell defect detection device. The lithium battery shell defect detection device includes a unit for executing the above lithium battery shell defect detection method, and the device can be configured in a desktop computer, a tablet computer, a laptop computer, and other terminals. Specifically, please refer to Figure 8 The lithium battery shell defect detection device includes an acquisition unit 210, an extraction unit 220 and a generation unit 230.

[0060] The acquisition unit 210 is used to acquire an image to be inspected of a lithium battery shell in a lithium battery production line, wherein the image to be inspected includes a plurality of lithium batteries.

[0061] In one embodiment, the acquisition unit 210 includes a pre-processing unit and an input unit.

[0062] A preprocessing unit, used for performing preprocessing operations of denoising, enhancing and adjusting brightness on the image to be detected;

[0063] An input unit is used to input the preprocessed image to be detected into the preset neural network model.

[0064] The extraction unit 220 is used to extract features from the image to be detected through a preset neural network model to obtain a plurality of feature maps.

[0065] In one embodiment, the extraction unit 220 includes a first extraction unit, a conversion unit, and a second extraction unit.

[0066] A first extraction unit, configured to perform convolution calculation on the image to be detected through a convolution layer in a backbone network of the preset neural network model to extract features from the image to be detected, wherein the backbone network is a RepVGG network;

[0067] A conversion unit, used to perform nonlinear conversion on the extracted features through a preset activation function to obtain an output feature map;

[0068] The second extraction unit is used to perform feature extraction and nonlinear transformation on the output feature map in different operation units in the backbone network to generate the feature map.

[0069] The generating unit 230 is used to sample and fuse the feature map through adaptive dilated convolution in a preset neural network model to generate a defect detection image, wherein the defective lithium battery casing and the defect position are marked in the defect detection image.

[0070] In one embodiment, the generating unit 230 includes an activating unit, a sampling unit, and an acquiring unit.

[0071] An activation unit, used for inputting the feature map into the adaptive dilated convolution for convolution processing and then outputting it through the preset activation function to obtain a dilation rate map;

[0072] A sampling unit, configured to sample the expansion rate map through bilinear interpolation to obtain sampling values, and perform weighted summation on the sampling values ​​to obtain a target feature map;

[0073] An acquisition unit is used to output the target feature map through a preset output layer to obtain the defect detection image.

[0074] In one embodiment, the generating unit 230 includes a calculating unit and an iterating unit.

[0075] A calculation unit, used for calculating the defect detection image and the preset manually annotated scratch image through a preset self-correction loss function;

[0076] An iterative unit is used to iteratively update the weights of the convolution kernels in the preset neural network model and the preset manual annotation graph according to the calculated loss function.

[0077] In one embodiment, the generating unit 230 includes a determining unit and an updating unit.

[0078] A judgment unit, used to judge whether the defect detection image meets the preset detection standard, and if not, update the preset neural network model through a preset clustering pruning algorithm;

[0079] An updating unit is used to obtain the defect detection image according to the updated preset neural network model.

[0080] In one embodiment, the generating unit 230 includes a clustering unit, a weighting unit, and a deleting unit.

[0081] A clustering unit, used to cluster the convolution kernels of the convolution layer of the backbone network by using the preset clustering pruning algorithm to obtain a plurality of cluster clusters;

[0082] A weight unit, used to obtain the total weight value of all convolution kernels in each of the clusters, wherein each of the convolution kernels has a corresponding weight;

[0083] The deleting unit is used to determine whether the total weight value of each cluster exceeds a preset weight threshold, and if not, delete the convolution kernel in the corresponding cluster.

[0084] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned lithium battery casing defect detection device 200 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.

[0085] The above-mentioned lithium battery shell defect detection device can be implemented in the form of a computer program, which can be used in Fig. 9 Runs on the computer device shown.

[0086] See also Fig. 9 , Fig. 95 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a terminal or a server, wherein the terminal may be an electronic device with communication functions such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of multiple servers.

[0087] See also Fig. 9 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0088] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a lithium battery shell defect detection method.

[0089] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0090] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a lithium battery shell defect detection method.

[0091] The network interface 505 is used to communicate with other devices over the network. Fig. 9 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0092] The processor 502 is used to run a computer program 5032 stored in the memory to implement the steps of the above method.

[0093] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0094] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0095] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the steps of the above method.

[0096] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0097] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0098] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0099] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0100] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0101] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for detecting defects in a lithium battery casing, characterized in that: include: Acquire an image to be inspected of a lithium battery shell in a lithium battery production line, wherein the image to be inspected includes a plurality of lithium batteries; Extract features of the image to be detected through a preset neural network model to obtain several feature maps; The feature map is sampled and feature-fused by adaptive dilated convolution in a preset neural network model to generate a defect detection image, wherein the defective lithium battery casing and the defect position are marked in the defect detection image.

2. The method according to claim 1, characterized in that After the step of obtaining the image to be inspected of the lithium battery shell in the lithium battery production line, the method further comprises: Performing preprocessing operations of denoising, enhancing and adjusting brightness on the image to be detected; The preprocessed image to be detected is input into the preset neural network model.

3. The method according to claim 1, characterized in that The step of extracting features from the image to be detected through a preset neural network model to obtain a plurality of feature maps comprises: The image to be detected is subjected to convolution calculation by a convolution layer in a backbone network of the preset neural network model to extract features in the image to be detected, wherein the backbone network is a RepVGG network; The extracted features are nonlinearly transformed through a preset activation function to obtain an output feature map; The output feature map is subjected to feature extraction and nonlinear transformation in different operation units in the backbone network to generate the feature map.

4. The method according to claim 3, characterized in that The step of sampling and fusing the feature map by adaptive dilated convolution in a preset neural network model to generate a defect detection image includes: The feature map is input into the adaptive dilated convolution for convolution processing and then output through the preset activation function to obtain a dilation rate map; The expansion rate map is sampled by bilinear interpolation to obtain sampling values, and the sampling values ​​are weighted summed to obtain a target feature map; The target feature map is output through a preset output layer to obtain the defect detection image.

5. The method according to claim 4, characterized in that After the step of generating the defect detection image, the method further includes: The defect detection image and the preset manually annotated scratch image are calculated using a preset self-correction loss function; The weights of the convolution kernels in the preset neural network model and the preset manual annotation graph are iteratively updated according to the calculated loss function.

6. The method according to claim 3, characterized in that After the step of generating the defect detection image, the method further comprises: Determine whether the defect detection image meets the preset detection standard, and if not, update the preset neural network model through a preset clustering pruning algorithm; The defect detection image is acquired according to the updated preset neural network model.

7. The method according to claim 6, characterized in that The step of updating the preset neural network model by using a preset clustering pruning algorithm includes: Clustering the convolution kernels of the convolution layer of the backbone network by using the preset clustering pruning algorithm to obtain a number of cluster clusters; Obtaining the total weight value of all convolution kernels in each of the clusters, wherein each of the convolution kernels has a corresponding weight; It is determined whether the total weight value of each cluster exceeds a preset weight threshold, and if not, the convolution kernel in the corresponding cluster is deleted.

8. A lithium battery shell defect detection device, characterized in that: include: An acquisition unit, used for acquiring an image to be detected of a lithium battery shell in a lithium battery production line, wherein the image to be detected includes a plurality of lithium batteries; An extraction unit, used to extract features from the image to be detected through a preset neural network model to obtain a plurality of feature maps; A generating unit is used to sample and fuse the feature map through adaptive dilated convolution in a preset neural network model to generate a defect detection image, wherein the defective lithium battery casing and the defect position are marked in the defect detection image.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method according to any one of claims 1 to 7 can be implemented.