SMA-YOLO-based battery liquid cooling plate surface defect detection method

By using the improved SMA-YOLO model, the problems of complex background and unbalanced defect types in the detection of surface defects of liquid cooling plates are solved, and high-precision and efficient detection of surface defects of liquid cooling plates is achieved.

CN121527092AActive Publication Date: 2026-02-13SICHUAN UNIVERSITY OF SCIENCE AND ENGINEERING
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610057350.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-16
Publication Date
2026-02-13
Estimated Expiration
2046-01-16

AI Technical Summary

Technical Problem

Existing methods for detecting surface defects in liquid-cooled plates are difficult to accurately locate and identify in complex backgrounds with few defect areas, and the number of defect types is unbalanced, resulting in low versatility of the detection models.

Method used

An instance segmentation model based on SMA-YOLO is adopted, and the feature extraction capability is enhanced by the SEP module, SPAM module and C2PSA-IEMA module. Combined with the improved neck network of BiFPN network and multi-scale feature detection head, the accurate detection of surface defects of liquid cooling plate is achieved.

Benefits of technology

It improves the detection accuracy and versatility of surface defects in liquid cooling plates, effectively identifying diverse defect morphologies and reducing the computational load of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121527092A_ABST
    Figure CN121527092A_ABST
Patent Text Reader

Abstract

The invention discloses a battery liquid cooling plate surface defect detection method based on SMA-YOLO, and belongs to the technical field of image processing, and the method comprises the following steps: collecting battery liquid cooling plate surface defect data, carrying out data enhancement processing, and constructing a battery liquid cooling plate defect data set; based on the defect data set of the battery liquid cooling plate, constructing and training an instance segmentation model SMA-YOLO for surface defect detection of the battery liquid cooling plate; and performing defect detection on the surface of the battery liquid cooling plate to be detected by using the instance segmentation model SMA-YOLO. According to the method, the problem that defect features are difficult to extract due to diverse surface defects, fuzzy edges, small sizes and complex background information of the battery liquid cooling plate is solved, and a good defect detection effect is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of image processing, and particularly relates to a battery liquid cooling plate surface defect detection method based on SMA-YOLO. BACKGROUND

[0002] New energy vehicles are the development direction of the automobile industry, and their advantages are not only related to travel, but also involve energy strategy and environmental protection, which are of great significance to China's energy transformation and "double carbon" goals. The power battery is the core component of the new energy vehicle, directly affecting the reliability and safety of the mechanical structure of the vehicle. The liquid cooling plate is a key component of the power battery thermal management system. The flow of the cooling liquid in the micro-channel inside the liquid cooling plate exchanges heat with each part of the battery in a conductive manner, avoiding thermal runaway of each level of battery cell, and thus ensuring the safe operation of the battery under various working conditions. The liquid cooling plate is mainly made of metals such as aluminum alloy with excellent thermal conductivity, and is manufactured through processes such as welding and stamping, which have high requirements for shape accuracy and surface quality.

[0003] During the production process of the liquid cooling plate, the forming process, equipment precision and process transfer process cause defects such as pits, scratches and black spots on the surface of the liquid cooling plate. These defects will cause the liquid cooling plate to leak under the long-term action of pressure and thermal shock, and thus cause thermal runaway, battery short circuit and even explosion, ultimately causing serious safety accidents. Therefore, defect detection in the manufacturing process is an important process for risk prevention.

[0004] The surface defects of the liquid cooling plate are currently mainly detected by manual inspection and traditional machine vision detection. Long manual detection time can reduce the attention of employees, reduce detection efficiency and may cause missed detection and false detection. Traditional machine vision detection methods such as histogram of oriented gradients (HOG), local binary pattern (LBP) and other technologies combined with classifiers. However, the traditional visual detection method mainly relies on manual feature design, and has insufficient generalization ability for defects with diverse shapes and complex backgrounds. SUMMARY

[0005] In view of the above deficiencies in the prior art, the battery liquid cooling plate surface defect detection method based on SMA-YOLO provided by the present application solves the problem that the existing defect detection method has low generalization of the existing detection model when applied to battery liquid cooling plate detection, because the liquid cooling plate defect occupies a small area in the image and the image background is complex, and the existing method is difficult to accurately locate and identify the defect target, and the frequency of defects on the surface of the liquid cooling plate is low, and the number of samples of some defect types is insufficient, resulting in imbalance in the number of each defect type, and thus the generalization of the existing detection model is low.

[0006] In order to achieve the above-mentioned application purpose, the technical scheme adopted by the present application is as follows: a battery liquid cooling plate surface defect detection method based on SMA-YOLO, comprising the following steps: S100. Collect surface defect data of the battery liquid cooling plate and perform data augmentation processing to construct a battery liquid cooling plate defect dataset. S200. Based on the battery liquid cooling plate defect dataset, construct and train the instance segmentation model SMA-YOLO for detecting surface defects of battery liquid cooling plates. The instance segmentation model SMA-YOLO includes a backbone network, a neck network, and a detection head. The backbone network includes a SEP module, a SPAM module, and a C2PSA-IEMA module. The SEP module downsamples the input features using parallel max pooling layers and a SET channel attention mechanism. The SPAM module extracts large-scale defect features using a 2d average pooling layer, extracts defect edge and texture features using a 2d max pooling layer, and focuses on the defect feature region using a SimAM attention mechanism. The C2PSA-IEMA module enhances information interaction capabilities by utilizing a multi-scale feature extraction mechanism and dynamic feature weight calculation to detect defects of different sizes. The neck network is an improvement on the BiFPN network. By performing channel dimensionality reduction on the output features of the backbone network, the computational load of the model is reduced. The detection head includes four detection heads that output defects for micro-targets, small targets, medium targets, and large targets; S300: Defect detection is performed on the surface of the battery liquid cooling plate under test using the instance segmentation model SMA-YOLO.

[0007] Furthermore, in S100, the defect types of the battery liquid cooling plate surface defect data include pits, scratches, black spots, roller marks, and oil stains; The data augmentation process includes adding noise, changing brightness, adding pixels, and mirroring.

