Image detection model, training method thereof, battery detection method and equipment

By combining the image detection model of the backbone network and the upsampling network, the problem of low accuracy of small and medium-sized battery detection is solved, and accurate detection of the end of the battery pole is achieved, reducing the risk of missed detection and improving the overall battery detection Effect.

CN119251128APending Publication Date: 2025-01-03CONTEMPORARY AMPEREX TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310797826.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The prior art has low accuracy in detecting small targets (such as cathode and anode sheets) in battery detection and is prone to missed detection. Especially when the target is dense, it leads to distortion of the battery defect detection results and poor accuracy.

Method used

An image detection model is adopted, which combines the backbone network and the upsampling network. Through the first detection layer and the second detection layer, the high-resolution features of the shallow network and the deep semantic features of the upsampling network are input to image detection. The model is used to improve the detection effect of small targets and constrain the detection box through the preset detection box size to avoid missed detection.

Benefits of technology

It significantly improves the detection accuracy and battery detection effect of the end of the battery pole plate, reduces the risk of missed detection, improves the integrity and comprehensiveness of battery detection, and ensures the safety and reliability of the battery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251128A_ABST
    Figure CN119251128A_ABST
Patent Text Reader

Abstract

The invention provides an image detection model and a training method thereof, and a battery detection method and equipment, and belongs to the technical field of batteries, the image detection model comprises a backbone network, an up-sampling network and a first detection layer, the input of the up-sampling network comprises the output of the backbone network, the backbone network is configured to perform down-sampling on an input detection image, and the first detection layer is configured to perform down-sampling on the input detection image; the up-sampling network is configured to perform up-sampling on a feature map output by the backbone network, and the input of the first detection layer comprises a first feature map output by the network shallow layer and a second feature map output by the up-sampling network; the first detection layer is configured to acquire a first image detection result of the detection image based on the input first feature map and the second feature map. As the image detection model is provided with the first detection layer, the first detection layer is used for identifying and detecting a small detected target, the accuracy of small target detection is improved, and the battery detection effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of battery technology, and in particular to an image detection model and a training method thereof, and a battery detection method and device. Background Art

[0002] Energy conservation and emission reduction are the key to the sustainable development of the automobile industry. Electric vehicles have become an important part of the sustainable development of the automobile industry due to their advantages in energy conservation and environmental protection. For electric vehicles, battery technology is an important factor in their development.

[0003] The safety and reliability of batteries are of vital importance, and more stringent and accurate control of possible defects is required during the battery production process. Summary of the invention

[0004] The present application aims to solve at least one of the technical problems in the background technology. To this end, one purpose of the present application is to provide an image detection model and its training method, a battery detection method, a training device, an electronic device, a battery production device, a storage medium and a program product to improve the accuracy and reliability of battery defect detection.

[0005] An embodiment of the first aspect of the present application provides an image detection model, including a backbone network, an upsampling network and a first detection layer, the input of the upsampling network includes the output of the backbone network, the backbone network is configured to downsample the input detection image, the upsampling network is configured to upsample the feature map output by the backbone network, the backbone network includes a shallow layer of the network close to the input end of the image detection model, the input of the first detection layer includes a first feature map output by the shallow layer of the network and a second feature map output by the upsampling network, and the first detection layer is configured to obtain a first image detection result of the detection image based on the input first feature map and second feature map.

[0006] In the technical solution of the embodiment of the present application, since the input of the first detection layer of the image detection model includes the first feature map output by the shallow layer of the network and the second feature map output by the upsampling network, the image detection model takes into account the high-resolution features of the shallow layer of the network and the deep semantic features of the upsampling network, and effectively integrates and utilizes information of different scales, thereby improving the detection effect for small targets.

[0007] In some embodiments, the first image detection result includes a first detection frame surrounding a first preset target in the detection image, and the first detection layer is configured to obtain the first image detection result of the detection image based on the preset detection frame size, the first feature map and the second feature map, wherein the size of the first detection frame is consistent with the preset detection frame size. Thus, by constraining the detection frame output by the model to a fixed size, it is possible to avoid the problem of missed detection caused by the predicted detection frame being filtered out due to the non-maximum suppression operation of post-processing, thereby achieving detection of targets of a specific size. In particular, when similar small targets appear densely, the problem of missed detection of small targets can be avoided by constraining the size of the predicted detection frame.

[0008] In some embodiments, the first feature map and the second feature map have the same scale, and can be directly fused based on the first feature map and the second feature map of the same scale, thereby improving the detection efficiency of the image detection model.

[0009] In some embodiments, the backbone network includes a plurality of first network layers connected in sequence, the plurality of first network layers include a shallow network layer and an intermediate network layer located at an intermediate connection position, and the shallow network layer is located on a side of the intermediate network layer close to the input end of the image detection model. By setting the shallow network layer as the network layer close to the input end, high-resolution features of the image can be obtained, which is beneficial for the detection of small targets.

[0010] In some embodiments, a second detection layer is also included, the upsampling network includes multiple second network layers, the backbone network includes a deep network layer far away from the input end of the image detection model, the input of the second detection layer includes a third feature map output by the deep network layer and a fourth feature map output by one of the second network layers, and the second detection layer is configured to obtain a second image detection result of the detection image based on the third feature map and the fourth feature map, wherein the second image detection result includes a second detection frame surrounding a second preset target in the detection image, and the size of the second preset target is greater than the size of the first preset target in the detection image. Since the input of the second detection layer includes the third feature map output by the deep network layer and the fourth feature map output by one of the second network layers, the second image detection result of the detection image is obtained through the second detection layer, so that the image detection model can have a good detection effect on large targets, thereby enabling the image detection model to have a good detection effect on both large and small targets, thereby improving the integrity and comprehensiveness of target detection.

[0011] In some embodiments, the backbone network includes a plurality of first network layers connected in sequence, the plurality of first network layers include a network deep layer and an intermediate network layer located at an intermediate connection position, and the network deep layer is located on a side of the intermediate network layer away from the input end of the image detection model. By setting the network deep layer to be a network layer away from the input side, the deep semantic features of the image can be obtained, which is beneficial for the detection of large targets.

[0012] An embodiment of the second aspect of the present application provides a training method for an image detection model of any of the above items, including: obtaining a sample battery detection image; marking a real bounding box surrounding the end of the pole piece in the sample battery detection image; inputting the sample battery detection image into the image detection model, and obtaining a predicted bounding box surrounding the end of the pole piece output by the image detection model; calculating a loss value based on the real bounding box and the predicted bounding box; and adjusting the parameters of the image detection model based on the loss value.

[0013] In the technical solution of the embodiment of the present application, the parameters of the image detection model are adjusted based on the loss value between the real bounding box and the predicted bounding box, so that the predicted bounding box is close to the real bounding box, so that the image detection model can fully learn the features of the pole piece end and realize the detection of the pole piece end.

[0014] In some embodiments, obtaining a detection image of a sample battery includes: obtaining a three-dimensional image of the sample battery under radiation; and slicing the three-dimensional image to obtain a two-dimensional detection image of the sample battery. Thus, the image detection model can learn the features of the pole piece end of any cross section, and improve the generalization of the image detection model for pole piece end detection.

[0015] In some embodiments, slicing a three-dimensional image to obtain a two-dimensional sample battery detection image includes: slicing the three-dimensional image to obtain a two-dimensional image; and preprocessing the two-dimensional image to obtain the sample battery detection image, the preprocessing including denoising and contrast enhancement. By preprocessing the two-dimensional image, the clarity and accuracy of the sample battery detection image are improved, thereby improving the training effect of the image detection model on the battery.

[0016] An embodiment of the third aspect of the present application provides a battery detection method based on any of the above-mentioned image detection models, including: obtaining a battery detection image; inputting the battery detection image into the image detection model, and obtaining a first image detection result of the battery output by the image detection model; and detecting the battery based on the first image detection result.

