Battery cell testing methods, electronic equipment and battery cell testing equipment
By identifying foreign objects inside the battery cell based on multiple predefined anchor frames and multiple convolution operations, the problem of the inability to identify foreign objects inside the battery cell in the existing technology is solved, and the comprehensiveness and accuracy of battery cell detection are improved, avoiding performance degradation and safety hazards.
Patent Information
- Application Number
- CN202510145465.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-02-10
AI Technical Summary
Existing cell testing methods cannot identify foreign objects between each layer inside the cell, which may lead to performance degradation and safety hazards.
By detecting multiple predefined anchor boxes in the image to be detected, and combining multiple convolution and deconvolution operations, foreign objects in the battery cell are identified. A multi-layer convolutional neural network is used to extract feature maps and generate anchor boxes. The position and size of the anchor boxes are adjusted, the confidence level is calculated, and the target region set of the battery cell is determined by combining edge detection methods.
It improves the comprehensiveness and accuracy of cell testing, enabling accurate detection of all foreign objects in the cell and avoiding performance degradation and safety hazards caused by foreign objects.
Smart Images

Figure CN120070371B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of battery cell testing technology, specifically to a battery cell testing method, electronic device, and battery cell testing equipment. Background Technology
[0002] With the rapid development of the new energy vehicle industry, the safety and stability requirements for power batteries, as a core component of new energy vehicles, are becoming increasingly stringent. As the basic unit of a power battery, the internal quality of the battery cell directly affects the overall performance of the battery. Therefore, non-destructive testing of the battery cell during the production process is particularly important.
[0003] Currently, X-ray inspection equipment is mainly used in the field of battery cell testing to detect the alignment of the cathode and anode. This method can monitor the alignment of each layer of the battery cell in real time during the manufacturing process to ensure the structural stability of the battery cell.
[0004] However, while existing detection methods can detect cell alignment, they do not identify foreign objects between the layers inside the cell. These foreign objects may accidentally fall in during the production process, potentially affecting the cell's performance and safety. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this application provides a battery cell detection method, electronic device, and battery cell detection equipment. The method involves detecting an image to be detected based on multiple predefined anchor frames to obtain a first target region of the image. Multiple convolution and deconvolution operations are then performed on the image to classify objects within it, resulting in a second target region. The union of the first and second target regions is defined as the detected target region set. This method can accurately detect all foreign objects within the battery cell, thereby improving the comprehensiveness and accuracy of the detection and avoiding performance degradation and safety hazards caused by foreign objects.
[0006] To address the above problems, the present invention provides the following technical solution:
[0007] In a first aspect, embodiments of this application provide a battery cell detection method, comprising: acquiring an image of a battery cell to be detected;
[0008] The image to be detected is detected based on multiple predefined anchor boxes to obtain the first target region of the image to be detected;
[0009] Multiple convolution and deconvolution operations are performed on the image to be detected to classify the objects in the image to be detected, thereby obtaining the second target region of the image to be detected. The objects in the image to be detected include battery cells and foreign objects.
[0010] The union of the first target region and the second target region is determined as the detected target region set.
[0011] In some embodiments, the method further includes:
[0012] Calculate multiple gradient values for each pixel in the image to be detected;
[0013] Edge detection is performed on the image to be detected based on multiple gradient values of each pixel in the image to be detected, to obtain the third target region of the image to be detected;
[0014] The step of determining the union of the first target region and the second target region as the detected target region set includes:
[0015] The union of the first target region, the second target region, and the third target region is defined as the target region set.
[0016] In some implementations, the step of detecting the image to be detected based on a plurality of predefined anchor boxes to obtain a first target region of the image to be detected includes:
[0017] The image to be detected is input into a pre-trained first detection model;
[0018] In the first detection model, a multi-layer convolutional neural network is used to extract the first feature map of the image to be detected;
[0019] Multiple anchor boxes are generated on the first feature map based on multiple predefined grid cells and aspect ratios, and the center point of each anchor box is the center point of the corresponding grid cell.
[0020] For each anchor frame, detect the target object region in a portion of the first feature map included by the anchor frame;
[0021] Based on the anchor frame and the corresponding target object area, adjust the position and size of the anchor frame to obtain the adjusted anchor frame;
[0022] The confidence level of the adjusted anchor frame is calculated based on the adjusted anchor frame and the corresponding target object region;
[0023] For each set of overlapping anchor boxes, retain the anchor box with the highest confidence in the set of overlapping anchor boxes to obtain at least one detection box;
[0024] The first target region is determined based on all the detection boxes.
[0025] In some implementations, adjusting the position and size of the anchor frame based on the anchor frame and the corresponding target object region to obtain the adjusted anchor frame includes:
[0026] The corresponding anchor frame is moved according to the center point of the target object area so that the center point of the anchor frame coincides with the center point of the target object area.
[0027] The width and height of the anchor frame are adjusted based on the width and height of the target object area to obtain the adjusted anchor frame.
[0028] In some implementations, calculating the confidence level of the adjusted anchor frame based on the adjusted anchor frame and the corresponding target object region includes:
[0029] The probability of the existence of an object in the adjusted anchor frame is calculated based on the width and height of the adjusted anchor frame and the width and height of the corresponding target object area.
[0030] Calculate the object category probability of the target object region;
[0031] The confidence level of the adjusted anchor frame is obtained by multiplying the probability of the object's existence by the probability of the object's category.
[0032] In some implementations, performing multiple convolution and deconvolution operations on the image to be detected to classify objects in the image and obtain a second target region of the image includes:
[0033] The image to be detected is input into a pre-trained second detection model;
[0034] In the second detection model, the image to be detected is subjected to multiple encoding operations including convolution and decoding operations including deconvolution to extract the second feature map of the image to be detected.
[0035] A convolution operation is performed on the second feature map to obtain a category vector, which is used to represent the category of the object to which each pixel in the image to be detected belongs;
[0036] The second target region of the image to be detected is determined based on the category vector.
[0037] In some embodiments, the step of performing multiple encoding operations including convolution and decoding operations including deconvolution on the image to be detected in the second detection model to extract a second feature map of the image to be detected includes:
[0038] The image to be detected is input into the encoding layer of the second detection model. The encoding layer performs multiple encoding operations, including convolution operations, on the image to be detected to obtain a first feature vector. The encoding layer includes multiple cascaded encoders, each of which performs an encoding operation once.
[0039] The first feature vector is input into the decoding layer of the second detection model. The decoding layer performs multiple decoding operations, including deconvolution, on the first feature vector to extract the second feature map of the image to be detected. The decoding layer includes multiple cascaded decoders, each decoder is connected to the encoder of the corresponding level, and each decoder is used to perform a decoding operation based on the feature vector input to the decoder and the feature vector output by the encoder of the corresponding level.
[0040] In some embodiments, the method further includes:
[0041] Obtain alignment detection image;
[0042] Multiple cell feature regions are extracted based on the alignment detection image;
[0043] A calculation line segment is generated based on each of the cell feature regions, thereby obtaining multiple calculation line segments, and the coordinates of the two endpoints of each calculation line segment are determined, wherein the first endpoint of the calculation line segment is located in the cathode region of the cell, and the second endpoint is located in the anode region of the cell.
[0044] The alignment of the battery cell is calculated based on the maximum and minimum coordinate values of all the first endpoints on the coordinate axis parallel to the calculated line segment, and the maximum and minimum coordinate values of all the second endpoints on the coordinate axis parallel to the calculated line segment.
[0045] Secondly, embodiments of this application provide an electronic device, the electronic device comprising:
[0046] At least one processor; and,
[0047] A memory communicatively connected to the at least one processor; wherein,
[0048] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the cell detection method as described in the first aspect.
[0049] Thirdly, embodiments of this application provide a battery cell testing device, which includes a transmission device, an X-ray image acquisition device, and an electronic device as described in the first aspect. The transmission device is used to transmit the battery cell to the location of the X-ray image acquisition device, and the X-ray image acquisition device is used to acquire an image of the battery cell to be tested and send the image to be tested to the electronic device for processing. The image to be tested is an X-ray image.
[0050] This application provides a battery cell detection method, electronic device, and battery cell detection equipment. The method involves detecting an image to be detected based on multiple predefined anchor frames to obtain a first target region of the image; performing multiple convolution and deconvolution operations on the image to classify objects within it to obtain a second target region; and defining the union of the first and second target regions as the detected target region set. This method can accurately detect all foreign objects in the battery cell, thereby improving the comprehensiveness and accuracy of the detection and avoiding performance degradation and safety hazards caused by foreign objects. Attached Figure Description
[0051] Figure 1 This is a flowchart illustrating the first embodiment of the cell testing method provided in this application.
[0052] Figure 2 This is a schematic diagram of the structure of the first detection model provided in the embodiments of this application.
[0053] Figure 3 This is a schematic diagram of the structure of the second detection model provided in the embodiments of this application.
[0054] Figure 4 This is a flowchart illustrating the second embodiment of the cell testing method provided in this application.
[0055] Figure 5 This is a flowchart illustrating the third embodiment of the cell testing method provided in this application.
[0056] Figure 6 This is a flowchart illustrating the fourth embodiment of the cell testing method provided in this application.
[0057] Figure 7 This is a result diagram of the target area set of the battery cell provided in the embodiments of this application.
[0058] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0059] Figure 9 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of this application.
[0060] Figure 10 This is a schematic diagram of the battery cell testing equipment provided in the embodiments of this application. Detailed Implementation
[0061] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0062] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0063] This application provides a battery cell inspection method, electronic device, and battery cell inspection equipment. The method involves detecting an image to be inspected based on multiple predefined anchor frames to obtain a first target region of the image; then performing multiple convolution and deconvolution operations on the image to classify objects within it, resulting in a second target region. The union of the first and second target regions is defined as the detected target region set. This method can accurately detect all foreign objects within the battery cell, thereby improving the comprehensiveness and accuracy of the inspection and avoiding performance degradation and safety hazards caused by foreign objects.
[0064] The cell testing method provided in this application will be described in detail below with reference to the accompanying drawings.
[0065] Please see Figure 1 , Figure 1 This is a schematic flowchart of the first embodiment of the cell testing method provided in this application. Figure 1 As shown, the cell testing method includes steps S100 to S400.
[0066] Step S100: Obtain the image of the battery cell to be inspected.
[0067] In some implementations, the image to be inspected of the battery cell is an X-ray image obtained by scanning the battery cell using an X-ray image acquisition device.
[0068] Step S200: Detect the image to be detected based on multiple predefined anchor boxes to obtain the first target region of the image to be detected.
[0069] In some implementations, step S200 includes steps S210 to S280.
[0070] Step S210: Input the image to be detected into the pre-trained first detection model.
[0071] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of the first detection model provided in the embodiments of this application. Figure 2 As shown, in some embodiments, the first detection model 10 includes a feature extraction module 101, a feature fusion module 102, a prediction module 103, and a result output module 104. Figure 2 The direction of the arrow indicates the direction of information flow. The output of the feature extraction module 101 is the input of the feature fusion module 102, the output of the feature fusion module 102 is the input of the prediction module 103, and the output of the prediction module 103 is the input of the result output module 104.
[0072] In some implementations, the first detection model is a YOLO model, such as the YOLOv5 model. The YOLOv5 model maintains high accuracy while having a very fast detection speed, making it suitable for real-time target detection.
[0073] In some implementations, the first detection model further includes a data preprocessing module. The data preprocessing module is used to preprocess the input image to be detected.
[0074] In some implementations, the feature extraction module is used to extract features from the image to be detected, obtaining a third feature map. This third feature map consists of multiple images, each with a different scale (i.e., resolution).
[0075] Optionally, the feature extraction module is used to extract features from the preprocessed image to be detected output by the data preprocessing module to obtain a third feature map.
[0076] Optionally, the feature extraction module includes multiple cascaded sub-feature extraction modules.
[0077] In some implementations, the feature extraction module includes a CSPDarknet (Cross-Stage Partial Network Darknet) module, where Darknet refers to the original Darknet network architecture. In the CSPDarknet module, the feature map is divided into two parts: one part is directly downsampled, and the other part is concatenated with the downsampled feature map in a later stage. This approach reduces computational cost.
[0078] In some implementations, the feature fusion module is used to fuse the third feature map output by the feature extraction module to obtain a first feature map. The first feature map consists of multiple images with different scales.
[0079] Optionally, the feature fusion module includes multiple cascaded sub-feature fusion modules.
[0080] In some implementations, a PANet (Pyramid Attention Network) structure is used in the feature fusion module to fuse high-resolution feature maps with low-resolution feature maps. This approach can improve the detection capability for small targets.
[0081] In some implementations, the prediction module generates multiple anchor boxes on each first feature map output by the feature fusion module based on a predefined set of grid cells and aspect ratios, and outputs the anchor box generation results to the result output module.
[0082] In some implementations, the results output module is used to determine a first target region based on the anchor frame generation results of the prediction module.
[0083] In some implementations, steps S220 to S280 are all executed by the corresponding modules in the first detection model.
[0084] In some embodiments, before step S220, step S200 further includes: preprocessing the image to be detected to obtain a preprocessed image to be detected.
[0085] In some implementations, the image to be detected is input into a data preprocessing module, which preprocesses the image to be detected to obtain a preprocessed image to be detected.
[0086] Optionally, the image to be detected is scaled to a preset image size while maintaining the aspect ratio. The pixel values of all pixels are normalized to a range of 0 to 1. Then, the image to be detected after the above preprocessing is converted into a preset tensor format to obtain the preprocessed image to be detected. In this case, the image to be detected in subsequent steps refers to the preprocessed image to be detected.
[0087] In some implementations, a first detection model is built using the PyTorch framework, thus converting the image to be detected into a preset PyTorch tensor format. PyTorch is an open-source deep learning framework widely used in the field of deep learning. In PyTorch, a tensor is a class of multidimensional matrices that can store multidimensional data, such as scalars, vectors, matrices, or higher-dimensional arrays. That is, preset tensor formats include formats such as scalars, vectors, matrices, or higher-dimensional arrays.
[0088] In some implementations, after obtaining the preprocessed image to be detected, all computational processes can be transferred to the GPU for accelerated execution.
[0089] In some implementations, if the acquired image to be detected has already been preprocessed, it is not necessary to preprocess the image to be detected again.
[0090] Step S220: In the first detection model, a multi-layer convolutional neural network is used to extract the first feature map of the image to be detected.
[0091] In some implementations, the feature extraction module and the feature fusion module of the first detection model constitute a multi-layer convolutional neural network, and the first feature map of the image to be detected is extracted using the feature extraction module and the feature fusion module of the first detection model.
[0092] Optionally, a feature extraction module is used to extract features from the preprocessed image to be detected output by the data preprocessing module to obtain a third feature map. This third feature map consists of multiple images with different scales (i.e., resolutions).
[0093] Optionally, a feature fusion module is used to fuse the third feature map output by the feature extraction module to obtain a first feature map. The first feature map consists of multiple images with different scales.
[0094] Step S230: Generate multiple anchor boxes on the first feature map based on multiple predefined grid cells and aspect ratios, with the center point of the anchor box being the center point of the corresponding grid cell.
[0095] In some implementations, multiple first feature maps are input into the prediction module, which generates multiple anchor boxes on each first feature map output by the feature fusion module based on multiple predefined grid cells and aspect ratios, and outputs the anchor box generation results to the result output module.
[0096] Optionally, the anchor box generation results include the coordinates of the center point, width, height, corresponding object category, and confidence level of each anchor box.
[0097] In some implementations, the prediction module is used to perform steps S230 to S260.
[0098] In some implementations, for each scale of the first feature map, the first feature map of that scale is pre-divided into multiple grid cells, and multiple anchor frames are pre-defined in each grid cell. The center point of each anchor frame is the center point of the grid cell, and the aspect ratio, width, and height of the multiple anchor frames are different from each other. Therefore, each scale of the first feature map corresponds to a set of predefined multiple grid cells and anchor frames with different aspect ratios.
[0099] In some implementations, multiple anchor frames are generated on the first feature map by selecting a set of predefined mesh cells and the aspect ratio of the anchor frames based on the scale of the first feature map. Specifically, multiple anchor frames are generated on the first feature map according to the predefined mesh cells and the aspect ratio, width, and height of the multiple anchor frames corresponding to each mesh cell.
[0100] Step S240: For each anchor box, detect the target object region in the first feature map included by the anchor box.
[0101] Optionally, the target object is a foreign object in the battery cell, and the target object area is the display area of the foreign object in the battery cell.
[0102] In some implementations, the first feature map already includes the target object region identified through feature extraction. In step S240, a portion of the target object region included within the anchor frame is detected. In this case, the anchor frame may only include a portion of the target object region, and not the entire target object region.
[0103] Step S250: Adjust the position and size of the anchor frame based on the anchor frame and the corresponding target object area to obtain the adjusted anchor frame.
[0104] In some implementations, step S250 includes steps S251 to S252.
[0105] Step S251: Move the corresponding anchor frame according to the center point of the target object area so that the center point of the anchor frame coincides with the center point of the target object area.
[0106] Optionally, the anchor frame is rectangular, and the center point of the anchor frame is the geometric center point of the rectangle.
[0107] Optionally, a minimum true bounding box containing the target object region is generated based on the width and height of the target object region, and the center point of the target object region is the geometric center point of the true bounding box.
[0108] Step S252: Adjust the width and height of the anchor frame based on the width and height of the target object area to obtain the adjusted anchor frame.
[0109] In some implementations, a width scaling factor is calculated based on the width of the target object region and the width of the anchor frame, a height scaling factor is calculated based on the height of the target object region and the height of the anchor frame, and then the width of the anchor frame is adjusted based on the width scaling factor, and the height of the anchor frame is adjusted based on the height scaling factor.
[0110] In some implementations, the adjusted anchor frame is not larger than the original anchor frame; that is, the width of the adjusted anchor frame is not greater than the width of the original anchor frame, and the height of the adjusted anchor frame is not greater than the height of the original anchor frame.
[0111] Optionally, the formula for calculating the width of the adjusted anchor frame is: b w =a w e tw , where b w This indicates the adjusted width of the anchor frame, aw This indicates the width of the anchor frame before adjustment, e represents the base of the natural logarithm, and tw represents the width scaling factor.
[0112] Optionally, the formula for calculating the height of the adjusted anchor frame is: b h =a h e th , where b h Indicates the adjusted height of the anchor frame, a h This indicates the height of the anchor frame before adjustment, where e represents the base of the natural logarithm, and th represents the height scaling factor.
[0113] Step S260: Calculate the confidence level of the adjusted anchor frame based on the adjusted anchor frame and the corresponding target object region.
[0114] The target object area corresponding to the adjusted anchor frame is the target object area where the center point of the anchor frame is located.
[0115] In some implementations, step S260 includes steps S261 to S263.
[0116] Step S261: Calculate the probability of object existence in the adjusted anchor frame based on the width and height of the adjusted anchor frame and the width and height of the corresponding target object area.
[0117] In some implementations, a minimum ground truth bounding box containing the target object region is generated based on the width and height of the target object region. The similarity between the adjusted anchor box and the ground truth bounding box is calculated based on the width and height of the adjusted anchor box and the width and height of the corresponding ground truth bounding box of the target object region.
[0118] Optionally, the intersection-union ratio of the adjusted anchor box and the corresponding ground truth box is calculated and used as the similarity between the adjusted anchor box and the corresponding ground truth box.
[0119] Optionally, the intersection-union ratio (IUGR) of the adjusted anchor frame and the corresponding ground truth frame is the ratio of the area of the intersection region of the adjusted anchor frame and the corresponding ground truth frame to the area of the union region. As mentioned above, the anchor frame may only include part of the target object region, not all of it. Therefore, the IUGR of the adjusted anchor frame and the corresponding ground truth frame ranges from 0 to 1.
[0120] In some implementations, when the similarity between the adjusted anchor box and the corresponding ground truth box is greater than a similarity threshold, the object existence probability of the adjusted anchor box is set to 1; otherwise, the object existence probability of the adjusted anchor box is set to 0.
[0121] Optionally, the similarity threshold is 0.5.
[0122] In some implementations, the similarity between the adjusted anchor box and the corresponding ground truth box is determined as the probability of the object existing in the adjusted anchor box.
[0123] Step S262: Calculate the object category probability of the target object region.
[0124] Among them, the object category probability represents the probability that an object within the target object region belongs to a certain object category.
[0125] Optionally, the object categories include battery cells and foreign objects.
[0126] In some implementations, a convolutional neural network is used to calculate the object category probability of the target object region.
[0127] In some implementations, when the feature fusion module outputs the first feature map, it simultaneously identifies the target object region in the first feature map and calculates the object category probability of the target object region.
[0128] Step S263: Multiply the object existence probability and the object category probability to obtain the adjusted anchor box confidence level.
[0129] Optionally, the anchor box generation result includes the coordinates of the center point, width, height, corresponding object category, and confidence level of each adjusted anchor box. The object category corresponding to the anchor box is the object category of the target object region included within the anchor box.
[0130] In some implementations, the result output module determines the first target region based on the anchor frame generation result of the prediction module.
[0131] Step S270: For each group of overlapping anchor boxes, retain the anchor box with the highest confidence in the group of overlapping anchor boxes to obtain at least one detection box.
[0132] In some implementations, for each set of overlapping anchor boxes, the result output module retains the anchor box with the highest confidence among the overlapping anchor boxes to obtain at least one detection box.
[0133] In some implementations, an anchor frame is also a detection frame when it does not overlap with other anchor frames.
[0134] Step S280: Determine the first target region based on all detection boxes.
[0135] In some implementations, a result output module is used to determine the first target region based on all detection boxes.
[0136] Optionally, the first target region is the union of partial regions in the first feature map included by all detection boxes.
[0137] In some implementations, the object category, confidence level, center point coordinates, width, and height of each detection box are obtained simultaneously.
[0138] In some implementations, the first target area is the display area for tiny foreign objects within the battery cell. Because the gaskets on both sides of the battery cell are slightly thicker, the image to be detected will include two black border areas and a large white area in the center. By using a first detection model to determine the first target area, the display area for tiny foreign objects can be located using anchor frames based on different regions of the image to be detected, thereby accurately detecting tiny foreign objects within the battery cell.
[0139] Step S300: Perform multiple convolution and deconvolution operations on the image to be detected to classify the objects in the image and obtain the second target region of the image to be detected.
[0140] The objects in the image to be detected include battery cells and foreign objects.
[0141] In some implementations, step S300 includes steps S310 to S340.
[0142] Step S310: Input the image to be detected into the pre-trained second detection model.
[0143] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of the second detection model provided in the embodiments of this application. Figure 3 The direction of the middle arrow indicates the direction of information flow. For example... Figure 3 As shown, in some embodiments, the second detection model 20 includes an encoding layer 21, a decoding layer 22, and a result output layer 23.
[0144] In some implementations, the second detection model is a neural network model, such as a U-net model or an improved U-net model.
[0145] Step S320: In the second detection model, the image to be detected is subjected to multiple encoding operations including convolution and decoding operations including deconvolution, thereby extracting the second feature map of the image to be detected.
[0146] In some implementations, step S320 includes steps S321 to S322.
[0147] Step S321: Input the image to be detected into the encoding layer of the second detection model, and use the encoding layer to perform multiple encoding operations including convolution on the image to be detected to obtain the first feature vector.
[0148] like Figure 3As shown, in some embodiments, the encoding layer 21 includes multiple cascaded encoders, each encoder being used to perform an encoding operation once.
[0149] Preferably, the number of encoders is 4.
[0150] Defined in the coding layer, the encoder that acquires the image to be detected is the first cascaded encoder. For example... Figure 3 As shown, exemplarily, encoder 211 is the first cascaded encoder, encoder 212 is the second cascaded encoder, encoder 213 is the third cascaded encoder, and encoder 214 is the fourth cascaded encoder.
[0151] In some implementations, an encoder performs multiple convolution operations on the acquired image to be detected or the third feature vector output by the previous encoder to obtain a third feature vector. When this encoder is not the last encoder stage, the third feature vector is input into the next encoder stage.
[0152] like Figure 3 As shown, in some embodiments, the encoding layer 21 also includes an FPA (feature pyramid attention) module 215. The FPA module 215 is used to perform dilation convolution, global average pooling and upsampling operations on the third feature vector output by the last encoder in sequence to obtain a fourth feature vector. Then, the fourth feature vector is concatenated with the third feature vectors output by all encoders except the last encoder to obtain a first feature vector.
[0153] In other implementations, when the encoder is the last stage encoder, the third feature vector is directly output as the first feature vector.
[0154] Step S322: Input the first feature vector into the decoding layer of the second detection model, and use the decoding layer to perform multiple decoding operations, including deconvolution, on the first feature vector to extract the second feature map of the image to be detected.
[0155] The decoding layer includes multiple cascaded decoders, each decoder is connected to the encoder of the corresponding level, and each decoder is used to perform a decoding operation based on the feature vector input to the decoder and the feature vector output by the encoder of the corresponding level.
[0156] Defined in the decoding layer, the decoder that outputs the second feature vector is the first cascaded decoder. For example... Figure 3 As shown, for example, decoder 221 is the first cascaded decoder, decoder 222 is the second cascaded decoder, decoder 223 is the third cascaded decoder, and decoder 224 is the fourth cascaded decoder.
[0157] like Figure 3 As shown, optionally, when decoder 224 is the last level decoder of decoding layer 22, decoder 224 performs a decoding operation only once based on the first feature vector output by FPA module 215.
[0158] Optionally, the encoder at the corresponding level of the decoder may include multiple encoders. The encoder at the corresponding level of the decoder refers to the encoder whose concatenation order in the coding layer is no greater than the concatenation order of the decoder in the decoding layer.
[0159] like Figure 3 As shown, exemplarily, if decoder 223 is the third cascaded decoder in decoding layer 22, then the encoders of the corresponding level of decoder 223 include encoder 221, encoder 222, and encoder 223. Decoder 223 performs a decoding operation based on the feature vector input to decoder 223, and the feature vector output by encoders 221, 222, and 223.
[0160] In some implementations, a decoder performs multiple deconvolution operations on the acquired first feature vector to obtain a fifth feature vector. This fifth feature vector is then concatenated with the third feature vectors output by all corresponding encoder levels to obtain a sixth feature vector. When the decoder is not the last encoder level, this sixth feature vector is input to the next encoder level. When the decoder is the last encoder level, this sixth feature vector is output as a second feature map. It is understood that a vector can be represented as an image, and an image can also be represented as a vector.
[0161] Step S330: Perform a convolution operation on the second feature map to obtain the category vector.
[0162] The category vector represents the category of the object to which each pixel in the image to be detected belongs.
[0163] like Figure 3 As shown, in some embodiments, the result output layer 23 performs a convolution operation on the second feature map output by the first cascaded decoder 221 to obtain a category vector.
[0164] Step S340: Determine the second target region of the image to be detected based on the category vector.
[0165] In some implementations, the union of all pixels belonging to the object category of foreign objects is determined as the second target region.
[0166] In some implementations, the second target area is the display area for larger foreign objects in the battery cell. By using a second detection model to determine the second target area, the display area for larger foreign objects can be located and segmented, thereby accurately detecting larger foreign objects in the battery cell.
[0167] Step S400: Determine the union of the first target region and the second target region as the detected target region set.
[0168] Please see Figure 4 , Figure 4 This is a schematic flowchart of the second embodiment of the cell testing method provided in this application. Figure 4 As shown, the cell testing method also includes step S500.
[0169] Step S500: Perform edge detection on the image to be detected to obtain the third target region of the image to be detected.
[0170] In some implementations, step S500 includes steps S510 to S520.
[0171] Step S510: Calculate multiple gradient values for each pixel in the image to be detected.
[0172] In some implementations, the image to be detected is first subjected to Gaussian blur, and then a convolution operation is performed on the image to be detected after Gaussian blur to obtain the gradient values of each pixel in the horizontal and vertical directions.
[0173] Optionally, the Sobel convolution kernel is used to perform convolution operations on the image to be detected during the convolution operation.
[0174] Step S520: Based on multiple gradient values of each pixel in the image to be detected, perform edge detection on the image to be detected to obtain the third target region of the image to be detected.
[0175] In some implementations, edge detection is performed on the image to be detected based on a preset gradient threshold and multiple gradient values of each pixel in the image to be detected, to obtain a third target region of the image to be detected. Specifically, when multiple gradient values of a pixel are all less than the gradient threshold, the pixel is determined as a non-edge pixel; when multiple gradient values of a pixel are not all less than the gradient threshold, the pixel is determined as an edge pixel. Finally, the region boundary of the third target region can be determined based on all edge pixels, thereby determining the third target region.
[0176] In some implementations, the third target region is the display area of foreign objects in the battery cell that are difficult to detect on the surface and edges. By performing edge detection on the image to be detected based on a preset gradient threshold and multiple gradient values of each pixel in the image to be detected, non-edge pixels can be filtered out, thereby accurately detecting foreign objects in the battery cell that are difficult to detect on the surface and edges.
[0177] In some embodiments, when the cell detection method further includes step S500, step S400 includes: determining the union of the first target region, the second target region, and the third target region as the target region set.
[0178] By defining the target area set as the union of the first, second, and third target areas, all foreign objects in the battery cell can be detected more accurately. This improves the comprehensiveness and accuracy of the detection, and avoids problems such as performance degradation and safety hazards caused by foreign objects.
[0179] Please see Figure 5 , Figure 5 This is a schematic flowchart of the third embodiment of the cell testing method provided in this application. Figure 5 As shown, in some embodiments, the cell testing method further includes step S600.
[0180] Step S600: Perform alignment detection on the battery cell to obtain the alignment of the battery cell.
[0181] In some implementations, the battery cell is a cuboid.
[0182] like Figure 5 As shown, in some embodiments, before step S100, step S600 is performed to detect the alignment of the first pair of adjacent corner points of the battery cell, thereby obtaining the first alignment of the battery cell. After step S400 or step S500, step S600 is performed to detect the alignment of the second pair of adjacent corner points of the battery cell, thereby obtaining the second alignment of the battery cell.
[0183] In some implementations, step S600 includes steps S610 to S640.
[0184] Step S610: Obtain the alignment detection image.
[0185] In some implementations, prior to step S100, an alignment detection image of the first pair of adjacent corner points of the battery cell is acquired.
[0186] In some implementations, after step S400 or step S500, an alignment detection image of the second pair of adjacent corner points of the battery cell is acquired. The two corner points included in the second pair of adjacent corner points are not identical to the two corner points included in the first pair of adjacent corner points.
[0187] Step S620: Extract multiple cell feature regions based on the alignment detection image.
[0188] In some implementations, the alignment detection image is preprocessed first. Optionally, the alignment detection image is filtered to reduce image noise, and histogram equalization and contrast adjustment are performed to enhance the image. Then, an image segmentation algorithm is used to detect edge features in the alignment detection image, and the cell feature region is separated from the non-cell feature region based on the edge features, retaining the cell feature region.
[0189] Optionally, the filter includes Gaussian filters and median filters, etc.
[0190] Optionally, image segmentation algorithms include Canny segmentation algorithm and Soble segmentation algorithm, etc.
[0191] Step S630: Generate a calculation line segment based on each cell feature region to obtain multiple calculation line segments, and determine the coordinates of the two endpoints of each calculation line segment.
[0192] The first endpoint of the calculation line segment is located in the cathode region of the battery cell, and the second endpoint is located in the anode region of the battery cell.
[0193] In some implementations, the cell feature area is rectangular or approximately rectangular, and a calculation line segment is fitted based on the two long sides of the cell feature area.
[0194] Step S640: Calculate the alignment of the battery cell based on the maximum and minimum coordinate values of all first endpoints on the coordinate axis parallel to the calculation line segment, and the maximum and minimum coordinate values of all second endpoints on the coordinate axis parallel to the calculation line segment.
[0195] In some implementations, the maximum and minimum coordinate values of the first endpoint on a coordinate axis parallel to the calculation line segment are subtracted to obtain the cathode region alignment corresponding to a pair of adjacent corner points.
[0196] In some implementations, the maximum and minimum coordinate values of the second endpoint on a coordinate axis parallel to the calculated line segment are subtracted to obtain the alignment of the anode regions corresponding to a pair of adjacent corner points.
[0197] In some embodiments, the first alignment includes a first cathode region alignment and a first anode region alignment. The second alignment includes a second cathode region alignment and a second anode region alignment.
[0198] Please see Figure 6 , Figure 6 This is a flowchart illustrating the fourth embodiment of the cell testing method provided in this application. Figure 6 As shown, in some embodiments, the cell testing method further includes step S700.
[0199] Step S700: Output the comprehensive test results of the battery cell based on the alignment of the battery cell, the target area set, and the preset judgment conditions.
[0200] In some implementations, when the value of any alignment degree of the battery cell is not greater than a preset alignment degree threshold and the target area set is empty, the overall test result of the battery cell is determined to be qualified.
[0201] In some implementations, when any alignment value of the battery cell is greater than a preset alignment threshold, or when the target area set is not empty, the overall test result of the battery cell is determined to be unqualified.
[0202] In some implementations, when the number of target regions in the target region set is less than the judgment quantity threshold, the steps in the above method are repeated to re-inspect the battery cell.
[0203] In some implementations, when the number of target areas in the overall test result output after retesting the battery cell is still less than the judgment number threshold, the overall test result of the battery cell is determined to be unqualified.
[0204] Please see Figure 7 , Figure 7 This is a result diagram of the target region set of the battery cell provided in the embodiments of this application. For example... Figure 7 As shown, in some implementations, in the target region set result diagram P, when the target region set is not empty, the target regions in the target region set are counted and numbered, and a display box A containing each target region is generated and displayed.
[0205] Optionally, the target area number can also be displayed next to display box A.
[0206] In summary, the cell testing method provided in this application has the following advantages:
[0207] 1. By detecting the image to be detected based on multiple predefined anchor boxes, the first target region of the image to be detected is obtained; multiple convolution and deconvolution operations are performed on the image to be detected to classify the objects in the image to be detected, resulting in the second target region of the image to be detected. The union of the first target region and the second target region is determined as the set of detected target regions. This method can accurately detect all foreign objects in the battery cell, thereby improving the comprehensiveness and accuracy of the detection and avoiding problems such as performance degradation and safety hazards caused by foreign objects.
[0208] 2. By using the first detection model to determine the first target area, the display area of small foreign objects can be located by anchor frame according to the area of different images to be detected, thereby accurately detecting small foreign objects in the battery cell.
[0209] 3. By using a second detection model to determine the second target area, the display area of larger foreign objects can be located and segmented, thereby accurately detecting larger foreign objects in the battery cell.
[0210] 4. By using a preset gradient threshold and multiple gradient values of each pixel in the image to be detected to perform edge detection, non-edge pixels can be filtered out, thereby accurately detecting the surface and foreign objects in the battery cell that are difficult to detect at the edges.
[0211] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 8 As shown, the electronic device 400 includes: one or more processors 410 and a memory 420. Figure 8 Take a processor 410 as an example.
[0212] In some implementations, the processor 410 and the memory 420 may be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.
[0213] In some implementations, the processor 410 is configured to acquire an image of a battery cell to be detected; detect the image based on multiple predefined anchor frames to obtain a first target region of the image to be detected; perform multiple convolution and deconvolution operations on the image to be detected to classify objects in the image to be detected to obtain a second target region of the image to be detected, wherein the objects in the image to be detected include battery cells and foreign objects; and determine the union of the first target region and the second target region as the set of detected target regions.
[0214] In some embodiments, memory 420 serves as a non-volatile computer-readable storage medium, used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules of the cell detection method in the embodiments of this application. Processor 410 executes various functional applications and data processing of electronic device 400 by running the non-volatile software programs, instructions, and modules stored in memory 420, thereby implementing the cell detection method of the above-described method embodiments.
[0215] In some embodiments, memory 420 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of electronic device 400, etc. Furthermore, memory 420 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 420 may optionally include memory remotely located relative to processor 410, and this remote memory may be connected to the controller via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0216] In some implementations, one or more modules are stored in memory 420 and, when executed by one or more processors 410, perform the cell detection method in any of the above method embodiments, for example, the method described above. Figure 1 Method steps S100 to S400.
[0217] Please refer to Figure 9 , Figure 9 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable storage medium 500 stores program code 510, which can be called by a processor to execute the cell detection method described in the above method embodiments.
[0218] The computer-readable storage medium 500 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium includes a non-transitory computer-readable storage medium. The computer-readable storage medium 500 has storage space for program code that performs any of the method steps of the above-described cell detection method. This program code can be read from or written to one or more computer program products. The program code may, for example, be compressed in a suitable form.
[0219] In some embodiments, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described cell detection method.
[0220] This application also provides a battery cell testing device, which includes a conveying device, an X-ray image acquisition device, and the electronic equipment described above. The conveying device is used to convey the battery cell to the location of the X-ray image acquisition device, and the X-ray image acquisition device is used to acquire an image of the battery cell to be tested and send the image to be tested to the electronic equipment for processing. The image to be tested is an X-ray image.
[0221] Please see Figure 10 , Figure 10 This is a schematic diagram of the battery cell testing equipment provided in an embodiment of this application. Figure 10 As shown, in some embodiments, the conveying device of the cell inspection equipment 3 includes an inspection conveyor belt 31 and a re-inspection conveyor belt 39. The inspection conveyor belt 31 is used to convey cells undergoing initial inspection to the location of the X-ray image acquisition device, and the re-inspection conveyor belt 39 is used to convey cells requiring re-inspection to the location of the X-ray image acquisition device. The X-ray image acquisition device of the cell inspection equipment 3 includes a first X-ray image acquisition device 35 and a second X-ray image acquisition device 36. The first X-ray image acquisition device 35 is used to acquire an image of the cell to be inspected. The second X-ray image acquisition device 36 is used to acquire an alignment detection image of the cell. The electronic device 400 is used to perform the cell inspection method described above.
[0222] In some embodiments, the first X-ray image acquisition device 35 includes two sets of X-ray image acquisition components.
[0223] In some embodiments, the second X-ray image acquisition device 36 includes eight sets of X-ray image acquisition components.
[0224] like Figure 10 As shown, in some embodiments, the battery cell testing equipment 3 further includes a retesting robot 32, a manual processing station 33, a barcode scanning device 34, an NG conveyor belt 37, an NG robot 38, a first unloading robot 41, and a second unloading robot 42. The retesting robot 32 is used to remove the battery cells that need to be retested and place them on the retesting conveyor belt 39. The manual processing station 33 is used to manually remove the unqualified battery cells at the manual processing station 33. The barcode scanning device 34 is used to scan the unique identifier of the battery cell.
[0225] In manufacturing, "NG" is used to indicate "Not Good" or "Defective Product". In some embodiments, the NG robot 38 is used to remove the defective battery cells and place them on the NG conveyor belt 37. The first unloading robot 41 and the second unloading robot 42 are both used to remove the acceptable battery cells.
[0226] Optionally, the first unloading robot 41 can remove two battery cells at a time.
[0227] Optionally, the second unloading robot 42 can remove 4 battery cells at a time.
[0228] In summary, this application provides a battery cell inspection method, electronic device, and battery cell inspection apparatus. The battery cell inspection method includes: acquiring an image of the battery cell to be inspected; inspecting the image based on multiple predefined anchor frames to obtain a first target region of the image; performing multiple convolution and deconvolution operations on the image to classify objects in the image to obtain a second target region of the image, wherein the objects in the image include battery cells and foreign objects; and determining the union of the first and second target regions as the detected target region set. This application, by inspecting the image based on multiple predefined anchor frames to obtain a first target region, performing multiple convolution and deconvolution operations on the image to classify objects in the image to obtain a second target region, and determining the union of the first and second target regions as the detected target region set, can accurately detect all foreign objects in the battery cell, thereby improving the comprehensiveness and accuracy of the inspection and avoiding problems such as battery cell performance degradation and safety hazards caused by foreign objects.
[0229] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method of detecting a battery cell, the method comprising: The method comprises the following steps: acquiring a to-be-detected image of a battery cell; detecting the to-be-detected image based on a plurality of predefined anchor boxes to obtain a first target region of the to-be-detected image; performing a plurality of convolution operations and deconvolution operations on the to-be-detected image to classify objects in the to-be-detected image, wherein the objects in the to-be-detected image include battery cells and foreign matters, and obtain a second target region of the to-be-detected image; calculating a plurality of gradient values of each pixel point in the to-be-detected image; performing edge detection on the to-be-detected image based on the plurality of gradient values of each pixel point in the to-be-detected image to obtain a third target region of the to-be-detected image; determining a union of the first target region, the second target region and the third target region as a target region set, wherein the first target region is a display region of a foreign matter smaller than a threshold in the battery cell, the second target region is a display region of a foreign matter larger than the threshold in the battery cell, and the third target region is a display region of a surface of the battery cell and a foreign matter difficult to be detected by an edge; performing alignment detection on the battery cell to obtain an alignment degree of the battery cell; outputting a comprehensive detection result of the battery cell based on the alignment degree of the battery cell, the target region set and a preset judgment condition; when a value of any alignment degree of the battery cell is not greater than a preset alignment threshold and the target region set is empty, determining that the comprehensive detection result of the battery cell is qualified; when a value of any alignment degree of the battery cell is greater than the preset alignment threshold or the target region set is not empty, determining that the comprehensive detection result of the battery cell is unqualified; and when a number of target regions in the target region set is less than a judgment number threshold, re-detecting the battery cell.
2. The method of claim 1, wherein, The method comprises the following steps: inputting the to-be-detected image into a first detection model pre-trained; extracting a first feature map of the to-be-detected image by using a multi-layer convolutional neural network in the first detection model; generating a plurality of anchor boxes on the first feature map based on a plurality of grid units and aspect ratios, wherein a center point of each anchor box is a center point of a corresponding grid unit; detecting a target object region in a part of the first feature map included in each anchor box; adjusting a position and a size of the anchor box based on the anchor box and the corresponding target object region to obtain an adjusted anchor box; calculating a confidence degree of the adjusted anchor box based on the adjusted anchor box and the corresponding target object region; for each group of overlapping anchor boxes, retaining an anchor box with the highest confidence degree in the group of overlapping anchor boxes to obtain at least one detection box; and determining the first target region based on all the detection boxes.
3. The method of claim 2, wherein, The method comprises the following steps: moving the corresponding anchor box according to a center point of the target object region to make the center point of the anchor box coincide with the center point of the target object region; and adjusting a width and a height of the anchor box based on a width and a height of the target object region to obtain the adjusted anchor box.
4. The method of claim 2, wherein, The confidence of the adjusted anchor frame is calculated based on the adjusted anchor frame and the corresponding target object region, including: An object existence probability of the adjusted anchor frame is calculated based on the width and height of the adjusted anchor frame and the width and height of the corresponding target object region; An object category probability of the target object region is calculated; The object existence probability and the object category probability are multiplied to obtain the confidence of the adjusted anchor frame.
5. The method of claim 1, wherein, The object in the to-be-detected image is classified by performing multiple convolution operations and deconvolution operations on the to-be-detected image to obtain a second target region of the to-be-detected image, including: The to-be-detected image is input into a second detection model pre-trained; In the second detection model, multiple encoding operations including convolution operations and multiple decoding operations including deconvolution operations are performed on the to-be-detected image, so as to extract a second feature map of the to-be-detected image; A class vector is obtained by performing convolution operation on the second feature map, and the class vector is used to represent the category of the object to which each pixel point in the to-be-detected image belongs; A second target region of the to-be-detected image is determined based on the class vector.
6. The method of claim 5, wherein, The object in the to-be-detected image is classified by performing multiple convolution operations and deconvolution operations on the to-be-detected image to obtain a second target region of the to-be-detected image, including: The to-be-detected image is input into an encoding layer of the second detection model, and the to-be-detected image is encoded by the encoding layer multiple times to obtain a first feature vector, wherein the encoding layer includes multiple cascaded encoders, and each encoder is used to perform an encoding operation once. The first feature vector is input into a decoding layer of the second detection model, and the first feature vector is decoded by the decoding layer multiple times to extract a second feature map of the to-be-detected image, wherein the decoding layer includes multiple cascaded decoders, each decoder is connected with a corresponding encoder, and each decoder is used to perform a decoding operation based on the feature vector input into the decoder and the feature vector output from the corresponding encoder.
7. The method of claim 1, wherein, The alignment degree of the battery cell is detected to obtain the alignment degree of the battery cell, including: An alignment degree detection image is obtained; Multiple battery cell feature regions are extracted based on the alignment degree detection image; A calculation line segment is generated based on each battery cell feature region, so as to obtain multiple calculation line segments, and the coordinates of two end points of each calculation line segment are determined, wherein the first end point of the calculation line segment is located in the cathode region of the battery cell, and the second end point is located in the anode region of the battery cell; The alignment degree of the battery cell is calculated based on the maximum and minimum coordinate values of all the first end points on the coordinate axis parallel to the calculation line segment, and the maximum and minimum coordinate values of all the second end points on the coordinate axis parallel to the calculation line segment.
8. An electronic device, comprising: The electronic device includes: at least one processor; and a memory connected with the at least one processor in communication; wherein The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method for detecting the battery cell according to any one of claims 1 to 7.
9. An electric cell inspection apparatus characterized by comprising: The battery cell detection device comprises a conveying device, an X-ray image acquisition device and the electronic device according to claim 8, the conveying device is used to convey the battery cell to a position of the X-ray image acquisition device, the X-ray image acquisition device is used to acquire a to-be-detected image of the battery cell and send the to-be-detected image to the electronic device for processing, and the to-be-detected image is an X-ray image.
Citation Information
Patent Citations
Industrial CT defect detection method based on deep learning
CN111179229A
Battery detection method, controller and computer readable storage medium
CN115564719A
Intelligent detection method and device for battery cell
CN117147574A
Battery CT image pole piece alignment degree intelligent identification method based on network learning
CN117372812A