[0008] Furthermore, the backbone network includes a first convolutional layer, a second convolutional layer, a first C3k2 module, a first SEP module, a second C3k2 module, a second SEP module, a third C3k2 module, a third convolutional layer, a fourth C3k2 module, a SPAM module, and a C2PSA-IEMA module connected in sequence.

[0009] Furthermore, the neck network includes a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, and a seventh convolutional layer; The input end of the fourth convolutional layer is connected with the output end of the C2PSA-IEMA module, and the output end of the fourth convolutional layer is sequentially connected with a first up-sampling layer, a first BiFPN module, a fifth C3k2 module, an eighth convolutional layer, a second up-sampling layer, a second BiFPN module, a ninth convolutional layer, a third BiFPN module, a third up-sampling layer, a fourth BiFPN module and a ninth C3k2 module; the output end of the fourth convolutional layer is also connected with the input end of a fifth BiFPN module; and the output end of the eighth convolutional layer is also connected with the input end of a sixth BiFPN module. The input end of the fifth convolutional layer is connected with the output end of the third C3k2 module, and the output end of the fifth convolutional layer is connected with the input end of the first BiFPN module and the input end of the sixth BiFPN module respectively. The input end of the sixth convolutional layer is connected with the output end of the second C3k2 module, and the output end of the sixth convolutional layer is sequentially connected with the second BiFPN module, an eighth C3k2 module, an eleventh convolutional layer, the sixth BiFPN module, a seventh C3k2 module, a tenth convolutional layer, the fifth BiFPN module and a sixth C3k2 module; the output end of the sixth convolutional layer and the output end of the eighth C3k2 module are also connected with the input end of the third BiFPN module. The input end of the seventh convolutional layer is connected with the output end of the first convolutional layer, and the output end of the seventh convolutional layer is connected with the input end of the fourth BiFPN module.

[0010] Further, in the detection head: The output end of the ninth C3k2 module is connected with a first detection head for outputting micro-target defects, the output end of the eighth C3k2 module is connected with a second detection head for outputting small-target defects, the output end of the seventh C3k2 module is connected with a third detection head for outputting medium-target defects, and the output end of the sixth C3k2 module is connected with a fourth detection head for outputting large-target defects.

[0011] Further, the first SEP module and the second SEP module are structurally identical, and each includes a first average pooling layer. The output end of the first average pooling layer is connected with the input end of a channel equalization layer. The first output end of the channel equalization layer is sequentially connected with a first maximum pooling layer, a first SET attention unit and a first multiplier, and the output end of the first maximum pooling layer is also connected with the input end of the first multiplier. The second output end of the channel equalization layer is sequentially connected with a second maximum pooling layer, a second SET attention unit and a second multiplier, and the output end of the second maximum pooling layer is also connected with the input end of the second multiplier. The output end of the first multiplier and the output end of the second multiplier are connected with a channel concatenation layer.

[0012] Further, the first SET attention unit and the second SET attention unit are structurally identical, and each includes a second average pooling layer; An output end of the second average pooling layer is connected with an input end of a first linear layer and an input end of a second linear layer respectively, an output end of the first linear layer is connected with an input end of a second channel concatenation layer through a first ReLU activation function, an output end of the second linear layer is connected with the input end of the second channel concatenation layer through a second ReLU activation function, and an output end of the second channel concatenation layer is sequentially connected with a third linear layer, a first Sigmoid activation function and a third multiplier, and an input end of the third multiplier is also connected with an input end of the second average pooling layer.

[0013] Further, the C2PSA-IEMA module includes a twelfth convolutional layer, a Spilt layer, a first Concat layer and a thirteenth convolutional layer connected in sequence, and an output end of the Spilt layer is also sequentially connected with a first PSA-IEMA unit, a second PSA-IEMA unit and the first Concat layer; The first PSA-IEMA unit and the second PSA-IEMA unit are structurally identical, and each includes an IEMA unit, a first adder, a fourteenth convolutional layer, a fifteenth convolutional layer and a second adder connected in sequence, an input end of the IEMA unit is also connected with an input end of the first adder, and an output end of the first adder is also connected with an input end of the second adder; The IEMA unit includes a normalization layer, an EMA unit, a third adder, a sixteenth convolutional layer, a regularization layer and a fourth adder connected in sequence, an input end of the normalization layer is also connected with an input end of the fourth adder, and an output end of the EMA unit is sequentially connected with a depth separable convolution, an SE block and an input end of the third adder; The EMA unit is used to extract multi-scale features of the micro target.

[0014] Further, the SPAM module includes a seventeenth convolutional layer, a first 2d average pooling layer, a second 2d average pooling layer, a first 2d max pooling layer and a second 2d max pooling layer arranged side by side; Output ends of the seventeenth convolutional layer, the first 2d average pooling layer, the second 2d average pooling layer, the first 2d max pooling layer and the second 2d max pooling layer are sequentially connected with a second Concat layer, an eighteenth convolutional layer and a SimAM unit; The SimAM unit generates three-dimensional attention weights on the basis of not introducing additional parameters by establishing an energy function for calculating the weights, and then performs feature enhancement on the input feature map.

[0015] Further, the minimum energy value of the three-dimensional attention weight generated by the SimAM unit is calculated according to the following formula: wherein, E represents the energy value of the target neuron, represents the mean value of all neurons in a single channel, represents the variance of all neurons in a single channel, represents a regularization coefficient, represents the target neuron, represents the i-th neuron adjacent to the target neuron, represents the i-th neuron adjacent to the target neuron, represents the number of neurons contained in each channel, and the subscript i represents the neuron index.

[0016] In view of the problems that the surface defect morphology of the battery liquid cooling plate is various, the edge is blurred, the size is small, the background information is complex, and the defect feature extraction is difficult, the battery liquid cooling plate surface defect detection method beneficial to industrial high-precision detection is provided; compared with the prior art, the SMA-YOLO model for realizing defect detection provided by the present application has the following beneficial effects: 1) In the downsampling part, the SEP module is first proposed to realize downsampling, the maximum pooling layer is used for downsampling operation, and the SET double-path channel attention mechanism is designed to enhance the weight distribution of key feature channels, which can effectively reduce the loss of detailed feature information of the deep network, and further improve the sensitivity and retention capacity of the liquid cooling plate defect feature.