[0017] In the technical solution of the embodiment of the present application, since the input of the first detection layer of the image detection model includes the first feature map output by the shallow layer of the network and the second feature map output by the upsampling network, the image detection model takes into account the high-resolution features of the shallow layer of the network and the deep semantic features of the upsampling network, and effectively integrates and utilizes information of different scales, thereby improving the detection effect of smaller features of the battery, reducing the risk of missed detection, and thus improving the detection effect of the battery.

[0018] In some embodiments, the first detection layer of the image detection model is configured to obtain a first image detection result of a battery detection image based on a preset detection frame size, a first feature map, and a second feature map, wherein the first image detection result includes a first detection frame surrounding the end of a pole piece in the battery detection image, wherein the size of the first detection frame is consistent with the preset detection frame size, and the preset detection frame size is based on the size of the end of the battery pole piece. Since the preset detection frame size is based on the size of the end of the battery pole piece, the size of the first detection frame is consistent with the preset detection frame size, which is conducive to improving the recognition accuracy of the image detection model for the end of the battery pole piece, reducing the risk of missed detection, and improving the detection effect of the image detection model.

[0019] In some embodiments, the pole piece includes a cathode piece and an anode piece, and the detection of the battery based on the first image detection result includes: determining a target detection frame including the pole piece based on two first detection frames respectively surrounding the two ends of the same pole piece of the battery; and determining the target misalignment amount of the cathode piece and the anode piece based on the target detection frame surrounding the cathode piece and the target detection frame surrounding the anode piece, wherein the target misalignment amount is based on the misalignment amount of the cathode piece and the anode piece along the width direction and / or the length direction of the cathode piece. The target detection frame surrounding the pole piece is determined by the first detection frame surrounding the pole piece end, thereby determining the target misalignment amount of the cathode piece and the anode piece, and realizing the detection of the misalignment amount of the battery pole piece. By improving the recognition accuracy of the pole piece end, the target detection frame surrounding the pole piece is determined by the pole piece end, and the detection effect of the misalignment amount of the battery pole piece can be improved.

[0020] In some embodiments, the battery detection method includes: preprocessing the acquired battery detection image, the preprocessing includes at least one of denoising and contrast enhancement, and inputting the preprocessed battery detection image into an image detection model. By preprocessing the acquired battery detection image, the interference of background noise in the battery detection image on target recognition can be reduced, thereby improving the detection effect of the battery detection image.

[0021] In some embodiments, contrast enhancement includes at least one of random flipping, scale transformation, image translation, and noise addition. By contrast enhancing the acquired battery detection image, the clarity of the battery detection image is improved, which is conducive to better detection of the battery detection image and improves the detection effect.

[0022] In some embodiments, the battery testing method includes: in response to the battery test result being unqualified, the battery is rejected or retested. By rejecting or retesting batteries with unqualified test results (such as the amount of pole piece misalignment), the safety and reliability of the battery are improved.

[0023] An embodiment of the fourth aspect of the present application provides a training device for an image detection model, the training device comprising: an acquisition unit for acquiring a sample battery detection image; a marking unit for marking a real bounding box surrounding the end of the pole piece in the sample battery detection image; a calculation unit for acquiring a predicted bounding box surrounding the end of the pole piece output by the image detection model based on the image detection model, and calculating a loss value based on the real bounding box and the predicted bounding box; and an adjustment unit for adjusting the parameters of the image detection model based on the loss value.

[0024] In the technical solution of the embodiment of the present application, the parameters of the image detection model are adjusted based on the loss value between the real bounding box and the predicted bounding box by the computing unit of the training device, so that the predicted bounding box is close to the real bounding box. The image detection model can fully learn the features of the pole piece end and realize the detection of the pole piece end.

[0025] An embodiment of the fifth aspect of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of the above methods.

[0026] An embodiment of the sixth aspect of the present application provides a battery production device, including the above-mentioned electronic device.

[0027] The embodiment of the seventh aspect of the present application provides a computer-readable storage medium storing a computer program, which implements any of the above methods when executed by a processor.

[0028] An embodiment of the eighth aspect of the present application provides a computer program product, including a computer program, which implements any of the above methods when executed by a processor.

[0029] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.

[0031] Figure 1 A schematic diagram of the structure of a vehicle according to some embodiments of the present application;

[0032] Figure 2 A schematic diagram of the exploded structure of a battery according to some embodiments of the present application;

[0033] Figure 3 The structure of the image detection model in some embodiments of the present application is shown as follows: Figure 1 ;

[0034] Figure 4 The structure of the image detection model in some embodiments of the present application is shown as follows: Figure 2 ;

[0035] Figure 5 Process of training the image detection model of some embodiments of the present application Figure 1 ;

[0036] Figure 6 Process of training the image detection model of some embodiments of the present application Figure 2 ;

[0037] Figure 7 A flow chart of a battery detection method based on an image detection model according to some embodiments of the present application;

[0038] Figure 8 A block diagram of a training device for an image detection model according to some embodiments of the present application;

[0039] Fig. 9 This is a comparison diagram of the effects of image detection models in some embodiments of the present application.

[0040] Description of reference numerals:

[0041] 1000. Vehicles;

[0042] 100, battery; 200, controller; 300, motor; 400, image detection model; 410, backbone network; 410, 411, shallow network layer; 420, upsampling network; 430, first detection layer; 500, training device; 510, acquisition unit; 520, marking unit; 530, calculation unit; 540, adjustment unit;

[0043] 10. Box body; 11. First part; 12. Second part; 20. Battery cell. DETAILED DESCRIPTION

[0044] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.

[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0046] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0047] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0048] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0049] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).

[0050] In the description of the embodiments of the present application, the technical terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the embodiments of the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the embodiments of the present application.

[0051] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.

[0052] At present, from the perspective of market development, the application of power batteries is becoming more and more extensive. Power batteries are not only used in energy storage power systems such as hydropower, thermal power, wind power and solar power stations, but also widely used in electric vehicles such as electric bicycles, electric motorcycles, electric cars, as well as military equipment and aerospace and other fields. With the continuous expansion of the application field of power batteries, the market demand is also constantly expanding.

[0053] As major automobile manufacturers and user groups pay more and more attention to the safety of electric vehicles, battery manufacturers are improving battery production efficiency while also carrying out stricter and more comprehensive control over defective batteries that may be produced during the manufacturing process to reduce the risk of defective batteries entering the market. For example, during the battery production process, it is necessary to conduct defect detection on the anode and cathode misalignment areas of the battery cell. The anode and cathode misalignment areas refer to the part of the anode that is longer and wider than the cathode. The amount of misalignment is closely related to the overall performance of the battery. If the amount of misalignment is too small, it will cause safety hazards to lithium-ion batteries, and in severe cases, it will lead to major safety accidents such as battery short circuits and explosions.

[0054] Defect detection can be performed on battery inspection images through image processing technology or deep learning detection methods. Among them, the detection method based on deep learning has become the mainstream detection algorithm due to its wide application range and strong robustness. It further calculates the amount of misalignment by identifying and locating the anode and cathode poles. However, in the battery inspection image, the width of the anode and cathode poles is usually only a few pixels on the inspection image. The related technical image detection model can obtain good detection results for large / medium-sized targets, but the detection effect is not good for small targets. The difficulty of small target detection lies in the fact that the target is very small, its features are relatively shallow (such as brightness / edge information, etc.), and there is less semantic information; in addition, the size between the small target and the background is unbalanced. If a smaller receptive field is used to focus on its features, it is difficult to extract global semantic information. If a larger receptive field is used to focus on background information, the features of the small target will lose information.

