Battery cell anomaly detection method and device, storage medium and electronic equipment
By automatically identifying and labeling welding abnormalities in the battery cell, the problem of unsatisfactory identification of abnormal welding in the existing technology is solved, and real-time quality monitoring of high accuracy and reliability is achieved.
Patent Information
- Application Number
- CN202411556936.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-11
AI Technical Summary
In the prior art, the abnormal recognition capability of cell welding is not ideal, relying on manual visual inspection efficiency and high misjudgment rate, and 3D line laser scanning cannot effectively capture pinholes at multiple angles, resulting in a high detection misjudgment rate.
By collecting the image of the battery cell, processing it using the target model, multiple bounding boxes are generated, target boxes with dimensions that meet the predetermined size range, annotate abnormal detection results, and automatically identify and mark welding abnormalities.
It realizes automatic identification of welding abnormalities of battery cell sealing nails, improves detection accuracy and reliability, and is suitable for real-time quality monitoring on large-scale battery cell production lines, reducing product defect rate.
Smart Images

Figure CN119417808A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing and battery detection technology, and specifically, to a method, device, storage medium and electronic device for detecting abnormality of a battery cell. Background Art
[0002] At present, welding sealing pins are installed between the electrodes and the shell of the battery. The sealing pins are welded to the shell during packaging to form a sealing structure to prevent leakage from causing internal short circuit of the battery. After the secondary injection of the battery cell, the injection port needs to be sealed and the sealing pins are welded by laser. In order to ensure the welding quality after the sealing pins are welded, it is necessary to detect the poor welding produced during the welding process through visual inspection, including explosion points, lack of welding, pinholes, incorrect welding trajectories, etc. In the related art, it mainly relies on manual visual inspection, or 3D (3-Dimensional, three-dimensional) line laser scanning to detect the welding quality of the sealing pins. However, manual visual inspection is inefficient, easy to fatigue and highly subjective, and 3D line laser scanning is usually unable to effectively shoot the pinholes at multiple angles during the inspection process, and there will be partial shadows, resulting in a high misjudgment rate of the current detection, which cannot meet production use, and requires manual re-judgment, which increases labor costs.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a method, device, storage medium and electronic device for detecting abnormality of a battery cell, so as to at least solve the technical problem in the related art that the ability to identify abnormal welding of a battery cell is not ideal.
[0005] According to one aspect of the embodiment of the present application, a method for detecting abnormality of a battery cell is provided, comprising: performing image acquisition on the battery cell to obtain an acquired image including the welding position of the sealing pin; inputting the acquired image into a target model for processing to obtain multiple bounding boxes for identifying different candidate targets, wherein the target model is obtained by iteratively adopting a target training set, and the target training set is obtained by processing according to the entropy value of the sample in the initial training set, and the entropy value is used to indicate the degree of uncertainty of the sample being identified; in the multiple bounding boxes, a target box whose size meets a predetermined size range is determined, wherein the predetermined size range is determined based on the predetermined welding abnormality type of the sealing pin, and the target box is used to identify the welding abnormality target detected by the target model; and marking the target box on the acquired image as the abnormality detection result of the battery cell. Through the above processing, the welding abnormality of the battery cell sealing pin can be automatically identified, and the accuracy and reliability of the detection are improved by iteratively optimizing the model, which is suitable for real-time quality monitoring on large-scale battery cell production lines, and effectively reduces the product defect rate caused by welding abnormality.
[0006] Optionally, the initial training set includes a first labeled sample set and an unlabeled second sample set, and the method further includes: based on the first sample set, using the initial model for iterative processing; after completing each iteration of the initial model, using the initial model of the current iteration to determine the prediction of the second sample set and determine the entropy value of each sample in the second sample set; based on the entropy value of each sample in the second sample set, updating the initial training set to obtain an updated initial training set; based on the updated initial training set, obtaining the target training set. In this way, the model can continuously learn new welding abnormality features and enhance the adaptability to complex welding scenarios, which is particularly suitable for scenarios in which the welding abnormality type may change over time during the production of battery cells, ensuring the long-term effectiveness of the model.
[0007] Optionally, the updating process of the initial training set based on the entropy value of each sample in the second sample set to obtain the updated initial training set includes: determining the confidence of each sample according to the entropy value of each sample; determining the pending sample with the lowest confidence among the samples included in the second sample set; labeling the pending sample in a predetermined manner to obtain a labeled sample; adding the labeled sample to the first sample set as an update process for the initial training set to obtain the updated initial training set. It can ensure that the samples learned by the model are representative, avoid overfitting, improve the detection accuracy of the model in different welding environments, and adapt to the scene of abnormal welding characteristics with more noise points.
[0008] Optionally, the captured image is input into a target model for processing to obtain multiple bounding boxes for identifying different candidate targets, including: extracting features based on the captured image to obtain multiple feature maps of different sizes; for a first target among multiple candidate targets, generating candidate boxes for identifying the first target on the multiple feature maps; based on the multiple candidate boxes of the first target, processing using the target model to determine a bounding box for identifying the first target; determining the multiple bounding boxes using the method of determining the bounding box of the first target. Through the use of multi-scale feature maps, the model can more accurately identify welding anomalies that account for a relatively small proportion of the image, which is suitable for battery cell production, where sealing pin welding anomalies may appear smaller in size, thereby improving detection accuracy.
[0009] Optionally, the target model includes at least an attention module, and the acquisition image is input into the target model for processing to obtain multiple bounding boxes for identifying different candidate targets, including: according to the weight value of the feature response channel, feature extraction is performed based on the acquisition image to obtain multiple feature maps of different sizes, wherein the weight value is configured by the attention module based on the degree of association with the welding abnormality feature of the sealing nail. The above processing enables the model to pay more attention to the key features related to welding abnormalities, thereby improving the pertinence of detection.
[0010] Optionally, the multiple candidate boxes based on the first target are processed using the target model to determine the bounding box used to identify the first target, including: determining the confidence and overlapping area corresponding to the multiple candidate boxes respectively; integrating the multiple candidate boxes based on the confidence and overlapping area corresponding to the multiple candidate boxes respectively to obtain the bounding box used to identify the first target. Through the integration of confidence and overlapping area, the model can more accurately determine the location of welding anomalies, avoiding false detection and missed detection, and is suitable for scenarios in battery cell production that require high-precision positioning of welding anomalies, providing accurate data support for subsequent repair and optimization.
[0011] Optionally, the method further includes: determining a scale factor based on a predetermined welding anomaly type of the sealing nail; determining a bounding box loss based on an intersection-over-union ratio between a predetermined true box and a predicted box, the scale factor, a horizontal weight value in a horizontal direction, and a vertical weight value in a vertical direction; and adjusting the target model based on the bounding box loss. By introducing a scale factor, calculating a bounding box loss, and adjusting the target model accordingly, the accuracy and efficiency of sealing nail welding anomaly detection are effectively improved.
[0012] According to another aspect of an embodiment of the present application, a battery cell abnormality detection device is provided, comprising: an image acquisition module, used to acquire images of battery cells to obtain an acquired image including a welding position of a sealing pin; a first recognition module, used to input the acquired image into a target model for processing to obtain a plurality of bounding boxes for identifying different candidate targets, wherein the target model is obtained by iterating a target training set, and the target training set is obtained by processing according to an entropy value of a sample in an initial training set, and the entropy value is used to represent the degree of uncertainty in the identification of the sample; a second recognition module, used to determine, among the plurality of bounding boxes, a target box whose size satisfies a predetermined size range, wherein the predetermined size range is determined based on a predetermined welding abnormality type of the sealing pin, and the target box is used to identify a welding abnormality target detected by the target model; an abnormality labeling module, used to label the target box on the acquired image as an abnormality detection result of the battery cell.
[0013] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, wherein the non-volatile storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing any one of the battery cell abnormality detection methods.
[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the battery cell abnormality detection methods.
[0015] In an embodiment of the present application, an image including the welding position of the sealing pin is obtained by image acquisition of the battery cell; the acquired image is input into the target model for processing to obtain multiple bounding boxes for identifying different candidate targets, wherein the target model is obtained by iteratively adopting the target training set, and the target training set is obtained by processing according to the entropy value of the sample in the initial training set, and the entropy value is used to indicate the uncertainty of the sample being identified; in the multiple bounding boxes, a target box whose size meets the predetermined size range is determined, wherein the predetermined size range is determined based on the predetermined welding abnormality type of the sealing pin, and the target box is used to identify the welding abnormality target detected by the target model; the target box is marked on the acquired image as the abnormality detection result of the battery cell. The purpose of effective model learning under limited abnormal samples and adapting to the characteristics of the sealing pin welding defects is achieved, and the technical effect of improving the recognition efficiency of the sealing pin welding abnormality is achieved, thereby solving the technical problem of the unsatisfactory ability to identify the welding abnormality of the battery cell in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0017] Figure 1 is a flow chart of an optional battery cell abnormality detection method provided according to an embodiment of the present application;
[0018] Figure 2 is a first schematic diagram of an optional battery cell abnormality detection method provided according to an embodiment of the present application;
[0019] Figure 3 is a second schematic diagram of an optional battery cell abnormality detection method provided according to an embodiment of the present application;
[0020] Figure 4 is a third schematic diagram of an optional battery cell abnormality detection method provided according to an embodiment of the present application;
[0021] Figure 5 is a fourth schematic diagram of an optional battery cell abnormality detection method provided according to an embodiment of the present application;
[0022] Figure 6 It is a schematic diagram of an optional battery cell abnormality detection device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0026] Sealing pin welding, also known as injection port welding, is a method of passing a sealing pin (or sealing bolt) through the workpieces and welding them together at the joint point of two or more workpieces to achieve a reliable sealing effect at the joint parts of the workpieces.
[0027] YOLOv8n is a lightweight variant of the YOLO (You Only Look Once) series of target detection models, designed to reduce computing resource consumption while maintaining efficient performance. The Neck part in YOLOv8n is the key part of the entire network that connects the backbone network (Backbone) and the head network (Head). It is mainly responsible for feature fusion and processing and can be called a feature fusion module.
[0028] Non-Maximum Suppression (NMS) is a post-processing technique used in object detection to remove redundant candidate boxes and retain only the best one. During the object detection process, the model generates multiple candidate boxes, each with a corresponding confidence score. NMS compares the confidence and overlap of adjacent candidate boxes, suppressing (i.e., deleting) those with lower confidence and greater overlap with higher confidence candidate boxes, thereby avoiding repeated detection of the same object.
[0029] The SE module (Squeeze-and-Excitation Module) is a lightweight module used to improve the performance of convolutional neural networks. By explicitly modeling the dependencies between feature channels, the learning ability of information features is enhanced. The SE module recalibrates the importance of each feature channel through two steps: compression (Squeeze) and excitation (Excitation). The compression step compresses the spatial dimensions of the feature map through global average pooling and other methods, and the excitation step captures the dependencies between channels through a self-gating mechanism to recalibrate the channels of the original feature map.
[0030] SENet (Squeeze-and-Excitation Networks) is a deep neural network architecture based on SE modules. SENet enables the network to focus more on important feature channels during learning, thereby improving the performance of the overall model.
[0031] The C2F structure (Cross-scale Feature Fusion) is a technology used for feature fusion. It integrates cross-layer information in multi-scale feature maps to improve the network's ability to detect targets of different sizes.
[0032] IOU (Intersection over Union) is an indicator for evaluating the similarity between the predicted box and the true box in the target detection algorithm. It is used to measure the accuracy of the predicted box by calculating the ratio of the intersection area of the two boxes to the union area.
[0033] With the development of deep learning technology, related technologies and research have begun to try to apply deep learning to anomaly detection of sealing nail welding. For example, detection is performed through model matching or three-dimensional point cloud methods. However, this method requires a large amount of labeled data to train the model, and the equipment needs to meet high requirements and multiple projectors need to be added. In practical applications, the number of abnormal samples is often small, which makes this type of method difficult to implement. And the high price of equipment will increase the production cost of battery cells and the maintenance cost of equipment. Although deep learning has shown potential in anomaly detection of sealing nails, there are still some problems and challenges: first, how to effectively learn useful features from a small number of abnormal samples; second, how to design a deep learning model suitable for the defect characteristics of sealing nails; finally, how to apply deep learning models to real-time online anomaly detection systems.
[0034] Existing anomaly detection methods based on deep learning usually require a large amount of labeled data to train the model. However, in the actual application of sealing nail welding anomaly detection, the number of abnormal samples is small, making this method difficult to implement. The abnormal situation of sealing nail welding is mostly due to too many noise points and uneven brightness of the light source, which brings certain difficulties to model recognition. Limited ability to recognize complex and nonlinear abnormal patterns: Traditional machine vision technology or shallow learning models can only process simple and regular image features, and have limited ability to recognize complex and nonlinear abnormal patterns. Deep learning models designed for sealing nails of specific types and characteristics may not be well generalized to other types of sealing nails. Some existing deep learning models have high computational complexity, which makes them inapplicable in real-time anomaly detection systems. The current re-inspection method of sealing nail welding anomaly is still highly dependent on manual visual inspection, which is not only inefficient but also prone to human errors.
[0035] In response to the above problems, an embodiment of the present application provides an embodiment of a method for detecting battery cell abnormalities. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0036] Figure 1 is a flow chart of an optional method for detecting abnormality of a battery cell according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0037] Step S102, capturing an image of the battery cell to obtain a captured image including a welding position of a sealing pin;
[0038] It can be understood that an image acquisition device (such as a camera or scanner) is used to photograph the battery cell to obtain an image containing the welding position of the sealing pin as the basic data for subsequent processing. Through high-precision image acquisition, it is possible to ensure that a clear image of the battery cell welding part is obtained, providing high-quality input data for subsequent target detection and abnormality recognition.
[0039] Step S104, inputting the captured image into the target model for processing to obtain multiple bounding boxes for identifying different candidate targets, wherein the target model is obtained by iteratively using the target training set, and the target training set is obtained by processing according to the entropy value of the sample in the initial training set, and the entropy value is used to indicate the uncertainty of the sample being identified;
[0040] It can be understood that the captured image is input into a pre-trained target detection model, which uses deep learning technology (such as convolutional neural network CNN) to process the image, identify multiple candidate targets that may exist in the image, and generate a bounding box for each candidate target for identification. The target model is iteratively trained based on a processed target training set, which is optimized by processing the sample entropy value in the initial training set. The entropy value reflects the degree of uncertainty when the sample is identified. By using deep learning technology and optimized training sets, the target model can accurately and efficiently identify multiple potential targets in the image, including possible welding anomalies, which is conducive to improving the accuracy and efficiency of detection.
[0041] In an optional embodiment, the initial training set includes a labeled first sample set and an unlabeled second sample set, and the method further includes: based on the first sample set, using the initial model for iterative processing; after completing each iteration of the initial model, using the initial model of the current iteration to determine a prediction for the second sample set and determine the entropy value of each sample in the second sample set; based on the entropy value of each sample in the second sample set, updating the initial training set to obtain an updated initial training set; based on the updated initial training set, obtaining a target training set.
[0042] It can be understood that the initial model is iteratively trained using the annotated first sample set. These annotated samples provide basic information about the quality of the sealing nail welding, so that the initial model can initially learn the characteristics of welding anomalies. After completing each iteration of the initial model, the model of the current iteration is used to predict the unannotated second sample set. The initial model predicts the probability distribution of each sample belonging to different categories, and calculates the entropy value of each sample accordingly. The entropy value reflects the uncertainty of the model's prediction results for a given sample. The higher the entropy value, the more uncertain the model's prediction of the sample. According to the entropy value of each sample in the second sample set, samples with higher entropy values (i.e., the samples with the most uncertainty in the model) are selected for manual annotation. These high entropy samples are considered to be the most valuable for model training because they can provide the most knowledge gain. Subsequently, these newly annotated samples are added to the initial training set to obtain an updated initial training set. Based on the updated initial training set, the model is iteratively trained until the preset stop condition (such as the maximum number of iterations or reaching a specific performance indicator) is met. The training set that has been iterated and updated multiple times becomes the target training set, which is used to train the final target model.
[0043] Through the active learning strategy, only the most valuable samples for model training are selected for annotation, which significantly reduces the workload of manual annotation and shortens the model training cycle. By generating pseudo labels and supplementing the training data set through contrastive learning, combined with active learning to intelligently select labeled samples, the model can effectively learn under limited abnormal samples, improving the robustness and generalization ability of the model.
[0044] Optionally, the initial model can use the latest target detection technology and optimization algorithm (such as YOLOv8) to improve the model's detection accuracy of sealing pin welding anomalies (such as cracks, missing welds, pinholes, etc.) and reduce the misjudgment rate. The use of a lightweight model can be combined with the optimization of the model structure and calculation process to improve the calculation efficiency and real-time performance, so that the detection system can be applied to real-time online anomaly detection scenarios.
[0045] Optionally, before obtaining the initial training set, data modules and data preprocessing models can be used for processing. The data is labeled using Labelimg. The data set includes a training set and a test set. The training set is all abnormal sample images, and the test set includes normal sealing nail images and various types of abnormal sealing nail images. A small number of images are manually labeled and reviewed, and the proportion of manually labeled images accounts for 30% of the total data set to ensure that the model can effectively learn abnormal patterns. Labelimg is an open source image annotation tool that is widely used in dataset annotation work in the fields of machine learning and computer vision, and supports multiple annotation formats.
[0046] The data preprocessing module preprocesses the collected images to make them suitable for training and testing deep learning models. The preprocessing steps include image resizing, normalization, enhancement (adjusting different brightness, adding noise, rotating, etc.) and data augmentation (randomly adding defect samples, flipping, mirroring, etc.) to improve the generalization ability and robustness of the model.
[0047] In an optional embodiment, based on the entropy value of each sample in the second sample set, the initial training set is updated to obtain an updated initial training set, including: determining the confidence of each sample according to the entropy value of each sample; determining the pending sample with the lowest confidence among the samples included in the second sample set; labeling the pending sample in a predetermined manner to obtain a labeled sample; adding the labeled sample to the first sample set as an update to the initial training set to obtain an updated initial training set.
[0048] It can be understood that the confidence of these samples is evaluated according to the entropy value of each sample in the second sample set. The entropy value is used to measure the uncertainty of information. A lower entropy value may indicate that the sample has a higher certainty or confidence, while a higher entropy value may indicate that the sample has a higher uncertainty or a lower confidence. Therefore, by calculating the entropy value of each sample, the confidence of each sample can be determined. The sample with the lowest confidence is selected from the second sample set as the pending sample. Since the confidence of the pending sample is low, it may be difficult for the current model to accurately classify or predict. Therefore, these pending samples have potential value for improving the generalization ability and accuracy of the model. These pending samples are labeled in a predetermined manner. The labeling process may involve manual review and classification to ensure that these samples are correctly classified into the corresponding categories. The labeled samples are labeled samples. The labeled samples are added to the first sample set to update the initial training set. By adding new samples with learning potential (i.e., those samples that originally had low confidence) to enrich the training set, the initial model is helped to learn more diverse features, thereby improving the generalization ability and accuracy of the model.
[0049] Optionally, Figure 2 is a first schematic diagram of an optional battery cell abnormality detection method provided according to an embodiment of the present application, such as Figure 2As shown in the figure, it shows that the structure of the deep learning model can be divided into a target prediction module, a loss function module, and a fully connected layer in the process of introducing low-confidence samples for annotation and adding them to the training set. The target prediction module is the core part of the model. It predicts the classification of the input sample (whether there is a welding abnormality) through a series of processing (such as the feature processing represented by each element in the sequence) and extracts key features from the input sample data (i.e., input). These features are the basis for subsequent prediction and classification. By introducing more diverse data, especially those samples with low confidence, the model can learn richer feature representations, thereby improving its adaptability to different data. The loss function module is used to evaluate the difference between the model prediction results and the true labels, and guide the optimization direction of the model accordingly. After introducing new labeled samples, the loss function will recalculate and feed back this information to the model, prompting the model to further adjust its parameters and weights to improve the accuracy of the prediction. As the last part of the model, the fully connected layer converts the feature vector output by the feature extraction module into the final prediction result. By dynamically updating the training set and continuously annotating new low-confidence samples, the fully connected layer can learn more accurate and generalized classification or prediction rules. By continuously identifying and labeling low-confidence samples, the model can learn more diverse data features, and these newly learned features are further optimized through the guidance of the loss function. Ultimately, the fully connected layer outputs more accurate and reliable prediction results, which helps to achieve more accurate identification of sealing pin weld anomalies.
[0050] By introducing low-confidence samples and annotating them before adding them to the training set, the model can learn more diverse data features, thereby enhancing its performance on unseen data, that is, improving its generalization ability. For samples that were originally difficult to accurately classify or predict, by annotating and adding them to the training set, the model has the opportunity to learn the correct classification method for these samples, thereby improving the overall classification or prediction accuracy. By dynamically updating the training set, the training process is made more flexible and efficient. As the model performance improves, new low-confidence samples can be continuously identified for annotation and addition, forming a virtuous cycle and continuously promoting the optimization of model performance.
[0051] Optionally, Figure 3 is a second schematic diagram of an optional battery cell abnormality detection method provided according to an embodiment of the present application, such as Figure 3As shown in Figure 1, data augmentation uses data augmentation techniques to increase the diversity of labeled samples (first sample set) in the initial stage, which helps the model learn more robust features and thus better generalize to new and unseen data. Anchoring In contrastive learning, one or more samples are usually selected as anchors for comparison with positive and negative samples. Encoder Optimization uses data-augmented labeled samples (first sample set) to perform preliminary training on the model (especially the encoder part). The encoder's task is to learn how to convert input data into meaningful feature representations. After each training iteration, the model predicts the unlabeled data set (second sample set). Then, the entropy value of the probability distribution of the prediction result of each sample is calculated to obtain an uncertainty score. This score reflects the confidence of the model in the prediction result of a given sample. According to the pre-set annotation resources, the sample with the highest uncertainty score is selected for predetermined annotation (such as manual). The newly annotated samples are added to the training set for the next round of iterations. This process is iterative, and each iteration uses newly annotated samples to improve the performance of the model. Contrastive Loss is used to evaluate the performance difference of the model on positive and negative sample pairs during the entire training process. By minimizing the contrastive loss, the model can learn to bring similar samples (positive pairs) closer together and push dissimilar samples (negative pairs) further apart. The entire process starts with the contrastive learning module and eventually returns to this module, constantly learning through new data and gradually improving performance.
[0052] Among them Figure 3 In, f + =θ(x + ): The feature vector obtained by the encoder after the positive sample (positive). a =θ(x a ): The feature vector obtained by the encoder of the anchor point. - =θ(x - ): The feature vector obtained by the encoder after the negative sample (negative). Here θ(x) represents the feature vector obtained after the input image of the encoder, where θ is the parameter of the encoder. δ(f a ,f + ): Calculate the similarity between the anchor feature vector and the positive sample feature vector, using Euclidean distance or cosine similarity. δ(f a ,f -): Calculate the similarity between the anchor feature vector and the negative sample feature vector, and expect that this similarity is smaller than the similarity between the anchor and the positive sample.
[0053] The model is initially trained using a small amount of normal and abnormal samples (i.e., the first sample set) that have been annotated (the annotation method can be manual or other model annotation). The initial model predicts the unlabeled data set (i.e., the second sample set) after each training iteration, and calculates the entropy value of the probability distribution of each sample for uncertainty scoring. The uncertainty score reflects the confidence level of the initial model in the prediction result of a given sample. Based on the pre-set annotation resources, samples with the highest uncertainty score are selected for manual annotation. This strategy assumes that the most challenging samples (i.e., samples with the most uncertainty in the model, with the highest entropy value) will provide the most knowledge gain. The processed data (including newly annotated samples) are added to the training set for the next round of iterations.
[0054] Optionally, taking the initial model as a deep neural network (CNN) as an example, each sample image is input into an encoder of the initial model to map the image to a feature representation in a low-dimensional vector space.
[0055] For positive pairs, the goal of contrastive learning is to bring them closer in feature space, while for negative pairs, the goal is to push them further apart. This is achieved through contrastive loss, which measures the distance between positive pairs and between positive and negative pairs. In the framework of contrastive learning, the model learns to bring similar images closer and push different images further apart. The function expression is:
[0056]
[0057] Where q is the query representation, a feature vector obtained by the encoder network. k+ is the positive key sample representation, which is the positive sample feature vector related to the query. k- is the set of negative key sample representations, which is the set of negative sample feature vectors irrelevant to the query. Τ is the temperature hyper-parameter, which is used to scale the temperature parameter of the inner product and can control the softened probability distribution. Use gradient descent or other optimization algorithms to update the weights of the encoder network to minimize the contrast loss. This process will prompt the model to learn more discriminative feature representations, so that it performs better in downstream tasks. The initial model is iterated until a preset stop condition is reached, such as the maximum number of iterations or a specific performance indicator is met.
[0058] Optionally, Figure 4 is a third schematic diagram of an optional battery cell abnormality detection method provided according to an embodiment of the present application, such as Figure 4 As shown in the figure, taking the initial model as the YOLOv8 model as an example, the network structure includes input layer, convolution layer (Conv2d), feature fusion (C2f), upsampling (Upsample), connection layer (Concat), SENet module, and output layer (Head). Other components are also included, including fast spatial pyramid pooling SPPF (Spatial Pyramid Pooling-Fast), which may be used to further fuse features and improve model performance. Feature transformation Inception, global average pooling, fully connected layer FC (Fully Connected Layer), activation function Sigmoid, and feature scaling Scale.
[0059] The initial training set output by the pre-module is used. The initial training set includes sample images and annotated labels (pseudo labels). Various transformations (such as rotation, flipping, scaling, etc.) are performed on the images to improve the generalization ability of the target model. Samples with obvious errors or low quality are eliminated to ensure the quality of the data set. The generated pseudo labels are manually verified and screened to improve the accuracy of the pseudo labels. The preprocessed and verified samples (i.e., the samples included in the initial training set) are divided into training sets and verification sets and input into the YOLOv8 model. The SE module is added to the Neck part of the YOLOv8 model to adjust the channel weights of the feature map using global information. The YOLOv8+SENet model models the interaction between channels during the feature extraction process. The SE module can dynamically recalibrate the feature responses of each channel, emphasize important features and suppress irrelevant features, and output enhanced feature maps, thereby enhancing the model's ability to understand target features and providing a basis for subsequent detection tasks.
[0060] Figure 4 The multiple Conv2d layers in the model represent convolution operations, which are used to extract features from the image. The Conv2d layer may be followed by other operations such as normalization (also known as BatchNorm) and non-linear activation (SiLU). The YOLOv8 model uses cross-layer feature fusion (C2f), which allows feature maps from different levels to be integrated to improve the detection accuracy of objects of different sizes. The multiple C2f modules in the model are used to fuse features at multiple levels. In order to fuse features at different scales, Figure 4 The upsampling layer is used to enlarge the size of the feature map, and the feature maps of different levels are merged through the connection operation. P2 represents the 8X8 feature map, P3 represents the 20X20 feature map, and P4 represents the 60X60 feature map. The size of the above feature maps is determined based on the typical size of the welding anomaly of the sealing nail. SENet dynamically recalibrates the feature response of each channel through global information, emphasizes important features and suppresses irrelevant features, thereby enhancing the expressive power of the feature map. The SENet module is usually followed by feature fusion (C2f) to further utilize the enhanced features. The processed feature map is passed through the output layer (Head) for target detection and outputs the detection results.
[0061] After SENet enhanced the expressive power of feature maps, YOLOv8 adopted cross-layer feature fusion (C2F structure), which inputs multi-scale feature maps (feature maps from different levels). Before predicting the output, these modules will integrate the feature information of different levels. Integrating feature information of different levels helps to improve the detection accuracy of targets of various sizes.
[0062] In an optional embodiment, the captured image is input into the target model for processing to obtain multiple bounding boxes for identifying different candidate targets, including: extracting features based on the captured image to obtain multiple feature maps of different sizes; for a first target among the multiple candidate targets, generating candidate boxes for identifying the first target on the multiple feature maps; based on the multiple candidate boxes of the first target, processing using the target model to determine a bounding box for identifying the first target; and determining multiple bounding boxes in the same manner as that for determining the bounding box of the first target.
[0063] It can be understood that feature extraction is performed on the collected images, and multiple feature maps (Feature Maps) of different sizes are extracted from the images by applying convolutional neural networks (CNN) in deep learning or other feature extraction methods. These feature maps contain information about the image at different scales and levels of abstraction, providing a rich data basis for subsequent target detection. For the first target among multiple candidate targets (for example, first detect the sealing pin weld), candidate boxes (also called anchor boxes, prediction boxes Anchor Box) that may contain the target are generated on feature maps of multiple different sizes. These candidate boxes are generated by sliding windows at different positions of the feature map based on preset sizes and proportions, and are used to preliminarily locate possible welding abnormalities. The multiple candidate boxes of the first target are processed using the target model to determine an optimal bounding box to identify the first target.
[0064] The use of multi-scale feature maps and candidate boxes can handle objects of different sizes and positions in the image, enhancing the robustness of detection. Even if the size of the object in the image changes greatly or the position is far from the center, it can still be effectively detected.
[0065] Optionally, the target model is used to process multiple candidate boxes of the first target, and the classification process may include determining whether the candidate box contains the target, and the regression process may include adjusting the position and size of the candidate box so that it more accurately surrounds the target. By generating candidate boxes on feature maps of different sizes and using the target model for accurate classification and regression, multiple targets in the image can be efficiently detected and their bounding boxes can be accurately determined. This is conducive to improving the efficiency and accuracy of target detection.
[0066] Optionally, the prediction mechanism of the YOLOv8 model is used to extract features at different scales for target detection, that is, a series of candidate boxes are output on feature maps of different scales, each of which is accompanied by a predicted category score (the model provides a category score vector for each detected target, and each element of this vector represents the probability that the target belongs to the normal or abnormal welding category.) and bounding box coordinates (parameters describing the position and size of the detected object in the image, the x and y coordinates of the center point, and the width and height of the bounding box).
[0067] In an optional embodiment, the target model includes at least an attention module, which inputs the captured image into the target model for processing to obtain multiple bounding boxes for identifying different candidate targets, including: according to the weight value of the feature response channel, feature extraction is performed based on the captured image to obtain multiple feature maps of different sizes, wherein the weight value is configured by the attention module based on the degree of correlation with the abnormal welding feature of the sealing pin.
[0068] It can be understood that for the task of processing the acquired image by the target model to identify the abnormal welding of the sealing pin, the target model is designed to include at least one attention module, and the above-mentioned attention module can be an SE module. The attention module automatically calculates and configures the weight value of the feature response channel according to the degree of association with the abnormal welding characteristics of the sealing pin (such as weld defects, dislocation, lack of fusion, etc.). The weight value reflects the importance of different feature channels in identifying welding anomalies. Subsequently, feature extraction is performed on the input acquired image, and the model generates multiple feature maps according to different sizes (usually multi-scale feature extraction is achieved through different layers of the convolutional neural network). Each feature map contains information about the image at different levels of abstraction, and due to the effect of the attention module, these feature maps will focus more on those features that are highly correlated with welding anomalies. Based on the different size feature maps of multiple candidate targets, the model is further processed to generate multiple bounding boxes. Each bounding box is used to identify a candidate target, which may be a potential welding anomaly location.
[0069] By weighting the feature response channels through the attention module, the model can focus more on features closely related to welding anomalies, thereby improving the accuracy of target detection. By introducing the attention module and performing feature extraction and bounding box generation based on its configured weight values, the performance and efficiency of sealing nail welding anomaly detection are effectively improved.
[0070] In an optional embodiment, based on multiple candidate boxes of the first target, a target model is used for processing to determine a bounding box for identifying the first target, including: determining the confidence levels and overlapping areas corresponding to the multiple candidate boxes; based on the confidence levels and overlapping areas corresponding to the multiple candidate boxes, integrating the multiple candidate boxes to obtain a bounding box for identifying the first target.
[0071] It can be understood that for multiple candidate boxes about the first target, the target model is used for further processing to determine the bounding box that is ultimately used to identify the first target. Each candidate box is evaluated to determine its corresponding confidence. The confidence usually reflects the classification probability or credibility that the model believes that the candidate box does contain the first target.
[0072] The overlapping area between multiple candidate boxes is calculated, and different detection results pointing to the same target are further determined through candidate boxes that overlap or are close to each other in spatial position. Based on the above confidence and overlapping area information, multiple candidate boxes are integrated, and the optimal bounding box is finally retained as the final result. Only one bounding box with the highest confidence is retained for each target. By integrating multiple candidate boxes, redundant and repeated detection results are eliminated, so that the final bounding box is more accurately around the first target, improving the accuracy of target positioning.
[0073] Optionally, the integration process optionally includes techniques such as non-maximum suppression (NMS) to eliminate duplicate or redundant candidate boxes based on the confidence of the candidate boxes and the degree of overlap between them.
[0074] In an optional embodiment, the method also includes: determining a scale factor based on a predetermined welding anomaly type of the sealing pin; determining a bounding box loss based on an intersection-and-union ratio between a predetermined real box and a predicted box, a scale factor, a horizontal weight value in the horizontal direction, and a vertical weight value in the vertical direction; and adjusting the target model based on the bounding box loss.
[0075] It can be understood that according to the predetermined welding anomaly types of sealing nails (such as weld cracks, lack of fusion, dislocation, etc.), the performance characteristics of these anomalies in the image, such as size, shape, direction, etc., are analyzed. Based on the above characteristics, the scale factor is determined to adjust the detection sensitivity of targets of different sizes during the training process to better adapt to various welding anomaly types. The intersection over union (IoU) between the predetermined real box (i.e., the bounding box with the actual welding anomaly position marked) and the bounding box predicted by the model (i.e., the bounding box determined after integration in the candidate box) is calculated. At the same time, the bounding box loss is determined by combining the previously determined scale factor, the horizontal weight value in the horizontal direction (which may be adjusted according to the importance of the welding anomaly in the horizontal direction), and the vertical weight value in the vertical direction (similarly, adjusted according to the importance of the vertical direction). This loss value measures the difference between the bounding box predicted by the model and the real bounding box, and is the target that needs to be minimized during the model training process. Based on the calculated bounding box loss, the target model is adjusted through optimization algorithms such as back propagation, aiming to reduce the difference between the predicted bounding box and the real bounding box, thereby improving the accuracy of the model in detecting the welding anomaly of the sealing nail. The use of scale factors enables the model to better adapt to welding anomalies of different sizes and shapes, enhancing the adaptability and generalization ability of the model.
[0076] It should be noted that the calculation of bounding box loss takes into account multiple factors, including intersection-over-union ratio, scale factor and weight value, making the training process more refined and efficient. By continuously adjusting the model to minimize the bounding box loss, the convergence speed of the model can be accelerated and the training efficiency can be improved. By introducing the scale factor, calculating the bounding box loss and adjusting the target model accordingly, the accuracy and efficiency of sealing nail welding anomaly detection are effectively improved.
[0077] Optionally, Figure 5 is a fourth schematic diagram of an optional battery cell abnormality detection method provided according to an embodiment of the present application, such as Figure 5 As shown in the figure, the Shape-IoU bounding box regression method is introduced. Based on the consideration of the shape and size factors of the bounding box itself, it can be expressed in the following way:
[0078]
[0079]
[0080] Among them, GT represents the true box, scale is the scale factor, indicating the scaling factor of width and height, which is related to the scale of the target (the size of the welding anomaly type), ww and hh are the weight coefficients in the horizontal and vertical directions respectively, and their values are related to the shape of the GT box.
[0081] Among them, B gt represents the ground truth, w gt represents the width of the true bounding box, h gt Indicates the height of the true bounding box, x c The x-coordinate and y-coordinate of the center of the predicted bounding box. c represents the y coordinate of the center coordinate of the predicted bounding box, represents the x-coordinate of the center coordinate of the true bounding box, Represents the y coordinate of the center coordinate of the true bounding box, and C is a scaling factor that is related to the image size and is used to normalize the difference in the center point. r is a measure of the matching degree of width and height, θ is an exponential factor, ω w Represents the relative error of width, indicating the difference in width between the predicted box and the real box, ω h Represents the relative error of height, indicating the difference in height between the predicted box and the real box, Ω shape is the final shape similarity measure that integrates the errors of width and height.
[0082] The corresponding border regression loss L shape-IoU as follows:
[0083] L Shape-IoU=1-IoU+distance shape +0.5*Ω shape
[0084] Through the above processing, the detection effect of abnormal welding positions can be effectively improved.
[0085] It should be noted that, in view of the refined improvement of the YOLOv8 model structure, in this embodiment, in the Neck part of the YOLOv8 model, the SE attention module is added for small targets to enhance the expressiveness of cross-scale features; in the boundary regression loss part, the traditional IOU algorithm is modified for the geometric relationship between the real box and the predicted box, and the Shape-IoU method is used to replace it, thereby improving the model's detection performance for small targets such as cracks and pinholes in sealing nails and improving the accuracy of regression. It is suitable for industrial target detection projects, especially when the detection effect of small targets is poor, and has methodological innovation and broad application prospects.
[0086] Step S106, determining a target frame whose size meets a predetermined size range in a plurality of boundary frames, wherein the predetermined size range is determined based on a predetermined welding abnormality type of the sealing pin, and the target frame is used to identify a welding abnormality target detected by the target model;
[0087] It can be understood that, among multiple boundary boxes, the target boxes that meet the conditions are screened out according to the predetermined size range, and the predetermined size range is determined based on the predetermined welding abnormality type of the sealing nail, which is conducive to accurately identifying welding abnormalities with specific size characteristics. By setting the size screening condition, the interference of non-target areas can be eliminated, and the detection can be focused on the target area related to the specific welding abnormality, thereby improving the pertinence and accuracy of the detection.
[0088] Step S108: marking a target frame on the captured image as a result of abnormality detection of the battery cell.
[0089] It can be understood that on the original captured image, the determined target frame is marked using annotation tools (such as a rectangular frame), which visually reflects the position and range of the abnormal welding target detected by the target model. Through intuitive image annotation, the test results are intuitively displayed on the original image, which is convenient for subsequent manual review and further analysis. This method improves the readability and interpretability of the test results, and helps to promptly discover and deal with abnormal welding problems of battery cells.
[0090] Optionally, the optimal bounding box information obtained by the YOLOv8 model, including category, confidence, and coordinates, is collated and sorted, and then the detected anomaly results are saved and graphically displayed on the original input image for easy observation and understanding by users.
[0091] In the detection of sealing nail defects, using the same data set and training set, the target model set in the above embodiment is compared with other related models when the same configuration machine runs the same number of training times. Among them, the above other related models are trained 500 times as pre-trained models on this basis, and the target model structure improved by the embodiment of the present application is trained 500 times. The comparison shows that the precision (P) and the average average precision (mAP) indicators are improved.
[0092] Through the above step S102, the battery cell is imaged to obtain an image including the welding position of the sealing pin; in step S104, the image is input into the target model for processing to obtain multiple bounding boxes for identifying different candidate targets, wherein the target model is obtained by iterating the target training set, and the target training set is obtained by processing according to the entropy value of the sample in the initial training set, and the entropy value is used to indicate the uncertainty of the sample being identified; in step S106, a target box whose size meets the predetermined size range is determined in multiple bounding boxes, wherein the predetermined size range is determined based on the predetermined welding abnormality type of the sealing pin, and the target box is used to identify the welding abnormality target detected by the target model; in step S108, the target box is marked on the image as the abnormality detection result of the battery cell. It can achieve effective model learning under limited abnormal samples, adapt to the purpose of the welding defect characteristics of the sealing pin, and achieve the technical effect of improving the recognition efficiency of the sealing pin welding abnormality, thereby solving the technical problem of the unsatisfactory ability to recognize the welding abnormality of the battery cell in the related art.
[0093] Based on the above embodiments and optional embodiments, the present application proposes an optional implementation method, which is applied in the sealing nail welding anomaly detection system, can effectively learn under limited abnormal samples, and can adapt to complex sealing nail defect characteristics, and is suitable for real-time online anomaly detection systems. By using the advanced deep learning paradigm of contrastive learning, the dependence on a large amount of labeled data can be reduced; adjusting the brightness and grayscale of the picture can ensure that more pictures are available for model learning. By optimizing the network structure and some traditional algorithms, the computational efficiency and real-time performance of the model can be improved; by introducing more data enhancement and transfer learning techniques, the generalization ability and adaptability of the model can be improved. Through the target detection framework of the YOLOv8 architecture, the active-contrast learning deep learning paradigm is adopted to realize an industrial-grade real-time detection model with superior performance, including a data module, a data preprocessing module, an active learning module, a contrastive learning module, and a real-time detection module. The connection method in the above modules is: data module → data preprocessing module → active learning and contrastive learning combination module → training and real-time detection module connection.
[0094] Data module: The data is annotated using Labelimg. The data set includes a training set and a test set. The training set consists of abnormal sample images, and the test set includes normal sealing nail images and various types of abnormal sealing nail images. A small number of images are manually annotated and reviewed, accounting for 30% of the total data set to ensure that the model can effectively learn abnormal patterns.
[0095] Data preprocessing module: The data preprocessing module preprocesses the collected images to make them suitable for training and testing deep learning models. The preprocessing steps include image resizing, normalization, enhancement (adjusting different brightness, adding noise, rotating, etc.) and data augmentation (randomly adding defect samples, flipping, mirroring, etc.) to improve the generalization ability and robustness of the model.
[0096] Active learning and contrastive learning combined module: Step S1, initial training: First, use a small number of existing manually annotated normal and abnormal samples to conduct preliminary training on the model. That is, select samples containing representative features for annotation, preprocess the samples through the data preprocessing module, and input them into the model for training.
[0097] Step S2, uncertainty assessment: The model predicts the unlabeled dataset after each training iteration and calculates the entropy of the probability distribution of each sample to generate an uncertainty score. These scores can reflect the confidence of the model in the prediction result of a given sample. Identify the samples that the model is most uncertain about, that is, those samples that the model has the lowest confidence in when predicting.
[0098] Step S3, sampling strategy: According to a pre-set budget, samples with the highest uncertainty scores are selected for manual annotation. This strategy assumes that the most challenging samples (i.e., samples that the model is most uncertain about) will provide the most knowledge gain.
[0099] Step S4, data preparation: add the processed data to the training set. Collect and preprocess the data set (including newly annotated samples).
[0100] Step S5, Encoder Network: Each view is input into a deep neural network (CNN), called an encoder, which maps the image to a feature representation in a low-dimensional vector space.
[0101] Step S6, loss function calculation: For positive sample pairs, the goal of contrastive learning is to bring them closer in feature space; while for negative sample pairs, the goal is to push them farther apart. This is usually achieved through contrastive loss, which measures the distance between positive sample pairs and between positive sample pairs and negative sample pairs. Under the framework of contrastive learning, the model learns to bring similar images closer and push different images farther apart. The function expression is:
[0102]
[0103] Where q is the query representation, which is usually the feature vector obtained by the encoder network.
[0104] k+: positive key sample representation, which is the positive sample feature vector related to the query.
[0105] k-: negative key samples representations, which is a set of negative sample feature vectors that are irrelevant to the query.
[0106] τ: temperature hyper-parameter, used to scale the temperature parameter of the inner product, which can control the softening probability distribution.
[0107] Step S7, optimization: Use gradient descent or other optimization algorithms to update the weights of the encoder network to minimize the contrast loss. This process will encourage the model to learn more discriminative feature representations, thereby performing better in downstream tasks.
[0108] Step S8, loop iteration: repeat steps S2-7 until a preset stop condition is reached, such as a maximum number of iterations or a specific performance indicator is met.
[0109] Training and real-time detection module: This module is responsible for outputting the detection results of the model to the user. Through the previous module, some labeled high-value samples and pseudo-label samples can be obtained. These samples and pseudo-labels will be used as training data for the YOLOv8 model.
[0110] Data input: Input sample images and pseudo labels output by the front module.
[0111] Data augmentation: Perform various transformations on the image (such as rotation, flipping, scaling, etc.) to improve the generalization ability of the model.
[0112] Data cleaning: Eliminate samples with obvious errors or low quality to ensure the quality of the data set.
[0113] Pseudo-label verification: Manual verification and screening of the generated pseudo-labels are performed to improve the accuracy of the pseudo-labels.
[0114] Feature enhancement: The preprocessed and verified samples are divided into training sets and validation sets and input into the YOLOv8 model. The SE module is added to the Neck part of the YOLOv8 model to adjust the channel weights of the feature map using global information. The YOLOv8+SENet model models the interaction between channels during the feature extraction process. The SE module can dynamically recalibrate the feature responses of each channel, emphasize important features and suppress irrelevant features, and output enhanced feature maps, thereby enhancing the model's ability to understand target features and providing a basis for subsequent detection tasks.
[0115] Cross-layer feature fusion: After SENet enhanced the expressive power of feature maps, YOLOv8 adopted cross-layer feature fusion (C2F structure), which inputs multi-scale feature maps (feature maps from different levels). Before predicting the output, these modules will integrate the feature information of different levels. Integrating feature information at different levels helps to improve the detection accuracy of targets of various sizes.
[0116] In the prediction part, the prediction mechanism of the YOLOv8 model is used to extract features at different scales for target detection, that is, a series of candidate boxes are output on feature maps of different scales, each of which is accompanied by a predicted category score (YOLO provides a category score vector for each detected object, and each element of this vector represents the probability that the object belongs to a certain category.) and bounding box coordinates (parameters that describe the position and size of the detected object in the image, the x and y coordinates of the center point, and the width and height of the bounding box).
[0117] In the prediction output stage, for these candidate boxes, the model will also apply the NMS algorithm to filter out the optimal candidate box based on the confidence and overlapping area of the candidate box, and output a filtered bounding box (only one bounding box with the highest confidence is retained for each target).
[0118] The filtered bounding box (including category and confidence) is input, and the optimal bounding box information obtained by the YOLOv8 model, including category, confidence and coordinates, is sorted and sorted. Then, these detected abnormal results are saved and displayed graphically on the original input image for easy observation and understanding by users.
[0119] The combination of active learning and contrastive learning makes the model more robust; by using the YOLOv8 framework, the recognition rate is accelerated to achieve a detection model with superior performance. It can effectively learn under limited abnormal samples, adapt to the complex characteristics of sealing nail welding, and reduce the dependence on manually labeled data. The latest target detection technology and optimization algorithm are used to implement the detection system under a small parameter model. It can be widely used in the field of sealing nail welding anomaly detection, improve the quality control level of battery cells, reduce battery production costs, and improve the overall performance and life of batteries.
[0120] The above optional implementation method achieves at least the following effects: through active-contrast learning, using a small amount of manually labeled data, effectively reducing the problem of excessive manual labeling costs, shortening the model training cycle to improve the accuracy of detection, and reducing the high misjudgment rate of current equipment.
[0121] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0122] In this embodiment, a battery cell abnormality detection device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the terms "module" and "device" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0123] According to an embodiment of the present application, a device embodiment for implementing a method for detecting abnormality of a battery cell is also provided. Figure 6 is a schematic diagram of a battery cell abnormality detection device according to an embodiment of the present application, such as Figure 6 As shown, the above-mentioned battery cell abnormality detection device includes: an image acquisition module 602, a first recognition module 604, a second recognition module 606, and an abnormality marking module 608. The device is described below.
[0124] An image acquisition module 602 is used to acquire an image of the battery cell to obtain an acquired image including a welding position of a sealing pin;
[0125] The first recognition module 604 is connected to the image acquisition module 602 and is used to input the acquired image into the target model for processing to obtain multiple bounding boxes for identifying different candidate targets, wherein the target model is obtained by iteratively using the target training set, and the target training set is obtained by processing according to the entropy value of the sample in the initial training set, and the entropy value is used to indicate the uncertainty of the sample being identified;
[0126] A second recognition module 606, connected to the first recognition module 604, is used to determine a target frame whose size meets a predetermined size range in a plurality of boundary frames, wherein the predetermined size range is determined based on a predetermined welding abnormality type of the sealing nail, and the target frame is used to identify a welding abnormality target detected by the target model;
[0127] The abnormality marking module 608 is connected to the second recognition module 606 and is used to mark a target frame on the collected image as an abnormality detection result of the battery cell.
[0128] In a battery cell abnormality detection device provided in an embodiment of the present application, an image acquisition module 602 is set to acquire images of the battery cell to obtain an acquired image including the welding position of the sealing pin; a first recognition module 604 is connected to the image acquisition module 602, and is used to input the acquired image into a target model for processing to obtain multiple bounding boxes for identifying different candidate targets, wherein the target model is obtained by iterating a target training set, and the target training set is obtained by processing according to the entropy value of the sample in the initial training set, and the entropy value is used to indicate the degree of uncertainty of the sample being identified; a second recognition module 606 is connected to the first recognition module 604, and is used to determine a target box whose size meets a predetermined size range in the multiple bounding boxes, wherein the predetermined size range is determined based on a predetermined welding abnormality type of the sealing pin, and the target box is used to identify the welding abnormality target detected by the target model; an abnormality marking module 608 is connected to the second recognition module 606, and is used to mark the target box on the acquired image as the abnormality detection result of the battery cell. The purpose of effective model learning under limited abnormal samples and adapting to the characteristics of sealing pin welding defects was achieved, and the technical effect of improving the efficiency of identifying sealing pin welding anomalies was realized, thereby solving the technical problem of unsatisfactory ability to identify welding anomalies of battery cells in related technologies.
[0129] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0130] It should be noted that the image acquisition module 602, the first recognition module 604, the second recognition module 606, and the abnormality marking module 608 correspond to steps S102 to S108 in the embodiment, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the modules as part of the device can be run in a computer terminal.
[0131] It should be noted that the optional or preferred implementation of this embodiment can refer to the relevant description in the embodiment, which will not be repeated here.
[0132] The above-mentioned battery cell abnormality detection device may also include a processor and a memory. The image acquisition module 602, the first recognition module 604, the second recognition module 606, the abnormality marking module 608, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
[0133] The processor includes a kernel, which retrieves the corresponding program unit from the memory. There can be one or more kernels. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.
[0134] An embodiment of the present application provides a non-volatile storage medium on which a program is stored, and when the program is executed by a processor, a method for detecting abnormality of a battery cell is implemented.
[0135] An embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: performing image acquisition on a battery cell to obtain an acquired image including a welding position of a sealing pin; inputting the acquired image into a target model for processing to obtain multiple bounding boxes for identifying different candidate targets, wherein the target model is obtained by iteratively adopting a target training set, and the target training set is obtained by processing according to the entropy value of a sample in an initial training set, and the entropy value is used to indicate the degree of uncertainty of sample identification; among the multiple bounding boxes, determining a target box whose size meets a predetermined size range, wherein the predetermined size range is determined based on a predetermined welding abnormality type of the sealing pin, and the target box is used to identify the welding abnormality target detected by the target model;
[0136] The target box is marked on the captured image as the abnormality detection result of the battery cell. The device in this article can be a server, PC, etc.
[0137] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: performing image acquisition on a battery cell to obtain an acquired image including a welding position of a sealing pin; inputting the acquired image into a target model for processing to obtain multiple bounding boxes for identifying different candidate targets, wherein the target model is obtained by iterating a target training set, and the target training set is obtained by processing according to the entropy value of the sample in the initial training set, and the entropy value is used to indicate the degree of uncertainty in the identification of the sample; among the multiple bounding boxes, determining a target box whose size meets a predetermined size range, wherein the predetermined size range is determined based on a predetermined welding anomaly type of the sealing pin, and the target box is used to identify the welding anomaly target detected by the target model; marking the target box on the acquired image as the abnormality detection result of the battery cell.
[0138] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0139] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0140] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0141] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0142] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0143] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0144] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0145] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0146] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0147] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for detecting abnormality of a battery cell, characterized in that: include: Capturing images of the battery cell to obtain images including welding positions of sealing pins; Inputting the captured image into a target model for processing to obtain a plurality of bounding boxes for identifying different candidate targets, wherein the target model is obtained by iteratively adopting a target training set, and the target training set is obtained by processing according to the entropy value of the sample in the initial training set, and the entropy value is used to indicate the uncertainty degree of the sample being identified; Determine a target frame whose size satisfies a predetermined size range among the multiple boundary frames, wherein the predetermined size range is determined based on a predetermined welding abnormality type of the sealing pin, and the target frame is used to identify a welding abnormality target detected by the target model; The target frame is marked on the collected image as an abnormality detection result of the battery cell.
2. The method according to claim 1, characterized in that The initial training set includes a first labeled sample set and an unlabeled second sample set, and the method further includes: Based on the first sample set, using the initial model to perform iterative processing; After completing each iteration of the initial model, using the initial model of the current iteration, determining to predict the second sample set, and determining the entropy value of each sample in the second sample set; Based on the entropy value of each sample in the second sample set, the initial training set is updated to obtain an updated initial training set; Based on the updated initial training set, the target training set is obtained.
3. The method according to claim 2, characterized in that The updating process of the initial training set based on the entropy value of each sample in the second sample set to obtain an updated initial training set includes: Determining the confidence level of each sample according to the entropy value of each sample; Determine, among the samples included in the second sample set, a pending sample with the lowest confidence; Annotating the pending sample in a predetermined manner to obtain an annotated sample; The labeled samples are added to the first sample set as an update process for the initial training set to obtain an updated initial training set.
4. The method according to claim 1, characterized in that: The collected image is input into the target model for processing to obtain a plurality of bounding boxes for identifying different candidate targets, including: Extracting features based on the acquired image to obtain a plurality of feature maps of different sizes; For a first target among the multiple candidate targets, generating candidate boxes identifying the first target on the multiple feature maps respectively; Based on multiple candidate boxes of the first object, the object model is used to perform processing to determine a bounding box for identifying the first object; The plurality of bounding boxes are determined in a manner similar to that of determining a bounding box of the first object.
5. The method according to claim 4, characterized in that The target model at least includes an attention module, and the collected image is input into the target model for processing to obtain multiple bounding boxes for identifying different candidate targets, including: According to the weight value of the feature response channel, feature extraction is performed based on the collected image to obtain multiple feature maps of different sizes, wherein the weight value is configured by the attention module based on the degree of association with the abnormal welding feature of the sealing pin.
6. The method according to claim 4, characterized in that the plurality of candidate frames based on the first target, The object model is used for processing to determine a bounding box for identifying the first object, including: Determine the confidence levels and overlapping areas respectively corresponding to the multiple candidate frames; Based on the confidence levels and overlapping areas respectively corresponding to the multiple candidate boxes, the multiple candidate boxes are integrated to obtain the bounding box for identifying the first target.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: determining a scale factor based on a predetermined welding anomaly type of the sealing pin; Determining a bounding box loss based on a predetermined intersection-over-union ratio between the true box and the predicted box, the scale factor, a horizontal weight value in the horizontal direction, and a vertical weight value in the vertical direction; The object model is adjusted based on the bounding box loss.
8. A battery cell abnormality detection device, characterized in that: include: An image acquisition module is used to acquire images of the battery cell to obtain an acquired image including the welding position of the sealing pin; A first recognition module is used to input the collected image into a target model for processing to obtain a plurality of bounding boxes for identifying different candidate targets, wherein the target model is obtained by iteratively using a target training set, and the target training set is obtained by processing according to the entropy value of the sample in the initial training set, and the entropy value is used to indicate the uncertainty degree of the sample being recognized; A second recognition module is used to determine, among the multiple boundary boxes, a target box whose size meets a predetermined size range, wherein the predetermined size range is determined based on a predetermined welding abnormality type of the sealing nail, and the target box is used to identify a welding abnormality target detected by the target model; The abnormality marking module is used to mark the target frame on the collected image as the abnormality detection result of the battery cell.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the battery cell abnormality detection method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: One or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the battery cell abnormality detection method described in any one of claims 1 to 7.
Citation Information
Cited By
Subway water leakage identification method based on infrared image
CN120163972A
Jewel case processing equipment monitoring method and monitoring system
CN120953915A