[0017] 2) In the neck network part, the YBFPN feature pyramid network is designed, the number of upsampling is increased, the P2 detection head is added, and the YTW small target feature extraction structure is designed to improve the extraction ability of the network to the P2 small target feature layer information, and further improve the detection ability of the model to the tiny defect target of the liquid cooling plate.

[0018] 3) The C2PSA-IEMA module is designed, the iRMB inverted residual structure is combined with the EMA attention mechanism to design the IEAM attention module, and the original self-attention mechanism is replaced, the C2PSA-IEMA module has multi-scale feature interaction ability and dynamic weight distribution ability, and can adaptively process liquid cooling plate defects of different sizes.

[0019] 4) The SPAM module is designed, the average pooling layer and the maximum pooling layer are used multiple times and fused with the SimAM parameter-free attention mechanism, and the capture effect of the model on the different scale defect features of the liquid cooling plate is further enhanced. BRIEF DESCRIPTION OF DRAWINGS

[0020] Figure 1A battery liquid cooling plate surface defect detection method based on SMA-YOLO is provided.

[0021] Figure 2 An example segmentation model SMA-YOLO structure diagram is provided.

[0022] Figure 3 A first SEP module and a second SEP module structure diagram are provided.

[0023] Figure 4 A first SET unit and a second SET unit structure diagram are provided.

[0024] Figure 5 A C2PSA-IEMA module structure diagram is provided.

[0025] Figure 6 A first PSA-IEMA unit and a second PSA-IEMA unit structure diagram are provided.

[0026] Figure 7 An IEMA unit structure diagram is provided.

[0027] Figure 8 An EMA unit structure diagram is provided.

[0028] Figure 9 An SPAM module structure diagram is provided.

[0029] Figure 10 A SimAM unit schematic diagram is provided.

[0030] Figure 11 A comparison diagram of detection effects before and after improvement is provided. DETAILED DESCRIPTION

[0031] The specific embodiments of the present application are described below to facilitate the understanding of the present application by those skilled in the art, but it should be clear that the present application is not limited to the scope of the specific embodiments, and for those skilled in the art, any changes within the spirit and scope of the present application as defined and determined by the appended claims are obvious, and all applications utilizing the concept of the present application are within the scope of protection.

[0032] The embodiment of the present application provides a battery liquid cooling plate surface defect detection method based on SMA-YOLO, which optimizes three key difficulties of battery liquid cooling plate surface defect detection, specifically including: 1. Surface defects of liquid cooling plates occupy a small area in images, and the image background is complex. Traditional target detection models have difficulty effectively locating defect targets in images with complex and diverse backgrounds. This invention uses the YOLO instance segmentation algorithm to achieve accurate detection of defect targets by leveraging the characteristics of target detection in distinguishing individual instances and semantic segmentation in classifying object pixels.

[0033] 2. To address the issues of large size differences, small target size, blurred edges, and diverse shapes of defects on the surface of liquid cooling plates, this invention improves the structure of traditional instance segmentation networks to form a new instance segmentation model, SMA-YOLO. This model not only enhances the weighted model's ability to accurately segment each pixel in the image but also enables precise location and identification of defects.

[0034] 3. In actual industrial production, surface defects of liquid cooling plates occur infrequently, and insufficient sample sizes for some defect types lead to an imbalance in the number of defect types. An imbalanced dataset can cause overfitting of the model and reduce its generalizability. This invention enhances the balance of the number of defect types by adding noise, changing brightness, adding pixels, and mirroring.

[0035] refer to Figure 1 The SMA-YOLO-based method for detecting surface defects in battery liquid cooling plates includes the following steps: S100. Collect surface defect data of the battery liquid cooling plate and perform data augmentation processing to construct a battery liquid cooling plate defect dataset. S200. Based on the battery liquid cooling plate defect dataset, construct and train the instance segmentation model SMA-YOLO for detecting surface defects of battery liquid cooling plates. The instance segmentation model SMA-YOLO includes a backbone network, a neck network, and a detection head. The backbone network includes SEP, SPAM, and C2PSA-IEMA modules. The SEP module downsamples the input features using parallel max pooling layers and a SET channel attention mechanism. The SPAM module extracts large-scale defect features using 2d average pooling layers, extracts defect edge and texture features using 2d max pooling layers, and focuses on defect feature regions using a SimAM attention mechanism. The C2PSA-IEMA module enhances information interaction capabilities by utilizing a multi-scale feature extraction mechanism and dynamic feature weight calculation to detect defects of different sizes. The neck network is an improvement on the BiFPN network. By performing channel dimensionality reduction on the output features of the backbone network, the computational cost of the model is reduced. The detection head includes four detection heads that output defects for tiny targets, small targets, medium targets, and large targets; S300, performing defect detection on the surface of the battery liquid cooling plate to be detected by using the instance segmentation model SMA-YOLO.

[0036] In step S100 of this embodiment, when constructing the battery liquid cooling plate defect data set, the defect types of the battery liquid cooling plate surface defect data include pits, scratches, black spots, roll marks and oil stains; the data enhancement processing includes adding noise, changing brightness, adding pixel points and mirroring.

[0037] Specifically, an industrial camera is used to collect defects from three types of liquid cooling plates, i.e., stamping liquid cooling plates, extrusion liquid cooling plates and mouthpiece tube liquid cooling plates, according to the production workshop of the enterprise. The stamping liquid cooling plate uses a stamping process to form a complex and flexible cooling liquid channel on an aluminum plate. The extrusion liquid cooling plate is formed by extruding an aluminum alloy profile, and its characteristics are that the front and back surfaces are flat. The characteristic of the mouthpiece tube liquid cooling plate is that the flow channel is in the shape of a mouthpiece. The surface defect distribution areas of various types of liquid cooling plates are the flat plate area of the stamping liquid cooling plate, the flat plate area and the flow channel area of the extrusion liquid cooling plate, and the flow channel area of the mouthpiece tube liquid cooling plate.

[0038] Five types of defects, i.e., pits, scratches, black spots, roll marks and oil stains, are collected in the defect distribution areas of the three types of liquid cooling plates, and a total of 2500 images are collected and manually labeled using the labelme software.

