Tab defect detection method and apparatus, and electronic device
Through the image classification model, the detection of polar ear images is solved, and the detection accuracy reduction caused by the complexity of polar ear imaging system is achieved, and the pre-discrimination and accurate detection of polar ear imaging problems are realized.
Patent Information
- Application Number
- PCT/CN2024/119843
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-05
- Filing Date
- 2024-09-19
- Publication Date
- 2025-08-14
AI Technical Summary
The ultra-ear imaging system is complex, resulting in frequent imaging problems, affecting the accuracy of the ultra-ear defect detection algorithm. It is urgent to make a pre-judgment to assist in adjusting the imaging equipment.
The image classification model is used to detect the polar ear images, and the detection accuracy is improved by training multiple classification labels marked in the sample set, including normal, uneven light, jitter, excessive darkness, overexposure, blurredness, excessive tail, dirty prism and left supervisual field.
The pre-discrimination of the imaging problems of the polar ear is achieved, and the auxiliary lithium battery line engineers are assisted to adjust the imaging equipment in time to improve the detection accuracy and avoid subsequent detection interference.
Smart Images

Figure CN2024119843_14082025_PF_FP_ABST
Abstract
Description
Tab defect detection method, device and electronic equipment
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application No. 202410166156.0, filed on February 5, 2024, entitled “Tab Defect Detection Method, Device and Electronic Device,” the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present application relates to the field of image processing technology, and in particular to a tab defect detection method, device, and electronic equipment. Background Art
[0004] Due to the thinness and severe reflection of the tabs, the tab imaging system is very complex, which can easily lead to imaging problems and significantly reduce the effectiveness of subsequent tab defect detection algorithms. Currently, there is an urgent need for a method to pre-identify problems in tab imaging to assist lithium battery production line engineers in timely adjusting imaging equipment.
[0005] Summary of the Invention
[0006] The present application provides a tab defect detection method, device, and electronic equipment, which can pre-identify problems arising from tab imaging, thereby assisting lithium battery production line engineers in timely adjusting imaging equipment.
[0007] In a first aspect, the present application provides a tab defect detection method, comprising:
[0008] Acquire an image of the tab to be tested;
[0009] Inputting the tab image to be tested into an image classification model to obtain a detection result of the tab image to be tested, wherein the image classification model is trained using a sample set, and the sample set includes tab images marked with multiple classification labels;
[0010] The multiple classification labels include normal, uneven lighting, jitter, too dark, overexposed, blurry, too large tail, dirty prism and left super vision;
[0011] The detection result is at least one of the multiple classification labels.
[0012] In this embodiment, the image of the tab to be tested is input into a pre-trained image classification model, and the classification model is used to detect the image of the tab to be tested to obtain a detection result. This can improve the accuracy of the detection of the image of the tab to be tested, and enable pre-judgment of problems arising from the imaging of the tab, thereby assisting lithium battery production line engineers in timely adjusting the imaging equipment.
[0013] In one embodiment of the present application, before inputting the image of the tab to be tested into an image classification model to obtain a detection result of the image of the tab to be tested, the method further includes:
[0014] Acquire a plurality of first tab images, wherein the plurality of first tab images are annotated with a plurality of classification labels;
[0015] Performing image processing on a first tab image in a target classification label to match the target classification label, to obtain a second tab image belonging to the target classification label, wherein the target classification label is any one of the multiple classification labels;
[0016] Adding the second tab image to a sample set, and marking the second tab image as the target classification label;
[0017] The sample set is used to train the initial network model to obtain an image classification model.
[0018] In this embodiment, based on a small number of first tab images, a large number of second tab images belonging to the same category can be obtained. Subsequently, the initial network model is trained using a sample set composed of the second tab images, which can improve the classification accuracy of the image classification model.
[0019] In one embodiment of the present application, performing image processing on the first tab image in the target classification label to match the target classification label to obtain the second tab image belonging to the target classification label includes:
[0020] The third tab image in the target classification label is downsampled to obtain a second tab image belonging to the target classification label, and the third tab image is any first tab image in the target classification label.
[0021] In this embodiment, by downsampling the third tab image, a new tab image (ie, the second tab image) can be obtained. The new tab image has a target classification label. The above method can expand the number of samples in the sample set.
[0022] In one embodiment of the present application, downsampling the third tab image in the target classification label to obtain the second tab image belonging to the target classification label includes:
[0023] Downsampling the third tab image in the target classification label to obtain a sampled image;
[0024] Randomly cropping the sampled image to obtain a sub-image;
[0025] Filling the sub-image to obtain a first image, where the size of the first image is the same as the size of the sampled image;
[0026] The first image is processed to match the target classification label to obtain a second tab image belonging to the target classification label.
[0027] In this embodiment, the sampled image can be randomly cropped multiple times to obtain multiple sub-images, thereby obtaining multiple second tab images, thereby expanding the sample images in the sample set to improve the classification accuracy of the image classification model.
[0028] In one embodiment of the present application, the processing of matching the first image with the target classification label to obtain a second tab image belonging to the target classification label includes:
[0029] If the target classification label is a first classification label, the local brightness and darkness of the first image is adjusted to obtain a second tab image belonging to the first classification label, where the first classification label is used to indicate uneven lighting.
[0030] In this embodiment, when the first classification label is uneven lighting, the local brightness and darkness of the first image are adjusted to obtain a second tab image belonging to the first classification label. Through the above method, the tab images marked as uneven lighting in the sample set can be expanded.
[0031] In one embodiment of the present application, the processing of matching the first image with the target classification label to obtain the second tab image includes:
[0032] If the target classification label is a second classification label, Gaussian smoothing is performed on the first image to obtain a second tab image belonging to the second classification label, where the second classification label is used to indicate being too dark, overexposed, or blurred.
[0033] In this embodiment, the tab images marked as being too dark, overexposed, or blurred in the sample set may be expanded.
[0034] In one embodiment of the present application, the processing of matching the first image with the target classification label to obtain the second tab image includes:
[0035] If the target classification label is a third classification label, Gaussian noise is added to the first image to obtain a second tab image belonging to the third classification label, where the third classification label is used to indicate that the prism is dirty.
[0036] In this embodiment, the tab images marked as prism dirty in the sample set may be expanded.
[0037] In one embodiment of the present application, the first image is processed to match the target classification label to obtain the second tab image, including: if the target classification label is a fourth classification label, the first image is processed using a kernel function to obtain a second tab image belonging to the fourth classification label, and the fourth classification label is used to indicate jitter.
[0038] In this embodiment, the tab images marked as shaking in the sample set may be expanded.
[0039] In an embodiment of the present application, in the process of training the initial network model using the sample set, the optimizer included in the initial network model is determined based on the number of training times.
[0040] In this embodiment, different optimizers can be used in different stages of model training to perform model training more reasonably.
[0041] In one embodiment of the present application, the initial network model includes a first optimizer, which uses an adaptive moment estimation algorithm; in the process of training the initial network model using the sample set, the optimizer included in the initial network model is determined based on the number of training times, including: in the process of training the initial network model using the sample set, if the number of training times is less than or equal to the first number threshold, the initial network model uses the first optimizer.
[0042] In this embodiment, in the early stage of model training, the first optimizer is used for rapid convergence.
[0043] In one embodiment of the present application, the initial network model includes a second optimizer, which uses a stochastic gradient descent algorithm; in the process of training the initial network model using the sample set, the optimizer included in the initial network model is determined based on the number of training times, including: if the number of training times is greater than the first number threshold, the initial network model uses the second optimizer.
[0044] In this embodiment, in the later stage of model training, the data is often more stable and the gradient information is more reliable. Using the second optimizer for fine-tuning, the objective function can jump to the minimum value and gradually converge.
[0045] In one embodiment of the present application, the sample set is used to train the initial network model to obtain an image classification model, including:
[0046] In each round of training of the initial network model, a preset number of second tab images are randomly selected from the sample set to train the initial network model to obtain the image classification model, where the preset number is the product of the number of second tab images in the sample set and a preset value.
[0047] In this embodiment, in each round of training, a second tab image is randomly selected from the sample set to train the initial network model. This introduces more randomness, which helps the model better explore different sample combinations during training and improves its generalization ability. Furthermore, by randomly selecting samples from the sample set, the model's sensitivity to specific batches or training sample order can be reduced, preventing overfitting.
[0048] In an embodiment of the present application, the tab head and the tab tail in each tab image in the sample set are placed in the same direction.
[0049] In this embodiment, the placement directions of the tab head and the tab tail in each tab image are set to be the same. For example, the tab head is located on the left side of the tab image, and the tab tail is located on the right side of the tab image. When the model is trained using a sample set, the placement direction of the tab in each tab image is consistent, which can eliminate the operation of adjusting the placement direction of the tab in the tab image, thereby improving the model training efficiency.
[0050] In one embodiment of the present application, the initial network model adopts the EfficientNet model.
[0051] In this embodiment, the EfficientNet model is used to better balance network depth, network width and image resolution.
[0052] In one embodiment of the present application, the first optimizer is an adaptive moment estimation algorithm optimizer.
[0053] In this embodiment, an adaptive moment estimation algorithm optimizer is used, which can converge faster and is less likely to fall into a local optimum.
[0054] In one embodiment of the present application, the second optimizer is a stochastic gradient descent algorithm optimizer.
[0055] In this embodiment, the stochastic gradient descent algorithm optimizer has a smaller learning rate, can jump at the minimum value of the objective function and gradually converge, and can help the model to search and converge better in the later stage.
[0056] In a second aspect, an embodiment of the present application provides a tab defect detection device, comprising:
[0057] A first acquisition module is used to acquire an image of the tab to be tested;
[0058] A second acquisition module is configured to input the tab image to be tested into an image classification model to obtain a detection result of the tab image to be tested, wherein the image classification model is trained using a sample set, and the sample set includes tab images annotated with a plurality of classification labels;
[0059] The multiple classification labels include normal, uneven lighting, jitter, too dark, overexposed, blurry, too large tail, dirty prism and left super vision;
[0060] The detection result is at least one of the multiple classification labels.
[0061] In this embodiment, the image of the tab to be tested is input into a pre-trained image classification model, and the classification model is used to detect the image of the tab to be tested to obtain a detection result. This can improve the accuracy of the detection of the image of the tab to be tested, and enable pre-judgment of problems arising from the imaging of the tab, thereby assisting lithium battery production line engineers in timely adjusting the imaging equipment.
[0062] In one embodiment of the present application, the device further includes:
[0063] A third acquisition module is configured to acquire a plurality of first tab images, where the plurality of first tab images are annotated with a plurality of classification labels;
[0064] a processing module, configured to perform image processing on a first tab image in a target classification label so as to match the target classification label, thereby obtaining a second tab image belonging to the target classification label, wherein the target classification label is any one of the multiple classification labels;
[0065] An adding module, configured to add the second tab image to a sample set and label the second tab image as the target classification label;
[0066] The training module is used to train the initial network model using the sample set to obtain an image classification model.
[0067] In this embodiment, based on a small number of first tab images, a large number of second tab images belonging to the same category can be obtained. Subsequently, the initial network model is trained using a sample set composed of the second tab images, which can improve the classification accuracy of the image classification model.
[0068] In one embodiment of the present application, the processing module includes:
[0069] The processing submodule is used to downsample the third tab image in the target classification label to obtain a second tab image belonging to the target classification label, and the third tab image is any first tab image in the target classification label.
[0070] In this embodiment, by downsampling the third tab image, a new tab image (ie, the second tab image) can be obtained. The new tab image has a target classification label. The above method can expand the number of samples in the sample set.
[0071] In one embodiment of the present application, the processing submodule includes:
[0072] a sampling unit, configured to downsample the third tab image in the target classification label to obtain a sampled image;
[0073] a cropping unit, configured to randomly crop the sampled image to obtain a sub-image;
[0074] a filling unit, configured to fill the sub-image to obtain a first image, wherein the size of the first image is the same as the size of the sampled image;
[0075] A processing unit is used to process the first image to match it with the target classification label to obtain a second tab image belonging to the target classification label.
[0076] In this embodiment, the sampled image can be randomly cropped multiple times to obtain multiple sub-images, thereby obtaining multiple second tab images, thereby expanding the sample images in the sample set to improve the classification accuracy of the image classification model.
[0077] In one embodiment of the present application, the processing unit is specifically configured to:
[0078] If the target classification label is a first classification label, the local brightness and darkness of the first image is adjusted to obtain a second tab image belonging to the first classification label, where the first classification label is used to indicate uneven lighting.
[0079] In this embodiment, when the first classification label is uneven lighting, the local brightness and darkness of the first image are adjusted to obtain a second tab image belonging to the first classification label. Through the above method, the tab images marked as uneven lighting in the sample set can be expanded.
[0080] In one embodiment of the present application, the processing unit is specifically configured to:
[0081] If the target classification label is a second classification label, Gaussian smoothing is performed on the first image to obtain a second tab image belonging to the second classification label, where the second classification label is used to indicate being too dark, overexposed, or blurred.
[0082] In this embodiment, the tab images marked as being too dark, overexposed, or blurred in the sample set may be expanded.
[0083] In one embodiment of the present application, the processing unit is specifically configured to:
[0084] If the target classification label is a third classification label, Gaussian noise is added to the first image to obtain a second tab image belonging to the third classification label, where the third classification label is used to indicate that the prism is dirty.
[0085] In this embodiment, the tab images marked as prism dirty in the sample set may be expanded.
[0086] In one embodiment of the present application, the initial network model includes a first optimizer and a second optimizer, the first optimizer adopts an adaptive moment estimation algorithm, and the second optimizer adopts a stochastic gradient descent algorithm;
[0087] In the process of training the initial network model using the sample set, if the number of training times is less than or equal to a first number threshold, the initial network model uses the first optimizer;
[0088] If the number of training times is greater than the first threshold, the initial network model adopts the second optimizer.
[0089] In this embodiment, in the early stage of model training, the first optimizer is used for rapid convergence. In the later stage of model training, the data is often more stable and the gradient information is more reliable. The second optimizer is used for fine-tuning, which can jump at the minimum value of the objective function and gradually converge.
[0090] In one embodiment of the present application, the training module is used to randomly select a preset number of second tab images from the sample set to train the initial network model in each round of training of the initial network model to obtain the image classification model, and the preset number is the product of the number of second tab images in the sample set and a preset value.
[0091] In this embodiment, in each round of training, a second tab image is randomly selected from the sample set to train the initial network model. This introduces more randomness, which helps the model better explore different sample combinations during training and improves its generalization ability. Furthermore, by randomly selecting samples from the sample set, the model's sensitivity to specific batches or training sample order can be reduced, preventing overfitting.
[0092] In an embodiment of the present application, the tab head and the tab tail in each tab image in the sample set are placed in the same direction.
[0093] In this embodiment, the placement directions of the tab head and the tab tail in each tab image are set to be the same. For example, the tab head is located on the left side of the tab image, and the tab tail is located on the right side of the tab image. When the model is trained using a sample set, the placement direction of the tab in each tab image is consistent, which can eliminate the operation of adjusting the placement direction of the tab in the tab image, thereby improving the model training efficiency.
[0094] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the tab defect detection method as described in the first aspect.
[0095] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] The features, advantages and technical effects of exemplary embodiments of the present application will be described below with reference to the accompanying drawings.
[0097] FIG1 is a schematic flow chart of a tab defect detection method provided in an embodiment of the present application;
[0098] FIG2 is a schematic flow chart of a tab defect detection method provided in an embodiment of the present application;
[0099] FIG3 is a schematic structural diagram of a tab defect detection device provided in an embodiment of the present application;
[0100] FIG4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0101] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0102] Unless otherwise defined, all technical and scientific terms used in this application have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first" and "second" in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order or a primary-secondary relationship.
[0103] FIG1 is a flow chart of a tab defect detection method provided in an embodiment of the present application. As shown in FIG1 , the method includes steps 101 to 102, wherein:
[0104] Step 101: Acquire an image of the tab to be tested. The image of the tab to be tested may be an image obtained by photographing the tab using an imaging device.
[0105] Step 102: Input the tab image to be tested into an image classification model to obtain a detection result of the tab image to be tested, wherein the image classification model is trained using a sample set, and the sample set includes tab images marked with multiple classification labels, and the multiple classification labels include normal, uneven lighting, jitter, too dark, overexposed, blurred, too large tail, dirty prism, and left super-field, and the detection result is at least one of the multiple classification labels.
[0106] When photographing the tab, the tab head is located on the left side of the tab image, and the tab tail is located on the right side. Left over-view refers to when photographing the tab, the left side of the tab is not fully displayed in the image, exceeding the left display range of the image. Tail oversize refers to an excessive distance between the upper and lower tabs at the tab head. Prism contamination refers to contamination on the prism of the imaging device photographing the tab, resulting in defects in the captured image.
[0107] In the above, the image classification model is obtained by pre-training the initial network model with a sample set, and the sample set includes multiple tab images, and these tab images are annotated with classification labels, and each tab image is annotated with a classification label. Exemplarily, the multiple classification labels may include normal, uneven lighting, jitter, too dark, overexposure, blur, too large tail, dirty prism and left super field of view. The image classification model can detect the input tab image to be tested and obtain a detection result. The detection result can be at least one of normal, uneven lighting, jitter, too dark, overexposure, blur, too large tail, dirty prism and left super field of view. According to the common problems in tab imaging, multiple classification labels are set. When the image classification model is used to detect the tab image to be tested, the precision of the detection result can be improved, so that the classification of the tab image to be tested is more accurate.
[0108] In this embodiment, the image of the tab to be tested is input into a pre-trained image classification model, and the classification model is used to detect the image of the tab to be tested to obtain a detection result. This can improve the accuracy of the detection of the image of the tab to be tested, and enable pre-judgment of problems arising from the imaging of the tab, thereby assisting lithium battery production line engineers in timely adjusting the imaging equipment.
[0109] FIG2 is a flow chart of a tab defect detection method provided in an embodiment of the present application. As shown in FIG2 , the method includes steps 201 to 206 , wherein:
[0110] Step 201: Acquire multiple first tab images, wherein the multiple first tab images are labeled with multiple classification labels, and each first tab image is labeled with at least one classification label;
[0111] Step 202: performing image processing on the first tab image in the target classification label to match the target classification label, thereby obtaining a second tab image belonging to the target classification label, wherein the target classification label is any one of the multiple classification labels;
[0112] Step 203: adding the second tab image to the sample set, and marking the second tab image as the target classification label;
[0113] Step 204 : Using the sample set to train the initial network model to obtain an image classification model, wherein the image classification model is used to determine the classification label to which the image input to the image classification model belongs.
[0114] Step 205: Acquire an image of the tab to be tested. The image of the tab to be tested may be an image obtained by photographing the tab using an imaging device;
[0115] Step 206: Input the tab image to be tested into an image classification model to obtain a detection result of the tab image to be tested, wherein the image classification model is trained using a sample set, the sample set includes tab images marked with multiple classification labels, and the detection result includes a classification indicated by at least one classification label.
[0116] Specifically, the more training samples there are, the better the training effect of the image classification model, and the higher the detection accuracy of the image classification model. In the actual training sample collection, due to the small number of images with quality problems in the tab imaging, the number of individual classifications may be extremely small, resulting in a small number of training samples. This embodiment can obtain a larger number of sample images based on a small number of tab images.
[0117] Multiple first tab images are captured, each labeled with a classification label, and each classification label has at least one corresponding first tab image. Image processing is performed on each first tab image to match the classification label of the first tab image, resulting in a second tab image having the same classification label as the first tab image. For example, if a first tab image is labeled "uneven lighting," image processing is performed on the first tab image to match "uneven lighting" to obtain a second tab image, which is also labeled "uneven lighting."
[0118] The initial network model can use the EfficientNet model. Using the EfficientNet model can better balance network depth, network width, and image resolution.
[0119] The tab head and tail are positioned in the same orientation in each tab image in the sample set. For example, the tab head is located on the left side of the tab image, and the tab tail is located on the right side of the tab image. When the sample set is used to train a model, the tab orientation is consistent in each tab image, eliminating the need to adjust the tab orientation in each tab image, thereby improving model training efficiency.
[0120] In the above, based on a small number of first tab images, a large number of second tab images belonging to the same category can be obtained. Subsequently, the initial network model is trained using a sample set composed of the second tab images, which can improve the classification accuracy of the image classification model.
[0121] In another embodiment of the present application, performing image processing on the first tab image in the target classification label to match the target classification label to obtain the second tab image belonging to the target classification label includes:
[0122] Downsampling the third tab image in the target classification label yields a second tab image belonging to the target classification label. The third tab image is any first tab image in the target classification label. In the above, downsampling the third tab image yields a new tab image (i.e., a second tab image) having the target classification label. This method can expand the number of samples in the sample set.
[0123] For third tab images labeled with the two classification labels "tail too large" and "left beyond visual field", the image obtained by downsampling the third tab image can be directly added to the sample set as the second tab image. In addition, for third tab images labeled with other classification labels, the image obtained by downsampling the third tab image can be directly added to the sample set as the second tab image, or the following processing can be performed:
[0124] Exemplarily, downsampling the third tab image in the target classification label to obtain the second tab image belonging to the target classification label includes:
[0125] Downsampling the third tab image in the target classification label to obtain a sampled image;
[0126] Randomly cropping the sampled image to obtain a sub-image;
[0127] Filling the sub-image to obtain a first image, where the size of the first image is the same as the size of the sampled image;
[0128] The first image is processed to match the target classification label to obtain a second tab image belonging to the target classification label.
[0129] For example, the third tab image is downsampled to obtain a 512*512 sampled image, and then a 400*400 area in the sampled image is randomly intercepted to obtain a sub-image, and pixels around the 400*400 area are filled with pixel value 0 until it is filled to a size of 512*512 to obtain the first image.
[0130] In the above, the sampled image can be randomly cropped multiple times to obtain multiple sub-images, thereby obtaining multiple second tab images, thereby expanding the sample images in the sample set to improve the classification accuracy of the image classification model.
[0131] Different target classification labels may correspond to different processing procedures. For example, if the target classification label is a first classification label, the local brightness and darkness of the first image are adjusted to obtain a second tab image belonging to the first classification label. The first classification label is used to indicate uneven lighting.
[0132] In this embodiment, when the first classification label is "uneven lighting," the local brightness of the first image is adjusted to obtain a second tab image having the classification label "uneven lighting." It should be noted that each time the local brightness adjustment is performed on a different first image, a different local brightness adjustment method can be used. For example, when adjusting first image a, the brightness of the central area of first image a is adjusted; when adjusting first image b, the brightness of the upper left area of first image b is adjusted. Different adjustment methods can increase the randomness of local brightness, allowing the samples in the sample set to meet more different scenarios, thereby improving the generalization ability of the image classification model.
[0133] In the above, when the first classification label is uneven lighting, the local brightness and darkness of the first image are adjusted to obtain a second tab image belonging to the first classification label. Through the above method, the tab images marked as uneven lighting in the sample set can be expanded.
[0134] For example, if the target classification label is the second classification label, Gaussian smoothing is performed on the first image to obtain a second tab image belonging to the second classification label, where the second classification label indicates being too dark, overexposed, or blurred. This approach can expand the sample set of tab images labeled as being too dark, overexposed, or blurred.
[0135] For example, if the target classification label is the third classification label, Gaussian noise is added to the first image to obtain a second tab image with the third classification label, where the third classification label indicates prism contamination. This approach can expand the number of tab images in the sample set labeled as prism contamination.
[0136] For example, if the target classification label is the fourth classification label, the kernel function is used to process the first image to obtain a second tab image belonging to the fourth classification label, where the fourth classification label is used to indicate jitter. In this way, the tab images labeled as jitter in the sample set can be expanded.
[0137] In another embodiment of the present application, the initial network model may include an optimizer. In the process of training the initial network model using the sample set, the optimizer included in the initial network model is determined based on the number of training times.
[0138] In this way, different optimizers are used at different stages of model training to facilitate more reasonable model training.
[0139] In another embodiment of the present application, the initial network model includes a first optimizer and a second optimizer, the first optimizer adopts an adaptive moment estimation algorithm, and the second optimizer adopts a stochastic gradient descent algorithm;
[0140] In the process of training the initial network model using the sample set, determining the optimizer included in the initial network model based on the number of training times may include:
[0141] In the process of training the initial network model using the sample set, if the number of training times is less than or equal to a first number threshold, the initial network model uses the first optimizer;
[0142] If the number of training times is greater than the first threshold, the initial network model adopts the second optimizer.
[0143] For example, the first optimizer can be an Adaptive Moment Estimation (Adam) optimizer. The Adam optimizer is highly adaptable and can adaptively update the learning rate. The second optimizer can be a Stochastic Gradient Descent (SGD) optimizer. The first number threshold can be set according to actual conditions and is not limited here. For example, if the total number of training times is 200, the first number threshold can be set to 150 times.
[0144] Compared with the SGD optimizer, the Adam optimizer can converge faster and is less likely to fall into local optimality. The learning rate scheduler uses cosine annealing, and the learning rate decreases from 0.001 (initial learning rate) to 0 in the form of a cosine function between 0 and 200 training times.
[0145] In the early stage of model training (i.e., when the number of training times is less than or equal to the first number threshold), the Adam optimizer is used for rapid convergence. In the later stage of training (i.e., when the number of training times is greater than the first number threshold), the SGD optimizer is used for fine-tuning. In the later stages of model training, the data is often more stable and the gradient information is more reliable. SGD may perform better at this time because it has a smaller learning rate and can jump at the minimum value of the objective function and gradually converge.
[0146] The Adam optimizer is very effective for exploring the solution space and converging quickly in the early stages, but it may lead to excessive exploration in the later stages, causing the model to fall into a local optimum or fail to reach a better global optimum. SGD may be more conservative, helping the model to search and converge better in the later stages.
[0147] In the above, in the early stage of model training, the first optimizer is used for rapid convergence. In the later stage of model training, the data is often more stable and the gradient information is more reliable. The second optimizer is used for fine-tuning, which can jump at the minimum value of the objective function and gradually converge.
[0148] In another embodiment of the present application, the sample set is used to train the initial network model to obtain an image classification model, including:
[0149] In each round of training of the initial network model, a preset number of second tab images are randomly selected from the sample set to train the initial network model to obtain the image classification model, where the preset number is the product of the number of second tab images in the sample set and a preset value.
[0150] In the above, the preset value can be set according to the actual situation, for example, 80% or 85%, etc., which is not limited here. It should be noted that the preset value should be in the range of 0 to 100%. If the preset value is 80%, in each round of training, 80% of the second pole ear images are randomly selected from the sample set to train the initial network model, introducing more randomness, which helps the model to better explore different sample combinations during the training process and improve the generalization ability of the model. In addition, by randomly selecting samples in the sample set, the model's sensitivity to specific batches or training sample orders can also be reduced, avoiding overfitting.
[0151] The initial network model includes a dropout layer to prevent specific neurons from overfitting the training data. The basic idea behind dropout is to randomly set the outputs of some neurons to zero during network training, thereby reducing the dependencies between neurons. This, in other words, "drops out" some neurons. This prevents the model from becoming overly dependent on certain neurons, thereby improving its generalization capabilities.
[0152] The model is trained using the Pytorch framework. The initial network model uses the cross-entropy loss function, the default learning rate is 0.001, and the batch_size is 64, which is the number of samples used in each training round. The number of training rounds is 200. The optimal model is automatically saved during training and saved in the current folder.
[0153] The image classification model obtained through the above process was used for detection. The image classification model can obtain scores for each category. If the category with the highest score is used as the detection result, the detection accuracy rates for each category are as follows: uneven lighting -75.00%; jitter -70.97%; too dark -93.55%; overexposure -87.88%; blur -97.06%; too large tail -58.62%; dirty prism -36.00%; normal -85.71%; left super vision -100.00%. The overall recognition accuracy is 80.43%.
[0154] Taking the top three categories with the highest scores as the detection results, the detection accuracy rates for each category are: uneven lighting -94.23%; jitter -80.65%; too dark -100.00%; overexposure -100.00%; blur -100.00%; too large tail -100.00%; dirty prism -72.00%; normal | 99.05%; left super vision -100.00%. The overall recognition accuracy is 95.38%.
[0155] The tab defect detection method provided in the embodiment of the present application is capable of detecting the imaging of the tab folding image and pre-identifying the problems arising from the tab imaging, so as to assist the lithium battery production line engineers in timely adjusting the imaging equipment and avoid the subsequent tab folding defect detection based on the collected tab image, which may interfere with the accuracy of the defect detection due to the tab image imaging problem.
[0156] Please refer to FIG3 , which is a schematic diagram of the structure of a tab defect detection device provided in an embodiment of the present application. As shown in FIG3 , the tab defect detection device 300 includes:
[0157] The first acquisition module 301 is used to acquire an image of the tab to be tested;
[0158] The second acquisition module 302 is used to input the image of the tab to be tested into an image classification model to obtain a detection result of the image of the tab to be tested, wherein the image classification model is trained using a sample set, and the sample set includes tab images marked with multiple classification labels, and the multiple classification labels include normal, uneven lighting, jitter, too dark, overexposed, blurred, too large tail, dirty prism and left super field of view; the detection result is at least one of the multiple classification labels.
[0159] In this embodiment, the image of the tab to be tested is input into a pre-trained image classification model, and the classification model is used to detect the image of the tab to be tested to obtain a detection result. This can improve the accuracy of the detection of the image of the tab to be tested, and enable pre-judgment of problems arising from the imaging of the tab, thereby assisting lithium battery production line engineers in timely adjusting the imaging equipment.
[0160] In one embodiment of the present application, the tab defect detection device 300 further includes:
[0161] A third acquisition module is configured to acquire a plurality of first tab images, where the plurality of first tab images are annotated with a plurality of classification labels;
[0162] a processing module, configured to perform image processing on a first tab image in a target classification label so as to match the target classification label, thereby obtaining a second tab image belonging to the target classification label, wherein the target classification label is any one of the multiple classification labels;
[0163] An adding module, configured to add the second tab image to a sample set and label the second tab image as the target classification label;
[0164] The training module is used to train the initial network model using the sample set to obtain an image classification model.
[0165] In this embodiment, based on a small number of first tab images, a large number of second tab images belonging to the same category can be obtained. Subsequently, the initial network model is trained using a sample set composed of the second tab images, which can improve the classification accuracy of the image classification model.
[0166] In one embodiment of the present application, the processing module includes:
[0167] The processing submodule is used to downsample the third tab image in the target classification label to obtain a second tab image belonging to the target classification label, and the third tab image is any first tab image in the target classification label.
[0168] In this embodiment, by downsampling the third tab image, a new tab image (ie, the second tab image) can be obtained. The new tab image has a target classification label. The above method can expand the number of samples in the sample set.
[0169] In one embodiment of the present application, the processing submodule includes:
[0170] a sampling unit, configured to downsample the third tab image in the target classification label to obtain a sampled image;
[0171] a cropping unit, configured to randomly crop the sampled image to obtain a sub-image;
[0172] a filling unit, configured to fill the sub-image to obtain a first image, wherein the size of the first image is the same as the size of the sampled image;
[0173] A processing unit is used to process the first image to match it with the target classification label to obtain a second tab image belonging to the target classification label.
[0174] In this embodiment, the sampled image can be randomly cropped multiple times to obtain multiple sub-images, thereby obtaining multiple second tab images, thereby expanding the sample images in the sample set to improve the classification accuracy of the image classification model.
[0175] In one embodiment of the present application, the processing unit is specifically configured to:
[0176] If the target classification label is a first classification label, the local brightness and darkness of the first image is adjusted to obtain a second tab image belonging to the first classification label, where the first classification label is used to indicate uneven lighting.
[0177] In this embodiment, when the first classification label is uneven lighting, the local brightness and darkness of the first image are adjusted to obtain a second tab image belonging to the first classification label. Through the above method, the tab images marked as uneven lighting in the sample set can be expanded.
[0178] In one embodiment of the present application, the processing unit is specifically configured to:
[0179] If the target classification label is a second classification label, Gaussian smoothing is performed on the first image to obtain a second tab image belonging to the second classification label, where the second classification label is used to indicate being too dark, overexposed, or blurred.
[0180] In this embodiment, the tab images marked as being too dark, overexposed, or blurred in the sample set may be expanded.
[0181] In one embodiment of the present application, the processing unit is specifically configured to:
[0182] If the target classification label is a third classification label, Gaussian noise is added to the first image to obtain a second tab image belonging to the third classification label, where the third classification label is used to indicate that the prism is dirty.
[0183] In this embodiment, the tab images marked as prism dirty in the sample set may be expanded.
[0184] In one embodiment of the present application, the processing unit is specifically configured to:
[0185] If the target classification label is a fourth classification label, a kernel function is used to process the first image to obtain a second tab image belonging to the fourth classification label, where the fourth classification label is used to indicate jitter.
[0186] In this embodiment, the tab images marked as shaking in the sample set may be expanded.
[0187] In an embodiment of the present application, in the process of training the initial network model using the sample set, the optimizer included in the initial network model is determined based on the number of training times.
[0188] In this embodiment, different optimizers can be used at different stages of model training to perform model training more reasonably.
[0189] In one embodiment of the present application, the initial network model includes a first optimizer, and the first optimizer adopts an adaptive moment estimation algorithm;
[0190] In the process of training the initial network model using the sample set, if the number of training times is less than or equal to a first number threshold, the initial network model uses the first optimizer.
[0191] In this embodiment, the first optimizer can be used to perform rapid convergence in the early stage of model training.
[0192] In one embodiment of the present application, the initial network model includes a second optimizer, and the second optimizer adopts a stochastic gradient descent algorithm;
[0193] In the process of training the initial network model using the sample set, if the number of training times is greater than the first number threshold, the initial network model uses the second optimizer.
[0194] In this embodiment, in the later stage of model training, the data is often more stable and the gradient information is more reliable. Using the second optimizer for fine-tuning, the objective function can jump to the minimum value and gradually converge.
[0195] In one embodiment of the present application, the training module is used to randomly select a preset number of second tab images from the sample set to train the initial network model in each round of training of the initial network model to obtain the image classification model, and the preset number is the product of the number of second tab images in the sample set and a preset value.
[0196] In this embodiment, in each round of training, a second tab image is randomly selected from the sample set to train the initial network model. This introduces more randomness, which helps the model better explore different sample combinations during training and improves its generalization ability. Furthermore, by randomly selecting samples from the sample set, the model's sensitivity to specific batches or training sample order can be reduced, preventing overfitting.
[0197] In one embodiment of the present application, the initial network model adopts the EfficientNet model.
[0198] In this embodiment, the EfficientNet model is used to better balance network depth, network width and image resolution.
[0199] In one embodiment of the present application, the first optimizer is an adaptive moment estimation algorithm optimizer.
[0200] In this embodiment, an adaptive moment estimation algorithm optimizer is used, which can converge faster and is less likely to fall into a local optimum.
[0201] In one embodiment of the present application, the second optimizer is a stochastic gradient descent algorithm optimizer.
[0202] In this embodiment, the stochastic gradient descent algorithm optimizer has a smaller learning rate, can jump at the minimum value of the objective function and gradually converge, and can help the model to search and converge better in the later stage.
[0203] FIG4 shows a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0204] The electronic device may include a processor 401 and a memory 402 storing computer program instructions.
[0205] Specifically, the processor 401 may include a central processing unit (CPU) or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0206] Memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In some instances, memory 402 may include removable or non-removable (or fixed) media, or memory 402 may be a non-volatile solid-state memory. In some embodiments, memory 402 may be internal or external to a battery device.
[0207] In some examples, the memory 402 may be a read-only memory (ROM). In one example, the ROM may be a mask-programmable ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.
[0208] The memory 402 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described in the tab defect detection method provided in the embodiments of the present application.
[0209] The processor 401 reads and executes the computer program instructions stored in the memory 402 to implement the tab defect detection method in the embodiment shown in Figure 1, and achieves the corresponding technical effects achieved by executing the method / steps of the example shown in Figure 1. For the sake of brevity, it will not be repeated here.
[0210] In addition, the embodiments of the present application may be implemented by providing a computer storage medium having computer program instructions stored thereon; when the computer program instructions are executed by a processor, any one of the tab defect detection methods in the above embodiments is implemented.
[0211] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.
[0212] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier wave. "Machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0213] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0214] The above reference is according to the method, apparatus, equipment and the flowchart and / or block diagram of the computer program product of the embodiment of the present application.It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a kind of machine, so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more boxes of the flowchart and / or block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It is also understood that each box in the block diagram and / or the flowchart and the combination of the boxes in the block diagram and / or the flowchart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0215] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in the various embodiments can be combined in any way. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions that fall within the scope of the claims.
Claims
1. A method for detecting tab defects, comprising: Acquire an image of the tab to be tested; Inputting the tab image to be tested into an image classification model to obtain a detection result of the tab image to be tested, wherein the image classification model is trained using a sample set, and the sample set includes tab images marked with multiple classification labels; The multiple classification labels include normal, uneven lighting, jitter, too dark, overexposed, blurry, too large tail, dirty prism and left super vision; The detection result is at least one of the multiple classification labels.
2. The tab defect detection method according to claim 1, further comprising: before inputting the tab image to be tested into an image classification model to obtain a detection result of the tab image to be tested; Acquire a plurality of first tab images, wherein the plurality of first tab images are annotated with a plurality of classification labels; Performing image processing on a first tab image in a target classification label to match the target classification label, to obtain a second tab image belonging to the target classification label, wherein the target classification label is any one of the multiple classification labels; Adding the second tab image to a sample set, and marking the second tab image as the target classification label; The sample set is used to train the initial network model to obtain an image classification model.
3. The tab defect detection method according to claim 2, wherein: The performing image processing on the first tab image in the target classification label to match the target classification label to obtain a second tab image belonging to the target classification label includes: The third tab image in the target classification label is downsampled to obtain a second tab image belonging to the target classification label, and the third tab image is any first tab image in the target classification label.
4. The tab defect detection method according to claim 3, wherein: The downsampling of the third tab image in the target classification label to obtain a second tab image belonging to the target classification label includes: Downsampling the third tab image in the target classification label to obtain a sampled image; Randomly cropping the sampled image to obtain a sub-image; Filling the sub-image to obtain a first image, where the size of the first image is the same as the size of the sampled image; The first image is processed to match the target classification label to obtain a second tab image belonging to the target classification label.
5. The tab defect detection method according to claim 4, wherein: The processing of matching the first image with the target classification label to obtain a second tab image belonging to the target classification label includes: If the target classification label is a first classification label, the local brightness and darkness of the first image is adjusted to obtain a second tab image belonging to the first classification label, where the first classification label is used to indicate uneven lighting.
6. The tab defect detection method according to claim 4 or 5, wherein: The processing of matching the first image with the target classification label to obtain the second tab image includes: If the target classification label is a second classification label, Gaussian smoothing is performed on the first image to obtain a second tab image belonging to the second classification label, where the second classification label is used to indicate being too dark, overexposed, or blurred.
7. The tab defect detection method according to any one of claims 4 to 6, wherein: The processing of matching the first image with the target classification label to obtain the second tab image includes: If the target classification label is a third classification label, Gaussian noise is added to the first image to obtain a second tab image belonging to the third classification label, where the third classification label is used to indicate that the prism is dirty.
8. The tab defect detection method according to any one of claims 4 to 7, wherein: The processing of matching the first image with the target classification label to obtain the second tab image includes: If the target classification label is a fourth classification label, a kernel function is used to process the first image to obtain a second tab image belonging to the fourth classification label, where the fourth classification label is used to indicate jitter. 9 . The tab defect detection method according to claim 2 , wherein in the process of training the initial network model using the sample set, an optimizer included in the initial network model is determined based on the number of training times.
10. The tab defect detection method according to claim 9, wherein: The initial network model includes a first optimizer, which uses an adaptive moment estimation algorithm; In the process of training the initial network model using the sample set, determining the optimizer included in the initial network model based on the number of training times includes: In the process of training the initial network model using the sample set, if the number of training times is less than or equal to a first number threshold, the initial network model uses the first optimizer.
11. The tab defect detection method according to claim 9 or 10, wherein: The initial network model includes a second optimizer, and the second optimizer adopts a stochastic gradient descent algorithm; In the process of training the initial network model using the sample set, determining the optimizer included in the initial network model based on the number of training times includes: In the process of training the initial network model using the sample set, if the number of training times is greater than a first number threshold, the initial network model uses the second optimizer.
12. The tab defect detection method according to any one of claims 2 to 11, wherein: The initial network model is trained using the sample set to obtain an image classification model, including: In each round of training of the initial network model, a preset number of second tab images are randomly selected from the sample set to train the initial network model to obtain the image classification model, where the preset number is the product of the number of second tab images in the sample set and a preset value.
13. The method for detecting tab defects according to any one of claims 1 to 12, wherein: The placement directions of the tab head and the tab tail in each tab image in the sample set are the same.
14. The tab defect detection method according to claim 2, wherein: The initial network model adopts the EfficientNet model.
15. The tab defect detection method according to claim 10, wherein: The first optimizer is an adaptive moment estimation algorithm optimizer.
16. The tab defect detection method according to claim 11, wherein: The second optimizer is a stochastic gradient descent algorithm optimizer.
17. A tab defect detection device, comprising: A first acquisition module is used to acquire an image of the tab to be tested; The second acquisition module is used to input the tab image to be tested into an image classification model to obtain a detection result of the tab image to be tested, wherein the image classification model is trained using a sample set, the sample set includes tab images marked with multiple classification labels, and the detection result includes a classification indicated by at least one classification label.
18. An electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the tab defect detection method according to any one of claims 1 to 16.
19. A computer storage medium, characterized in that The computer storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the tab defect detection method according to any one of claims 1 to 16 is implemented.
20. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the tab defect detection method according to any one of claims 1 to 16.
Citation Information
Patent Citations
Pole piece tab defect detection model, detection method and system based on a convolutional neural network
CN110135521A
Battery tab appearance defect detection method
CN114022479A
Defect detection model training method and device, electronic equipment and storage medium
CN114781605A
Defect detection method, device and equipment for battery pole piece and storage medium
CN115205247A
Defect image generation method, electronic equipment and storage medium
CN117237254A