Welding mark detection method, device, computer equipment and storage medium
Through the pre-trained solder mark segmentation model and attention mechanism, combined with channel and spatial attention, the problem of inaccurate solder mark positioning is solved, and high-accuracy solder mark detection is achieved, adapting to different conditions and types.
Patent Information
- Application Number
- CN202410630657.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-05-21
AI Technical Summary
In existing welding mark detection methods, inaccurate welding mark positioning results in inaccurate defect detection. Especially under different welding mark types and background conditions, it is difficult to achieve accurate defect detection.
The pre-trained solder mark segmentation model is used to segment the battery image through the feature extraction network and feature fusion network. It combines the channel attention and spatial attention mechanisms to accurately locate the solder mark area and improve detection accuracy.
It achieves pixel-level segmentation accuracy, adapts to different welding print types and background conditions, reduces the need for manual intervention, improves the accuracy and efficiency of welding print detection, and reduces segmentation errors.
Smart Images

Figure CN118212238B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of battery detection, and in particular to a weld mark detection method, device, computer equipment and storage medium. Background Art
[0002] With the development of new energy technology, batteries have been widely used. In the battery production process, hot melt welding is an indispensable process. Due to process and equipment reasons, hot melt welding will have certain defects, and various detection methods are needed to detect the defects to improve the battery yield.
[0003] At present, the commonly used method is to determine the weld mark area according to the positional relationship between the weld mark and the battery, and then detect whether there is a defect in the weld mark area. However, this method is prone to inaccurate weld mark positioning, resulting in inaccurate defect detection. Summary of the invention
[0004] Based on the above problems, the present application provides a weld mark detection method, device, computer equipment and storage medium, which can accurately locate weld marks and improve the accuracy of weld mark detection.
[0005] In a first aspect, the present application provides a weld mark detection method, the method comprising: extracting an image of interest from a pre-acquired battery image; wherein the image of interest includes a weld mark area; using a pre-trained weld mark segmentation model to segment the image of interest to obtain a weld mark area; determining a weld mark detection result according to the weld mark area; wherein the weld mark detection result is used to characterize whether the weld mark is qualified, and the weld mark includes a weld mark of hot melt welding of an isolation film; wherein the weld mark segmentation model comprises a feature extraction network, the feature extraction network comprises an attention mechanism layer and a downsampling layer located before and after the attention mechanism layer, the attention mechanism layer comprises a channel attention module and a spatial attention module, and the processing process of the attention mechanism layer comprises: inputting the i-th first feature map output by the downsampling layer before the attention mechanism layer into the channel attention module for channel analysis processing to obtain the weights of each channel in the i-th first feature map; determining a channel feature map according to the i-th first feature map and the weights of each channel; inputting the channel feature map into the spatial attention module for spatial analysis processing to obtain the spatial weight of the i-th first feature map; obtaining the i+1-th first feature map according to the channel feature map and the spatial weight.
[0006] The technical solution provided by the embodiment of the present application can narrow the detection range by extracting the image of interest, and the weld mark segmentation model can adapt to different weld mark types and background conditions, without manually adjusting the grayscale range in the image, reducing the need for manual intervention, and making the whole process more automated; and the weld mark segmentation model is pre-trained based on a large-scale data set, which can better cope with weld mark detection tasks in different scenes and changing conditions and capture more information. Therefore, the weld mark segmentation model can achieve pixel-level segmentation accuracy, thereby accurately locating weld marks and improving the accuracy of defect detection. Furthermore, by combining channel attention and spatial attention, the key information in the features can be fully captured, and the network's representation ability can be improved, thereby achieving better performance in detection tasks.
[0007] In some embodiments, the weld mark segmentation model further includes a feature fusion network, and the weld mark segmentation model trained in advance is used to segment the image of interest to obtain the weld mark area, including: extracting features of deep information from the image of interest through a feature extraction network to obtain a plurality of first feature maps; and fusing features of deep information and shallow information based on the plurality of first feature maps through a feature fusion network to obtain the weld mark area. In the technical solution of the embodiment of the present application, the deep information in the image of interest is extracted through a feature extraction network, and the deep information is fused with the shallow information through a feature fusion network, so that the weld mark can be located more accurately, thereby improving the accuracy of weld mark detection.
[0008] In some embodiments, the feature extraction network performs feature extraction processing on the deep information of the image of interest to obtain multiple first feature maps, including: inputting the image of interest into the first downsampling layer for feature extraction processing to obtain the first first feature map; inputting the i-th first feature map into the next level for feature extraction processing to obtain the i+1-th first feature map, where i is a positive integer and the next level is an attention mechanism layer or a downsampling layer. In the technical solution of the embodiment of the present application, an attention mechanism layer is set in the feature extraction network of the weld mark segmentation model, which can improve the performance of the weld mark segmentation model in the weld mark positioning task, increase the perception ability and accuracy of the feature extraction network, reduce segmentation errors, and thus improve the reliability of weld mark detection.
[0009] In some embodiments, the ith first feature map output by the downsampling layer before the attention mechanism layer is input into the channel attention module for channel analysis processing to obtain the weights of each channel in the ith first feature map, including: performing global maximum pooling processing and global average pooling processing on the ith first feature map respectively to obtain the first maximum pooling map and the first average pooling map; performing channel analysis processing on the first maximum pooling map and the first average pooling map respectively to obtain the first channel analysis map and the second channel analysis map; performing activation operation based on the first channel analysis map and the second channel analysis map to obtain the weights of each channel in the ith first feature map. In the technical solution of the embodiment of the present application, the weights of each channel can be obtained by utilizing the channel relationship of the features, so that the feature extraction can focus on important channels, improve the accuracy of feature extraction, and further improve the accuracy of weld mark detection.
[0010] In some embodiments, the channel feature map is input into the spatial attention module for spatial analysis processing to obtain the spatial weight of the i-th first feature map, including: performing global maximum pooling processing and global average pooling processing on the channel feature map to obtain a second maximum pooling map and a second average pooling map; performing a convolution operation based on the second maximum pooling map and the second average pooling to obtain a convolution map; performing an activation operation on the convolution map to obtain the spatial weight of the i-th first feature map. In the technical solution of the embodiment of the present application, the spatial weight can represent the importance of the corresponding position, so that the feature extraction can focus on the important spatial position, improve the accuracy of the feature extraction, and thus improve the accuracy of the weld mark detection.
[0011] In some embodiments, the feature fusion network includes multiple upsampling layers, and the multiple upsampling layers correspond to the layers of the feature extraction network in a one-to-one order from the beginning to the end. The feature fusion network performs feature fusion processing of deep information and shallow information according to multiple first feature maps to obtain the weld print area, including: inputting the last first feature map into the first level upsampling layer for feature extraction processing to obtain the first second feature map; splicing the i-th second feature map with the corresponding first feature map and inputting the i+1-th level upsampling layer for feature fusion processing to obtain the i+1-th second feature map, where i is a positive integer; performing convolution processing on the last second feature map to obtain the weld print area. In the technical solution of the embodiment of the present application, shallow information and deep information can be fused through multi-level upsampling, thereby improving the accuracy of weld print segmentation.
[0012] In some embodiments, determining the weld mark detection result according to the weld mark area includes: determining the weld mark area according to the weld mark area; and determining the weld mark detection result according to the weld mark area and a preset area range. In the technical solution of the embodiment of the present application, the weld mark detection result can be determined conveniently and quickly according to the weld mark area, thereby improving the detection efficiency.
[0013] In some embodiments, determining the weld mark area according to the weld mark region includes: determining the number of pixels in the weld mark region; and determining the weld mark area according to a pre-established correspondence between the pixel area and the actual area and the number of pixels. In the technical solution of the embodiment of the present application, the weld mark area can be quickly determined according to the number of pixels, thereby improving the efficiency of weld mark detection.
[0014] In a second aspect, the present application also provides a welding mark detection device, the device comprising:
[0015] An image extraction module, used to extract an image of interest from a pre-acquired battery image; wherein the image of interest includes a weld mark area;
[0016] A region segmentation module is used to segment the image of interest using a pre-trained weld mark segmentation model to obtain a weld mark region;
[0017] A weld mark detection module, used to determine a weld mark detection result according to a weld mark area; wherein the weld mark detection result is used to indicate whether the weld mark is qualified, and the weld mark includes a weld mark of a hot-melt weld of an isolation film;
[0018] The weld mark segmentation model includes a feature extraction network, which includes an attention mechanism layer and downsampling layers before and after the attention mechanism layer. The attention mechanism layer includes a channel attention module and a spatial attention module.
[0019] The region segmentation module is specifically used to input the i-th first feature map output by the downsampling layer before the attention mechanism layer into the channel attention module for channel analysis processing to obtain the weights of each channel in the i-th first feature map; determine the channel feature map according to the i-th first feature map and the weights of each channel; input the channel feature map into the spatial attention module for spatial analysis processing to obtain the spatial weight of the i-th first feature map; obtain the i+1-th first feature map according to the channel feature map and the spatial weight.
[0020] 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.
[0021] 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.
[0022] 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
[0023] 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:
[0024] Figure 1 The application environment of the welding mark detection method according to an embodiment of the present application;
[0025] Figure 2 It is a schematic diagram of the flow of a welding mark detection method according to an embodiment of the present application;
[0026] Figure 3 is a schematic diagram of a battery image according to an embodiment of the present application;
[0027] Figure 4a is a schematic diagram of the structure of a feature extraction network according to an embodiment of the present application;
[0028] Figure 4b is a schematic diagram of the structure of the attention mechanism layer of an embodiment of the present application;
[0029] Figure 5 It is a flowchart of processing through the attention mechanism layer according to an embodiment of the present application;
[0030] Figure 6 It is a flow chart of the segmentation steps using the weld print segmentation model according to one embodiment of the present application;
[0031] Figure 7 It is a flowchart of a feature extraction processing step performed by a feature extraction network according to an embodiment of the present application;
[0032] Figure 8 is a flowchart of processing steps performed by a channel attention module according to an embodiment of the present application;
[0033] Fig. 9 is a schematic diagram of the processing flow of a channel attention module according to an embodiment of the present application;
[0034] Fig.10 is a flowchart of processing steps performed by a spatial attention module according to an embodiment of the present application;
[0035] Fig.11 is a schematic diagram of a processing flow of a spatial attention module according to an embodiment of the present application;
[0036] Fig.12 It is a structural schematic diagram of a weld print segmentation model according to an embodiment of the present application;
[0037] Fig.13It is a flowchart of a feature fusion processing step performed through a feature fusion network according to an embodiment of the present application;
[0038] Fig.14 It is a flowchart of the step of determining the weld mark detection result according to the weld mark area in one embodiment of the present application;
[0039] Fig.15 It is a flowchart of the step of determining the weld print area according to the weld print area according to an embodiment of the present application;
[0040] Fig.16 It is a structural block diagram of a welding mark detection device according to an embodiment of the present application;
[0041] Fig.17 It is a diagram of the internal structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0042] 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.
[0043] 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.
[0044] 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.
[0045] 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.
[0046] 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.
[0047] 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).
[0048] 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.
[0049] With the development of new energy technology, batteries have been widely used. In the battery production process, hot melt welding is an indispensable process. Due to process and equipment reasons, hot melt welding will have certain defects, and various detection methods are needed to detect defects to improve the battery yield. At present, the common method is to locate the battery in the image by grabbing the edge with a caliper, and then determine the welding area according to the positional relationship between the welding mark and the battery, and then detect whether the welding area is qualified. However, this method has many problems. For example, the background on the collected product image interferes with the welding mark, making it difficult to accurately determine the welding area; for example, changes in battery type, light source, etc., resulting in unstable grayscale in the collected product image, making it difficult to determine the welding area according to the positional relationship, and for example, the hot melt welding mark is incomplete, segmentation occurs, or the hot melt temperature drops, resulting in a problem of false welding, which will increase the difficulty of detection, resulting in inaccurate welding mark positioning, affecting the accuracy of defect detection, and then leading to overkill or miss kill problems. Among them, the overkill rate refers to the mistaken removal of defect-free qualified products from the production line; the miss kill rate refers to the defective products as qualified products. The weld mark of the hot-melt welding of the isolation film Mylar is inspected. If it is over-killed, it will affect the shell yield; if it is missed, the isolation film is prone to shifting after shelling, scratching the surface of the bare battery cell.
[0050] The embodiment of the present application provides a weld mark detection solution, which extracts an image of interest including a weld mark area from a pre-acquired battery image; uses a pre-trained weld mark segmentation model to segment the image of interest to obtain the weld mark area; and determines the weld mark detection result according to the weld mark area. The technical solution provided by the embodiment of the present application can narrow the detection range by extracting the image of interest, and can adapt to different weld mark types and background conditions by using the weld mark segmentation model for segmentation, without manually adjusting the grayscale range in the image, reducing the need for manual intervention, and making the entire process more automated; and the weld mark segmentation model is pre-trained based on a large-scale data set, which can better cope with weld mark detection tasks in different scenarios and changing conditions, and capture more information. Therefore, the weld mark segmentation model can achieve pixel-level segmentation accuracy, thereby accurately locating weld marks and improving the accuracy of defect detection.
[0051] The welding mark detection method 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.
[0052] According to some embodiments of the present application, referring to Figure 2 , provides a welding mark detection method, which may include the following steps:
[0053] Step 201 : extracting an image of interest from a pre-acquired battery image.
[0054] Among them, the image of interest includes the weld mark area. The image of the region of interest refers to the image to be processed that is outlined in the form of a box, circle, ellipse, irregular polygon, etc. in the processed image. Various operators and functions are often used in some machine vision software to obtain the region of interest (ROI) and then obtain the image of interest.
[0055] The battery production line moves the batteries that have undergone the hot melt welding process to the image acquisition device, which captures the images of the batteries and then transmits the captured battery images to the computer device in real time.
[0056] The computer equipment can determine the battery edge in the battery image based on the grayscale value. Usually, the relative position between the weld mark and the battery edge is fixed. Therefore, the weld mark area can be determined based on the relative position and the battery edge; then, the image of interest containing the weld mark area is extracted from the battery image according to preset rules.
[0057] Reference Figure 3 In the battery image A shown, the relative position relationship between the battery A1 and the weld mark area A2 is that the distance between the weld mark area and the right edge of the battery 11 is a, and the weld mark area 12 can be determined based on the distance and the position of the battery edge. Afterwards, the long side of the image of interest is determined based on the height of the battery 11, and the wide side of the image of interest is determined based on the width b of the weld mark area 12 and the distance a; or, the long side and wide side of the image of interest are determined based on the size of the weld mark area 12 and the reserved width; finally, the image of interest is cut out from the battery image based on the long side and the wide side.
[0058] It should be noted that the preset rules are not limited to the above examples, and other rules may also be used in practical applications.
[0059] Step 202: Use a pre-trained weld mark segmentation model to segment the image of interest to obtain a weld mark area.
[0060] The welding marks include welding marks of the isolation film mylar by hot melting.
[0061] The weld mark segmentation model is trained in advance using a large-scale data set. After the image of interest is extracted, the image of interest is input into the weld mark segmentation model, and the weld mark segmentation model can directly output the segmentation result. For example, a detection box is marked in the image of interest, and the detection box is the weld mark area; or the weld mark edge is marked in the area of interest.
[0062] It can be understood that the weld mark segmentation model can adapt to different weld mark types and background conditions, without the need to manually adjust the grayscale range in the image, reducing the need for manual intervention and making the entire process more automated; moreover, the weld mark segmentation model is pre-trained based on a large-scale data set, and can better cope with weld mark detection tasks in different scenarios and changing conditions, and capture more information. Therefore, the weld mark segmentation model can achieve pixel-level segmentation accuracy, thereby accurately locating weld marks and improving the accuracy of defect detection.
[0063] In some embodiments, the weld segmentation model includes a feature extraction network, referring to Figure 4a The feature extraction network includes an attention mechanism layer 12 and a downsampling layer 11 located before and after the attention mechanism layer. The attention mechanism layer includes a channel attention module and a spatial attention module. Figure 4b, the attention mechanism layer 12 includes a channel attention module 121 and a spatial attention module 122. Among them, the channel attention mainly focuses on "which channels are important". In a convolutional neural network, each channel can be regarded as a feature map of an image, such as color, texture, or shape. The goal of the channel attention mechanism is to assign a weight to each feature channel so that the network can adaptively emphasize features that are beneficial to the task while suppressing irrelevant or noisy features. Spatial attention focuses on "where" is an informative part. It can help the network locate the most informative areas in the image and further improve the network's feature extraction capabilities. The attention mechanism layer can effectively save computing power by focusing on key information in channels and space. The following are several key reasons for saving computing power:
[0064] 1) Enhanced feature selectivity: The attention mechanism layer allows the model to focus more on features that are beneficial to the task and ignore irrelevant or noisy features. This means that the model no longer needs to process these useless features in subsequent calculations, thereby reducing unnecessary calculations.
[0065] 2) Reduce the number of parameters: In the spatial attention module, the dimension of the feature map is reduced through convolution operations, and then it is raised to the original dimension after one convolution. This design can not only establish high-dimensional spatial feature correlation, but also greatly reduce the number of parameters. The reduction in the number of parameters means that the model requires less computing resources during training and inference.
[0066] 3) Improve the connection between features: Through the attention mechanism layer, the feature map is recalibrated in terms of attention weights in both the channel and spatial dimensions. This makes the connection between the features closer and the model can locate the key information more accurately. Therefore, the model can use this key information more efficiently in subsequent calculations, reducing the processing of useless information and thus saving computing power.
[0067] 4) Parallel processing: In the attention mechanism layer, the channel attention and spatial attention modules are executed sequentially, but there is no data dependency between them, so they can be processed in parallel. This parallel processing method can make full use of computing resources, improve computing efficiency, and further save computing power.
[0068] Therefore, the attention mechanism layer can effectively save computing power by enhancing the selectivity of features, reducing the number of parameters, improving the connection between features, and realizing parallel processing. This makes the attention matrix layer more efficient and has lower computational cost when processing large-scale image data.
[0069] Reference Figure 5, the processing of the attention mechanism layer can include:
[0070] Step 2021, the i-th first feature map output by the downsampling layer before the attention mechanism layer is input into the channel attention module for channel analysis processing to obtain the weights of each channel in the i-th first feature map.
[0071] Take the attention mechanism layer in the second level of the feature extraction network as an example, refer to Figure 4b , the first feature map C output by the first downsampling layer is input into the channel attention module 121, which analyzes which channels of the color, texture, shape and other channels in the first feature map are important, and then assigns weights to each channel according to the analysis results.
[0072] Step 2022, determining a channel feature map according to the i-th first feature map and the weights of each channel.
[0073] Multiply the weight of each channel by each channel of the i-th first feature map to obtain the channel feature map after channel attention weighting.
[0074] Step 2023, input the channel feature map into the spatial attention module for spatial analysis processing to obtain the spatial weight of the i-th first feature map.
[0075] Reference Figure 4b , the channel feature map is input into the spatial attention module 122, and the spatial attention module 122 analyzes where the information is in the channel feature map, locates the area with the most information in the channel feature map, and obtains the spatial weight corresponding to the first feature map C.
[0076] Step 2024, obtaining the (i+1)th first feature map according to the channel feature map and the spatial weight.
[0077] Reference Figure 4b , multiply the channel feature map by the spatial weight and output the second first feature map C.
[0078] Understandably, by combining channel attention and spatial attention, the key information in the features can be fully captured, improving the representation ability of the network and thus achieving better performance in detection tasks.
[0079] Step 203, determining the weld mark detection result according to the weld mark area.
[0080] Among them, the weld mark detection result is used to indicate whether the weld mark is qualified.
[0081] After the weld mark area is determined, the weld mark area can be classified to obtain the weld mark type; then the weld mark detection result can be determined according to the weld mark type. For example, if the weld mark type obtained by classification is a cold weld, the weld mark detection result can be determined as an unqualified weld mark. For the weld mark of the isolation film hot melt welding, its type mainly includes at least one of a cold weld, a leaking weld, an insufficient area and a normal area.
[0082] Alternatively, the weld mark area is input into a pre-trained quality inspection model, and the quality inspection model directly outputs a weld mark inspection result of whether the weld mark is qualified based on the weld mark area.
[0083] It should be noted that the detection method is not limited to the above examples, and other methods may also be used in practical applications.
[0084] In the above embodiment, an image of interest including a weld mark area is extracted from a pre-acquired battery image; the image of interest is segmented using a pre-trained weld mark segmentation model to obtain a weld mark area; and the weld mark detection result is determined based on the weld mark area. The technical solution provided by the embodiment of the present application can narrow the detection range by extracting the image of interest, and can adapt to different weld mark types and background conditions by using a weld mark segmentation model for segmentation, without the need to manually adjust the grayscale range in the image, reducing the need for manual intervention and making the entire process more automated; and the weld mark segmentation model is pre-trained based on a large-scale data set, and can better cope with weld mark detection tasks in different scenarios and changing conditions, and capture more information. Therefore, the weld mark segmentation model can achieve pixel-level segmentation accuracy, thereby accurately locating weld marks and improving the accuracy of defect detection.
[0085] According to some embodiments of the present application, the weld print segmentation model also includes a feature fusion network, referring to Figure 6 In the above embodiment, the step of "segmenting the image of interest using the pre-trained weld mark segmentation model to obtain the weld mark area" may include:
[0086] Step 301: Perform feature extraction processing of deep information on an image of interest through a feature extraction network to obtain a plurality of first feature maps.
[0087] The image of interest is input into the feature extraction network, and the feature extraction network can perform multiple feature extraction processes on the image of interest in series to obtain multiple first feature maps; it can also perform multiple feature extraction processes on the image of interest in parallel to obtain multiple first feature maps.
[0088] 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.
[0089] Step 302, a feature fusion network is used to perform feature fusion processing of deep information and shallow information according to a plurality of first feature maps to obtain a weld mark area.
[0090] Multiple first feature maps are input into the feature fusion network, and the feature fusion network can perform feature extraction processing on the multiple first feature maps respectively to obtain multiple shallow information and deep information, and then fuse the multiple shallow information and deep information to obtain the weld area. The first first feature map can also be subjected to feature extraction processing to obtain shallow information; then the first feature extraction result and the second first feature map are subjected to feature fusion processing to obtain the second feature extraction result, and then the second feature extraction result and the third first feature map are subjected to feature fusion processing, and so on, and the weld area is determined according to the last feature extraction result.
[0091] In the above embodiment, the feature extraction network is used to perform feature extraction processing of deep information on the image of interest to obtain multiple first feature maps; the feature fusion network is used to perform feature fusion processing of deep information and shallow information based on the multiple first feature maps to obtain the weld mark area. In the technical solution of the embodiment of the present application, the deep information in the image of interest is extracted by the feature extraction network, and the deep information is fused with the shallow information by the feature fusion network, so that the weld mark can be located more accurately, thereby improving the accuracy of weld mark detection.
[0092] According to some embodiments of the present application, the feature extraction network includes an attention mechanism layer and a downsampling layer before and after the attention mechanism layer; Figure 7 In the above embodiment, the step of “extracting features of deep information of the image of interest through a feature extraction network to obtain a plurality of first feature maps” includes:
[0093] Step 401: Input the image of interest into the first downsampling layer for feature extraction to obtain a first feature map.
[0094] The image of interest is input into the first downsampling layer, the first downsampling layer performs feature extraction processing on the image of interest, and outputs a first feature map.
[0095] Step 402, input the i-th first feature map to the next level for feature extraction processing to obtain the i+1-th first feature map, where i is a positive integer and the next level is an attention mechanism layer or a downsampling layer.
[0096] The first first feature map is input into the second stage for feature extraction processing to obtain the second first feature map; the second first feature map is input into the third stage for feature extraction processing to obtain the third first feature map. And so on, multiple first feature maps are obtained.
[0097] Reference Figure 4b, taking the case where the feature extraction network includes five levels and the attention mechanism layer 12 is located at the second level, after the image of interest B is input into the first level downsampling layer 11 to obtain the first first feature map, the first first feature map is input into the attention mechanism layer 12 for feature extraction processing to obtain the second first feature map; the second first feature map is input into the third level downsampling layer 11 for feature extraction processing to obtain the third first feature map. And so on, multiple first feature maps are obtained.
[0098] Among them, the attention mechanism layer can enhance the feature extraction network's perception of the area around the weld mark, making it easier to distinguish the details and texture features between the weld mark and the cold weld, and suppress some noise or interference information; and the attention mechanism layer can enable the feature extraction network to adaptively focus on features of different scales, which is very useful for locating weld marks of different sizes and shapes. Weld marks may appear in different sizes, and the attention mechanism layer helps the feature extraction network adapt to such changes.
[0099] In traditional technology, there may also be situations where a segmentation model is used to locate weld marks. However, traditional technology may have some positioning errors, such as some pixels are not counted in the weld mark area or some pixels are not counted in the weld mark area. In the embodiment of the present application, the image of interest is input into the first-level downsampling layer for feature extraction processing to obtain the first first feature map; the i-th first feature map is input into the next level for feature extraction processing to obtain the i+1-th first feature map. It can be seen that in the technical solution of the embodiment of the present application, an attention mechanism layer is set in the feature extraction network of the weld mark segmentation model, which can improve the performance of the weld mark segmentation model in the weld mark positioning task, increase the perception ability and accuracy of the feature extraction network, reduce segmentation errors, and thus improve the reliability of weld mark detection.
[0100] According to some embodiments of the present application, referring to Figure 8 In the above embodiment, the step of “inputting the i-th first feature map into the channel attention module for channel analysis processing to obtain the weights of each channel in the i-th first feature map” may include:
[0101] Step 501, performing global maximum pooling processing and global average pooling processing on the i-th first feature map to obtain a first maximum pooling map and a first average pooling map.
[0102] Among them, global pooling calculates all elements of each channel separately, global max pooling outputs a maximum value after calculation, and global average pooling outputs an average value after calculation.
[0103] Taking the attention mechanism layer in the second level of the feature extraction network as an example, the first feature map output by the first level downsampling layer is input into the channel attention module, referring to Fig. 9 The channel attention module calculates all elements of each channel in the first feature map C, outputs the first maximum pooling map C1 according to the calculated global maximum feature, and outputs the first average pooling map C2 according to the calculated global average feature. The global maximum feature and the global average feature can represent the most significant information and the average information in the channel, respectively.
[0104] Step 502 , performing channel analysis processing on the first maximum pooling map and the first average pooling map respectively to obtain a first channel analysis map and a second channel analysis map.
[0105] The first maximum pooling map is input into a shared network, which can compress the number of channels of the first maximum pooling map to 1 / r of the original through the first fully connected layer, and then activate it through the ReLU activation function, and then expand it to the original number of channels through the second fully connected layer to obtain the first channel analysis map C3.
[0106] The first average pooling map is input into the above-mentioned shared network, which can compress the number of channels of the first average pooling map to 1 / r of the original through the first fully connected layer, and then activate it through the ReLU activation function, and then expand it to the original number of channels through the second fully connected layer to obtain the second channel analysis map C4.
[0107] Step 503: Perform activation operation based on the first channel analysis graph and the second channel analysis graph to obtain the weights of each channel in the i-th first feature graph.
[0108] Reference Fig. 9 , the first channel analysis graph C3 and the second channel analysis graph C4 are summed up element by element, and the Sigmod activation function is used for activation operation to obtain the weight C5 of each channel in the first feature graph.
[0109] Understandably, multiplying the output by the activation function can increase the nonlinearity of the output and improve the robustness of the network.
[0110] In the above embodiment, the i-th first feature map is subjected to global maximum pooling processing and global average pooling processing to obtain the first maximum pooling map and the first average pooling map; the first maximum pooling map and the first average pooling map are subjected to channel analysis processing to obtain the first channel analysis map and the second channel analysis map; an activation operation is performed based on the first channel analysis map and the second channel analysis map to obtain the weight of each channel in the i-th first feature map. In the technical solution of the embodiment of the present application, the weight of each channel can be obtained by using the channel relationship of the feature, so that the feature extraction can focus on important channels, improve the accuracy of feature extraction, and further improve the accuracy of weld mark detection.
[0111] According to some embodiments of the present application, referring to Fig.10 In the above embodiment, the step of “inputting the channel feature map into the spatial attention module for spatial analysis processing to obtain the spatial weight of the i-th first feature map” may include:
[0112] Step 601, performing global maximum pooling processing and global average pooling processing on the channel feature map respectively to obtain a second maximum pooling map and a second average pooling map.
[0113] Input the channel feature map into the spatial attention module, refer to Fig.11 The spatial attention module calculates all elements of each channel in the channel feature map C6, outputs the second maximum pooling map C7 according to the calculated global maximum feature, and outputs the second average pooling map C8 according to the calculated global average feature.
[0114] Step 602: Perform a convolution operation based on the second maximum pooling map and the second average pooling to obtain a convolution map.
[0115] Reference Fig.11 , the second maximum pooling map and the second average pooling map are spliced, and then a convolution operation is performed on the spliced pooling map to obtain the convolution map C9.
[0116] In some embodiments, the convolution operation can use a 7×7 convolution kernel. The 7×7 convolution kernel has a larger receptive field than the 3×3 convolution kernel. The receptive field refers to the size of the input image area that each output feature point in the convolutional neural network can see. A larger receptive field means that the model can capture a wider range of contextual information, which is particularly important for the spatial attention mechanism because it needs to locate the most informative area in the image. The 7×7 convolution kernel has a stronger feature expression capability than the 3×3 convolution kernel: although the 3×3 convolution kernel is sufficient to capture changes in local features, the 7×7 convolution kernel can capture more complex spatial feature patterns. This stronger feature expression capability helps the model better understand and analyze images, thereby improving the accuracy of spatial attention. In addition, using a 7×7 convolution kernel in the spatial attention module can help the model better locate the key areas related to channel attention, thereby further improving the performance of the model.
[0117] Step 603: Perform an activation operation on the convolution map to obtain the spatial weight of the i-th first feature map.
[0118] Reference Fig.11 , the Sigmod activation function is used to activate the convolution map to obtain the spatial weight C10 of the first feature map.
[0119] In the above embodiment, the channel feature map is subjected to global maximum pooling processing and global average pooling processing respectively to obtain a second maximum pooling map and a second average pooling map; a convolution operation is performed based on the second maximum pooling map and the second average pooling to obtain a convolution map; and an activation operation is performed on the convolution map to obtain the spatial weight of the i-th first feature map. In the technical solution of the embodiment of the present application, the spatial weight can represent the importance of the corresponding position, so that the feature extraction can focus on the important spatial position, improve the accuracy of the feature extraction, and further improve the accuracy of the weld mark detection.
[0120] According to some embodiments of the present application, referring to Fig.12 The feature fusion network includes multiple upsampling layers 13, and the multiple upsampling layers 13 correspond to the layers of the feature extraction network in a one-to-one order. Fig.13 In the above embodiment, the step of "using a feature fusion network to perform feature fusion processing of deep information and shallow information according to a plurality of first feature maps to obtain a weld mark area" may include:
[0121] Step 701, input the last first feature map into the first upsampling layer for feature extraction processing to obtain the first second feature map.
[0122] The first feature map outputted by the last level of the feature extraction network is inputted into the first level upsampling layer of the feature fusion network. The first level upsampling layer performs feature extraction processing on the first feature map and outputs the first second feature map.
[0123] Step 702: concatenate the i-th second feature map with the corresponding first feature map and input the concatenated map into the i+1-th upsampling layer for feature fusion processing to obtain the i+1-th second feature map, where i is a positive integer.
[0124] The first second feature map is concatenated with the first feature map output from the second-to-last level in the feature extraction network, and the concatenated feature map is input into the second-level upsampling layer for feature fusion processing to obtain the second second feature map. The second second feature map is concatenated with the first feature map output from the third-to-last level in the feature extraction network, and the concatenated feature map is input into the third-level upsampling layer for feature fusion processing to obtain the third second feature map. And so on, the last upsampling layer outputs the last second feature map.
[0125] Step 703, performing convolution processing on the second feature map at the end to obtain the weld mark area.
[0126] Perform 1×1 convolution on the last second feature map to obtain the weld mark area.
[0127] In the above embodiment, the first feature map at the end is input into the first upsampling layer for feature extraction processing to obtain the first second feature map; the i-th second feature map is spliced with the corresponding first feature map and input into the i+1-th upsampling layer for feature fusion processing to obtain the i+1-th second feature map; the second feature map at the end is convoluted to obtain the weld mark area. In the technical solution of the embodiment of the present application, the shallow information and the deep information can be fused through multi-level upsampling, thereby improving the accuracy of weld mark segmentation.
[0128] According to some embodiments of the present application, referring to Fig.14 In the above embodiment, the step of “determining the weld mark detection result according to the weld mark area” may include:
[0129] Step 801, determining the weld print area according to the weld print region.
[0130] After the weld mark area is determined, the proportion of the weld mark area in the battery image can be determined; then, the weld mark area can be calculated according to the actual area corresponding to the battery image.
[0131] The actual area corresponding to the battery image can be determined according to acquisition parameters of the image acquisition device and the image area of the battery image.
[0132] Step 802, determining the weld mark detection result according to the weld mark area and the preset area range.
[0133] After the weld mark area is determined, the weld mark area can be compared with a preset area range. If the weld mark area is within the preset area range, the weld mark detection result can be determined to be a qualified weld mark; if the weld mark area is not within the preset area range, the weld mark detection result can be determined to be an unqualified weld mark.
[0134] For the hot melt welding process of the isolation membrane, a welding head is used to hot melt weld the isolation membrane, so the preset area range mainly includes a preset area threshold. If the weld mark area is greater than or equal to the preset area threshold, it can be determined that the weld mark detection result is a qualified weld mark; if the weld mark area is less than the preset area threshold, it indicates that the weld mark is too small, and the weld mark detection result can be determined as an unqualified weld mark.
[0135] In the above embodiment, the weld mark area is determined according to the weld mark region; and the weld mark detection result is determined according to the weld mark area and the preset area range. In the technical solution of the embodiment of the present application, the weld mark detection result can be determined conveniently and quickly according to the weld mark area, thereby improving the detection efficiency.
[0136] According to some embodiments of the present application, referring to Fig.15 In the above embodiment, the step of “determining the weld mark area according to the weld mark area” may include:
[0137] Step 8011, determine the number of pixels in the weld print area.
[0138] Count the number of pixels in the weld area. In some embodiments, incomplete pixels in the weld area can be discarded or converted according to pixel size.
[0139] Step 8012, determining the weld area according to the pre-established correspondence between the pixel area and the actual area and the number of pixels.
[0140] The corresponding relationship between the pixel area and the welding area can be obtained according to the acquisition parameters of the image acquisition device, wherein the acquisition parameters include image acquisition distance, image size, etc.
[0141] After counting the number of pixels in the weld area, the weld area can be calculated based on the correspondence between the pixel area and the actual area and the number of pixels. For example, if the correspondence between the pixel area and the actual area is m:n and the number of pixels is M, then the weld area N=M*n / m.
[0142] In the above embodiment, the number of pixels in the weld mark area is determined; the weld mark area is determined based on the pre-established correspondence between the pixel area and the actual area and the number of pixels. In the technical solution of the embodiment of the present application, the weld mark area can be quickly determined based on the number of pixels, thereby improving the efficiency of weld mark detection.
[0143] According to some embodiments of the present application, a weld mark detection method is provided, which may include the following steps:
[0144] Step 1, extracting an image of interest from a pre-acquired battery image; wherein the image of interest includes a weld mark area;
[0145] Step 2, input the image of interest into the first downsampling layer for feature extraction to obtain a first feature map;
[0146] Step 3: Input the i-th first feature map to the next level for feature extraction processing to obtain the i+1-th first feature map.
[0147] Among them, when the next level is the attention mechanism layer, the i-th first feature map is subjected to global maximum pooling processing and global average pooling processing to obtain the first maximum pooling map and the first average pooling map; the first maximum pooling map and the first average pooling map are subjected to channel analysis processing to obtain the first channel analysis map and the second channel analysis map; an activation operation is performed based on the first channel analysis map and the second channel analysis map to obtain the weights of each channel in the i-th first feature map; the channel feature map is determined according to the i-th first feature map and the weights of each channel; the channel feature map is subjected to global maximum pooling processing and global average pooling processing to obtain the second maximum pooling map and the second average pooling map; a convolution operation is performed based on the second maximum pooling map and the second average pooling to obtain a convolution map; an activation operation is performed on the convolution map to obtain the spatial weight of the i-th first feature map; the i+1-th first feature map is obtained according to the channel feature map and the spatial weight.
[0148] Step 4, input the last first feature map into the first upsampling layer for feature extraction to obtain the first second feature map;
[0149] Step 5, concatenating the i-th second feature map with the corresponding first feature map and inputting the concatenated map into the i+1-th upsampling layer for feature fusion processing to obtain the i+1-th second feature map, where i is a positive integer;
[0150] Step 6: Perform convolution processing on the second feature map at the end to obtain the weld mark area.
[0151] Step 7, determining the number of pixels in the weld print area;
[0152] Step 8, determining the weld area according to the pre-established correspondence between the pixel area and the actual area and the number of pixels.
[0153] Step 9, determining the weld mark detection result according to the weld mark area and the preset area range.
[0154] In the above embodiment, extracting the image of interest can narrow the detection range, and using the weld mark segmentation model for segmentation can adapt to different weld mark types and background conditions, without manually adjusting the grayscale range in the image, reducing the need for manual intervention, and making the entire process more automated; and the weld mark segmentation model is pre-trained based on a large-scale data set, and can better cope with weld mark detection tasks under different scenarios and changing conditions, and capture more information. Therefore, the weld mark segmentation model can achieve pixel-level segmentation accuracy, thereby accurately locating weld marks and improving the accuracy of defect detection. An attention mechanism layer is set in the feature extraction network of the weld mark segmentation model, which can improve the performance of the weld mark segmentation model in the weld mark positioning task, increase the perception ability and accuracy of the feature extraction network, reduce segmentation errors, and thus improve the reliability of weld mark detection.
[0155] 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.
[0156] Based on the same inventive concept, the embodiment of the present application also provides a weld mark detection device for implementing the weld mark detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more weld mark detection device embodiments provided below can refer to the limitations of the weld mark detection method above, and will not be repeated here.
[0157] According to some embodiments of the present application, referring to Fig.16 , provides a welding mark detection device, the device comprising:
[0158] An image extraction module 901 extracts an image of interest from a pre-acquired battery image; wherein the image of interest includes a weld mark area;
[0159] The region segmentation module 902 is used to segment the image of interest using a pre-trained weld mark segmentation model to obtain a weld mark region;
[0160] The weld mark detection module 903 is used to determine the weld mark detection result according to the weld mark area; wherein the weld mark detection result is used to indicate whether the weld mark is qualified, and the weld mark includes the weld mark of the isolation film hot melt welding;
[0161] The weld mark segmentation model includes a feature extraction network, which includes an attention mechanism layer and downsampling layers before and after the attention mechanism layer. The attention mechanism layer includes a channel attention module and a spatial attention module.
[0162] The region segmentation module 902 is specifically used to input the i-th first feature map output by the downsampling layer before the attention mechanism layer into the channel attention module for channel analysis processing to obtain the weights of each channel in the i-th first feature map; determine the channel feature map according to the i-th first feature map and the weights of each channel; input the channel feature map into the spatial attention module for spatial analysis processing to obtain the spatial weight of the i-th first feature map; and obtain the i+1-th first feature map according to the channel feature map and the spatial weight.
[0163] In some embodiments, the weld mark segmentation model also includes a feature fusion network, a region segmentation module 902, which is specifically used to perform feature extraction processing of deep information on the image of interest through the feature extraction network to obtain multiple first feature maps; and perform feature fusion processing of deep information and shallow information based on the multiple first feature maps through the feature fusion network to obtain the weld mark area.
[0164] In some embodiments, the region segmentation module 902 is specifically used to input the image of interest into the first-level downsampling layer for feature extraction processing to obtain the first first feature map; input the i-th first feature map into the next level for feature extraction processing to obtain the i+1-th first feature map, where i is a positive integer and the next level is an attention mechanism layer or a downsampling layer.
[0165] In some embodiments, the region segmentation module 902 is specifically used to perform global maximum pooling processing and global average pooling processing on the i-th first feature map to obtain a first maximum pooling map and a first average pooling map; perform channel analysis processing on the first maximum pooling map and the first average pooling map to obtain a first channel analysis map and a second channel analysis map; perform activation operations based on the first channel analysis map and the second channel analysis map to obtain the weights of each channel in the i-th first feature map.
[0166] In some embodiments, the region segmentation module 902 is specifically used to perform global maximum pooling processing and global average pooling processing on the channel feature map to obtain a second maximum pooling map and a second average pooling map; perform a convolution operation based on the second maximum pooling map and the second average pooling to obtain a convolution map; perform an activation operation on the convolution map to obtain the spatial weight of the i-th first feature map.
[0167] In some embodiments, the feature fusion network includes multiple upsampling layers, and the multiple upsampling layers correspond to the levels of the feature extraction network in a first-to-last order. The region segmentation module 902 is specifically used to input the last first feature map into the first-level upsampling layer for feature extraction processing to obtain the first second feature map; concatenate the i-th second feature map with the corresponding first feature map and input the i+1-th upsampling layer for feature fusion processing to obtain the i+1-th second feature map, where i is a positive integer; and perform convolution processing on the last second feature map to obtain the weld print area.
[0168] In some embodiments, the weld mark detection module 903 is specifically used to determine the weld mark area according to the weld mark region; and determine the weld mark detection result according to the weld mark area and a preset area range.
[0169] In some embodiments, the weld mark detection module 903 is specifically used to determine the number of pixels in the weld mark area; the weld mark area is determined according to the pre-established correspondence between the pixel area and the actual area and the number of pixels.
[0170] Each module in the above-mentioned weld mark detection device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in the electronic device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0171] 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.17As 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 welding mark detection method 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.
[0172] Those skilled in the art will understand that Fig.17 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.
[0173] 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.
[0174] 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.
[0175] 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.
[0176] 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.
[0177] 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 welding mark detection method, characterized in that: The method comprises: Extracting an image of interest from a pre-acquired battery image; wherein the image of interest includes a weld mark area; Using a pre-trained weld mark segmentation model to segment the image of interest to obtain the weld mark area; Determine a weld mark detection result according to the weld mark area; wherein the weld mark detection result is used to indicate whether the weld mark is qualified, and the weld mark includes a weld mark of hot-melt welding of an isolation film; The weld mark segmentation model includes a feature extraction network and a feature fusion network. The weld mark segmentation model trained in advance is used to segment the image of interest to obtain the weld mark area, including: Performing feature extraction processing of deep information on the image of interest through the feature extraction network to obtain a plurality of first feature maps; The feature fusion network performs feature fusion processing of deep information and shallow information according to the plurality of the first feature maps to obtain the weld mark area; The feature extraction network includes an attention mechanism layer and downsampling layers located before and after the attention mechanism layer. The attention mechanism layer includes a channel attention module and a spatial attention module. The processing process of the attention mechanism layer includes: For the i-th first feature map output by the downsampling layer before the attention mechanism layer, perform global maximum pooling processing and global average pooling processing respectively to obtain a first maximum pooling map and a first average pooling map; Performing channel analysis processing on the first maximum pooling map and the first average pooling map respectively to obtain a first channel analysis map and a second channel analysis map; Performing an activation operation based on the first channel analysis graph and the second channel analysis graph to obtain the weight of each channel in the i-th first feature graph; Determine a channel feature map according to the i-th first feature map and the weights of each channel; Performing global maximum pooling processing and global average pooling processing on the channel feature map respectively to obtain a second maximum pooling map and a second average pooling map; Performing a convolution operation based on the second maximum pooling map and the second average pooling to obtain a convolution map; Performing an activation operation on the convolution map to obtain the spatial weight of the i-th first feature map; Obtain the (i+1)th first feature map according to the channel feature map and the spatial weight.
2. The method according to claim 1, characterized in that The step of performing feature extraction processing of deep information on the image of interest through the feature extraction network to obtain a plurality of first feature maps includes: Inputting the image of interest into the first downsampling layer for feature extraction processing to obtain the first first feature map; The i-th first feature map is input into the next level for feature extraction processing to obtain the i+1-th first feature map, where i is a positive integer and the next level is the attention mechanism layer or the downsampling layer.
3. The method according to claim 2, characterized in that The feature fusion network includes a plurality of upsampling layers, and the plurality of upsampling layers correspond to the levels of the feature extraction network in a one-to-one order from the first to the last. The feature fusion network performs feature fusion processing of deep information and shallow information according to the plurality of the first feature maps to obtain the weld imprint area, including: Inputting the first feature map at the end into the first upsampling layer for feature extraction processing to obtain the first second feature map; The i-th second feature map is concatenated with the corresponding first feature map and then input into the i+1-th upsampling layer for feature fusion processing to obtain the i+1-th second feature map, where i is a positive integer; The second feature map at the end is convolved to obtain the weld mark area.
4. The method according to any one of claims 1 to 3, characterized in that: Determining the weld mark detection result according to the weld mark area includes: Determine the weld area according to the weld area; The weld mark detection result is determined according to the weld mark area and a preset area range.
5. The method according to claim 4, characterized in that Determining the weld print area according to the weld print region includes: Determining the number of pixels within the weld imprint area; The welding area is determined according to the pre-established correspondence between the pixel area and the actual area and the number of pixels.
6. A welding mark detection device, characterized in that: The device comprises: An image extraction module, used to extract an image of interest from a pre-acquired battery image; wherein the image of interest includes a weld mark area; A region segmentation module, used to segment the image of interest using a pre-trained weld mark segmentation model to obtain the weld mark region; A weld mark detection module, used to determine a weld mark detection result according to the weld mark area; wherein the weld mark detection result is used to indicate whether the weld mark is qualified, and the weld mark includes a weld mark of a hot melt weld of an isolation film; The weld mark segmentation model includes a feature extraction network and a feature fusion network. The region segmentation module is specifically used to perform feature extraction processing of deep information on the image of interest through the feature extraction network to obtain a plurality of first feature maps; perform feature fusion processing of deep information and shallow information according to the plurality of first feature maps through the feature fusion network to obtain the weld imprint region; The feature extraction network includes an attention mechanism layer and a downsampling layer located before and after the attention mechanism layer, and the attention mechanism layer includes a channel attention module and a spatial attention module; The region segmentation module is specifically used to perform global maximum pooling processing and global average pooling processing on the i-th first feature map output by the downsampling layer before the attention mechanism layer to obtain a first maximum pooling map and a first average pooling map; perform channel analysis processing on the first maximum pooling map and the first average pooling map to obtain a first channel analysis map and a second channel analysis map; perform activation operation based on the first channel analysis map and the second channel analysis map to obtain the weights of each channel in the i-th first feature map; determine the channel feature map according to the i-th first feature map and the weights of each channel; perform global maximum pooling processing and global average pooling processing on the channel feature map to obtain a second maximum pooling map and a second average pooling map; perform convolution operation based on the second maximum pooling map and the second average pooling to obtain a convolution map; perform activation operation on the convolution map to obtain the spatial weight of the i-th first feature map; obtain the i+1-th first feature map according to the channel feature map and the spatial weight.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