[0055] Taking the misalignment detection of anode and cathode plates as an example, the image recognition of related technologies has the problem of low accuracy in plate detection. For example, in the CT image of a stacked battery, the ends of the anode and cathode plates are usually only 4 to 9 pixels wide on the detection image. There is little visual information, and it is difficult to extract discriminative features. It is also easily affected by the image background, which makes it difficult for the detection model to accurately locate and identify small targets.

[0056] Based on the above problems, the present application proposes an image detection model and its training method, and a battery detection method based on the image detection model, wherein the input of the first detection layer of the image detection model includes a first feature map output by a shallow network and a second feature map output by an upsampling network, so that the image detection model takes into account both the high-resolution features of the shallow network and the deep semantic features of the upsampling network, and effectively integrates and utilizes information of different scales, thereby improving the detection accuracy of small targets and further improving the battery detection effect.

[0057] The battery detection technology provided in the embodiments of the present application can effectively detect defects in the battery (misalignment of the positive and negative electrodes) after processes such as tab shaping, shelling, welding, liquid injection, and formation, and can fully meet the real-time full inspection of the production line, reduce the outflow of risky products, and improve the reliability and applicability of the battery.

[0058] The battery detection technology in the embodiments of the present application can be applied to, but is not limited to, cylindrical batteries, soft-pack batteries, square-shell batteries, wound batteries, etc.

[0059] The battery disclosed in the embodiment of the present application can be used in, but not limited to, electrical devices such as vehicles, ships or aircraft. A power supply system equipped with the electrical device can be used, which is conducive to improving the stability of battery performance.

[0060] The embodiment of the present application provides an electric device using a battery as a power source, and the electric device may be, but is not limited to, a mobile phone, a tablet, a laptop computer, an electric toy, an electric tool, a battery car, an electric car, a ship, a spacecraft, and the like. Among them, the electric toy may include a fixed or mobile electric toy, for example, a game console, an electric car toy, an electric ship toy, and an electric airplane toy, and the like, and the spacecraft may include an airplane, a rocket, a space shuttle, and a spacecraft, and the like. By testing the battery using the battery detection technology in the embodiment of the present application, the safety of the battery can be ensured, thereby ensuring the safety of the electric device.

[0061] For the convenience of description, the following embodiments are described by taking a vehicle 1000 as an example of an electrical device according to an embodiment of the present application.

[0062] Please refer to Figure 1 , Figure 1A schematic diagram of the structure of a vehicle 1000 provided for some embodiments of the present application. The vehicle 1000 may be a fuel vehicle, a gas vehicle or a new energy vehicle, and the new energy vehicle may be a pure electric vehicle, a hybrid vehicle or an extended-range vehicle, etc. A battery 100 is provided inside the vehicle 1000, and the battery 100 may be provided at the bottom, head or tail of the vehicle 1000. The battery 100 may be used to power the vehicle 1000, for example, the battery 100 may be used as an operating power source for the vehicle 1000. The vehicle 1000 may also include a controller 200 and a motor 300, and the controller 200 is used to control the battery 100 to power the motor 300, for example, for starting, navigating and driving the vehicle 1000.

[0063] In some embodiments of the present application, the battery 100 can not only serve as an operating power source for the vehicle 1000, but also serve as a driving power source for the vehicle 1000, replacing or partially replacing fuel or natural gas to provide driving power for the vehicle 1000.

[0064] Please refer to Figure 2 , Figure 2 An exploded view of a battery 100 provided in some embodiments of the present application. The battery 100 includes a box 10 and a battery cell 20, and the battery cell 20 is contained in the box 10. Among them, the box 10 is used to provide a storage space for the battery cell 20, and the box 10 can adopt a variety of structures. In some embodiments, the box 10 may include a first part 11 and a second part 12, the first part 11 and the second part 12 cover each other, and the first part 11 and the second part 12 jointly define a storage space for accommodating the battery cell 20. The second part 12 may be a hollow structure with one end open, the first part 11 may be a plate-like structure, and the first part 11 covers the open side of the second part 12, so that the first part 11 and the second part 12 jointly define a storage space; the first part 11 and the second part 12 may also be hollow structures with one side open, and the open side of the first part 11 covers the open side of the second part 12. Of course, the box 10 formed by the first part 11 and the second part 12 may be in a variety of shapes, such as a cylinder, a cuboid, etc.

[0065] In the battery 100, there may be multiple battery cells 20, and the multiple battery cells 20 may be connected in series, in parallel, or in a mixed connection. A mixed connection means that the multiple battery cells 20 are both connected in series and in parallel. The multiple battery cells 20 may be directly connected in series, in parallel, or in a mixed connection, and then the whole formed by the multiple battery cells 20 is accommodated in the box 10; of course, the battery 100 may also be a battery module formed by connecting multiple battery cells 20 in series, in parallel, or in a mixed connection, and then the multiple battery modules are connected in series, in parallel, or in a mixed connection to form a whole, and accommodated in the box 10. The battery 100 may also include other structures, for example, the battery 100 may also include a busbar component for realizing electrical connection between the multiple battery cells 20.

[0066] Each battery cell 20 may be a secondary battery or a primary battery, or a lithium-sulfur battery, a sodium-ion battery, or a magnesium-ion battery, but is not limited thereto. The battery cell 20 may be cylindrical, flat, rectangular, or in other shapes.

[0067] Figure 3 The structure of the image detection model in some embodiments of the present application is shown as follows: Figure 1 , Figure 4 The structure of the image detection model in some embodiments of the present application is shown as follows: Figure 2 .like Figure 3 and Figure 4 As shown, the embodiment of the present application provides an image detection model 400, including a backbone network 410, an upsampling network 420 and a first detection layer 430, the input of the upsampling network 420 includes the output of the backbone network 410, the backbone network 410 is configured to downsample the input detection image, and the upsampling network 420 is configured to upsample the feature map output by the backbone network 410,

[0068] The backbone network 410 includes a shallow network layer 411 close to the input end of the image detection model 400. The input of the first detection layer 430 includes a first feature map output by the shallow network layer 411 and a second feature map output by the upsampling network 420. The first detection layer 430 is configured to obtain a first image detection result of the detection image based on the input first feature map and second feature map.

[0069] The main function of the backbone network (Backbone) is to extract features. According to some embodiments of the present application, the backbone network may include a plurality of first network layers connected in sequence, and as the depth increases, the scale of the feature map output by the first network layer can be continuously reduced. In some embodiments, the main structure of Backbone may include a CBL module, a C3 module (abbreviated as C3), and an SPP module (spatial pyramid pooling layer, abbreviated as SPP), wherein the CBL module is composed of Conv (convolutional layer) + BN (batch normalization layer) + Leaky_relu (activation function) (abbreviated as CBL). It should be noted that the graphic features are features extracted from the shallow layer of the neural network, but they are only simple features, such as brightness, edge information, etc., and the semantics is not strong enough. Semantic features are features extracted from the deep layer of the neural network, which are highly semantic, but some simple graphic features are lost instead.

[0070] The upsampling network upsamples the feature map output by the backbone network. According to some embodiments of the present application, the upsampling network may include a plurality of second network layers connected in sequence, and as the depth increases, the scale of the feature map output by the second network layer may continue to increase. The upsampling network may also fuse the feature map output by the first network layer of the backbone network with the feature map output by the second network layer of the upsampling network. In this case, the detection layer may perform target detection based on the fused feature map obtained by the fusion of the upsampling network.

[0071] The shallow network layer can be, for example, one of the first few network layers close to the input end of the backbone network, such as the third network layer, and the output feature map has richer graphic feature information. It is understandable that the shallow network layer is not limited to the third network layer close to the input end among the multiple network layers connected in sequence, and can be reasonably selected according to the depth of the backbone network (i.e., the number of network layers).

