A lithium battery pole piece defect detection method based on knowledge distillation lightweight U-Net
Patent Information
- Application Number
- CN202611096367.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]为解决现有技术无法克服极片红外热像中缺陷对比度低、热扰动噪声强、高精度模型难以实时部署等干扰,难以对锂电池极片缺陷进行自动化、高精度、实时分割提取的技术问题,本发明的目的在于提供一种基于知识蒸馏轻量化U-Net的锂电池极片缺陷分割提取方法,所采用的技术方案具体如下:一种基于知识蒸馏轻量化U-Net的锂电池极片缺陷分割提取方法,所述方法包括:对锂电池极片进行脉冲热激励并利用红外热像仪采集极片表面热图序列;根据热图序列的温升特性对采集的热图进行时序特征融合数据增强;沿缺陷边界对融合后的热图进行人工标注,获得参考热图数据集;对参考热图数据集进行归一化处理获得数据集;基于ResUNet设计教师分割网络,将输入热图信息转换成张量以提取缺陷深层特征;基于深度可分离卷积设计轻量化学生分割网络;设计知识蒸馏模块,包括软标签蒸馏子模块与特征图蒸馏子模块,用于将教师网络的知识迁移至学生网络;融合获得KD-LiteUNet融合模型;根据缺陷像素占比低、热图噪声强的特点设计蒸馏联合损失函数,获得学生网络的损失函数权重;根据损失函数权重进行蒸馏监督计算,获得模型反馈;根据KD-LiteUNet融合模型进行训练获得训练好的轻量化模型;利用训练好的轻量化模型对极片红外热图进行缺陷分割提取;对分割提取结果进行形态学后处理与连通域分析,获得缺陷图像结果;对缺陷图像结果进行缺陷面积、温升速率统计及极片质量分级数据分析
[0010]This invention offers the following advantages: By pulsed thermal excitation of electrodes and acquisition of infrared thermogram sequences, it reveals surface and internal defects through thermal field changes. The data provides rich defect morphology and temperature rise variations, offering ample samples for deep learning models. Since single-frame thermograms are sensitive to instantaneous thermal disturbances, temporal temperature rise feature fusion is used to enhance the thermogram sequence, improving defect contrast while enriching data diversity. Pixel-level manual annotation along defect boundaries is performed on the thermograms to obtain reference thermogram data. Normalization of the thermogram data reduces computation and improves training efficiency, resulting in a standard dataset. Because high-precision segmentation networks are difficult to deploy in real-time on production line edge devices, a ResUNet teacher network is used to provide high-precision soft labels and intermediate feature supervision. Simultaneously, a lightweight student network with less than one-tenth the number of parameters is constructed using depthwise separable convolutions. The output distribution of the teacher network is then analyzed through a knowledge distillation module. Knowledge of both the initial and intermediate features is simultaneously transferred to the student network to avoid the decline in expressive power caused by direct network compression. A four-stage deep separable U-Net structure is adopted with channel shuffling operations to maintain information interaction between channels while keeping the network lightweight, resulting in a KD-LiteUNet fusion model. Due to the low proportion of defective pixels and strong noise in the heatmap, a distillation joint loss function is designed, which jointly supervises the soft label distillation loss, feature map distillation loss, Dice loss, and cross-entropy loss to improve the boundary segmentation accuracy of the student network without increasing inference cost. The trained lightweight model is used to segment the infrared heatmap of the electrode, resulting in fast inference speed and meeting the production line's online inspection cycle. Since the model segmentation results may contain small noise and holes, morphological opening and closing operations and connected component analysis are used for post-processing to obtain complete defect image results. Finally, statistical and data analysis is performed on the defect images for defect area, temperature rise rate, and quality grading. This invention fully considers the complexity of electrode infrared thermal imaging in terms of timing, noise, and deployment cost. It designs a unique temporal feature fusion, teacher-student knowledge distillation, and lightweight U-Net structure, which enhances the feature expression capability and real-time reasoning capability of the lightweight segmentation model, improves the completeness, accuracy, and online detection efficiency of defect segmentation, and provides a reliable technical means for quality control in lithium battery manufacturing.
Smart Images