[0039] The battery liquid cooling plate defect data set is specifically composed of 700 scratches, 800 pits, 600 roll marks, 200 black spots and 200 oil stains. Due to the small number of black spot and oil stain pictures, the number of pictures of various types in the data set is unbalanced, which cannot meet the training requirements. By adding noise, changing brightness, adding pixel points and mirroring, the data set is enhanced to 3700 pictures to balance the number of various defects.

[0040] In S200 of this embodiment, the instance segmentation model SMA-YOLO for battery liquid cooling plate surface defect detection is improved on the basis of the YOLOv11 model, and the model has the characteristics of small volume and high detection accuracy.

[0041] In Figure 2 In the instance segmentation model SMA-YOLO shown in the figure, the input feature map is divided into P1~P5 (corresponding to 1 / 2, 1 / 4, 1 / 8, 1 / 16 and 1 / 32) five levels according to the spatial compression ratio, and P1~P5 are labeled after the different module structures in the figure. Further, Figure 2 The different module structures in the figure are labeled 0~32 after the different module structures, which correspond to the different network structure layers of the instance segmentation model SMA-YOLO from shallow to deep.

[0042] In the instance segmentation model SMA-YOLO, the backbone network comprises, which are sequentially connected, a first convolutional layer, a second convolutional layer, a first C3k2 module, a first SEP module, a second C3k2 module, a second SEP module, a third C3k2 module, a third convolutional layer, a fourth C3k2 module, a SPAM module and a C2PSA-IEMA module.

[0043] As shown in Figure 2 The neck network YBFPN of the instance segmentation model SMA-YOLO is redesigned on the basis of the BiFPN pyramid network, the traditional BiFPN pyramid network adds a skip connection on the basis of the PAN-FPN, and a unique weighted feature fusion method is introduced, a fast normalization weighted feature fusion method is used to distinguish and fuse the input features of different levels, and the BiFPN pyramid network enhances the focusing ability of the model on the key feature region by dynamically calculating and assigning the weights of different feature layers.

[0044] However, after multiple downsampling operations, the image detail features are gradually lost, although the BiFPN pyramid network alleviates the loss of detail information caused by multiple pooling and convolution operations by adding a skip connection between the input and output nodes of the same level, but for the tiny defect target on the surface of the liquid cooling plate, if five downsampling processes are performed and only two upsampling processes are performed, the recovery degree of the small target detail feature information is insufficient.

[0045] Based on this, when improving the neck network, first, the channel dimension reduction processing is performed on the second layer output feature map P2, the fourth layer output feature map P3, the sixth layer output feature map P4 and the tenth layer output feature map P5 of the backbone network through the 1x1 convolution, and the channel number of all modules of the neck network is changed to 64, which can significantly reduce the network calculation amount.

[0046] Specifically, as shown in Figure 2 The neck network comprises a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer and a seventh convolutional layer. The input end of the fourth convolutional layer is connected with the output end of the C2PSA-IEMA module, and the output end of the fourth convolutional layer is sequentially connected with the first upsampling layer, the first BiFPN module, the fifth C3k2 module, the eighth convolutional layer, the second upsampling layer, the second BiFPN module, the ninth convolutional layer, the third BiFPN module, the third upsampling layer, the fourth BiFPN module and the ninth C3k2 module; the output end of the fourth convolutional layer is also connected with the input end of the fifth BiFPN module; and the output end of the eighth convolutional layer is also connected with the input end of the sixth BiFPN module. The input end of the fifth convolutional layer is connected with the output end of the third C3k2 module, and the output end of the fifth convolutional layer is connected with the input end of the first BiFPN module and the input end of the sixth BiFPN module, respectively. The input of the sixth convolutional layer is connected to the output of the second C3k2 module. The output of the sixth convolutional layer is sequentially connected to the second BiFPN module, the eighth C3k2 module, the eleventh convolutional layer, the sixth BiFPN module, the seventh C3k2 module, the tenth convolutional layer, the fifth BiFPN module, and the sixth C3k2 module. The outputs of the sixth convolutional layer and the eighth C3k2 module are also connected to the input of the third BiFPN module. The input of the seventh convolutional layer is connected to the output of the first convolutional layer, and the output of the seventh convolutional layer is connected to the input of the fourth BiFPN module.

[0047] In this embodiment, during the structural design of the neck network, the concat fusion module in the traditional YOLO network is replaced by a BiFPN module. The BiPFN module replaces all the concat modules in the YOLO network and adds additional hop connections. Therefore, the neck network YBFPN provided by this invention is redesigned based on the BiFPN pyramid network.

[0048] Based on the above model structure design, the first / second SEP modules in the backbone network downsample the receptive field to shrink the feature map, learn more global and broader contextual information, and then extract abstract high-level semantic features. However, this operation loses a lot of spatial and detailed feature information. The first / second upsampling layers in the neck network enlarge the feature map to obtain a higher resolution feature map, and then learn detailed feature information such as texture and edges to enhance the detection performance of small-sized targets. Specifically, in the neck network YBFPN, after the backbone network performs 5 downsampling operations through the convolutional layer structure in layers 0, 1, 3, 5, and 7, the neck network YBFPN only performs 2 upsampling operations through the first / second upsampling layers in layers 12 and 17. Insufficient upsampling times lead to insufficient recovery of detailed features, resulting in the inability to effectively extract the defect features of small targets on the surface of the liquid cooling plate. Therefore, by adding a third upsampling layer in layer 29, the number of upsampling operations in the neck network is increased to 3, allowing the model to obtain a more refined feature map.

[0049] Furthermore, in Figure 2 The detection head of the SMA-YOLO instance segmentation model shown: The output of the ninth C3k2 module is connected to the first detection head that outputs small target defects, the output of the eighth C3k2 module is connected to the second detection head that outputs small target defects, the output of the seventh C3k2 module is connected to the third detection head that outputs medium target defects, and the output of the sixth C3k2 module is connected to the fourth detection head that outputs large target defects.