[0072] The image detection model can be based on a convolutional neural network model, such as a Yolov5 model. According to some embodiments of the present application, the image detection model is based on the Yolov5 model, and the first detection layer 430 can be added on the basis of the Yolov5 model. The first feature map output by the shallow layer 411 of the network can be the feature map output by the 2nd network layer P2 in the backbone network 410 (Backbone). On the basis of the 17th network layer P17 of the YoloV5 model, upsampling is performed so that the feature map continues to expand. The second feature map output by the upsampling network 420 can be the feature map output by the 20th network layer P20. The feature map output by the 20th network layer P20 is fused with the feature map output by the 2nd network layer P2 in the backbone network, and the fused feature map is input into the first detection layer 430. The first detection layer 430 obtains the first image detection result of the detection image based on the input fusion feature map, so that the recognition of small targets can be realized.

[0073] The shallow network layer 411 represents a layer in the backbone network 410 close to the input end of the image detection model 400. The first feature map output by the shallow network layer 411 has the characteristics of high resolution and contains more abundant underlying feature information of the target, which is conducive to the recognition of small targets. The shallow network layer 411 should not be understood as a specific level of the backbone network 410. The above example using the shallow network layer 411 as the second layer in the backbone network is not a limitation on the scope of the image detection model of the embodiment of the present application. In some other embodiments, the shallow network layer 411 can also be other layers in the backbone network 410, for example, the third network layer P3 of the backbone network 410.

[0074] According to some embodiments of the present application, Figure 4 As shown in the figure, the backbone network of the Yolov5 model includes network layers P3, P4, and P5. Among them, the network layer P3 is downsampled 8 times, and the corresponding detection feature map size is 80x80, which is used to detect targets with a size larger than 8x8; the network layer P4 is downsampled 16 times, and the corresponding detection feature map size is 40x40, which is used to detect targets with a size larger than 16x16; the network layer P5 is downsampled 32 times, and the corresponding detection feature map size is 20x20, which is used to detect targets with a size larger than 32x32. The network layer P2 is downsampled 4 times, and the corresponding detection feature map size is 160x160, which can be used to detect small targets with a size larger than 4x4.

[0075] The image detection model may include a detection network, and the detection network includes a first detection layer 430. The first detection layer 430 performs feature detection based on the feature map output by the network layer P2, and can be used to detect targets larger than 4x4. The resolution of the feature map output by the network layer P2 is 160x160 pixels, which is equivalent to performing two downsampling operations in the backbone network 410 (Backbone), and contains richer underlying feature information of the target. It can be fused with the same-scale feature map in the upsampling network through concat, so that the first detection layer is more sensitive to small targets, so that the target detection capability of the image detection model is significantly improved.

[0076] According to some embodiments of the present application, further, the relevant network structure for detecting targets with a size larger than 32x32 in the detection network of the YoloV5 model can be removed, and the relevant network structure for detecting targets with a size larger than 16x16 can be removed to obtain the image detection model 400 in the embodiment of the present application.

[0077] Since the input of the first detection layer 430 of the image detection model 400 includes the first feature map output by the shallow network layer 411 and the second feature map output by the upsampling network 420, the image detection model 400 takes into account the high-resolution features of the shallow network layer 411 and the deep semantic features of the upsampling network 420, and effectively integrates and utilizes information of different scales, thereby improving the recognition of small targets and enhancing the detection effect for small targets.

[0078] According to some embodiments of the present application, the first image detection result includes a first detection frame surrounding a first preset target in the detection image, and the first detection layer 430 is configured to obtain the first image detection result of the detection image based on a preset detection frame size, a first feature map, and a second feature map, wherein the size of the first detection frame is consistent with the preset detection frame size.

[0079] The first detection frame may include the location information and category information of the first preset target. In the image detection model 400, the first detection layer 430 may constrain the first detection frame to a fixed size by setting a preset detection frame size, so as to avoid the situation where the predicted detection frame filters a large number of correctly predicted detection frames due to the non-maximum suppression operation of post-processing when similar small targets appear densely, thereby causing missed detection.

[0080] The preset detection frame size can be reasonably set based on the size of the target to be detected. For example, the preset detection frame size is used to detect a 4x4 target, so that the size of the first detection frame predicted by the first detection layer can be limited to 4x4, which can be used to detect a 4x4 target.

[0081] Therefore, by constraining the detection box output by the model to a fixed size, it is possible to avoid the problem of missed detection caused by the predicted detection box being filtered out due to the non-maximum suppression operation in post-processing, and to achieve detection of objects of a specific size. In particular, when small objects of the same type appear densely, the problem of missed detection of small objects can be avoided by constraining the size of the predicted detection box.

[0082] According to some embodiments of the present application, the first feature map and the second feature map have the same scale.

[0083] The first feature map and the second feature map are output by the shallow network layer 411 and the upsampling network 420, respectively. When the scales of the first feature map and the second feature map are different, the first feature map and the second feature map cannot be directly fused, and one of the first feature map and the second feature map needs to be processed so that the scales of the processed first feature map and the second feature map are consistent. For example, the scale of the first feature map is 160x160, and the scale of the second feature map is 80x80. At this time, the first detection layer 430 is based on the first feature map and the second feature map of different scales for fusion, and the scale of the second feature map needs to be adjusted to adapt to 160X160.

[0084] When the scales of the first feature map and the second feature map are the same, the first detection layer 430 can directly fuse the input first feature map and the second feature map.

[0085] Since the first feature map and the second feature map have the same scale, the first feature map and the second feature map with the same scale can be directly fused to improve the detection efficiency of the image detection model 400.

[0086] According to some embodiments of the present application, the backbone network includes multiple first network layers connected in sequence, the multiple first network layers include a shallow network layer and an intermediate network layer located at an intermediate connection position, and the shallow network layer 411 is located on one side of the intermediate network layer close to the input end of the image detection model 400.

[0087] While a plurality of first network layers connected in sequence extract features from the detection image input to the image detection model 400, the scale of the output feature map can be continuously reduced. For example, the scale of the detection image input to the image detection model 400 is 640x640, and after passing through a plurality of first network layers connected in sequence, the scales are changed to 320x320, 160x160, 80x80, 40x40, and 20x20 in sequence. In this case, the middle network layer at the middle connection position is the third network layer P3, and the scale of the output feature map is 80x80.

[0088] It should be understood that the network layer located on the side of the middle network layer close to the input end of the image detection model 400 has higher resolution features and richer underlying features, and the first network layers at different levels have different resolutions. As the depth increases (relative to the input end of the model, the connection position is getting further and further back), the scale of the feature map output by the first network layer becomes smaller and smaller, and targets of different sizes can be detected based on the feature maps output by different first network layers.

[0089] Since the backbone network 410 includes a plurality of first network layers connected in sequence, the image detection model 400 can detect multi-size targets based on the feature maps output by the first network layers at different levels, thereby improving the detection accuracy. By setting the shallow layer of the network to be the network layer close to the input end, the high-resolution features of the image can be obtained, which is beneficial for the detection of small targets.

[0090] According to some embodiments of the present application, the image detection model 400 also includes a second detection layer, the upsampling network 420 includes multiple second network layers, the backbone network 410 includes a deep network layer away from the input end of the image detection model 400, the input of the second detection layer includes a third feature map output by the deep network layer and a fourth feature map output by one of the second network layers, and the second detection layer is configured to obtain a second image detection result of the detection image based on the third feature map and the fourth feature map, wherein the second image detection result includes a second detection box surrounding a second preset target in the detection image, and the size of the second preset target is larger than the size of the first preset target in the detection image.

