Method, device, equipment and medium for measuring the distance between the isolation membrane and the top cover of a battery
The edge detection model is used to extract and fuse features of the battery image, generate a mask image and measure the distance between the battery isolation film and the top cover, which solves the problem of inaccurate measurement in complex environments and improves the accuracy and stability of measurement. sex.
Patent Information
- Application Number
- CN202410614219.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-05-17
AI Technical Summary
The existing technology is difficult to accurately measure the distance between the battery isolation film and the top cover in a complex environment, and is prone to inaccurate measurement problems.
The pre-trained edge detection model is used to perform feature extraction, information focusing and feature fusion processing on the battery image to generate a mask image, and distance measurement is performed in the covered battery image. Semantic segmentation and grayscale gradient are used to determine the isolation film and roof. Cover edge to improve measurement accuracy.
It improves the detection accuracy and distance measurement accuracy of the edge of the isolation film and the top cover, solves the problem of incomplete segmentation and interference of the edge detection model, and enhances the stability and accuracy of the model.
Smart Images

Figure CN118212287B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of battery manufacturing, and in particular to a method, device, equipment and medium for measuring the distance between an isolation membrane and a top cover of a battery. Background Art
[0002] With the development of new energy technology, batteries have been widely used. In the packaging isolation film process of battery production, it is necessary to detect the distance between the isolation film and the top cover of the battery shell.
[0003] At present, the commonly used detection methods include: edge point detection of battery images, then fitting edge points to obtain the edge of the isolating membrane and the edge of the top cover, and then measuring the distance between the edge of the isolating membrane and the edge of the top cover. However, this method is difficult to meet the precise positioning of the edge of the isolating membrane and the edge of the top cover in complex environments, and is prone to inaccurate distance measurement. Summary of the invention
[0004] Based on the above problems, the present application provides a method, device, equipment and medium for measuring the distance between the isolation membrane and the top cover of a battery, which can improve the detection accuracy of the isolation membrane and the edge of the top cover, and thus improve the accuracy of the distance measurement.
[0005] In a first aspect, the present application provides a method for measuring the distance between an isolation membrane and a top cover of a battery, the method comprising: acquiring a battery image, the battery image including the isolation membrane and the top cover area of the battery; performing feature extraction processing, information focusing processing and feature fusion processing on the battery image using a pre-trained edge detection model to obtain edge detection results of the isolation membrane and the top cover; generating a mask image based on the edge detection results; overlaying the mask image on the battery image, and performing distance measurement in the covered battery image to obtain a distance measurement result between the isolation membrane and the top cover.
[0006] In the technical solution of the embodiment of the present application, the edge detection model can be used to perform semantic segmentation on each pixel of the battery image, so as to obtain a relatively accurate isolation membrane edge and top cover edge, thereby improving the accuracy of distance measurement. In addition, it can avoid the problem of over-reliance on edge detection results when measuring directly in the mask image, resulting in a decrease in measurement precision and accuracy. Distance measurement is performed in the battery image covered by the mask image, which can solve the problem of incomplete segmentation of the edge detection model and the problem of interference between the isolation membrane and the top cover, making the stability and accuracy of the edge detection model higher.
[0007] In some embodiments, the edge detection model includes a backbone feature extraction network, an information processing network, and an enhanced feature extraction network. The pre-trained edge detection model is used to perform feature extraction, information focusing, and feature fusion processing on the battery image to obtain edge detection results of the isolation membrane and the top cover, including: performing feature extraction of deep information on the battery image through the backbone feature extraction network to obtain multiple first image feature maps; performing feature position information focusing processing on each first image feature map through the information processing network to obtain multiple second image feature maps; performing feature fusion processing of deep information and shallow information based on multiple second image feature maps through the enhanced feature extraction network to obtain edge detection results. In the technical solution of the embodiment of the present application, a lightweight backbone feature extraction network is used for feature extraction, which can improve the detection speed of the edge detection model, thereby meeting the real-time requirements of distance detection; after the feature extraction process, the feature position in the feature map is focused to meet the accuracy requirements of the edge detection model.
[0008] In some embodiments, the backbone feature extraction network includes multiple downsampling layers; the backbone feature extraction network is used to perform feature extraction processing on the battery image of deep information to obtain multiple first image feature maps, including: inputting the battery image into the first downsampling layer for feature extraction processing to obtain the first first image feature map; inputting the i-th first image feature map into the i+1-th downsampling layer for feature fusion processing to obtain the i+1-th first image feature map, where i is a positive integer. In the technical solution of the embodiment of the present application, multiple feature extractions are performed through the backbone feature extraction network, which can improve the accuracy of feature extraction, thereby improving the detection accuracy of the edge detection model. In addition, the backbone feature extraction network adopts a lightweight network with fewer convolutional layers and fast feature extraction speed, which can improve the detection speed of the edge detection model, thereby meeting the real-time requirements of distance detection.
[0009] In some embodiments, the information processing network includes multiple information processing layers, and the information processing layers correspond to the downsampling layers one by one; the information processing network performs a focusing process on the feature position information of each first image feature map to obtain multiple second image feature maps, including: for each first image feature map, the corresponding information processing layer performs a global average pooling process in both width and height directions to obtain a first width feature map and a first height feature map; the first width feature map and the first height feature map are spliced, and the spliced feature map is convoluted, normalized and nonlinearly activated to obtain a feature representation; the feature representation is divided and transposed to obtain a second width feature map and a second height feature map; the second width feature map and the second height feature map are convoluted and activated respectively to obtain a width weight and a height weight; the second image feature map is obtained according to the first image feature map, the width weight and the height weight. In the technical solution of the embodiment of the present application, the attention mechanism can be used to obtain the width weight and the height weight, so that the target can be focused on from the two dimensions of width and height respectively, thereby improving the detection accuracy of the edge detection model, and then improving the accuracy of the distance measurement.
[0010] In some embodiments, the enhanced feature extraction network includes multiple upsampling layers, and the multiple upsampling layers correspond to the multiple downsampling layers in a one-to-one order from the beginning to the end; the feature extraction network is enhanced to perform feature fusion processing of deep information and shallow information according to multiple second image feature maps to obtain edge detection results, including: inputting the second image feature map at the end into the first upsampling layer for feature extraction processing to obtain the first third image feature map; splicing the i-th third image feature map with the corresponding second image feature map and inputting the i+1-th upsampling layer for feature fusion processing to obtain the i+1-th third image feature map, where i is a positive integer; performing convolution processing on the third image feature map at the end to obtain edge detection results. In the technical solution of the embodiment of the present application, the image dimension can be restored by enhancing the feature extraction of the feature extraction network, thereby achieving pixel-level semantic segmentation.
[0011] In some embodiments, the edge detection result includes the gray value of each pixel, and generating a mask image based on the edge detection result includes: increasing the gray value of each pixel to obtain a backup image; and negating the gray value of each pixel in the backup image to obtain the mask image. In the technical solution of the embodiment of the present application, the gray value of the pixel is increased and negated to obtain a mask image with a large difference in gray value, which can improve the accuracy of distance measurement.
[0012] In some embodiments, distance measurement is performed in the covered battery image to obtain a distance measurement result, including: for a preset isolation film detection area or a top cover detection area, determining the grayscale gradient between adjacent pixels in the covered battery image; determining the isolation film edge and the top cover edge according to adjacent pixels whose grayscale gradient is greater than a preset threshold; measuring the distance between the isolation film edge and the top cover edge to obtain a distance measurement result. In the technical solution of the embodiment of the present application, the isolation film edge and the top cover edge can be accurately located according to the grayscale gradient, thereby improving the accuracy of the distance measurement.
[0013] In some embodiments, obtaining a battery image includes: obtaining an original image of the battery; performing image enhancement processing on the original image to obtain a processed image; and performing cropping processing on the processed image to obtain a battery image. In the technical solution of the embodiment of the present application, the image enhancement processing can reduce the interference between the isolation film and the top cover, and the cropping processing can improve the speed and robustness of the edge detection model.
[0014] In a second aspect, the present application further provides a device for measuring the distance between a battery isolation film and a top cover, the device comprising:
[0015] An image acquisition module, used to acquire a battery image; the battery image includes an isolation film and a top cover area of the battery;
[0016] An edge detection module is used to perform feature extraction, information focusing and feature fusion processing on the battery image using a pre-trained edge detection model to obtain edge detection results of the isolation film and the top cover;
[0017] The distance measurement module is used to generate a mask image based on the edge detection result; cover the mask image on the battery image, and perform distance measurement in the covered battery image to obtain the distance measurement result between the isolation film and the top cover.
[0018] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any one of the methods in the first aspect when executing the computer program.
[0019] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method of any one of the first aspects is implemented.
[0020] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which implements any one of the methods in the first aspect when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the optional embodiments below. The accompanying drawings are only used for the purpose of illustrating the optional embodiments and are not to be considered as limiting the present application. Moreover, the same reference numerals are used throughout the drawings to represent the same components. In the drawings:
[0022] Figure 1 A schematic diagram of an application environment of an embodiment of the present application;
[0023] Figure 2 A schematic diagram of a flow chart of a method for measuring the distance between a separation membrane and a top cover of a battery according to an embodiment of the present application;
[0024] Figure 3a A battery image according to an embodiment of the present application;
[0025] Figure 3b A battery image covered by a mask image according to an embodiment of the present application;
[0026] Figure 4 A schematic diagram of a process of performing detection steps using an edge detection model according to an embodiment of the present application;
[0027] Figure 5 A schematic diagram of the structure of an edge detection model according to an embodiment of the present application;
[0028] Figure 6 A schematic diagram of a flow chart of feature extraction processing steps performed by a backbone feature extraction network according to an embodiment of the present application;
[0029] Figure 7 A schematic diagram of a flow chart of information focusing processing steps performed by an information processing network according to an embodiment of the present application;
[0030] Figure 8 A schematic diagram of the information focusing process according to an embodiment of the present application;
[0031] Fig. 9 A schematic diagram of a flow chart of a feature extraction process performed by an enhanced feature extraction network according to an embodiment of the present application;
[0032] Fig.10 A schematic diagram of a flow chart of a distance measurement step based on edge detection results according to an embodiment of the present application;
[0033] Fig.11 A schematic diagram of a distance measurement process according to an embodiment of the present application;
[0034] Fig.12 A schematic diagram of a detection area according to an embodiment of the present application;
[0035] Fig.13A schematic diagram of a process of obtaining a battery image according to an embodiment of the present application;
[0036] Fig.14 A structural block diagram of a device for measuring the distance between a separation membrane and a top cover of a battery according to an embodiment of the present application;
[0037] Fig.15 This is a diagram of the internal structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0038] 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.
[0039] 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.
[0040] 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.
[0041] 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.
[0042] 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.
[0043] 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).
[0044] 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.
[0045] With the development of new energy technology, batteries have been widely used. In the process of packing the isolation membrane in the production of lithium batteries, it is necessary to detect the distance between the isolation membrane and the top cover of the battery shell. At present, the commonly used detection methods include: edge point detection of the battery image, then fitting the edge points to obtain the edge of the isolation membrane and the edge of the top cover, and then measuring the distance between the edge of the isolation membrane and the edge of the top cover. However, this method is difficult to meet the precise positioning of the edge of the isolation membrane and the edge of the top cover in complex environments. For example, if there are debris near the isolation membrane and the top cover, or reflections during image acquisition, etc., it is easy to cause inaccurate distance measurement.
[0046] In response to the above problems, an embodiment of the present application provides a method for measuring the distance between the isolation membrane and the top cover of a battery. The method first obtains a battery image; then uses a pre-trained edge detection model to perform feature extraction, information focusing, and feature fusion processing on the battery image to obtain edge detection results of the isolation membrane and the top cover; finally, based on the edge detection results, distance measurement is performed in the battery image to obtain the distance measurement results between the isolation membrane and the top cover. In the technical solution of the embodiment of the present application, the edge detection model can be used to perform semantic segmentation on each pixel of the battery image, thereby obtaining a more accurate isolation membrane edge and top cover edge, thereby improving the accuracy of distance measurement.
[0047] The distance measurement method between the isolation film and the top cover of the battery provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The application environment includes an image acquisition device 101 and a computer device 102. The image acquisition device 101 and the computer device 102 can communicate through a network. The above-mentioned image acquisition device 101 may include but is not limited to various cameras, two-dimensional line scan cameras, three-dimensional cameras, etc.; the above-mentioned computer device 102 may include but is not limited to various personal computers, laptops, tablet computers and servers, etc.
[0048] According to some embodiments of the present application, referring to Figure 2 A method for measuring the distance between the isolation membrane and the top cover of a battery is provided. Figure 1Taking the computer device in the example as an example, the following steps may be included:
[0049] Step 201, obtaining a battery image.
[0050] The battery image includes the isolation membrane and top cover area of the battery.
[0051] The battery production line moves the battery to be inspected to the image acquisition device, with the battery's isolation membrane and top cover area facing the image acquisition device. The image acquisition device captures images of the isolation membrane and top cover area of the battery to be inspected, and then transmits the captured battery image to the computer device in real time.
[0052] Step 202 , using a pre-trained edge detection model to perform feature extraction processing, information focusing processing and feature fusion processing on the battery image, to obtain edge detection results of the isolation film Mylar and the top cover.
[0053] The edge detection result includes a semantic segmentation result of each pixel in the battery image, and the semantic segmentation result can be represented by a gray value or a semantic segmentation label.
[0054] The computer equipment pre-trains the edge detection model. After acquiring the battery image, the battery image is input into the edge detection model, which first performs feature extraction processing on the battery image to obtain an extracted feature map; then, performs information focusing processing on the extracted feature map to obtain a focused feature map; then, the focused feature map is subjected to feature fusion processing to obtain the edge detection results of the isolation film and the top cover.
[0055] It should be noted that due to the high production speed of the current production line, the detection time for each battery is very short. Therefore, in order to meet the real-time requirements, the edge detection model can abandon the network structure with deeper convolution layers and use a lightweight convolution network for feature extraction. However, the use of a lightweight convolution network may cause the accuracy of the entire model to decrease, resulting in inaccurate segmentation of the isolation membrane and the top cover. Therefore, after the feature extraction process, the extracted feature map is focused on the location information of the target feature in the feature map, so that the accuracy of the entire model can be guaranteed.
[0056] Step 203: Generate a mask image based on the edge detection result.
[0057] The edge detection result may include a semantic segmentation result of each pixel in the battery image, and the semantic segmentation result indicates whether the pixel is in the gap between the isolation film and the top cover. Then, a binary mask image is generated according to the semantic segmentation result of each pixel.
[0058] For example, if the semantic segmentation result indicates that the pixel is in the gap between the isolation film and the top cover, the pixel value is set to 255; if the semantic segmentation result indicates that the pixel is not in the gap between the isolation film and the top cover, the pixel value is set to 0.
[0059] Step 204 , overlay the mask image on the battery image, and perform distance measurement in the overlaid battery image to obtain a distance measurement result.
[0060] Overlay the mask image on the battery image to separate the gap between the isolation film and the top cover from other areas. Figure 3a Battery images and Figure 3b The battery image is covered by the mask image. Afterwards, a caliper or a detection frame can be used to perform distance measurement in the covered battery image to obtain a distance measurement result.
[0061] It should be noted that, since the distance between the isolation membrane and the top cover fluctuates, multiple distance measurement points may be set, and the distance measurement result between the isolation membrane and the top cover may be determined based on the distances of the multiple distance measurement points. For example, the maximum value of the multiple distances measured may be determined as the distance measurement result; or the average value of the multiple distances measured may be determined as the distance measurement result.
[0062] In some embodiments, the quality of the battery can be determined based on the distance measurement result. For example, if the distance measurement result shows that the distance between the isolation film and the top cover exceeds the distance range, the battery is determined to be unqualified; if the distance measurement result shows that the distance between the isolation film and the top cover is within the distance range, the battery is determined to be qualified.
[0063] In the above embodiment, a battery image is acquired; then a pre-trained edge detection model is used to perform feature extraction, information focusing and feature fusion processing on the battery image to obtain edge detection results of the isolation membrane and the top cover; finally, distance measurement is performed in the battery image based on the edge detection results to obtain the distance measurement results between the isolation membrane and the top cover. In the technical solution of the embodiment of the present application, the edge detection model can be used to perform semantic segmentation on each pixel of the battery image, so as to obtain more accurate isolation membrane edges and top cover edges, thereby improving the accuracy of distance measurement. It can avoid the problem of over-reliance on edge detection results when measuring directly in the mask image, resulting in a decrease in measurement precision and accuracy. Distance measurement is performed in the battery image covered by the mask image, which can solve the problem of incomplete segmentation of the edge detection model and the problem of interference between the isolation membrane and the top cover, making the stability and accuracy of the edge detection model higher.
[0064] According to some embodiments of the present application, the edge detection model includes a backbone feature extraction network, an information processing network, and an enhanced feature extraction network. Figure 4In the above embodiment, “using a pre-trained edge detection model to perform feature extraction, information focusing and feature fusion processing on the battery image to obtain edge detection results of the isolation film and the top cover” may include the following steps:
[0065] Step 301: Perform feature extraction processing of deep information on a battery image through a backbone feature extraction network to obtain a plurality of first image feature maps.
[0066] The battery image is input into the backbone feature extraction network. The backbone feature extraction network can perform multiple feature extraction processes on the battery image in series to obtain multiple first image feature maps; it can also perform multiple feature extraction processes on the battery image in parallel to obtain multiple first image feature maps.
[0067] The above-mentioned deep information is low-resolution information after multiple feature extractions, which can provide the contextual semantics of the segmentation target in the entire image and can be understood as a feature, which is helpful for classification.
[0068] Step 302: Perform a focusing process on the feature position information of each first image feature map through an information processing network to obtain a plurality of second image feature maps.
[0069] A plurality of first image feature maps are input into an information processing network, and the information processing network performs information focusing processing on each first image feature map, that is, embeds the position information into the channel attention, pays attention to the isolation membrane and the top cover in each first image feature map, and outputs a plurality of second image feature maps.
[0070] Step 303, performing feature fusion processing of deep information and shallow information according to multiple second image feature maps by strengthening the feature extraction network to obtain an edge detection result.
[0071] Multiple second image feature maps are input into the enhanced feature extraction network, and the enhanced feature extraction network can perform feature extraction processing on the multiple second image feature maps respectively to obtain multiple shallow information and deep information, and then fuse the multiple shallow information and deep information to obtain edge detection results. Feature extraction processing can also be performed on the first second image feature map to obtain shallow information; then feature fusion processing is performed on the first feature extraction result and the second second image feature map, and then feature fusion processing is performed on the second feature extraction result and the third second image feature map, and so on, and the edge detection result is determined according to the last feature extraction result.
[0072] In the above embodiment, the backbone feature extraction network is used to perform feature extraction processing on the battery image of deep information to obtain multiple first image feature maps; the information processing network is used to perform focusing processing on the feature position information of each first image feature map to obtain multiple second image feature maps; the feature extraction network is strengthened to perform feature fusion processing of deep information and shallow information according to multiple second image feature maps to obtain edge detection results. In the technical solution of the embodiment of the present application, a lightweight backbone feature extraction network is used for feature extraction, which can improve the detection speed of the edge detection model, thereby meeting the real-time requirements of distance detection; after the feature extraction processing, the feature position in the extracted feature map is focused to meet the accuracy requirements of the edge detection model.
[0073] According to some embodiments of the present application, referring to Figure 5 ,The backbone feature extraction network includes multiple downsampling layers. In practical applications, the backbone feature extraction network, as the backbone feature extraction network of the edge detection model, can include multiple convolutional layers, and some convolutional layers are used as downsampling layers.
[0074] Reference Figure 6 In the above embodiment, “extracting the deep information of the battery image through the backbone feature extraction network to obtain multiple first image feature maps” may include the following steps:
[0075] Step 3011, input the battery image into the first downsampling layer for feature extraction processing to obtain a first first image feature map.
[0076] The battery image is input into the first downsampling layer, which performs feature extraction on the battery image and outputs a first image feature map.
[0077] In some embodiments, before the battery image is input into the first-level downsampling layer, a two-dimensional convolution may be performed on the battery image, and then the convolution result is input into the first-level downsampling layer for feature extraction processing.
[0078] The above downsampling layer can introduce a lightweight attention module (Squeeze and excitation, SE). The attention model can use the Swish activation function or the H-Swish activation function. The H-Swish activation function refers to formula (1):
[0079] ------------------------(1)
[0080] in, , x is the first image feature map. The essence of the ReLU activation function is to take the maximum value between 0 and the input value, that is, max(0,x). The ReLU activation function can alleviate the gradient descent problem.
[0081] It should be noted that the use of SE and H-Swish activation functions can reduce the calculation time while ensuring accuracy. Therefore, the network calculation speed can be improved to meet the real-time requirements of distance detection.
[0082] Step 3012: Input the i-th first image feature map into the i+1-th downsampling layer for feature extraction to obtain the i+1-th first image feature map, where i is a positive integer.
[0083] The first first image feature map is input into the second downsampling layer for feature extraction processing to obtain a second first image feature map; the second first image feature map is input into the third downsampling layer for feature extraction processing to obtain a third first image feature map. And so on, multiple first image feature maps are obtained.
[0084] For example, the 1st, 3rd, 6th, 12th, and 15th bneck blocks of the backbone feature extraction network are used as downsampling layers, and feature extraction processing is performed on these downsampling layers to obtain 5 first image feature maps.
[0085] In the above embodiment, the battery image is input into the first downsampling layer for feature extraction processing to obtain the first first image feature map; the i-th first image feature map is input into the i+1-th downsampling layer for feature extraction processing to obtain the i+1-th first image feature map. In the technical solution of the embodiment of the present application, multiple feature extractions are performed through the backbone feature extraction network, which can improve the accuracy of feature extraction, thereby improving the detection accuracy of the edge detection model. In addition, the backbone feature extraction network adopts a lightweight network with fewer convolutional layers and fast feature extraction speed, which can improve the detection speed of the edge detection model, thereby meeting the real-time requirements of distance detection.
[0086] According to some embodiments of the present application, referring to Figure 5 The information processing network includes multiple information processing layers, which correspond to downsampling layers one by one. Each information processing layer can adopt the attention mechanism (Coordinate attention, CA). CA can embed position information into channel attention, which not only considers the relationship between space and channel, but also takes into account the long-range dependency problem. Figure 7 In the above embodiment, “focusing feature position information of each first image feature map through an information processing network to obtain multiple second image feature maps” may include the following steps:
[0087] Step 3021: For each first image feature map, global average pooling processing is performed in both width and height directions through the corresponding information processing layer to obtain a first width feature map and a first height feature map.
[0088] Among them, the global average pooling process is to add all the pixel values of the feature map and average them to get a value, which is used to represent the corresponding feature map.
[0089] Each first image feature map is input into the corresponding information processing layer. Figure 8 , each information processing layer first performs global average pooling processing in both width and height directions on the input first image feature map to obtain the first width feature map and the first height feature map. Refer to formulas (2) and (3):
[0090] ----------------------------(2)
[0091] -----------------------------(3)
[0092] Where W is the width, H is the height, is the first image feature map, is the first width feature map, It is the first height feature map.
[0093] Step 3022, concatenate the first width feature map and the first height feature map, and perform convolution, normalization and non-linear activation on the concatenated feature map to obtain a feature representation.
[0094] The first height feature map is transformed, and then the first width feature map and the transformed height feature map are concatenated to obtain a concatenated feature map. After that, the concatenated feature map is convolved and normalized, and then the normalized feature map is nonlinearly activated to obtain a feature representation. Refer to formula (4):
[0095] ---------------------------------(4)
[0096] Among them, F is the feature representation, δ() is the nonlinear activation function, f() is the convolution and normalization function, is the first width feature map, It is the first height feature map.
[0097] The above-mentioned standardization processing, also known as whitening processing, is a processing to achieve centralization by removing the mean, such as subtracting the pixel mean from the pixel value and then dividing it by the standard deviation of the pixel value. The above-mentioned nonlinear activation processing can use a variety of nonlinear activation functions to convert linear input into nonlinear.
[0098] Step 3023, dividing and transposing the feature representation to obtain a second width feature map and a second height feature map.
[0099] First, the feature representation is divided to obtain two feature maps; then, one of the feature maps can be transposed to obtain a second width feature map and a second height feature map; or both feature maps can be transposed to obtain a second width feature map and a second height feature map.
[0100] For example, the feature representation quantity is divided in the height direction to obtain two feature maps in the height direction, and one of the feature maps in the height direction is transposed to the width direction, thus obtaining a second width feature map and a second height feature map. Alternatively, the feature representation quantity is divided in the width direction to obtain two feature maps in the width direction, and one of the feature maps in the width direction is transposed to the height direction, thus obtaining a second width feature map and a second height feature map.
[0101] Step 3024, convolution and activation processing are performed on the second width feature map and the second height feature map respectively to obtain width weight and height weight.
[0102] For the second width feature map and the second height feature map, we can first adjust the number of channels through 1×1 convolution, and then use the sigmoid function to obtain the attention weights in the width direction and height direction. Refer to formulas (5) and (6):
[0103] ---------------------------------(5)
[0104] ---------------------------------(6)
[0105] in, is the second width feature map, is the second height feature map, is the transposed convolution in width, is the transposed convolution in height, is the width weight, is the height weight, and σ is the sigmoid function.
[0106] Step 3025, obtaining a second image feature map according to the first image feature map, the width weight and the height weight.
[0107] Multiply the width weight and height weight by the first image feature map to obtain the second image feature map. Refer to formula (7):
[0108] ---------------------------(7)
[0109] in, is the second image feature map, is the first image feature map, is the width weight, Is highly weighted.
[0110] In the above embodiment, for each first image feature map, global average pooling processing is performed in both width and height directions through the corresponding information processing layer to obtain a first width feature map and a first height feature map; the first width feature map and the first height feature map are spliced, and the spliced feature map is convolved, normalized and nonlinearly activated to obtain a feature representation; the feature representation is divided and transposed to obtain a second width feature map and a second height feature map; the second width feature map and the second height feature map are convolved and activated to obtain a width weight and a height weight; the second image feature map is obtained according to the first image feature map, the width weight and the height weight. In the technical solution of the embodiment of the present application, the attention mechanism can be used to obtain the width weight and the height weight, so that the target can be paid attention to from the two dimensions of width and height respectively, thereby improving the detection accuracy of the edge detection model, and then improving the accuracy of the distance measurement.
[0111] According to some embodiments of the present application, referring to Figure 5 , the enhanced feature extraction network includes multiple upsampling layers, and the multiple upsampling layers correspond to the multiple downsampling layers in a one-to-one order from first to last. For example, the backbone feature extraction network includes five downsampling layers, the enhanced feature extraction network includes five upsampling layers, the first upsampling layer corresponds to the fifth downsampling layer, the second upsampling layer corresponds to the fourth downsampling layer, the third upsampling layer corresponds to the third downsampling layer, the fourth upsampling layer corresponds to the second downsampling layer, and the fifth upsampling layer corresponds to the first downsampling layer.
[0112] Reference Fig. 9 In the above embodiment, “by strengthening the feature extraction network to perform feature fusion processing of deep information and shallow information according to multiple second image feature maps to obtain edge detection results” may include the following steps:
[0113] Step 3031, input the last second image feature map into the first level upsampling layer for feature extraction processing to obtain the first third image feature map.
[0114] The first image feature map output by the final downsampling layer is input into the corresponding information processing layer to obtain the second image feature map at the end. The second image feature map is input into the first upsampling layer, and the first upsampling layer performs feature extraction processing on the second image feature map to obtain the first third image feature map.
[0115] Step 3032, concatenate the i-th third image feature map and the corresponding second image feature map and input them into the i+1-th upsampling layer for feature fusion processing to obtain the i+1-th third image feature map, where i is a positive integer.
[0116] After obtaining the first third image feature map (deep information), the first third image feature map is input into the second upsampling layer. The second upsampling layer concatenates the corresponding second image feature map (shallow information) with the first third image feature map to obtain a concatenated feature map. The concatenated feature map is then subjected to feature fusion processing to obtain a second third image feature map. The second third image feature map is input into the third upsampling layer. The third upsampling layer concatenates the corresponding second image feature map (shallow information) with the second third image feature map to obtain a concatenated feature map. The concatenated feature map is then subjected to feature fusion processing to obtain a third third image feature map. By analogy, the last upsampling layer can obtain the last third image feature map.
[0117] Reference Figure 5 The above-mentioned stitching process may include: stitching the first third image feature map with the second image feature map corresponding to the fourth downsampling layer; stitching the second third image feature map with the second image feature map corresponding to the third downsampling layer; stitching the third third image feature map with the second image feature map corresponding to the second downsampling layer; stitching the fourth third image feature map with the second image feature map corresponding to the first downsampling layer.
[0118] The above stitching process can stitch the two image feature maps in the X direction or in the Y direction.
[0119] In some embodiments, the first upsampling layer and the fifth upsampling layer perform feature extraction processing, which may include: performing 3×3 convolution and ReLU activation on the feature map, and then performing 2×2 convolution upsampling processing. The second upsampling layer, the third upsampling layer, and the fourth upsampling layer perform feature extraction processing, which may include: performing two 3×3 convolutions and ReLU activations on the feature map, and then performing 2×2 convolution upsampling processing.
[0120] The above convolution is the result of multiplying two variables within a certain range and then summing them.
[0121] Step 3033, performing convolution processing on the third image feature map at the end to obtain an edge detection result.
[0122] After obtaining the last third image feature map, a 1×1 convolution process is performed on the last third image feature map to obtain an edge detection result.
[0123] In the above embodiment, the second image feature map at the end is input into the first upsampling layer for feature extraction processing to obtain the first third image feature map; the i-th third image feature map is spliced with the corresponding second image feature map and input into the i+1-th upsampling layer for feature fusion processing to obtain the i+1-th third image feature map; the third image feature map at the end is convoluted to obtain edge detection results. In the technical solution of the embodiment of the present application, by strengthening the feature extraction of the feature extraction network, the image dimension can be restored, thereby achieving pixel-level semantic segmentation.
[0124] According to some embodiments of the present application, referring to Fig.10 In the above embodiment, “generating a mask image based on edge detection results” may include the following steps:
[0125] Step 401, increasing the gray value of each pixel to obtain a spare image.
[0126] The edge detection result may include the grayscale value of each pixel. Generally, the grayscale value of the pixel between the isolation film and the top cover is slightly different from the grayscale value of the pixel in other areas, which is not conducive to the subsequent distance measurement. Therefore, the grayscale value of each pixel can be increased first, and the backup image can be obtained according to the grayscale value after the increase.
[0127] For example, the grayscale value of the pixels between the isolation film and the top cover is 0, and the grayscale value of the pixels in other areas is x. The grayscale value of the pixels in other areas is increased by N times or increased to 255 to obtain a spare image.
[0128] Step 402, invert the gray value of each pixel in the backup image to obtain a mask image.
[0129] The grayscale value of each pixel in the backup image is inverted to obtain a mask image.
[0130] In the above embodiment, the grayscale value of each pixel is increased to obtain a backup image; the grayscale value of each pixel in the backup image is inverted to obtain a mask image. In the technical solution of the embodiment of the present application, the grayscale value of the pixel is increased and inverted to obtain a mask image with a large difference in grayscale value, which can improve the accuracy of distance measurement.
[0131] According to some embodiments of the present application, referring to Fig.11 In the above embodiment, “performing distance measurement in the covered battery image to obtain a distance measurement result” may include the following steps:
[0132] Step 501 : for a preset isolation film detection area or a top cover detection area, determine the grayscale gradient between adjacent pixels in the covered battery image.
[0133] The computer device can display a detection area setting interface, obtain area parameters input by the user based on the detection area setting interface, and then determine the isolation film detection area and the top cover detection area according to the area parameters. The above area parameters may include the length, width, number, etc. of the detection area.
[0134] Afterwards, the computer device determines the grayscale gradient between adjacent pixels in the isolation film detection area and the top cover detection area respectively. Fig.12 The left box is the isolation film detection area. From left to right, the gray value change between adjacent pixels in the box is determined to obtain the gray gradient. The right box is the top cover detection area. From right to left, the gray value change between adjacent pixels in the box is determined to obtain the gray gradient.
[0135] Step 502: Determine the edge of the isolation film and the edge of the top cover according to adjacent pixels whose grayscale gradient is greater than a preset threshold.
[0136] If the grayscale gradient is less than or equal to the preset threshold, it indicates that the grayscale value change of adjacent pixels is small, and the adjacent pixels are not at the edge of the isolation film and the edge of the top cover. If the grayscale gradient is greater than the preset threshold, it indicates that the grayscale value change of adjacent pixels is large, and the adjacent pixels are at the edge of the isolation film or the edge of the top cover.
[0137] by Fig.12 Taking the isolation film detection area in as an example, among adjacent pixels, if the grayscale gradient between the right pixel and the left pixel is greater than a preset threshold, the left pixel is determined as the isolation film edge. Fig.12 Taking the top cover detection area in as an example, among adjacent pixels, if the grayscale gradient between the left pixel and the right pixel is greater than a preset threshold, the right pixel is determined as the top cover edge.
[0138] In some embodiments, the area parameters can be set so that the isolation film detection area covers the isolation film edge, and the top cover detection area covers the top cover edge. It is also possible to set multiple isolation film detection areas and multiple top cover detection areas, and fit the entire isolation film edge according to the isolation film edges in the multiple isolation film detection areas, and fit the entire top cover edge according to the top cover edges in the multiple top cover detection areas.
[0139] Step 503, measuring the distance between the edge of the isolation membrane and the edge of the top cover to obtain a distance measurement result.
[0140] The number and position of the distance measurement points can be preset, and the distance between the edge of the isolation membrane and the edge of the top cover can be measured at each distance measurement point to obtain the distance measurement result. The distance measurement interval can also be preset, and multiple distance measurement points can be determined according to the distance measurement interval, and then the distance between the edge of the isolation membrane and the edge of the top cover can be measured at each distance measurement point to obtain the distance measurement result. Multiple isolation membrane detection areas and multiple top cover detection areas can also be set, and for each isolation membrane detection area and the top cover detection area corresponding to the position, the distance between the edge of the isolation membrane and the edge of the top cover is measured to obtain the distance measurement result.
[0141] It should be noted that the distance measurement method is not limited to the above description and can be set according to actual conditions.
[0142] In the above embodiment, for the preset isolation film detection area or the top cover detection area, the grayscale gradient between adjacent pixels is determined in the covered battery image; the isolation film edge and the top cover edge are determined according to the adjacent pixels whose grayscale gradient is greater than the preset threshold; the distance between the isolation film edge and the top cover edge is measured to obtain the distance measurement result. In the technical solution of the embodiment of the present application, the isolation film edge and the top cover edge can be accurately located according to the grayscale gradient, thereby improving the accuracy of the distance measurement.
[0143] According to some embodiments of the present application, referring to Fig.13 In the above embodiment, “obtaining a battery image” may include the following steps:
[0144] Step 601, obtaining an original image of a battery.
[0145] The computer device can obtain the original image of the battery from the image acquisition device.
[0146] Step 602: Perform image enhancement processing on the original image to obtain a processed image.
[0147] A variety of image enhancement algorithms or tools can be used to perform image enhancement processing on the original image to obtain a processed image. For example, a pow function can be used to perform nonlinear transformation to perform image enhancement processing.
[0148] Step 603, cropping the processed image to obtain a battery image.
[0149] Since the detection area on the front of the battery is longer than that on the side, in order to improve the speed and robustness of the edge detection model, the processed image can be cropped into two parts from the middle to obtain the battery image.
[0150] In the above embodiment, an original image of the battery is obtained; the original image is subjected to image enhancement processing to obtain a processed image; and the processed image is subjected to cropping processing to obtain a battery image. In the technical solution of the embodiment of the present application, the image enhancement processing can reduce the interference between the isolation film and the top cover, and the cropping processing can improve the speed and robustness of the edge detection model.
[0151] According to some embodiments of the present application, a method for measuring the distance between an isolation film and a top cover of a battery is provided, which may include the following steps:
[0152] Step 1, obtain the original image of the battery.
[0153] Step 2: Perform image enhancement processing on the original image to obtain a processed image.
[0154] Step 3: crop the processed image to obtain a battery image.
[0155] Step 4: Input the battery image into the first downsampling layer for feature extraction to obtain a first image feature map.
[0156] Step 5: Input the i-th first image feature map into the i+1-th downsampling layer for feature extraction to obtain the i+1-th first image feature map, where i is a positive integer.
[0157] Step 6: For each first image feature map, global average pooling processing is performed in both width and height directions through the corresponding information processing layer to obtain a first width feature map and a first height feature map.
[0158] Step 7, concatenate the first width feature map and the first height feature map, and perform convolution, normalization and nonlinear activation on the concatenated feature map to obtain a feature representation.
[0159] Step 8: divide and transpose the feature representation to obtain a second width feature map and a second height feature map.
[0160] Step 9: Perform convolution and activation processing on the second width feature map and the second height feature map respectively to obtain width weight and height weight.
[0161] Step 10, obtaining a second image feature map according to the first image feature map, the width weight and the height weight.
[0162] Step 11, input the last second image feature map into the first level upsampling layer for feature extraction processing to obtain the first third image feature map.
[0163] Step 12, concatenating the i-th third image feature map with the corresponding second image feature map and inputting the concatenated map into the i+1-th upsampling layer for feature fusion processing to obtain the i+1-th third image feature map, where i is a positive integer.
[0164] Step 13, performing convolution processing on the third image feature map at the end to obtain an edge detection result.
[0165] Step 14, increasing the gray value of each pixel to obtain a spare image.
[0166] Step 15, inverting the grayscale value of each pixel in the backup image to obtain a mask image.
[0167] Step 16: for the preset isolation film detection area or the top cover detection area, determine the grayscale gradient between adjacent pixels in the covered battery image.
[0168] Step 17, determining the edge of the isolation film and the edge of the top cover according to adjacent pixels whose grayscale gradient is greater than a preset threshold.
[0169] Step 18, measuring the distance between the edge of the isolation membrane and the edge of the top cover to obtain a distance measurement result.
[0170] In the above embodiment, the original image is subjected to image enhancement and cropping to obtain a battery image. After that, multiple feature extractions are performed through the backbone feature extraction network, and the width weight and height weight can be obtained by using the attention mechanism. According to the width weight and the height weight, the target in the image can be focused on; then, the image dimension is restored through multiple feature extractions. The above processing can reduce the interference between the isolation membrane and the top cover, improve the speed and detection accuracy of the edge detection model, and meet the real-time requirements of distance detection. Furthermore, distance measurement is performed in the battery image covered by the mask image, which can solve the problem of incomplete segmentation of the edge detection model and the problem of interference between the isolation membrane and the top cover, making the edge detection model more stable and accurate.
[0171] It should be understood that, although the various steps in the above flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowchart may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0172] Based on the same inventive concept, the embodiment of the present application also provides a device for measuring the distance between the isolation membrane and the top cover of a battery for implementing the above-mentioned method for measuring the distance between the isolation membrane and the top cover of the battery. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations of the embodiments of the device for measuring the distance between the isolation membrane and the top cover of one or more batteries provided below can refer to the limitations of the method for measuring the distance between the isolation membrane and the top cover of the battery above, and will not be repeated here.
[0173] According to some embodiments of the present application, referring to Fig.14 , a device for measuring the distance between a battery isolation film and a top cover is provided, the device comprising:
[0174] The image acquisition module 701 is used to acquire a battery image; the battery image includes the isolation membrane and the top cover area of the battery;
[0175] The edge detection module 702 is used to perform feature extraction processing, information focusing processing and feature fusion processing on the battery image using a pre-trained edge detection model to obtain edge detection results of the isolation film and the top cover;
[0176] The distance measurement module 703 is used to generate a mask image based on the edge detection result; cover the mask image on the battery image, and perform distance measurement in the covered battery image to obtain the distance measurement result between the isolation film and the top cover.
[0177] In some embodiments, the edge detection model includes a backbone feature extraction network, an information processing network and an enhanced feature extraction network. The edge detection module 702 is specifically used to perform feature extraction processing of deep information on the battery image through the backbone feature extraction network to obtain multiple first image feature maps; focus processing of feature position information on each first image feature map through the information processing network to obtain multiple second image feature maps; and perform feature fusion processing of deep information and shallow information based on multiple second image feature maps through the enhanced feature extraction network to obtain edge detection results.
[0178] In some embodiments, the backbone feature extraction network includes multiple downsampling layers; the edge detection module 702 is specifically used to input the battery image into the first downsampling layer for feature extraction processing to obtain the first first image feature map; the i-th first image feature map is input into the i+1-th downsampling layer for feature extraction processing to obtain the i+1-th first image feature map, where i is a positive integer.
[0179] In some embodiments, the information processing network includes multiple information processing layers, and the information processing layers correspond to the downsampling layers one by one; the edge detection module 702 is specifically used to perform global average pooling processing in both width and height directions on each first image feature map through the corresponding information processing layer to obtain a first width feature map and a first height feature map; splicing the first width feature map and the first height feature map, and convolving, normalizing and non-linearly activating the spliced feature map to obtain a feature representation; dividing and transposing the feature representation to obtain a second width feature map and a second height feature map; convolving and activating the second width feature map and the second height feature map respectively to obtain a width weight and a height weight; and obtaining a second image feature map according to the first image feature map, the width weight and the height weight.
[0180] In some embodiments, the enhanced feature extraction network includes multiple upsampling layers, and the multiple upsampling layers correspond to the multiple downsampling layers in a one-to-one order from first to last; the edge detection module 702 is specifically used to input the second image feature map at the end into the first upsampling layer for feature extraction processing to obtain the first third image feature map; the i-th third image feature map is spliced with the corresponding second image feature map and then input into the i+1-th upsampling layer for feature fusion processing to obtain the i+1-th third image feature map, where i is a positive integer; the third image feature map at the end is convolved to obtain an edge detection result.
[0181] In some embodiments, the distance measurement module 703 is specifically used to increase the gray value of each pixel to obtain a spare image; and to invert the gray value of each pixel in the spare image to obtain a mask image.
[0182] In some embodiments, the distance measurement module 703 is specifically used to determine the grayscale gradient between adjacent pixels in the covered battery image for a preset isolation film detection area or a top cover detection area; determine the isolation film edge and the top cover edge based on adjacent pixels whose grayscale gradient is greater than a preset threshold; measure the distance between the isolation film edge and the top cover edge to obtain a distance measurement result.
[0183] In some embodiments, the image acquisition module 701 is specifically used to acquire an original image of a battery; perform image enhancement processing on the original image to obtain a processed image; and perform cropping processing on the processed image to obtain a battery image.
[0184] Each module in the above-mentioned distance measuring device between the isolation membrane and the top cover of the battery can be fully or partially implemented by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0185] According to some embodiments of the present application, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.15 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for measuring the distance between the isolation membrane and the top cover of a battery is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0186] Those skilled in the art will understand that Fig.15 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0187] According to some embodiments of the present application, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0188] According to some embodiments of the present application, a computer program product is also provided, and when the computer program is executed by a processor, the above method can be implemented. The computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, part or all of the above method can be implemented in whole or in part according to the process or function described in the embodiment of the present application.
[0189] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0190] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0191] The above-described embodiments only express several implementation methods of the present application, which is convenient for understanding the technical solutions of the present application in detail, but cannot be understood as limiting the scope of protection of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. It should be understood that the technical solutions obtained by those skilled in the art through logical analysis, reasoning or limited experiments on the basis of the technical solutions provided in the present application are all within the protection scope of the attached claims described in the present application. Therefore, the protection scope of the patent of this application shall be based on the contents of the attached claims, and the description and drawings can be used to explain the contents of the claims.
Claims
1. A method for measuring the distance between a battery isolation membrane and a top cover, It is characterized in that The method comprises: Acquire a battery image, wherein the battery image includes an isolation film and a top cover area of the battery; Using a pre-trained edge detection model to perform feature extraction processing, information focusing processing and feature fusion processing on the battery image, to obtain edge detection results of the isolation film and the top cover; generating a mask image based on the edge detection result; Overlaying the mask image on the battery image, and performing distance measurement in the covered battery image to obtain a distance measurement result between the isolation film and the top cover; The edge detection model includes a backbone feature extraction network, an information processing network and an enhanced feature extraction network. The pre-trained edge detection model is used to perform feature extraction processing, information focusing processing and feature fusion processing on the battery image to obtain edge detection results of the isolation membrane and the top cover, including: Performing feature extraction processing of deep information on the battery image through the backbone feature extraction network to obtain a plurality of first image feature maps; Performing a focusing process on feature position information of each of the first image feature maps through the information processing network to obtain a plurality of second image feature maps; Performing feature fusion processing of deep information and shallow information according to a plurality of second image feature maps through the enhanced feature extraction network to obtain the edge detection result; The backbone feature extraction network includes a multi-level downsampling layer; the information processing network includes a plurality of information processing layers, and the information processing layers correspond to the downsampling layers one by one; the information processing network performs focusing processing on the feature position information of each of the first image feature maps to obtain a plurality of second image feature maps, including: For each of the first image feature maps, global average pooling processing is performed in width and height directions through the corresponding information processing layer to obtain a first width feature map and a first height feature map; Performing splicing processing on the first width feature map and the first height feature map, and performing convolution, normalization and nonlinear activation processing on the spliced feature map to obtain a feature representation; Performing division processing and transposition processing on the feature representation quantity to obtain a second width feature map and a second height feature map; Performing convolution and activation processing on the second width feature map and the second height feature map respectively to obtain a width weight and a height weight; The second image feature map is obtained according to the first image feature map, the width weight and the height weight.
2. The method according to claim 1, It is characterized in that The deep information feature extraction process is performed on the battery image by the backbone feature extraction network to obtain a plurality of first image feature maps, including: Inputting the battery image into the first downsampling layer for feature extraction processing to obtain a first feature map of the first image; The i-th first image feature map is input into the i+1-th downsampling layer for feature extraction processing to obtain the i+1-th first image feature map, where i is a positive integer.
3. The method according to claim 2, It is characterized in that The enhanced feature extraction network includes multiple levels of upsampling layers, and the multiple levels of upsampling layers correspond to the multiple levels of downsampling layers in a one-to-one order of first to last; the enhanced feature extraction network performs feature fusion processing of deep information and shallow information according to a plurality of second image feature maps to obtain the edge detection result, including: Inputting the second image feature map at the end into the first upsampling layer for feature extraction processing to obtain a first third image feature map; The i-th third image feature map is concatenated with the corresponding second image feature map and then input into the i+1-th upsampling layer for feature fusion processing to obtain the i+1-th third image feature map, where i is a positive integer; The third image feature map at the end is convolved to obtain the edge detection result.
4. The method according to claim 1, It is characterized in that The edge detection result includes a grayscale value of each pixel, and generating a mask image based on the edge detection result includes: Performing an increase process on the gray value of each pixel to obtain a spare image; The grayscale value of each pixel in the backup image is inverted to obtain the mask image.
5. The method according to claim 1, It is characterized in that The performing distance measurement in the covered battery image to obtain the distance measurement result includes: For a preset isolation film detection area or a top cover detection area, determining a grayscale gradient between adjacent pixels in the covered battery image; Determine the edge of the isolation film and the edge of the top cover according to the adjacent pixels whose grayscale gradient is greater than a preset threshold; The distance between the edge of the isolation film and the edge of the top cover is measured to obtain the distance measurement result.
6. The method according to any one of claims 1 to 5, It is characterized in that The obtaining of the battery image comprises: Get the original image of the battery; Performing image enhancement processing on the original image to obtain a processed image; The processed image is cropped to obtain the battery image.
7. A device for measuring the distance between the isolation membrane and the top cover of a battery, It is characterized in that The device comprises: An image acquisition module, used to acquire a battery image; the battery image includes an isolation membrane and a top cover area of the battery; An edge detection module, used to perform feature extraction processing, information focusing processing and feature fusion processing on the battery image using a pre-trained edge detection model to obtain edge detection results of the isolation film and the top cover; A distance measurement module, used for generating a mask image based on the edge detection result; covering the mask image on the battery image, and performing distance measurement in the covered battery image to obtain a distance measurement result between the isolation film and the top cover; The edge detection model includes a backbone feature extraction network, an information processing network and an enhanced feature extraction network. The edge detection module is specifically used to perform feature extraction processing of deep information on the battery image through the backbone feature extraction network to obtain multiple first image feature maps; perform focusing processing of feature position information on each of the first image feature maps through the information processing network to obtain multiple second image feature maps; perform feature fusion processing of deep information and shallow information according to multiple second image feature maps through the enhanced feature extraction network to obtain the edge detection result; The backbone feature extraction network includes multiple downsampling layers; the information processing network includes multiple information processing layers, and the information processing layers correspond to the downsampling layers one by one; the edge detection module is specifically used to perform global average pooling processing in width and height directions on each of the first image feature maps through the corresponding information processing layer to obtain a first width feature map and a first height feature map; splicing the first width feature map and the first height feature map, and convolving, normalizing and non-linearly activating the spliced feature map to obtain a feature representation; dividing and transposing the feature representation to obtain a second width feature map and a second height feature map; convolving and activating the second width feature map and the second height feature map respectively to obtain a width weight and a height weight; and obtaining the second image feature map according to the first image feature map, the width weight and the height weight.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for detecting metal area in image, equipment and storage medium
CN110443254A
Edge detection method and device for battery insulator and battery production line
CN117848222A