[0050] Specifically, the neck network YBFPN contains second / third / fourth detection heads that respectively receive P3, P4 and P5 hierarchical output feature maps, and the neck network YBFPN adds a first detection head that receives a P2 hierarchical output feature map on the basis of a traditional BiFPN bidirectional pyramid network, so that the first detection head receives a feature map containing more detailed feature information, and the first detection head improves the detection capability of the model for small-size targets by receiving a high-resolution feature map containing rich semantic information.

[0051] In order to enable the first detection head to receive a feature map containing more detailed feature information, a YTW small target feature extraction structure (YTW marked in the dashed box in the figure) is designed in the neck network YBFPN, P2 detection layers obtained by three up-sampling operations of the first, second and third up-sampling layers of the 12th, 17th and 29th layers on the 4th and 10th layers of the backbone network, P2 detection layers obtained by one up-sampling operation of the third up-sampling layer of the 29th layer on the 18th and 20th layers in the neck network YBFPN are fused by the fourth BiFPN module of the 31st layer, and the fused P2 feature map is directly output to the first detection head, and the fused P2 feature map is no longer transmitted downward to avoid loss of detailed feature information, which effectively improves the detection capability of the network for small targets by fully extracting the shallow detailed feature information of the P2 feature map.

[0052] In the embodiment of the application, the backbone network in the traditional YOLOv11 model uses Conv convolution for down-sampling operation, but single convolution kernel processing will cause a large amount of detailed feature information to be lost in the deep network as the size of the feature map is reduced, which is particularly unfavorable for detection of small target defects such as scratches, pits and black spots on the surface of the battery liquid cooling plate.

[0053] In the embodiment, a (first / second) SEP module is proposed in the backbone network for down-sampling, as shown in Figure 3 The first SEP module and the second SEP module are the same in structure and both include a first average pooling layer; The output end of the first average pooling layer is connected to the input end of the channel division layer; The first output end of the channel division layer is connected to a first max-pooling layer, a first SET attention unit and a first multiplier in sequence, and the output end of the first max-pooling layer is also connected to the input end of the first multiplier; The second output end of the channel division layer is connected to a second max-pooling layer, a second SET attention unit and a second multiplier in sequence, and the output end of the second max-pooling layer is also connected to the input end of the second multiplier; The output end of the first multiplier and the output end of the second multiplier are connected to a channel concatenation layer.

[0054] In the embodiment, the first detection head receives the P2 feature map obtained by the fourth BiFPN module of the 31st layer, and the P2 feature map is directly output to the first detection head without being transmitted downward, so that the first detection head can receive a feature map containing more detailed feature information, and the first detection head improves the detection capability of the model for small-size targets by receiving a high-resolution feature map containing rich semantic information. Figure 3In the formula, C, H and W respectively represent the channel number, height and width of the input feature map, based on the structure of the above (first / second) SEP module, the input feature Figure X ∈R C×H×W Firstly, the spatial information is effectively extracted by a 2x2 first average pooling layer, and the output feature Figure X a is: The pooled feature map is evenly divided from the channel dimension through the channel equalization layer, and is evenly divided into two sub-feature Figure X 1 and X2: In the formula, represents channel dimension equalization; Two sub-features Figure X 1 and X2 are processed through the first / second maximum pooling layer with a kernel size of 3x3 and a step size of 2, and the output two features Figure X m1 and X m2 are: The output two features Figure X m1 and X m2 are processed through the first / second SET attention unit respectively, and then X m1 and X m2 are multiplied by the feature map, and the output two features Figure X a1 and X a2 are: In the formula, represents element-wise multiplication; The output feature Figure X a1 and X a2 are spliced and fused through the first channel splicing layer in the channel dimension, and the output feature map is: In the above first / second SEP module, the first / second maximum pooling layer in parallel is used to replace the Conv convolution in the traditional network structure for down-sampling operation, which enhances the attention of the model to the important features of small defects such as scratches, pits and black spots by capturing the maximum value of the local area. Further, since the model mainly loses detailed feature information in the deep network during down-sampling, compared with the traditional network model, the first and second SEP modules are respectively replaced with the third layer Conv convolution down-sampling module and the fifth layer Conv convolution down-sampling module in the deep network.

[0055] In the first / second SEP module, the first SET attention unit and the second SET attention unit learn the importance weight of each channel through the SET channel attention mechanism, further enhance the attention to the small target defect related features while suppressing irrelevant background information.

[0056] As shown in Figure X , the first SET attention unit and the second SET attention unit have the same structure, and both include a second average pooling layer; The output end of the second average pooling layer is connected with the input end of the first linear layer and the input end of the second linear layer respectively, the output end of the first linear layer is connected with the input end of the second channel splicing layer through the first ReLU activation function, the output end of the second linear layer is connected with the input end of the second channel splicing layer through the second ReLU activation function, and the output end of the second channel splicing layer is connected with the third linear layer, the first Sigmoid activation function and the third multiplier in sequence, and the input end of the third multiplier is also connected with the input end of the second average pooling layer.

[0057] In Figure 4 , C, H and W represent the channel number, height and width of the input feature map, the first SET unit and the second SET unit are composed of feature compression, channel compression and weight expansion, and the SET attention mechanism is used to further extract features from the feature map after down-sampling of the first / second maximum pooling layer through the establishment of residual connection; specifically, first, the input tensor X ∈ R C×H×W is processed by the average pooling operation of the second average pooling layer, and the spatial dimension is compressed to 1x1, and the compressed feature vector Z is: Then, the feature vector Z is processed by two parallel paths (first / second linear layer + first / second ReLU activation function) for channel dimension reduction, and the output two feature vectors X1 and X2 are: In the formula, Linear ∈ R C / r×1×1 , r represents 16 representing the channel compression ratio, and σ represents the first / second ReLU activation function.

[0058] The double-path output vector is spliced along the channel dimension through the second channel splicing layer, and the channel attention weight is generated through the third linear layer and the first Sigmoid activation function. In the formula, Linear ∈ R KC×1×1K represents a 16 representative channel growth ratio, and σ1 represents a first Sigmoid activation function.

[0059] Finally, the channel attention weight is expanded to the initial dimension by multiplying the initial input tensor through the broadcast mechanism, and the output feature Figure 4 out : In the formula, ⊙ represents element-wise multiplication.