[0091] The image detection model 400 can identify targets of different sizes. In order to ensure good detection performance for targets of different sizes, the feature map of the corresponding scale output by the model can be selected for detection based on the size of the target. The first detection layer 430 can identify small targets based on the feature map output by the shallow layer of the network, and the second detection layer can identify larger targets based on the features output by the deep layer of the network. In addition, by combining the feature map of the same scale output by the upsampling network 420 for target recognition, it is possible to integrate the high-resolution features of the shallow layer and the semantic features of the deep layer, effectively utilize information of different scales, and improve target detection performance.

[0092] For example, when the scale of the detection image is 640x640, the first detection layer 430 can detect small targets such as 4x4 based on the feature map with a scale of 160x160 output by the shallow network layer P2. For larger targets of 8x8, 16x16, and 20x20, detection can be performed based on the feature map output by the network layer P3.

[0093] The second detection frame may include location information and category information of a second preset target in the detection image.

[0094] Since the input of the second detection layer includes the third feature map output by the deep network of the backbone network and the fourth feature map output by one of the second network layers of the upsampling network, the second image detection result of the detection image is obtained through the second detection layer, so that the image detection model can have a good detection effect on large targets, thereby making the image detection model have a good detection effect on both large targets and small targets, thereby improving the integrity and comprehensiveness of target detection.

[0095] According to some embodiments of the present application, the backbone network 410 includes a plurality of first network layers connected in sequence, the plurality of first network layers including a network deep layer and an intermediate network layer located at an intermediate connection position, and the network deep layer is located on a side of the intermediate network layer away from the input end of the image detection model.

[0096] While multiple first network layers connected in sequence extract features from the detection image input to the image detection model 400, the scale of the output feature map can be continuously reduced. Multiple first network layers include a network deep layer and an intermediate network layer located at an intermediate connection position. For example, the scale of the detection image input to the image detection model 400 is 640x640. After passing through multiple first network layers connected in sequence, the scale becomes 320x320, 160x160, 80x80, 40x40, and 20x20 in turn. In this case, the intermediate network layer at the intermediate connection position is the third network layer, and the scale of the output feature map is 80x80. The feature scale of the deep network output is 40x40 or 20x20.

[0097] It should be understood that the network layer located on one side of the input end of the principle image detection model 400 of the intermediate network layer outputs a feature map with lower resolution features and deeper semantic features, which can ensure the detection performance of large targets. As the depth increases, the scale of the feature map output by the first network layer becomes smaller and smaller, and targets of different sizes can be detected based on the feature maps output by different first network layers.

[0098] By setting the deep layer of the network to be far away from the input side, the deep semantic features of the image can be obtained, which is beneficial for the detection of large objects.

[0099] Figure 5 Flowchart of a method for training an image detection model in some embodiments of the present application. Figure 5 As shown, the embodiment of the present application provides a training method for an image detection model, comprising:

[0100] S510, obtaining a sample battery detection image;

[0101] S520, marking a real bounding box surrounding the end of the pole piece in the sample battery detection image;

[0102] S530, inputting the sample battery detection image into the image detection model, and obtaining the predicted bounding box surrounding the end of the pole piece output by the image detection model;

[0103] S540, calculating a loss value based on the true bounding box and the predicted bounding box; and

[0104] S540: Adjust parameters of the image detection model based on the loss value.

[0105] The image detection model of the embodiment of the present application can be, for example, but not limited to, improved based on the YoloV5 model. The sample battery detection image can, for example, directly call the relevant battery detection image from the database, or use the battery detection image obtained by taking a photo with a camera. For example, an industrial CT device can be used to collect a 3D image of the battery, and the sliced ​​2D image can be selected to form a sample data set.

[0106] Mark the real bounding box surrounding the end of the pole piece in the sample battery inspection image. For example, use the LabelImg tool to label the heads of the anode and cathode in the battery inspection image. The labeling information includes target category information and position information, thereby marking the real bounding box surrounding the end of the pole piece in the sample battery inspection image.

[0107] The sample battery inspection image is input into the image detection model 400, and the predicted bounding box surrounding the end of the pole piece output by the image detection model 400 is obtained. The loss value is calculated based on the marked real bounding box and the predicted bounding box. For example, the three parts of confidence loss, classification loss and coordinate loss are calculated respectively through the loss function in the image detection model 400.

[0108] The bounding box and detection box in the embodiments of the present application have the same meaning, both including location information and category information, and are only used to distinguish between the model training and application processes.

[0109] For example, the parameter settings of the image detection model 400 are as follows: the input image size is 1024×1024, the initial weight of the model is randomly initialized, the number of samples in a single batch (batch-size) is set to 8, the maximum number of iterations (epoch) is set to 400, the optimizer uses the adaptive moment estimation (AdamW) optimizer, the initial learning rate (lr0) is set to 0.0005, the momentum parameter (momentum) is 0.937, and the weight decay coefficient (weight_decay) is 0.0005. It should be noted that this is only an example to illustrate the specific process of model training, and the parameters of model training are not limited to the above one, which can be reasonably set according to actual training needs.

[0110] The sample data set can be used to train the image detection model 400. During the training process of the model, as the number of iterations increases, the average mAP (mean Average Precision) changes at different IoU (Intersection over Union) thresholds (from 0.5 to 0.95, step size 0.05: 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95). Compared with using the existing Yolov5 model to detect the end of the battery pole piece, the mAP value of the image detection model based on the embodiment of the present application for detecting the end of the battery pole piece is significantly higher than the existing Yolov5 model.

[0111] Based on the loss value between the real bounding box and the predicted bounding box, the parameters of the image detection model 400 are adjusted so that the predicted bounding box is close to the real bounding box, so that the image detection model can fully learn the features of the pole piece end and realize the detection of the pole piece end.

[0112] Figure 6 Flowchart of a method for training an image detection model in some embodiments of the present application. Figure 6 As shown, according to some embodiments of the present application, S510, obtaining a detection image of a sample battery includes:

[0113] S512, obtaining a three-dimensional image of the sample battery under radiation; and

[0114] S512: Slice the three-dimensional image to obtain a two-dimensional sample battery detection image.

[0115] In some embodiments, a three-dimensional image of a sample battery under radiation is obtained by a shooting device. For example, the shooting device may be a CT device, and a 3D image of the battery is collected by the CT device. The obtained 3D image of the battery is sliced ​​to obtain a two-dimensional sample battery detection image, and the two-dimensional sample battery detection image is annotated to suggest a sample data set.

[0116] It should be noted that the image detection model 400 performs target detection based on the two-dimensional sample battery detection image obtained by slicing, which can improve the generalization of target detection.

[0117] By slicing the three-dimensional image, a two-dimensional sample battery detection image is obtained. Based on the two-dimensional sample battery detection image, the battery detection result is obtained, the comprehensiveness and completeness of the battery detection is improved, and then the training effect of the image detection model on the battery is improved.

[0118] According to some embodiments of the present application, S512, slicing the three-dimensional image to obtain a two-dimensional sample battery detection image includes:

[0119] Slicing the three-dimensional image to obtain a two-dimensional image; and

[0120] The two-dimensional image is preprocessed to obtain a sample battery detection image, and the preprocessing includes denoising and contrast enhancement.

[0121] The two-dimensional sample battery detection image obtained by slicing the three-dimensional image is preprocessed in order to better reduce the interference of the sample battery detection image and improve the clarity and accuracy of the two-dimensional image. Among them, clarity represents the degree of difference between the target object and the background in the sample battery detection image. Accuracy represents the presence of noise interference in the sample battery detection image during the detection. The noise interference is presented on the sample battery detection image. The noise interference in the sample battery detection image is reduced by denoising.

[0122] For example, denoising and contrast enhancement are performed on a two-dimensional image. It should be noted that the preprocessing method includes denoising and contrast enhancement. When preprocessing a two-dimensional image, denoising and contrast enhancement can be performed successively, or one of the preprocessing methods can be selected. Exemplarily, contrast enhancement can be performed by random flipping, scaling, image translation, adding noise, etc.