Figure CN123015406A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lithium battery manufacturing quality inspection technology, specifically to a lithium battery electrode defect segmentation and extraction method based on knowledge distillation lightweight U-Net. Background Technology
[0002] Lithium-ion battery electrodes are one of the core components of lithium-ion batteries. The morphology, area, and location distribution of surface defects such as exposed foil, scratches, bubbles, powder shedding, and wrinkles generated during electrode coating and rolling directly determine the battery's consistency, capacity, and safety performance. With the rapid expansion of power battery and energy storage battery production capacity, the demand for online detection of electrode defects is becoming increasingly urgent. However, electrode defects are characterized by large scale spans, irregular shapes, and small grayscale differences from normal coating textures, posing a significant challenge to accurate defect segmentation and quantitative analysis. Accurate segmentation and quantitative characterization of lithium-ion battery electrode defects have important scientific and engineering value for improving battery manufacturing yield, early warning of safety hazards, and optimization of process parameters. In traditional electrode defect detection methods, manual visual inspection combined with sampling microscopic verification is usually used for defect identification, which suffers from low efficiency, strong subjectivity, and inability to perform 100% inspection. In recent years, researchers have successively introduced visible light machine vision combined with traditional image processing techniques such as threshold segmentation, edge detection, and template matching for defect extraction. However, the complex texture of the coating particles on the electrode surface and the fact that some internal defects are invisible under visible light mean that traditional methods lack the ability to detect low-contrast defects and latent defects such as internal bubbles. Pulsed thermal excitation infrared thermography reveals internal and surface defects by analyzing the temperature field changes on the electrode surface, providing a new data modality for electrode detection. With the development of deep learning technology, semantic segmentation networks such as U-Net and DeepLab have achieved significant results in the field of industrial inspection and are gradually being introduced into infrared thermal imaging defect detection. However, electrode infrared detection is characterized by fast production line cycle time, limited computing power of edge devices, and rich temporal information of thermal image sequences. Single-structure segmentation networks still have the following shortcomings: (1) High-precision segmentation networks have a large number of parameters and computational load, making it difficult to deploy them in real time on edge computing devices in the production line; (2) Single-frame thermal images are sensitive to instantaneous thermal disturbances, and the temporal temperature rise information of thermal image sequences is not utilized, resulting in insufficient defect contrast; (3) Lightweight direct compression of the network leads to a decrease in feature expression ability and a significant loss of defect boundary segmentation accuracy. Therefore, there is an urgent need for an automatic segmentation and extraction method that is tailored to the characteristics of electrode infrared thermal imaging, has high-precision knowledge transfer and lightweight real-time reasoning capabilities. Summary of the Invention
[0003] To address the technical challenges of automated, high-precision, and real-time segmentation and extraction of lithium-ion battery electrode defects, such as low defect contrast, strong thermal disturbance noise, and difficulty in real-time deployment of high-precision models in existing electrode infrared thermal images, this invention aims to provide a lithium-ion battery electrode defect segmentation and extraction method based on knowledge distillation lightweight U-Net. The specific technical solution is as follows: A lithium-ion battery electrode defect segmentation and extraction method based on knowledge distillation lightweight U-Net, comprising: pulsed thermal excitation of the lithium-ion battery electrode and acquisition of a sequence of surface thermal images using an infrared thermal imager; temporal feature fusion data enhancement of the acquired thermal images based on the temperature rise characteristics of the thermal image sequence; manual annotation of the fused thermal images along the defect boundaries to obtain a reference thermal image dataset; normalization processing of the reference thermal image dataset to obtain a new dataset; and designing a teacher segmentation network based on ResUNet. The process involves converting input heatmap information into tensors to extract deep defect features; designing a lightweight student segmentation network based on depthwise separable convolution; designing a knowledge distillation module, including a soft-label distillation submodule and a feature map distillation submodule, to transfer knowledge from the teacher network to the student network; fusing the data to obtain a KD-LiteUNet fusion model; designing a joint loss function for distillation based on the characteristics of low defect pixel ratio and high heatmap noise, and obtaining the loss function weights for the student network; performing supervised distillation calculations based on the loss function weights to obtain model feedback; training the KD-LiteUNet fusion model to obtain a trained lightweight model; using the trained lightweight model to segment and extract defects from the electrode infrared heatmap; performing morphological post-processing and connected component analysis on the segmentation and extraction results to obtain defect image results; and performing statistical analysis on defect area, temperature rise rate, and electrode quality grading data on the defect image results.
[0004] Furthermore, the pulsed thermal excitation and thermal image sequence acquisition method includes: fixing the lithium battery electrode sample flat on the detection platform, using a high-energy flash lamp to perform pulsed thermal excitation on the electrode surface, with a pulse duration of 2-5ms; and using a cooled infrared thermal imager to continuously acquire a 2-second thermal image sequence of the electrode surface after thermal excitation, with the thermal imager having a spectral range of 8-14μm, a frame rate of not less than 60Hz, and a single frame thermal image resolution of not less than 640×512 pixels.
[0005] Furthermore, the temporal feature fusion and annotation method includes: performing data augmentation on the collected heat map sequence according to the temporal temperature rise feature fusion formula, the temporal fusion formula is as follows: I_peak(x,y) = max_t(I_t(x,y)), I_rate(x,y) = max_t(ΔI_t(x,y) / Δt), I_fuse(x,y) = [I_peak(x,y), I_rate(x,y), I_T(x,y)], where I_t(x,y) represents the grayscale value of the heatmap at (x,y) in frame t; I_peak(x,y) represents the peak temperature feature map; ΔI_t(x,y) / Δt represents the temperature rise rate of adjacent frames; I_rate(x,y) represents the maximum temperature rise rate feature map; I_T(x,y) represents the heatmap in frame T after thermal excitation; I_fuse(x,y) represents the 3-channel time-series fused heatmap; the time-series fused heatmap is manually pixel-level annotated along the defect boundary, and four types of defects, namely exposed foil, scratches, bubbles, and powder shedding, are annotated separately to generate reference heatmap data; the grayscale information of the reference heatmap is normalized, and the pixel values are linearly mapped to the [0,1] interval to obtain the standard dataset.
[0006] Furthermore, the method for obtaining the KD-LiteUNet fusion model includes: constructing a ResUNet teacher segmentation network using ResNet-34 pre-trained on ImageNet as the encoding backbone; reshaping the input temporal fusion heatmap into a 512×512×3 tensor; outputting a pixel-level defect probability map through 4-stage residual coding and 4-stage deconvolution decoding supplemented by skip connections; freezing the parameters of the teacher network after training; constructing a 4-stage U-Net structure using depthwise separable convolution, with each stage including depthwise convolution, pointwise convolution, and channel shuffling operations, with the number of parameters in the student network not exceeding one-tenth of that in the teacher network; designing a knowledge distillation module, where the soft-label distillation submodule performs KL divergence alignment on the output probability distributions of the teacher and student networks after temperature coefficient softening; and the feature map distillation submodule performs L2 distance alignment on the intermediate feature maps of the corresponding decoding stages of the teacher and student networks after channel adaptation; and fusing the teacher segmentation network, the lightweight student segmentation network, and the knowledge distillation module to obtain the KD-LiteUNet fusion model.
[0007] Furthermore, the method for obtaining the distillation joint loss function includes: addressing the issues of low defect pixel ratio, strong heatmap noise, and limited expressive power of lightweight networks, combining the distillation loss with the pixel supervision loss to obtain the distillation joint loss function, calculated as follows: L_kd = T^2·KL(softmax(z_s / T) || softmax(z_t / T)), L_feat = Σ_l ||f_s^l - A_l(f_t^l)||_2, L_dice = 1 - 2TP / (2TP + FP + FN), L =α·L_kd + β·L_feat + γ1·L_dice + γ2·L_BCE, where z_s and z_t are the output logits of the student network and teacher network, respectively; T is the distillation temperature coefficient, with a value of 4; KL(·) is the KL divergence; L_kd is the soft label distillation loss; f_s^l and f_t^l are the intermediate feature maps of the student and teacher networks in the l-th decoding stage, respectively; A_l(·) is the channel-adapted 1×1 convolution; L_feat is the feature map distillation loss; TP is the number of true positive pixels in the defect region; FP is the number of false positive pixels where the normal coating is misclassified as a defect; FN is the number of false negative pixels where the defect is misclassified as a normal coating; L_dice is the Dice loss; L_BCE is the pixel binary cross-entropy loss; α, β, γ1, and γ2 are balance coefficients; the loss function is used to perform distillation supervision calculation on the student network to obtain model feedback.
[0008] Furthermore, the model training method includes: using defect region pixels as foreground targets and normal coating region pixels as background; first, training the teacher segmentation network to convergence using pixel-supervised loss and freezing the teacher network parameters; initializing the student segmentation network encoding layer using MobileNet weights pre-trained on ImageNet and performing transfer learning; training the student network using the distillation joint loss function, setting the initial learning rate to 5×10^-4 and dynamically adjusting it according to the cosine annealing strategy; setting the batch size to 16 and iteratively training for no less than 150 epochs; stopping training when the Dice coefficients on the validation set no longer increase for 15 consecutive epochs, and saving the best student network weights as a lightweight model.
[0009] Furthermore, the morphological post-processing and connected component analysis method includes: binarizing the heatmap extracted from the lightweight model segmentation according to a preset threshold; using morphological opening operations to remove isolated noise points and small burrs, the opening operation formula is: O(A,B) = (A⊖B)⊕B; using morphological closing operations to fill small holes inside defects and smooth defect boundaries, the closing operation formula is: C(A,B) = (A⊕B)⊖B, where A is the input binary heatmap and B is the structuring element; marking each defect region according to connected component analysis, removing pseudo-defect regions with an area smaller than a preset threshold, and calculating the area, equivalent circle diameter, maximum temperature rise value, and maximum temperature rise rate of each defect; classifying the electrode into three quality levels—superior, qualified, and unqualified—based on the defect area and temperature rise characteristics, and obtaining the final defect image results and statistical parameters.
[0010] This invention offers the following advantages: By pulsed thermal excitation of electrodes and acquisition of infrared thermogram sequences, it reveals surface and internal defects through thermal field changes. The data provides rich defect morphology and temperature rise variations, offering ample samples for deep learning models. Since single-frame thermograms are sensitive to instantaneous thermal disturbances, temporal temperature rise feature fusion is used to enhance the thermogram sequence, improving defect contrast while enriching data diversity. Pixel-level manual annotation along defect boundaries is performed on the thermograms to obtain reference thermogram data. Normalization of the thermogram data reduces computation and improves training efficiency, resulting in a standard dataset. Because high-precision segmentation networks are difficult to deploy in real-time on production line edge devices, a ResUNet teacher network is used to provide high-precision soft labels and intermediate feature supervision. Simultaneously, a lightweight student network with less than one-tenth the number of parameters is constructed using depthwise separable convolutions. The output distribution of the teacher network is then analyzed through a knowledge distillation module. Knowledge of both the initial and intermediate features is simultaneously transferred to the student network to avoid the decline in expressive power caused by direct network compression. A four-stage deep separable U-Net structure is adopted with channel shuffling operations to maintain information interaction between channels while keeping the network lightweight, resulting in a KD-LiteUNet fusion model. Due to the low proportion of defective pixels and strong noise in the heatmap, a distillation joint loss function is designed, which jointly supervises the soft label distillation loss, feature map distillation loss, Dice loss, and cross-entropy loss to improve the boundary segmentation accuracy of the student network without increasing inference cost. The trained lightweight model is used to segment the infrared heatmap of the electrode, resulting in fast inference speed and meeting the production line's online inspection cycle. Since the model segmentation results may contain small noise and holes, morphological opening and closing operations and connected component analysis are used for post-processing to obtain complete defect image results. Finally, statistical and data analysis is performed on the defect images for defect area, temperature rise rate, and quality grading. This invention fully considers the complexity of electrode infrared thermal imaging in terms of timing, noise, and deployment cost. It designs a unique temporal feature fusion, teacher-student knowledge distillation, and lightweight U-Net structure, which enhances the feature expression capability and real-time reasoning capability of the lightweight segmentation model, improves the completeness, accuracy, and online detection efficiency of defect segmentation, and provides a reliable technical means for quality control in lithium battery manufacturing. Attached Figure Description
[0011] To more clearly illustrate the solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Figure 1 This is a flowchart of a lithium battery electrode defect segmentation and extraction method based on knowledge distillation lightweight U-Net, provided by an embodiment of the present invention. Figure 2This is a network structure diagram of the KD-LiteUNet fusion model provided in one embodiment of the present invention. Detailed Implementation
[0012] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a lithium battery electrode defect segmentation and extraction method based on knowledge distillation lightweight U-Net proposed according to the present invention. In the following description, different embodiments or one embodiment do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The specific scheme of the lithium battery electrode defect segmentation and extraction method based on knowledge distillation lightweight U-Net provided by the present invention is described in detail below with reference to the accompanying drawings.
[0013] Please see Figure 1 This invention illustrates a method for segmenting and extracting defects in lithium battery electrode sheets based on a knowledge distillation lightweight U-Net, which includes the following steps.
[0014] Step S1: The lithium battery electrode is subjected to pulsed thermal excitation, and a sequence of surface thermal images is acquired using an infrared thermal imager. This embodiment of the invention is mainly applied to defect segmentation scenarios after the coating and rolling processes of the positive and negative electrodes of power batteries. To obtain electrode defect thermal image data, the electrode sample is first subjected to pulsed thermal excitation, and then a sequence of surface thermal images is continuously acquired using an infrared thermal imager. Since this embodiment of the invention uses a deep learning model to segment defects, the model network requires a large number of thermal image samples containing defect temperature rise characteristics to ensure that the model has sufficient generalization ability. Preferably, in one embodiment of the present invention, the pulsed thermal excitation and thermal image sequence acquisition method includes: fixing the lithium battery electrode sample flat on the detection platform; using a dual-lamp high-energy flash lamp with a total energy of 6kJ to perform pulsed thermal excitation on the electrode surface, with a pulse duration of 3ms; using a cooled mid-wave infrared thermal imager to continuously acquire a 2-second thermal image sequence of the electrode surface at a frame rate of 60Hz after thermal excitation, for a total of 120 frames; the thermal imager has a spectral range of 8-14μm and a single frame thermal image resolution of 640×512 pixels; acquiring no less than 800 sets of thermal image sequences for positive and negative electrodes with different coating surface densities to ensure the diversity and representativeness of the dataset.
[0015] Step S2: Perform temporal feature fusion data enhancement on the acquired heatmaps based on the temperature rise characteristics of the heatmap sequence; manually annotate the fused heatmaps along the defect boundaries to obtain a reference heatmap dataset; normalize the reference heatmap dataset to obtain the final dataset. Since single-frame heatmaps are subject to noise due to instantaneous thermal disturbances, temporal temperature rise feature fusion is used to enhance the heatmap sequence, improving defect contrast while enriching data diversity. Because the temperature rise characteristics of defect areas differ significantly from those of normal coating areas, pixels are manually annotated along the defect boundaries. Since defect segmentation and extraction only require focusing on relative temperature rise differences, the heatmaps are normalized to reduce computation and improve training efficiency, resulting in a standard dataset. Preferably, in one embodiment of the present invention, the temporal feature fusion and annotation method includes: fusing the heat map sequence according to the temporal temperature rise feature fusion formula, extracting the temperature rise peak feature map, the maximum temperature rise rate feature map and the heat map of the 100th frame after thermal excitation respectively, and combining them into a 3-channel temporal fused heat map; expanding the dataset to 6-8 times the original size by applying horizontal flipping, vertical flipping and random brightness perturbation to each fused heat map; using the Labelme annotation tool to perform pixel-level annotation along the defect boundary, labeling four types of defects, namely exposed foil, scratches, bubbles and powder shedding, as categories 1-4 respectively, and normal coating as 0, to generate reference heat map data; linearly mapping all heat map gray values to the [0,1] interval according to I_norm = (I - I_min) / (I_max - I_min), cropping to 512×512 pixels and randomly dividing them into training set, validation set and test set in a ratio of 8:1:1.
[0016] Step S3: Design a teacher segmentation network based on ResUNet; design a lightweight student segmentation network based on depthwise separable convolution; design a knowledge distillation module to fuse and obtain the KD-LiteUNet fusion model. In one embodiment of the present invention, the method for obtaining the KD-LiteUNet fusion model includes: using the teacher segmentation network to extract deep features of defects and providing soft label supervision; using the lightweight student segmentation network for real-time inference; and completing the knowledge transfer from teacher to student through the knowledge distillation module. Preferably, in one embodiment of the present invention, the teacher segmentation network design method includes: the input layer reshaping the input temporal fusion heatmap into a 512×512×3 tensor; using ResNet-34 pre-trained on ImageNet as the encoding backbone, extracting 32×32×512 deep features through 4-stage residual encoding; the decoding part consists of 4 upsampling stages, each stage including bilinear upsampling, 3×3 convolution, batch normalization and ReLU activation, and skip connections with the corresponding encoding layer; the output layer outputs a 512×512 pixel-level defect probability map through 1×1 convolution and Softmax activation; the teacher network is pre-trained with Dice loss and cross-entropy loss until convergence and then all parameters are frozen. Preferably, in one embodiment of the present invention, the lightweight student segmentation network and knowledge distillation module design method includes: the student network adopts a 4-stage U-Net structure, each stage including 3×3 depthwise convolution, 1×1 pointwise convolution, batch normalization, ReLU activation and channel shuffling operations, with the number of encoding channels being 24, 48, 96 and 192 respectively, and the number of parameters of the student network being 2.1M, which is no more than one-tenth of the 21.7M of the teacher network; the soft label distillation submodule of the knowledge distillation module performs KL divergence alignment on the output logits of the teacher and student networks after softening with a temperature coefficient T=4; the feature map distillation submodule performs L2 distance alignment on the intermediate feature maps of the 2nd, 3rd and 4th decoding stages of the teacher and student networks after 1×1 convolution channel adaptation, and fuses them to obtain the KD-LiteUNet fusion model.
[0017] Step S4: Based on the characteristics of low defect pixel ratio and high thermal image noise, a distillation joint loss function is designed to obtain the loss function weights of the student network; distillation supervision calculation is performed based on the loss function weights to obtain model feedback. The temperature rise and structural information of the defect area and the normal coating area are obtained through the above process. Due to the low defect pixel ratio, high thermal image noise, and limited expressive power of the lightweight network, a distillation joint loss function is designed and calculated based on the above feature information to obtain model feedback. Preferably, in one embodiment of the present invention, the model feedback acquisition method includes: obtaining the student network loss weights according to the distillation joint loss function calculation formula, and calculating the model feedback, the calculation formula is as follows: L_kd = T^2·KL(softmax(z_s / T) || softmax(z_t / T)), L_feat = Σ_l ||f_s^l - A_l(f_t^l)||_2, L_dice = 1 - 2TP / (2TP + FP + FN), L = α·L_kd + β·L_feat + γ1·L_dice + γ2·L_BCE, where T is 4; α, β, γ1, and γ2 are 0.5, 0.3, 0.7, and 0.5 respectively; and performing distillation supervision calculation on the student network using the joint loss to obtain the model feedback.
[0018] Step S5: Train the KD-LiteUNet fusion model to obtain a trained lightweight model; use the trained lightweight model to segment and extract defects from the infrared thermograms of the electrodes; perform morphological post-processing and connected component analysis on the segmentation and extraction results to obtain defect image results; perform defect area, temperature rise rate statistics, and electrode quality grading data analysis on the defect image results. Preferably, in one embodiment of the present invention, training the model based on the KD-LiteUNet fusion model includes: first training the teacher network with Dice loss and cross-entropy loss for 120 epochs until convergence and freezing the parameters; initializing the student network encoding layer with MobileNet weights pre-trained on ImageNet and performing transfer learning; training the student network with the distillation joint loss function, setting the initial learning rate to 5×10^-4, and smoothly decaying it from 5×10^-4 to 1×10^-6 according to the cosine annealing strategy; setting the batch size to 16 and using the Adam optimizer; iteratively training for 150 epochs, stopping training when the Dice coefficients on the validation set no longer increase for 15 consecutive epochs, and saving the best student network weights as the lightweight model. The lightweight model obtained through training is used to segment the infrared thermal image of the electrode. On an edge computing device, the inference time per frame does not exceed 35ms, minimizing the loss of segmentation accuracy due to lightweight compression and improving segmentation accuracy and real-time performance, thus completing the segmentation of electrode defects. Preferably, in one embodiment of the present invention, the morphological post-processing and connected component analysis method includes: binarizing the thermal image extracted by the lightweight model segmentation with a 0.5 threshold; performing morphological opening operations using 3×3 elliptical structuring elements to remove isolated noise points and small burrs with an area less than 15 pixels; performing morphological closing operations using 5×5 elliptical structuring elements to fill small holes inside defects and smooth defect boundaries; marking each defect region according to connected component analysis, calculating the area, equivalent circle diameter, maximum temperature rise value, and maximum temperature rise rate of each defect; classifying the electrode into three quality grades—superior, qualified, and unqualified—based on the total defect area and maximum temperature rise rate, and statistically analyzing the quantity and location distribution of each type of defect. This completes the segmentation and extraction of lithium battery electrode defects.
[0019] In summary, pulsed thermal excitation was applied to lithium battery electrodes, and a series of thermal images of the electrode surface were acquired using an infrared thermal imager. Based on the temperature rise characteristics of the thermal image sequences, temporal feature fusion data enhancement was performed on the acquired thermal images. The fused thermal images were manually annotated along defect boundaries to obtain a reference thermal image dataset. The reference thermal image dataset was normalized to obtain a new dataset. A teacher segmentation network was designed based on ResUNet. A lightweight student segmentation network was designed based on depthwise separable convolution. A knowledge distillation module was designed to fuse and obtain a KD-LiteUNet fusion model. A joint loss function for distillation was designed based on the characteristics of low defect pixel ratio and high thermal image noise. Distillation supervision calculation was performed based on the weights of the loss function to obtain model feedback. The KD-LiteUNet fusion model was trained to obtain a trained lightweight model. The trained lightweight model was used to segment and extract defects from the electrode infrared thermal images. Morphological post-processing and connected component analysis were performed on the segmentation and extraction results to obtain defect image results. Finally, defect area, temperature rise rate statistics, and electrode quality grading data analysis were performed on the defect image results. This invention can segment, extract, and quantitatively characterize defects such as exposed foil, scratches, bubbles, and powder shedding in different types of electrodes, including positive and negative electrodes, providing technical support for quality control in lithium battery manufacturing.
[0020] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous. The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A method for segmenting and extracting defects in lithium battery electrode sheets based on knowledge distillation lightweight U-Net, characterized in that, The method includes: applying pulsed thermal excitation to lithium battery electrodes and acquiring a sequence of thermal images of the electrode surface using an infrared thermal imager; performing temporal feature fusion data enhancement on the acquired thermal images based on the temperature rise characteristics of the thermal image sequence; manually annotating the fused thermal images along the defect boundaries to obtain a reference thermal image dataset; normalizing the reference thermal image dataset to obtain a dataset; designing a teacher segmentation network based on ResUNet to convert the input thermal image information into tensors to extract deep defect features; designing a lightweight student segmentation network based on depthwise separable convolution; and designing a knowledge distillation module, including a soft-label distillation submodule and a feature map distillation submodule, for distilling the knowledge from the teacher network... Knowledge transfer is performed to the student network; a KD-LiteUNet fusion model is obtained through fusion; a distillation joint loss function is designed based on the characteristics of low defect pixel ratio and strong thermal image noise to obtain the loss function weights of the student network; distillation supervision calculation is performed based on the loss function weights to obtain model feedback; a trained lightweight model is obtained by training the KD-LiteUNet fusion model; the trained lightweight model is used to segment and extract defects from the infrared thermal images of the electrodes; morphological post-processing and connected component analysis are performed on the segmentation and extraction results to obtain defect image results; and defect image results are analyzed for defect area, temperature rise rate statistics, and electrode quality grading data.
2. The method for segmenting and extracting defects in lithium battery electrode sheets based on knowledge distillation lightweight U-Net according to claim 1, characterized in that, The pulsed thermal excitation and thermal image sequence acquisition method includes: fixing the lithium battery electrode sample flat on the detection platform, using a high-energy flash lamp to perform pulsed thermal excitation on the electrode surface, with a pulse duration of 2-5ms; and using a cooled infrared thermal imager to continuously acquire a 2-second thermal image sequence of the electrode surface after thermal excitation, with the thermal imager having a spectral range of 8-14μm, a frame rate of not less than 60Hz, and a single frame thermal image resolution of not less than 640×512 pixels.
3. The method for segmenting and extracting defects in lithium battery electrode sheets based on knowledge distillation lightweight U-Net according to claim 1, characterized in that, The temporal feature fusion and annotation method includes: performing data augmentation on the collected heat map sequence according to the temporal temperature rise feature fusion formula, which is as follows: I_peak(x,y) = max_t(I_t(x,y)), I_rate(x,y) = max_t(ΔI_t(x,y) / Δt), I_fuse(x,y) = [I_peak(x,y), I_rate(x,y), I_T(x,y)], where I_t(x,y) represents the grayscale value of the heatmap at (x,y) in frame t; I_peak(x,y) represents the peak temperature feature map; ΔI_t(x,y) / Δt represents the temperature rise rate of adjacent frames; I_rate(x,y) represents the maximum temperature rise rate feature map; I_T(x,y) represents the heatmap in frame T after thermal excitation; I_fuse(x,y) represents the 3-channel time-series fused heatmap; the time-series fused heatmap is manually pixel-level annotated along the defect boundary, and four types of defects, namely exposed foil, scratches, bubbles, and powder shedding, are annotated separately to generate reference heatmap data; the grayscale information of the reference heatmap is normalized, and the pixel values are linearly mapped to the [0,1] interval to obtain the standard dataset.
4. The method for segmenting and extracting defects in lithium battery electrode sheets based on knowledge distillation lightweight U-Net according to claim 1, characterized in that, The method for obtaining the KD-LiteUNet fusion model includes: constructing a ResUNet teacher segmentation network using ResNet-34 pre-trained on ImageNet as the encoding backbone; reshaping the input temporal fusion heatmap into a 512×512×3 tensor; outputting a pixel-level defect probability map through 4-stage residual coding and 4-stage deconvolution decoding supplemented by skip connections; freezing the parameters of the teacher network after training; constructing a 4-stage U-Net structure using depthwise separable convolution, with each stage including depthwise convolution, pointwise convolution, and channel shuffling operations, with the number of parameters in the student network not exceeding one-tenth of that in the teacher network; designing a knowledge distillation module, where the soft-label distillation submodule performs KL divergence alignment on the output probability distributions of the teacher and student networks after temperature coefficient softening; and the feature map distillation submodule performs L2 distance alignment on the intermediate feature maps of the corresponding decoding stages of the teacher and student networks after channel adaptation; and fusing the teacher segmentation network, the lightweight student segmentation network, and the knowledge distillation module to obtain the KD-LiteUNet fusion model.
5. The method for segmenting and extracting defects in lithium battery electrode sheets based on knowledge distillation lightweight U-Net according to claim 1, characterized in that, The method for obtaining the distillation joint loss function includes: addressing the issues of low defect pixel ratio, strong heatmap noise, and limited expressive power of lightweight networks, combining distillation loss with pixel supervision loss to obtain the distillation joint loss function, calculated as follows: L_kd = T^2·KL(softmax(z_s / T) || softmax(z_t / T)), L_feat= Σ_l ||f_s^l - A_l(f_t^l)||_2, L_dice = 1 - 2TP / (2TP + FP + FN), L = α·L_kd + β·L_feat + γ1·L_dice + γ2·L_BCE, where z_s and z_t are the output logits of the student network and teacher network, respectively; T is the distillation temperature coefficient, with a value of 4; KL(·) is the KL divergence; L_kd is the soft label distillation loss; f_s^l and f_t^l are the intermediate feature maps of the student and teacher networks in the l-th decoding stage, respectively; A_l(·) is the channel-adapted 1×1 convolution; L_feat is the feature map distillation loss; TP is the number of true positive pixels in the defect region; FP is the number of false positive pixels where the normal coating is misclassified as a defect; FN is the number of false negative pixels where the defect is misclassified as a normal coating; L_dice is the Dice loss; L_BCE is the pixel binary cross-entropy loss; α, β, γ1, and γ2 are balance coefficients; the loss function is used to perform distillation supervision calculation on the student network to obtain model feedback.
6. The method for segmenting and extracting defects in lithium battery electrode sheets based on knowledge distillation lightweight U-Net according to claim 1, characterized in that, The model training method includes: using defective region pixels as foreground targets and normal coating region pixels as backgrounds; first, training the teacher segmentation network to convergence using pixel-supervised loss and freezing the teacher network parameters; initializing the student segmentation network encoding layer using MobileNet weights pre-trained on ImageNet and performing transfer learning; training the student network using the distillation joint loss function, setting the initial learning rate to 5×10^-4 and dynamically adjusting it according to the cosine annealing strategy; setting the batch size to 16 and iterating for at least 150 epochs; stopping training when the Dice coefficients on the validation set no longer increase for 15 consecutive epochs, and saving the best student network weights as a lightweight model.
7. The method for segmenting and extracting defects in lithium battery electrode sheets based on knowledge distillation lightweight U-Net according to claim 1, characterized in that, The morphological post-processing and connected component analysis method includes: binarizing the heatmap extracted from the lightweight model segmentation according to a preset threshold; using morphological opening operations to remove isolated noise points and small burrs, the opening operation formula is: O(A,B) = (A⊖B)⊕B; using morphological closing operations to fill small holes inside defects and smooth defect boundaries, the closing operation formula is: C(A,B) = (A⊕B)⊖B, where A is the input binary heatmap and B is the structuring element; marking each defect region according to connected component analysis, removing pseudo-defect regions with an area smaller than a preset threshold, and calculating the area, equivalent circle diameter, maximum temperature rise value, and maximum temperature rise rate of each defect; classifying the electrode into three quality levels—superior, qualified, and unqualified—based on the defect area and temperature rise characteristics, and obtaining the final defect image results and statistical parameters.