[0060] In the present embodiment, the scratch, pit and black spot defects on the surface of the liquid cooling plate are relatively small in size, while the oil stain and roll mark are relatively large in size. In view of the above problem that the sizes of the defects on the liquid cooling plate are quite different, a C2PSA-IEMA module is proposed in the backbone network, as shown in Figure X The output end of the Spilt layer is further connected with a first PSA-IEMA unit, a second PSA-IEMA unit and a first Concat layer in sequence. As shown in Figure 5 The first PSA-IEMA unit and the second PSA-IEMA unit are the same in structure, and each includes a IEMA unit, a first adder, a fourteenth convolutional layer, a fifteenth convolutional layer and a second adder connected in sequence. The input end of the IEMA unit is further connected with the input end of the first adder, and the output end of the first adder is further connected with the input end of the second adder. As shown in Figure 6 The IEMA unit includes a normalization layer, an EMA unit, a third adder, a sixteenth convolutional layer, a regularization layer and a fourth adder connected in sequence. The input end of the normalization layer is further connected with the input end of the fourth adder, and the output end of the EMA unit is connected with the input end of the third adder in sequence through a depth separable convolution and an SE block. The EMA unit is used to extract the multi-scale features of the micro target.

[0061] Specifically, the EMA unit is an existing network structure, which is constructed by referring to the iRMB inverted residual structure and combining the EMA attention mechanism. The EMA unit is a multi-scale feature extraction mechanism focusing on micro targets, and its network structure is as shown in Figure 7As shown, / / in the figure represents the grouping processing, X and Y represent two different spatial directions respectively, the input features are divided into G groups of sub-features, each group of sub-features is interacted through the channel dimension to learn more rich semantic features, and the two parallel 1x1 branches and 3x3 branches can effectively capture multi-scale features. In the 3x3 branch, large-scale features are extracted through convolution with a 3x3 convolution kernel. In the 1x1 branch, channel encoding is performed along two different spatial directions, while 1x1 convolution with weight sharing is used to prevent dimension compression. The two output vectors are processed through the Sigmoid activation function and then multiplied to complete the cross-channel information fusion. Therefore, the EMA attention mechanism effectively integrates spatial information into the channel while adjusting the importance of each channel through channel encoding.

[0062] In Figure 8 As shown in the IEMA unit structure formed based on the above EMA unit, first, the input feature map is normalized through the normalization layer, then the EMA attention mechanism of the EMA unit is used to perform multi-scale analysis on the feature map, and then the correlation between the features is explored and the importance is evaluated. After that, the first residual branch is established, the feature map processed through the depth separable convolution and the channel attention processing of the SE block is added to the feature map processed through the EMA attention mechanism to obtain the output feature map. This operation retains the global feature information while enhancing the model's ability to extract local features. Then the channel number of the feature map is adjusted through the 1x1 convolution (sixteenth convolution layer). Finally, the second residual branch is established, and the original input feature map is added to the feature map after a series of processing. This operation can make the model learn the feature difference more effectively.

[0063] In Figure 7 As shown in the first / second PSA-IEMA unit formed based on the above IEMA unit, the IEMA unit is used to replace the Attention self-attention module in the traditional PSA module, and then the first / second PSA-IEMA unit structure is formed. The traditional PSA module includes two residual connections. The first residual connection is to add the input feature map processed by the Attention self-attention module to the input feature map, and the second residual connection is to add the output feature map of the first residual connection to the feature map processed by the feedforward neural network containing two Conv convolutions. The Attention self-attention module is a self-attention mechanism. This mechanism projects the input feature map into three tensors of query (Q), key (K) and value (V) through 1x1 Conv convolution, calculates the correlation between spatial positions, and uses 3x3 Conv convolution as a position encoder to enhance the model's ability to extract local position information.

[0064] In Figure 6In the C2PSA-IEMA module shown based on the first / second PSA-IEMA unit described above, the PSA-IEMA unit is used to replace the PSA module in the traditional C2PSA module, thereby forming the C2PSA-IEMA module structure described above. In the traditional C2PSA module, the input feature map is divided into two paths containing half of the input channel number after being processed by a 1x1 Conv convolution, and one of the paths directly transmits the initial input feature, and the other path is processed by a PSA module. Then the output feature maps of the two paths are spliced from the channel dimension by a Concat layer, and finally the output feature map is obtained after 1x1 Conv convolution processing.

[0065] The C2PSA-IEMA module structure provided in the embodiment described above inherits the advantages of the iRMB structure, strengthens the information interaction ability between branches, and uses a multi-scale feature extraction mechanism to enable the model to adaptively process liquid cooling plate surface defects of different sizes. At the same time, with the help of dynamic calculation of feature weights, the model pays more attention to key feature regions, so that the C2PSA-IEMA module can enhance the detection performance of liquid cooling plate defects of different sizes.

[0066] In the embodiment, in order to further enhance the detection ability of defects of different sizes on the liquid cooling plate, a SPAM module is proposed to replace the SPPF module in the traditional backbone network in the backbone network; as shown in Figure 5 The SPAM module includes a seventeenth convolutional layer, a first 2d average pooling layer, a second 2d average pooling layer, a first 2d maximum pooling layer, and a second 2d maximum pooling layer in parallel. The output ends of the seventeenth convolutional layer, the first 2d average pooling layer, the second 2d average pooling layer, the first 2d maximum pooling layer, and the second 2d maximum pooling layer are connected with a second Concat layer, an eighteenth convolutional layer, and a SimAM unit in sequence. The SimAM unit generates a three-dimensional attention weight by establishing an energy function for calculating the weight, and then performs feature enhancement on the input feature map without introducing additional parameters.

[0067] Based on the structure design of the SPAM module described above, the 2d average pooling layer is used to enhance the perception ability of the overall defect feature, which is beneficial to extract the features of large-sized oil stains and roll marks. At the same time, the 2d maximum pooling layer is used to strengthen the model's ability to capture the edge and texture features of the defects, which is beneficial to extract the features of small-sized scratches and pits. Finally, the SimAM unit is used to further process the feature map after the maximum pooling and average pooling operations without introducing additional parameters, so that the model can focus on the defect feature region more effectively.