[0123] By preprocessing the two-dimensional images, the clarity and accuracy of the sample battery detection images can be improved, thereby improving the training effect of the image detection model on the battery.

[0124] Figure 7 Schematic diagram of a battery detection method based on an image detection model according to some embodiments of the present application, such as Figure 7 As shown, the embodiment of the present application provides a battery detection method based on an image detection model, including:

[0125] S610, acquiring a battery detection image;

[0126] S620, inputting the battery detection image into the image detection model, and obtaining a first image detection result of the battery output by the image detection model; and

[0127] S630: Detect the battery based on the first image detection result.

[0128] For example, a 3D image of a battery is acquired through industrial CT, and a 2D image after slicing is selected as a battery detection image. Alternatively, a two-dimensional battery detection image is acquired through a CCD (Charge-coupled Device), or a two-dimensional battery detection image is acquired through a TDI (Tim Delay Integration).

[0129] Combination Figure 3 and Figure 4 As shown, the battery detection image is input into the image detection model 400, the first image detection result of the battery output by the image detection model is obtained, and the battery is detected based on the first image detection result. The detection of the misalignment of the positive and negative electrodes of the battery is taken as an example for explanation. For example, the battery detection image is input into the image detection model 400 of the embodiment of the present application for detection. The image detection model 400 obtains the position (end) of the positive and negative electrodes, calculates the misalignment of the positive and negative electrodes of the battery, and based on the first image detection result, the battery whose electrode misalignment does not meet the requirements is judged as NG, and the battery that meets the requirements is judged as OK.

[0130] It should be understood that in the battery inspection image, due to the small pixel proportion of the anode and cathode pieces, the small coverage area, little information, high positioning accuracy requirements, and highly concentrated targets, the detection method based on the existing detection model is prone to miss detection of small targets, resulting in distorted battery defect detection results, poor accuracy, and the risk of false detection.

[0131] Since the input of the first detection layer of the image detection model includes the first feature map output by the shallow layer of the network and the second feature map output by the upsampling network, the image detection model takes into account both the high-resolution features of the shallow layer of the network and the deep semantic features of the upsampling network, and effectively and comprehensively utilizes information of different scales, thereby improving the detection effect of smaller features of the battery, reducing the risk of missed detection, and thus improving the detection effect of the battery.

[0132] According to some embodiments of the present application, the first detection layer 430 of the image detection model 400 is configured to obtain a first image detection result of a battery detection image based on a preset detection frame size, a first feature map, and a second feature map, the first image detection result including a first detection frame surrounding the end of a pole piece in the battery detection image, wherein the size of the first detection frame is consistent with a preset detection frame size, and the preset detection frame size is based on the size of the end of the pole piece of the battery.

[0133] Combination Figure 3 and Figure 4 As shown, in the image detection model 400, the first detection layer 430 is performed based on a preset detection frame size, so that the output preset detection frame can be constrained to the size of the pole piece end, so as to avoid the situation where when the pole piece ends appear densely, the predicted detection frame will filter out a large number of correctly predicted detection frames due to the post-processing non-maximum suppression operation, thereby causing missed detection.

[0134] For example, the preset detection frame size is 4x4, and the size of the first detection frame output by the first detection layer of the image detection model 400 is also 4x4, and the first detection layer 430 can be used to detect 4x4 targets. The first detection layer 430 of the image detection model 400 obtains the first image detection result of the battery detection image based on the preset detection frame size, the first feature map and the second feature map, wherein the first feature map has shallow image feature information, and the second feature map has deep semantic information, effectively utilizing information of different scales, so that the first detection layer 430 has good detection performance for small targets, thereby accurately detecting the pole piece end of the battery.

[0135] Since the preset detection frame size is based on the size of the end of the battery pole piece, the size of the first detection frame is consistent with the preset detection frame size, which is beneficial to improving the recognition accuracy of the image detection model for the end of the battery pole piece, reducing the risk of missed detection, and improving the detection effect of the image detection model.

[0136] According to some embodiments of the present application, the electrode sheet includes a cathode sheet and an anode sheet, and detecting the battery based on the first image detection result includes:

[0137] Determining a target detection frame including the pole piece based on two first detection frames respectively surrounding two ends of the same pole piece of the battery; and

[0138] Based on the target detection frame surrounding the cathode sheet and the target detection frame surrounding the anode sheet, the target misalignment amount of the cathode sheet and the anode sheet is determined, and the target misalignment amount is based on the misalignment amount of the cathode sheet and the anode sheet along the width direction and / or length direction of the cathode sheet.

[0139] When testing a battery, the battery test image includes a cathode and an anode. Since the width of the electrode is relatively narrow, usually only 4-9 pixels, if the detection algorithm of the relevant technology is used, it is easy to miss the end positions of the cathode and anode in the battery test image. For example, when the ends of the cathode and anode are small and the gray value is not different enough from the background, it is difficult to identify the ends of the cathode and anode at that location during the detection process, resulting in omissions, which in turn distorts the electrode misalignment measured in the subsequent steps.

[0140] By adopting the image detection model 400 in the embodiment of the present application, the detection performance of the pole piece end can be significantly improved. Furthermore, based on the two first detection frames at the two ends of the same pole piece, the target detection frame of the pole piece can be accurately surrounded, thereby improving the calculation accuracy of the subsequent pole piece misalignment amount.

[0141] Based on the target detection frame surrounding the cathode sheet and the target detection frame surrounding the anode sheet, the target misalignment amount between the cathode sheet and the anode sheet is determined. For example, two target misalignment amounts between the cathode sheet and two adjacent anode sheets can be determined, and the larger one can be determined as the misalignment amount between the cathode sheet and the anode sheet.

[0142] The target misalignment amount may be the misalignment amount between the cathode sheet and the anode sheet along the length direction of the cathode sheet.

[0143] By determining a target detection frame surrounding the pole piece through a first detection frame surrounding the pole piece end, the target misalignment amount of the cathode piece and the anode piece is determined, thereby realizing the detection of the misalignment amount of the battery pole piece. By improving the recognition accuracy of the pole piece end and determining a target detection frame surrounding the pole piece through the pole piece end, the detection effect of the misalignment amount of the battery pole piece can be improved.

[0144] According to some embodiments of the present application, a battery detection method includes:

[0145] Preprocessing the acquired battery detection image, wherein the preprocessing includes at least one of denoising processing and contrast enhancement processing,

[0146] And the preprocessed battery detection image is input into the image detection model.

[0147] The main purpose of image preprocessing is to eliminate irrelevant information in the image, restore useful real information, enhance the detectability of relevant information and simplify the data to the maximum extent, thereby improving the reliability of feature extraction, matching and recognition.

[0148] By preprocessing the acquired battery detection image, irrelevant information in the battery detection image can be reduced or eliminated, for example, the acquired battery detection image can be denoised. The image can be contrast enhanced to improve the grayscale difference between pixels in the battery detection image. For example, when detecting the misalignment of the battery, the contrast enhancement process is performed based on the acquired battery detection image, thereby improving the grayscale difference between the cathode and cathode and the background in the battery detection image, so as to better identify the cathode and cathode. After the preprocessed battery detection image is input into the image detection model, a more accurate detection effect can be obtained.

[0149] Preprocessing the acquired battery detection image can reduce the interference of background noise in the battery detection image on target recognition, thereby improving the detection effect of the battery detection image.

[0150] According to some embodiments of the present application, contrast enhancement includes at least one of random flipping, scale transformation, image translation, and adding noise.

[0151] Contrast enhancement is also called contrast enhancement, which is achieved by transforming the pixel brightness value (also called grayscale or grayscale value). The recognition of battery detection images is achieved through the grayscale difference between pixels. Large grayscale differences can be more easily recognized.