[0068] In the embodiment, in order to further enhance the detection ability of defects of different sizes on the liquid cooling plate, a SPAM module is proposed to replace the SPPF module in the traditional backbone network in the backbone network; as shown in Figure 9In this context, C1×H×W represents the number of channels, height, and width of the intermediate feature map.

[0069] The structure of the SimAM unit is as follows: Figure 9 As shown (in the figure, C, H, and W represent the number of channels, height, and width of the input feature map, respectively), this structure generates 3D attention weights without introducing additional parameters by establishing an energy function for calculating the weights; specifically, the formula for calculating the minimum energy value when the SimAM unit generates 3D attention weights is: In the formula, This represents the energy value of the target neuron. This represents the mean of all neurons in a single channel. This represents the variance of all neurons in a single channel. Represents the regularization coefficient. Represents the target neuron. Indicates the relationship with the target neuron The adjacent i-th neuron, This indicates the number of neurons in each channel, with the subscript 'i' representing the neuron index. A lower energy value for the target neuron indicates a greater difference compared to other neurons, thus signifying its higher importance.

[0070] Based on the above-mentioned SPAM module structure design, it first inputs features Figure 10 ∈R C×H×W Channel dimensionality reduction is performed using 1×1 convolution to output features. Figure X 1 is: Features after dimensionality reduction Figure X 1. Pooling is performed through four branches, two of which are 2d average pooling layers and the other two are 2d max pooling layers. The four features after pooling are... Figure X a1 X a2 X m1 X m2 for: Features after dimensionality reduction Figure X The four feature maps after pooling are concatenated along the channel dimension using a second Concat layer. This operation fuses the initial features and the multi-scale features from the pooling process, enhancing the richness of the model's feature extraction. (The fused features are shown in the image.) Figure X 2 is: The fused feature map is processed through a 1x1 convolution of an eighteenth convolutional layer to restore the channel number of the feature Figure X 3 is: The feature map processed through a series of processes is further processed through the attention mechanism of the SimAM unit. The final output feature Figure X 4 is: The battery liquid cooling plate surface defect detection method provided by the application utilizes the characteristics of individual instance differentiation of the target detection algorithm and the characteristics of pixel classification of the semantic segmentation algorithm, and realizes accurate detection of defect targets.

[0071] In the embodiment of the application, the effect verification experiment example of the instance segmentation model SMA-YOLO is provided.

[0072] In the experimental example, the detection accuracy Precision(Box), segmentation accuracy Precision(Mask), detection recall rate Recall(Box), segmentation recall rate Recall(Mask), detection average precision mAP0.5(Box), segmentation average precision mAP0.5(Mask), parameter quantity (Parameters), model size, etc. are used as evaluation criteria.

[0073] Table 1 is a comparison chart of algorithm performance before and after improvement, and it can be seen that compared with the YOLOv11n-seg algorithm, the detection accuracy, detection recall rate and detection average precision of the SMA-YOLO algorithm are improved by 1.1%, 8.9% and 5.8% respectively, the segmentation recall rate and segmentation average precision are improved by 2.7% and 1.4% respectively, and the model parameter quantity is reduced by 35.7%. The detection accuracy is improved while the algorithm complexity is reduced, which is more beneficial to industrial detection.

[0074] Table 1: Comparison chart of algorithm performance before and after improvement The detection results are shown in Figure X Figure 11 , wherein (a) represents each of the pictures containing a pit, a scratch, a black spot, a roll mark and an oil spot defect, (b) represents the detection result of each defect picture in (a) using the initial algorithm YOLOv11n-seg instance segmentation network to train the best weight file, and (c) represents the detection result of each defect picture in (a) using the improved SMA-YOLO instance segmentation network to train the best weight file. As can be seen from the figure, the defect detection effect of SMA-YOLO is higher than that of the YOLOv11n-seg model.

[0075] The principles and implementation manners of the present application are described by using specific examples in the present application, and the above examples are only used for helping to understand the method of the present application and its core idea; meanwhile, for the ordinary skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges can be changed, and the above description should not be understood as the limitation of the present application.

[0076] Those skilled in the art will understand that the examples described herein are for the purpose of understanding the principles of the present application and should be understood as not limiting the scope of protection of the present application. Those skilled in the art can make various other specific modifications and combinations according to the technical inspiration disclosed in the present application without departing from the essence of the present application, and these modifications and combinations are still within the scope of protection of the present application.

Claims

1. A method for detecting surface defects in battery liquid cooling plates based on SMA-YOLO, characterized in that, Includes the following steps: S100. Collect surface defect data of the battery liquid cooling plate and perform data augmentation processing to construct a battery liquid cooling plate defect dataset. S200. Based on the battery liquid cooling plate defect dataset, construct and train the instance segmentation model SMA-YOLO for detecting surface defects of battery liquid cooling plates. The instance segmentation model SMA-YOLO includes a backbone network, a neck network, and a detection head. The backbone network includes a SEP module, a SPAM module, and a C2PSA-IEMA module; the SEP module downsamples the input features through parallel max pooling layers and a SET channel attention mechanism. The SPAM module extracts large-scale defect features through a 2d average pooling layer, extracts defect edge and texture features through a 2d max pooling layer, and focuses on defect feature regions through the SimAM attention mechanism. The C2PSA-IEMA module enhances information interaction capabilities and utilizes a multi-scale feature extraction mechanism and dynamic feature weight calculation to detect defects of different sizes. The neck network is an improvement on the BiFPN network. By performing channel dimensionality reduction on the output features of the backbone network, the computational load of the model is reduced. The detection head includes four detection heads that output defects for micro-targets, small targets, medium targets, and large targets; S300: Defect detection is performed on the surface of the battery liquid cooling plate under test using the instance segmentation model SMA-YOLO.

2. The method for detecting surface defects of battery liquid cooling plates based on SMA-YOLO according to claim 1, characterized in that, In S100, the defect types of the battery liquid cooling plate surface defect data include pits, scratches, black spots, roller marks, and oil stains. The data augmentation process includes adding noise, changing brightness, adding pixels, and mirroring.