[0152] For example, the acquired battery inspection image is subjected to denoising and contrast enhancement processing, and the contrast enhancement includes at least one of random flipping, scale transformation, image translation, and noise addition, so that the data (features) in the battery inspection image are enhanced, thereby making it easier to obtain the end of the pole piece.

[0153] By contrast enhancing the acquired battery detection image, the clarity of the battery detection image is improved, which is beneficial to better detect the battery detection image and improve the detection effect.

[0154] According to some embodiments of the present application, the battery detection method includes: in response to a detection result of the battery being unqualified, the battery is discarded or re-tested.

[0155] According to the first detection layer 430 of the image detection model 400, the first image detection result of the battery is output. The first image detection result represents the misalignment amount of the battery. The misalignment amount of the detected battery needs to meet the preset threshold range requirement. When the misalignment amount of the detected battery does not meet the preset threshold range requirement, the misalignment amount of the battery is determined to be unqualified, and the battery is discarded or re-inspected.

[0156] It should be noted that during the operation phase of the testing equipment, or when the operator is operating it, there may be improper operation or accidental equipment failure, which may affect the accuracy of the test results. At this time, the unqualified batteries will be re-inspected to reduce the risk of misjudgment due to accidental factors (equipment failure, improper operation).

[0157] By removing or re-inspecting batteries with unqualified test results (such as the amount of pole piece misalignment), the safety and reliability of the battery can be improved.

[0158] Figure 8 A schematic block diagram of a training device for an image detection model according to some embodiments of the present application, such as Figure 8 As shown, an embodiment of the present application provides a training device 500 for an image detection model 400, and the training device 500 includes an acquisition unit 510, a marking unit 520, a calculation unit 530 and an adjustment unit 540, wherein the acquisition unit 510 is used to acquire a sample battery detection image, the marking unit 520 is used to mark a real bounding box surrounding the end of the pole piece in the sample battery detection image, the calculation unit 530 is used to acquire the predicted bounding box surrounding the end of the pole piece output by the image detection model 400 based on the image detection model 400, and calculate the loss value based on the real bounding box and the predicted bounding box, and the adjustment unit 540 is used to adjust the parameters of the image detection model 400 based on the loss value.

[0159] The acquisition unit 510 is used to acquire a sample battery detection image. For example, the acquisition unit 510 directly calls a related battery detection image from a database, or the acquisition unit 510 uses a camera to take a photo to acquire the battery detection image.

[0160] The marking unit 520 marks the real bounding box surrounding the end of the pole piece in the sample battery detection image. For example, the marking unit 520 uses the LabelImg tool to label the heads of the anode and cathode in the battery detection image of the acquired image. The labeling information includes target category information and position information, thereby marking the real bounding box surrounding the end of the pole piece in the sample battery detection image.

[0161] The computing unit 530 inputs the sample battery detection image into the image detection model 400, and obtains the predicted bounding box surrounding the end of the pole piece output by the image detection model 400, and calculates the loss value based on the marked real bounding box and the predicted bounding box. For example, the three parts of confidence loss, classification loss and coordinate loss are calculated respectively through the loss function in the image detection model 400.

[0162] The adjustment unit 540 adjusts the parameters of the image detection model 400 based on the loss value, for example, using the data set for multiple rounds of iterative training, stopping the training iterations when the loss value tends to be stable, and saving the trained image detection model 400.

[0163] The computing unit 530 of the training device 500 adjusts the parameters of the image detection model 400 based on the loss value between the real bounding box and the predicted bounding box, so that the predicted bounding box is close to the real bounding box. The image detection model can fully learn the features of the pole piece end and realize the detection of the pole piece end.

[0164] An embodiment of the present application provides an electronic device, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the training method of the image detection model and the battery detection method based on the image detection model in the above-mentioned embodiment.

[0165] An embodiment of the present application provides a battery production device, including the electronic device in the above embodiment.

[0166] An embodiment of the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the training method of the image detection model and the battery detection method based on the image detection model in the above-mentioned embodiment are implemented.

[0167] An embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the training method of the image detection model and the battery detection method based on the image detection model in the above-mentioned embodiment.

[0168] In order to better understand the image detection model and training method and battery detection method of the embodiment of the present application, Figure 4 Provide specific instructions.

[0169] The image detection model of the embodiment of the present application is improved based on the YoloV5 model, and the image detection model is used to detect battery defects. First, the image to be detected is obtained, for example, a 3D image of the battery is collected by industrial CT, and a 2D image after slicing is selected as the image to be detected. The image to be detected is preprocessed, for example, contrast enhancement, denoising and other preprocessing.

[0170] The end (head) of the anode and cathode in the preprocessed image is labeled with type and position to generate a data set. For example, the collected image is labeled with the head of the anode and cathode in the detection image of the battery using the LabelImg tool. The labeling information includes target category information and position information. The data set is randomly divided into a training set, a validation set, and a test set in a ratio of 6:2:2. Data enhancement techniques are used for the sample set images, such as random flipping, scale transformation, image translation, and noise addition. Parameter settings of the image detection model: the input image size is 1204×1204, the initial weight of the model is randomly initialized, the number of samples in a single batch (batch-size) is set to 8, the maximum number of iterations (epoch) is set to 400, the optimizer uses the adaptive moment estimation (AdamW) optimizer, the initial learning rate (lr0) is set to 0.0005, the momentum parameter (momentum) is 0.937, and the weight decay coefficient (weight_decay) is 0.0005.

[0171] The improved YoloV5 model is trained using the above training set, wherein the improved YoloV5 model refers to adding a first detection layer for small target detection on the basis of the original detection layer of the YoloV5 network, obtaining the feature map of the size of 160X160 output by the upsampling network and concat fusion with the shallow output feature map of the second layer of the backbone network (Backbone), and inputting the fused feature map into the first detection layer for small target detection. The target box output by the first detection layer is constrained to a fixed size to reduce the risk of missing detection when small targets appear densely, because the predicted bounding box will filter a large number of correctly predicted bounding boxes due to the non-maximum suppression operation of post-processing. For example, in the training process of the improved YoloV5 model, as the number of iterations increases, the average mAP changes at different IoU thresholds (from 0.5 to 0.95, step size 0.05: 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95) are shown by Fig. 9 It can be seen that the mAP value of the improved YoloV5 model (Improved YoloV5) is significantly higher than that of the original YoloV5 model (YoloV5).

[0172] It should be noted that the image detection model effectively utilizes information of different scales by integrating shallow high-resolution features and deep semantic features, significantly improves the detection performance for small targets, and can better identify the ends of the cathode and anode sheets in the detection image background.

[0173] Improvements to the image detection model and explanation of model training: In the detection image of the laminated battery, due to the small pixel proportion of the anode and cathode sheets, the coverage area is small, the information contained is small, the positioning accuracy requirement is high, and the target is highly concentrated. Therefore, the network structure of the YoloV5 model is improved. The improved YoloV5 model network structure is as follows: Figure 1 As shown, the first detection layer 430 is added to enhance the model's detection capability for small targets by fusing shallow representation information and deep semantic information.

[0174] like Figure 4 As shown in the figure, the backbone network of the YoloV5 model includes network layers P3, P4, and P5. Among them, the network layer P3 is downsampled 8 times, and the corresponding detection feature map size is 80x80, which is used to detect targets with a size larger than 8x8; the network layer P4 is downsampled 16 times, and the corresponding detection feature map size is 40x40, which is used to detect targets with a size larger than 16x16; the network layer P5 is downsampled 32 times, and the corresponding detection feature map size is 20x20, which is used to detect targets with a size larger than 32x32.