3. The method for detecting surface defects of battery liquid cooling plates based on SMA-YOLO according to claim 1, characterized in that, The backbone network includes a first convolutional layer, a second convolutional layer, a first C3k2 module, a first SEP module, a second C3k2 module, a second SEP module, a third C3k2 module, a third convolutional layer, a fourth C3k2 module, a SPAM module, and a C2PSA-IEMA module connected in sequence.

4. The method for detecting surface defects of battery liquid cooling plates based on SMA-YOLO according to claim 3, characterized in that, The neck network includes a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, and a seventh convolutional layer; The input of the fourth convolutional layer is connected to the output of the C2PSA-IEMA module. The output of the fourth convolutional layer is sequentially connected to the first upsampling layer, the first BiFPN module, the fifth C3k2 module, the eighth convolutional layer, the second upsampling layer, the second BiFPN module, the ninth convolutional layer, the third BiFPN module, the third upsampling layer, the fourth BiFPN module, and the ninth C3k2 module. The output of the fourth convolutional layer is also connected to the input of the fifth BiFPN module. The output of the eighth convolutional layer is also connected to the input of the sixth BiFPN module. The input of the fifth convolutional layer is connected to the output of the third C3k2 module, and the output of the fifth convolutional layer is connected to the input of the first BiFPN module and the input of the sixth BiFPN module, respectively. The input of the sixth convolutional layer is connected to the output of the second C3k2 module, and the output of the sixth convolutional layer is sequentially connected to the second BiFPN module, the eighth C3k2 module, the eleventh convolutional layer, the sixth BiFPN module, the seventh C3k2 module, the tenth convolutional layer, the fifth BiFPN module, and the sixth C3k2 module; the output of the sixth convolutional layer and the output of the eighth C3k2 module are also connected to the input of the third BiFPN module. The input of the seventh convolutional layer is connected to the output of the first convolutional layer, and the output of the seventh convolutional layer is connected to the input of the fourth BiFPN module.

5. The method for detecting surface defects of battery liquid cooling plates based on SMA-YOLO according to claim 4, characterized in that, In the detection head: The output of the ninth C3k2 module is connected to the first detection head that outputs small target defects, the output of the eighth C3k2 module is connected to the second detection head that outputs small target defects, the output of the seventh C3k2 module is connected to the third detection head that outputs medium target defects, and the output of the sixth C3k2 module is connected to the fourth detection head that outputs large target defects.

6. The method for detecting surface defects of battery liquid cooling plates based on SMA-YOLO according to claim 3, characterized in that, The first SEP module and the second SEP module have the same structure, both including a first average pooling layer; The output of the first average pooling layer is connected to the input of the channel average pooling layer; The first output terminal of each channel is connected in sequence to the first max pooling layer, the first SET attention unit, and the first multiplier, and the output terminal of the first max pooling layer is also connected to the input terminal of the first multiplier. The second output terminal of each channel is connected in sequence to the second max pooling layer, the second SET attention unit, and the second multiplier, and the output terminal of the second max pooling layer is also connected to the input terminal of the second multiplier. The output terminals of the first multiplier and the second multiplier are connected to the channel splicing layer.

7. The method for detecting surface defects of battery liquid cooling plates based on SMA-YOLO according to claim 6, characterized in that, The first SET attention unit and the second SET attention unit have the same structure, both including a second average pooling layer; The output of the second average pooling layer is connected to the input of the first linear layer and the input of the second linear layer, respectively. The output of the first linear layer is connected to the input of the second channel splicing layer through the first ReLU activation function. The output of the second linear layer is connected to the input of the second channel splicing layer through the second ReLU activation function. The output of the second channel splicing layer is connected to the third linear layer, the first Sigmoid activation function and the third multiplier in sequence. The input of the third multiplier is also connected to the input of the second average pooling layer.

8. The method for detecting surface defects of battery liquid cooling plates based on SMA-YOLO according to claim 3, characterized in that, The C2PSA-IEMA module includes a twelfth convolutional layer, a Split layer, a first Concat layer and a thirteenth convolutional layer connected in sequence. The output of the Split layer is also connected in sequence to the first PSA-IEMA unit, the second PSA-IEMA unit and the first Concat layer. The first PSA-IEMA unit and the second PSA-IEMA unit have the same structure, both including an IEMA unit, a first adder, a fourteenth convolutional layer, a fifteenth convolutional layer and a second adder connected in sequence. The input terminal of the IEMA unit is also connected to the input terminal of the first adder, and the output terminal of the first adder is also connected to the input terminal of the second adder. The IEMA unit includes a normalization layer, an EMA unit, a third adder, a sixteenth convolutional layer, a regularization layer, and a fourth adder connected in sequence. The input of the normalization layer is also connected to the input of the fourth adder. The output of the EMA unit is connected in sequence to the input of the depth-separable convolution, the SE block, and the third adder. The EMA unit is used to extract multi-scale features of small targets.

9. The method for detecting surface defects of battery liquid cooling plates based on SMA-YOLO according to claim 3, characterized in that, The SPAM module includes a seventeenth convolutional layer, a first 2d average pooling layer, a second 2d average pooling layer, a first 2d max pooling layer, and a second 2d max pooling layer, all arranged in parallel. The outputs of the seventeenth convolutional layer, the first 2d average pooling layer, the second 2d average pooling layer, the first 2d max pooling layer, and the second 2d max pooling layer are all connected sequentially to the second Concat layer, the eighteenth convolutional layer, and the SimAM unit. The SimAM unit generates three-dimensional attention weights without introducing additional parameters by establishing an energy function for calculating weights, thereby enhancing the features of the input feature map.

10. The method for detecting surface defects of a battery liquid cooling plate based on SMA-YOLO according to claim 7, characterized in that, The formula for calculating the minimum energy value when the SimAM unit generates the 3D attention weights is as follows: In the formula, This represents the energy value of the target neuron. This represents the mean of all neurons in a single channel. This represents the variance of all neurons in a single channel. Represents the regularization coefficient. Represents the target neuron. Indicates the relationship with the target neuron The adjacent i-th neuron, This indicates the number of neurons in each channel, with the subscript i representing the neuron index.

Citation Information

Patent Citations

  • Industrial product surface defect detection method based on deep learning

    CN115511812A

  • Structure defect detection using machine learning algorithms

    US20200175352A1