[0175] It should be noted that the improved YoloV5 model adds a 160x160 detection feature map, which can be used to detect targets larger than 4x4. The feature map scale output by the network layer P2 is 160x160 pixels, which is equivalent to performing two downsampling operations in the backbone network (Backbone), containing richer underlying feature information of the target, and the feature map of the same scale output by the upsampling network is concat-fused, making the first detection layer based on the fused feature map more sensitive to small targets. The improved YoloV5 model has significantly improved its ability to detect small targets.

[0176] Taking the detection of battery pole misalignment as an example, the training process of the image detection model is as follows:

[0177] S11. Use industrial CT equipment to collect 3D images of the battery, and select the sliced ​​2D images to form a data set;

[0178] S12, performing image preprocessing on the 2D image, using filtering, contrast enhancement and other methods to obtain an image in which the positive and negative electrodes are clearly distinguishable;

[0179] S13, using data enhancement technology for the 2D image, illustratively, random flipping, scale transformation, image translation, adding noise, etc. can be used;

[0180] S14. Use the LabelImg tool to select and annotate the 2D image and generate a label file;

[0181] S15. Randomly divide the data set into training set, validation set and test set in a ratio of 6:2:2.

[0182] S20, build an image detection model based on Yolov5, add the first detection layer and small target Anchor parameters, fuse the feature map output by the network layer P2 in the backbone network with the feature map of the same scale output by the upsampling network in the form of concat, and input the fused feature map into the first detection layer;

[0183] S21, using the training set to train the image detection model;

[0184] S22. The training iteration stops when the loss value becomes stable, and the trained model is saved.

[0185] Taking the detection of battery pole misalignment as an example, the application process of the image detection model is as follows:

[0186] S31, using industrial CT equipment to collect an image of the battery as an image to be detected;

[0187] S32, inputting the image to be detected into the image detection model for detection;

[0188] S33, based on the detection frames surrounding the ends of the cathode sheet and the anode sheet output by the image detection model, obtaining target detection frames surrounding the cathode and anode sheets;

[0189] S34, calculating the misalignment amount of the cathode and anode sheets of the battery based on the target detection frame surrounding the cathode and anode sheets;

[0190] S35. The battery whose pole piece misalignment does not meet the requirements is judged as NG, and the battery that meets the requirements is judged as OK.

[0191] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in the various embodiments can be combined in any way. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions that fall within the scope of the claims.

Claims

1. An image detection model, comprising a backbone network, an upsampling network and a first detection layer, wherein the input of the upsampling network comprises the output of the backbone network, the backbone network is configured to downsample the input detection image, and the upsampling network is configured to upsample the feature map output by the backbone network, The backbone network includes a shallow network layer close to the input end of the image detection model, the input of the first detection layer includes a first feature map output by the shallow network layer and a second feature map output by the upsampling network, and the first detection layer is configured to obtain a first image detection result of the detection image based on the input first and second feature maps.

2. The image detection model according to claim 1, wherein: The first image detection result includes a first detection frame surrounding a first preset target in the detection image, and the first detection layer is configured to obtain the first image detection result of the detection image based on a preset detection frame size, the first feature map and the second feature map, wherein the size of the first detection frame is consistent with the preset detection frame size.

3. The image detection model according to claim 1, wherein: The first feature map and the second feature map both have the same scale.

4. The image detection model according to any one of claims 1 to 3, wherein: The backbone network includes a plurality of first network layers connected in sequence, wherein the plurality of first network layers include a shallow network layer and an intermediate network layer located at an intermediate connection position, and the shallow network layer is located on one side of the intermediate network layer close to the input end of the image detection model.

5. The image detection model according to any one of claims 1 to 3, further comprising a second detection layer, the upsampling network comprising a plurality of second network layers, the backbone network comprising a deep network layer away from the input end of the image detection model, The input of the second detection layer includes the third feature map output by the deep layer of the network and the fourth feature map output by one of the second network layers, and the second detection layer is configured to obtain a second image detection result of the detection image based on the third feature map and the fourth feature map. in, The second image detection result includes a second detection frame surrounding a second preset target in the detection image, and a size of the second preset target is larger than a size of the first preset target in the detection image.

6. The image detection model according to claim 5, wherein: The backbone network includes a plurality of first network layers connected in sequence, wherein the plurality of first network layers include the network deep layer and an intermediate network layer located at an intermediate connection position, and the network deep layer is located on a side of the intermediate network layer away from an input end of the image detection model.

7. A method for training an image detection model according to any one of claims 1 to 6, comprising: Acquire a sample battery detection image; Marking a true bounding box surrounding the end of the pole piece in the sample battery inspection image; Inputting the sample battery detection image into the image detection model, and obtaining a predicted bounding box surrounding the end of the pole piece output by the image detection model; Calculating a loss value based on the true bounding box and the predicted bounding box; and Parameters of the image detection model are adjusted based on the loss value.

8. The training method according to claim 7, characterized in that: The step of obtaining a detection image of a sample battery comprises: Acquiring a three-dimensional image of the sample battery under radiation exposure; and The three-dimensional image is sliced ​​to obtain a two-dimensional detection image of the sample battery.

9. The training method according to claim 8, characterized in that: Slicing the three-dimensional image to obtain a two-dimensional sample battery detection image includes: Slicing the three-dimensional image to obtain a two-dimensional image; and The two-dimensional image is preprocessed to obtain the sample battery detection image, and the preprocessing includes denoising processing and contrast enhancement processing.

10. A battery detection method based on the image detection model according to any one of claims 1 to 6, characterized in that: include: Acquire battery detection images; Inputting the battery detection image into the image detection model, and obtaining a first image detection result of the battery output by the image detection model; as well as The battery is inspected based on the first image inspection result.

11. The battery detection method according to claim 10, wherein: The first detection layer of the image detection model is configured to obtain a first image detection result of the battery detection image based on a preset detection frame size, a first feature map, and a second feature map, wherein the first image detection result includes a first detection frame surrounding an end of a pole piece in the battery detection image. The size of the first detection frame is consistent with the preset detection frame size, and the preset detection frame size is based on the size of the end of the electrode of the battery.

12. The battery detection method according to claim 11, wherein: The pole piece includes a cathode piece and an anode piece, and detecting the battery based on the first image detection result includes: Determining a target detection frame including the pole piece based on two first detection frames respectively surrounding two ends of the same pole piece of the battery; and Based on the target detection frame surrounding the cathode sheet and the target detection frame surrounding the anode sheet, the target misalignment amount of the cathode sheet and the anode sheet is determined, and the target misalignment amount is based on the misalignment amount of the cathode sheet and the anode sheet along the width direction and / or length direction of the cathode sheet.

13. The battery detection method according to any one of claims 10 to 12, characterized in that: The battery detection method comprises: Preprocessing the acquired battery detection image, wherein the preprocessing includes at least one of denoising processing and contrast enhancement processing, And the battery detection image that has undergone the preprocessing is input into the image detection model.

14. The battery defect detection method according to claim 13, characterized in that: The contrast enhancement includes at least one of random flipping, scale transformation, image translation, and adding noise.

15. The battery defect detection method according to any one of claims 10 to 12, characterized in that: The battery detection method comprises: In response to the test result of the battery being unqualified, the battery is rejected or re-tested.

16. A training device for an image detection model, characterized in that: The training device comprises: An acquisition unit, used for acquiring a sample battery detection image; A marking unit, used to mark a real boundary box surrounding the end of the pole piece in the sample battery detection image; a calculation unit, configured to obtain, based on the image detection model, a predicted bounding box surrounding the end of the pole piece output by the image detection model, and calculate a loss value based on the real bounding box and the predicted bounding box; and An adjustment unit is used to adjust the parameters of the image detection model based on the loss value.

17. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 7 to 15.

18. A battery production device comprising the electronic device according to claim 17.

19. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 7 to 15 is implemented.

20. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 7 to 15 when being executed by a processor.