CNN-transformer lithium battery micro-short circuit fault diagnosis method based on snake egret optimization
By combining the snake heron optimization algorithm, CNN and Transformer models, the problems of insufficient fault identification capabilities and poor generalization performance in the micro-short circuit fault diagnosis of lithium batteries are solved, and high accuracy and robust fault diagnosis are achieved.
Patent Information
- Application Number
- CN202510170208.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-05-23
AI Technical Summary
There are problems in the diagnosis of internal micro-short circuit faults of lithium batteries, such as insufficient fault identification capabilities, poor generalization performance and fault misjudgment.
The method of optimizing CNN-Transformer based on snake heron is adopted, and the secondary feature extraction and fault classification are finally used to perform secondary feature extraction and fault classification through high-frequency data acquisition, continuous wavelet transformation, Gramm angle field transformation, CNN feature extraction and snake heron optimization weighted fusion algorithm.
It improves the accuracy and adaptability of micro-short circuit fault diagnosis of lithium batteries, reduces the misjudgment rate, and demonstrates strong robustness and generalization ability.
Smart Images

Figure CN120028699A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lithium iron phosphate battery fault diagnosis, and in particular to a lithium battery micro-short circuit fault diagnosis method based on CNN-transformer optimized by snake egret. Background Art
[0002] Lithium battery energy storage systems are widely used in the field of large-scale energy storage due to their high energy efficiency, flexibility and rapid response capabilities. However, safety accidents and electrical failures of lithium batteries occur frequently, which seriously affects their promotion in the field of energy storage. Although micro-short circuits, overcharging, over-discharging and other faults will not immediately cause explosions or thermal runaway, long-term accumulation will damage the internal structure of the battery, accelerate degradation, and pose potential safety risks. Therefore, efficient monitoring and diagnosis of micro-short circuit faults inside lithium batteries is crucial to ensure the safety and reliability of energy storage systems.
[0003] Traditional fault diagnosis methods are mainly based on physical models and signal processing techniques, such as electrical models, thermal models, and multi-physics field models. However, these methods rely on precise parameter estimation, are computationally complex, and have difficulty taking into account multiple fault types. With the improvement of data acquisition capabilities, data-driven fault diagnosis methods have gradually attracted attention. This type of method can automatically extract features and identify fault conditions by learning a large amount of lithium battery operation data, but it usually requires cumbersome feature engineering and is highly dependent on the number of samples and the significance of fault features, which can easily lead to misdiagnosis or missed diagnosis.
[0004] Electrochemical impedance spectroscopy has become an important source of fault diagnosis data because it can reflect the internal health status and degradation mechanism of the battery. Deep learning methods (such as CNN, RNN and its variant Transformer) can automatically learn potential fault modes in complex data with powerful feature extraction and nonlinear mapping capabilities, reduce reliance on manual feature engineering, and maintain a high recognition rate in non-significant fault conditions. Therefore, combining deep learning with electrochemical impedance spectroscopy analysis can not only extract rich fault features in the time domain and frequency domain, but also fuse multi-source data to achieve high-precision modeling, providing reliable technical support for the early diagnosis and prevention of lithium battery micro-short circuits and other potential faults. Summary of the invention
[0005] The present invention provides a lithium battery micro-short circuit fault diagnosis method based on CNN-transformer optimized by snake egret, so as to solve the problems of insufficient fault discrimination ability, poor generalization performance and fault misjudgment in the diagnosis of internal micro-short circuit faults of lithium batteries.
[0006] The present invention adopts the following technical solution: Step 1: Use a high-frequency data acquisition card to continuously collect T at a frequency of 10kHz 0 Seconds Lithium Battery Voltage u( t ), current i ( t )Time series data, T 0 = 100 seconds, front T 0 / 2 seconds for static state, then T 0 / 2 seconds is the constant current discharge state, and continuous wavelet transform is used to u ( t ), i ( t ) to perform time-frequency analysis, and the voltage wavelet coefficients U ( a , b ) and current wavelet coefficients I ( a , b ) ratio to calculate the electrochemical impedance spectrum of the lithium battery Z ( a , b ), the solution formula of voltage wavelet coefficient U(a, b) and voltage wavelet coefficient I(a, b) is: (1) in, a is the scale parameter, which determines the frequency range of the wavelet. b is the translation parameter, which determines the position of the wavelet on the time axis. f b is the Gaussian window parameter, which determines the shape and width of the wavelet. f c is the center frequency parameter, which determines the center frequency of the wavelet frequency domain, j is the imaginary unit, is the normalization factor of the Morlet wavelet, conj is the conjugate operation, and exp is the exponential function symbol; Step 2: Use the Gram angle field to reveal the changing trend of the electrochemical impedance spectrum in different frequency ranges. First, reorganize the real and imaginary parts of the n data points of the electrochemical impedance spectrum into a vector Z = [z 1 ,z 2 ,…,z n ], and then normalize the vector Z to the interval [−1,1]. The normalization process can be expressed as: (2) in, is the data point mapped to the interval [−1,1] after normalization, z i represents the first i data points, max(Z) and min(Z) are the maximum and minimum values in vector Z respectively; Secondly, the normalized electrochemical impedance spectroscopy data is mapped to the polar coordinate space, so that the normalized value of each data point is converted to the corresponding angle through the angular cosine function, and its timestamp is regarded as the polar axis radius. The process is expressed as: (3) in, ϕ represents the angle in polar coordinates, r Represents the polar axis of polar coordinates ,t i is the timestamp, and N represents the number of sampling points contained in a single electrochemical impedance spectroscopy curve; Step 3: Based on the CNN network, the two-dimensional image data obtained by Gram angular field transformation is input into the model to perform preliminary recognition of its features; ResNet18 is used as the specific implementation of the CNN structure. ResNet18 consists of a 7×7 convolutional layer, 8 residual blocks and a fully connected layer. x To input the fault information of the network, F ( x ) represents the residual to be learned in the network, H ( x ) represents the output of the network, satisfying: (4) in, σ represents the activation function ReLU, W 1 and W 2 Respectively represent the weight parameters of the corresponding nonlinear layer; Step 4: Use the snake heron algorithm to optimize the feature weights. First, randomly initialize the fault features obtained by the sensor to form multiple candidate weight combinations: (5) in, w i,j Indicates i The current location of the snake heron, l bj and u bj are the lower and upper bounds of the j-th dimension of the search space, respectively. R is a random number in the interval [0, 1], M is the total number of snake egrets, and Dim is the dimension of the solution space; Referring to the predation behavior of snake herons, the iterative process is divided into three stages: finding prey, consuming prey, and attacking prey. The weight vector is then updated by wide-area search, local mining, and large-step jumps respectively: (6) (7) Among them, represents the new state of the i th secretary bird at this stage, w i,j is the i th value of the j th problem variable for the w random_1 and w random_2 are iterative random candidate solutions, t represents the current iteration number, and T represents the maximum iteration number. w best is the current optimal solution, and R 1 represents an array of dimension 1 × Dim randomly generated in the interval [0,1], RB is Brownian motion, an array of size 1×Dim randomly generated from a standard normal distribution (mean 0, standard deviation 1). represents its j th dimension value. represents the fitness of its objective function, and RL is weighted Levy flight, as shown in the following formula: (8) Among them, s represents Levy the scale factor of the , is Levy the exponential parameter of the ,u and v are random numbers in [0,1], representing the gamma function; Input the weight combination corresponding to each secretary bird individual into the ResNet18 network, and calculate its fitness value according to the cross-entropy loss for fault classification. If the fitness of the new weight solution is better than the original solution, update it to the new position; otherwise, keep the original solution unchanged. After multiple iterations, obtain the optimal combination of feature weighting coefficients and fuse them into a fault feature map. Step 5: Input the obtained fused feature map into the Transformer model for secondary feature extraction and final classification: First, use the Embedding layer to perform spatial encoding on the optimized and fused fault feature map by channel number, and convert it into an input that can be processed by the Transformer. Subsequently, in the Encoder layer composed of L stacked encoding modules, perform in-depth modeling and interaction on the global features through the multi-head self-attention mechanism. Finally, output the final classification result of the micro-short circuit fault of the chemical energy storage battery in the MLP multi-layer perceptron of the Transformer model.
[0007] Compared with the prior art, the present invention has the following beneficial effects: First, the spatial features of signals such as battery voltage and electrochemical impedance spectrum are extracted through the 2D-CNN convolutional layer, and then the Transformer architecture is used to capture the global features of these signals, thereby improving the accuracy of fault diagnosis. In addition, in view of the complex electrochemical behavior of chemical energy storage batteries under fault conditions, this paper uses the Gram angle field to convert the battery electrochemical impedance spectrum into a two-dimensional graph. After CNN extracts features, it combines the SBOA optimization weighted fusion algorithm to generate a more representative feature representation. Finally, after secondary feature extraction by Transformer, the final classification result is output. This method effectively improves the diagnostic accuracy of micro-short circuit faults by combining the local feature extraction capability of CNN and the global information modeling advantages of Transformer, and shows strong adaptability and robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 It is a fault diagnosis flow chart of the method of the present invention.
[0009] Figure 2 It is a flow chart of snake heron optimization feature weights of the method of the present invention.
[0010] Figure 3 It is a snake heron optimized CNN-Transformer fault diagnosis model of the method of the present invention.
[0011] Figure 4 This is the accuracy curve of the CNN-Transformer network optimized based on snake egret in an embodiment of the present invention.
[0012] Figure 5 The ROC curve and AUC value of the CNN-Transformer network are optimized based on snake egret in the embodiment of the present invention.
[0013] Figure 6 This is a confusion matrix diagram of the CNN-Transformer network optimized based on snake egret in an embodiment of the present invention. DETAILED DESCRIPTION
[0014] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Example
[0015] See also Figure 1The object of diagnosis is a 18650 type 1500mAh lithium battery, which is composed of three series and two parallel modules. The invented snake heron optimized CNN-transformer lithium battery micro-short circuit fault diagnosis method includes the following steps: Step 1: Use a high-frequency data acquisition card to continuously collect T at a frequency of 10kHz 0 Seconds Lithium Battery Voltage u ( t ), current i ( t )Time series data, T 0 = 100 seconds, front T 0 / 2 seconds for static state, then T 0 / 2 seconds is the constant current discharge state, and continuous wavelet transform is used to u ( t ), i ( t ) to perform time-frequency analysis, and the voltage wavelet coefficients U ( a , b ) and current wavelet coefficients I ( a , b ) ratio to calculate the electrochemical impedance spectrum of the lithium battery Z ( a , b ), the solution formula of voltage wavelet coefficient U(a, b) and voltage wavelet coefficient I(a, b) is: (1) in, a is the scale parameter, which determines the frequency range of the wavelet. b is the translation parameter, which determines the position of the wavelet on the time axis. f b is the Gaussian window parameter, which determines the shape and width of the wavelet. f c is the center frequency parameter, which determines the center frequency of the wavelet frequency domain, j is the imaginary unit, is the normalization factor of the Morlet wavelet, conj is the conjugate operation, and exp is the exponential function symbol; Step 2: Use the Gram angle field to reveal the changing trend of the electrochemical impedance spectrum in different frequency ranges. First, reorganize the real and imaginary parts of the n data points of the electrochemical impedance spectrum into a vector Z = [z 1 ,z 2 ,…,z n ], and then normalize the vector Z to the interval [−1,1]. The normalization process can be expressed as: (2) in, is the data point mapped to the interval [−1,1] after normalization, z i represents the first i data points, max(Z) and min(Z) are the maximum and minimum values in vector Z respectively; Secondly, the normalized electrochemical impedance spectroscopy data is mapped to the polar coordinate space, so that the normalized value of each data point is converted to the corresponding angle through the angular cosine function, and its timestamp is regarded as the polar axis radius. The process is expressed as: (3) in, ϕ represents the angle in polar coordinates, r Represents the polar axis of polar coordinates ,t i is the timestamp, and N represents the number of sampling points contained in a single electrochemical impedance spectroscopy curve; Step 3: Based on the CNN network, the two-dimensional image data obtained by Gram angular field transformation is input into the model to perform preliminary recognition of its features; ResNet18 is used as the specific implementation of the CNN structure. ResNet18 consists of a 7×7 convolutional layer, 8 residual blocks and a fully connected layer. x To input the fault information of the network, F ( x ) represents the residual to be learned in the network, H ( x ) represents the output of the network, satisfying: (4) in, σ represents the activation function ReLU, W 1 and W 2 Respectively represent the weight parameters of the corresponding nonlinear layer; Step 4: Use the snake heron algorithm to optimize the feature weights. First, randomly initialize the fault features obtained by the sensor to form multiple candidate weight combinations: (5) in, w i,j Indicates i The current location of the snake heron, l bj and u bj are the lower and upper bounds of the j-th dimension of the search space, respectively. R is a random number in the interval [0, 1], Dim is the dimension of the solution space; Referring to the predation behavior of snake herons, the iterative process is divided into three stages: finding prey, consuming prey, and attacking prey. The weight vector is then updated by wide-area search, local mining, and large-step jumps respectively: (6) (7) in, Indicates i The new state of the snake heron at this stage, w i,j For the i Snake Heron j The value of the problem variable, w random_1 and w random_2 is the iterative random candidate solution, t represents the current iteration number, T represents the maximum iteration number, w best is the current optimal solution, R 1 represents a randomly generated array of dimension 1 × Dim in the interval [0,1]. RB is Brownian motion, a randomly generated array of size 1×Dim from a standard normal distribution (mean 0, standard deviation 1). Indicates its j The value of the dimension, Represents the fitness of its objective function, RL is a weighted Levy Flying, as shown in the following formula: (8) in, s represent Levy Scale factor of the distribution , for Levy Exponential parameter of the distribution ,u and v is a random number in [0,1], representing the gamma function; The weight combination corresponding to each snake heron individual is input into the ResNet18 network, and its fitness value is calculated based on the cross entropy loss of fault classification. If the fitness of the new weight solution is better than the original solution, it is updated to the new position, otherwise the original solution is kept unchanged. After multiple iterations, the optimal feature weight coefficient combination is obtained and fused into a fault feature map; Step 5: Input the obtained fused feature map into the Transformer model for secondary feature extraction and final classification: First, use the Embedding layer to spatially encode the optimized fused fault feature map according to the number of channels, and convert it into an input that can be processed by the Transformer; then, in the Encoder layer composed of L stacked encoding modules, the global features are deeply modeled and interacted through the multi-head self-attention mechanism; finally, the MLP multi-layer perceptron of the Transformer model outputs the final classification result of the chemical energy storage battery micro-short circuit fault.
[0016] Specifically, the method of the present invention first extracts the spatial features of signals such as battery voltage and electrochemical impedance spectrum through the 2D-CNN convolutional layer, and then uses the Transformer architecture to capture the global features of these signals, thereby improving the accuracy of fault diagnosis. In addition, in view of the complex electrochemical behavior of lithium batteries under fault conditions, this paper uses the Gram angle field to convert the battery electrochemical impedance spectrum into a two-dimensional graph. After CNN extracts features, it combines the SBOA (Snake Heron Optimization Algorithm) to optimize the weighted fusion algorithm to generate a more representative feature representation. Finally, after secondary feature extraction by Transformer, the final classification result is output. Its structure is as follows Figure 2 This method effectively improves the diagnosis accuracy of micro-short circuit faults by integrating the local feature extraction capability of CNN and the global information modeling advantage of Transformer, and shows strong adaptability and robustness.
[0017] The experimental steps are as follows: (1) First, the Gram angle field impedance spectrum two-dimensional image is used as the original image, and the image is cut into a 60×60 fault information source image containing only the original fault information through the cutting operation: (2) The cropped fault information source image is fed into CNN and features are output from the STAGE3 layer. At this point, after a series of convolutions and pooling, the output is a feature map of size [9, 4, 4].
[0018] (3) Repeat steps (1) and (2) to convert the two-dimensional time-frequency diagrams of the other three signal sources into [9, 4, 4] feature diagrams. In this way, four sets of fault feature diagrams can be obtained. (4) Different fault feature maps are assigned different initial weights, and then the feature maps with a size of 4×4 and 9 channels are fused into one feature map; (5) Use SBOA to optimize the weights of weighted fusion. In the initialization stage, the weights are initialized to random values to form a population. Each individual represents a weight combination. The goal is to optimize the weight combination of weighted fusion so that the final feature map can maximize the accuracy of fault diagnosis. In the exploration stage, the weights are updated through the exploration process of SBOA. In the early stage, a larger range of search is used to optimize the weight combination (using formulas 5, 6, 7 and 8 to update each weight combination). Development stage: After convergence, use SBOA's random mechanism (based on the condition of rand>0.5) to decide whether to strengthen the current optimal combination or continue to explore other possible weights. Fitness update: The fitness of each weight combination is obtained through joint training of CNN and Transformer, and finally optimized through the cross entropy loss function. SBOA optimizes the overall structure of the fusion layer as shown below: Figure 3 As shown; (6) Spatial encoding of the fused feature map according to the number of channels; (7) The encoded feature map is used as the original signal source of the transformer and input into the transformer classification model for the second training; (8) Perform back propagation based on the network cross entropy loss function; during the back propagation process, optimize the model weights.
[0019] Training environment parameters and results analysis The experiment of this embodiment is mainly a micro short circuit experiment carried out at three different ambient temperatures, namely 10°C, 25°C, and 40°C. The experimental data comes from the battery charge and discharge test platform and the data acquisition card. The experimental platform parameters used are: Intel(R) Xeon(R) Gold 6234 processor, basic frequency 3.30GHz, 256G memory, GPU model GeForceRTX 3090, this experiment is built in the pytorch environment, and the programming language is python3.8.
[0020] Under the 25℃ environment, by changing the parallel resistance, the faults are divided into 3 different categories, plus the normal state, a total of 4 categories. The accuracy curve during network training is as follows Figure 4 shown.
[0021] Figure 4In the figure, the red curve represents the accuracy of the training set, and the blue curve represents the accuracy of the test set. As the number of iterations increases, the network classification accuracy gradually improves. After 30 iterations, the accuracy of the training set reaches 100%, and the accuracy of the test set is generally stable at more than 99%, and the final test set accuracy is 99.63%. The high accuracy results show that the established diagnostic model has strong fault identification and classification capabilities, and the model performs well in feature extraction and classification decisions. In the early stage, when the network weights are initialized, the classification ability of the model is weak and the accuracy is low. By using the SBOA optimization algorithm, in the initialization stage, the network weights are initialized with random values to form a population, and each individual represents a weight combination. The goal is to optimize the weights of weighted fusion and improve the accuracy of fault diagnosis. In the exploration stage, SBOA updates the weight combination through a larger range of searches. In the development stage, SBOA decides whether to strengthen the current optimal combination or continue to explore other weight configurations based on a random mechanism. With the optimization process, the accuracy of the training set rises rapidly, and the network gradually learns and adapts to the data characteristics. In the later stages of training, the accuracy of the test set tended to stabilize and remained at a high level, indicating that the weight combination optimized by SBOA was close to the optimal one and the model’s predictive ability for new data was stable.
[0022] In order to demonstrate the performance of the SBOA-CNN-Transformer fault diagnosis network, the receiver operating characteristic (ROC) curve and the area under the curve (AUC) value were plotted. Figure 5 ROC curve and AUC value based on SBOA-CNN-Transformer network under discharge mode.
[0023] Figure 5In the figure, the horizontal axis represents the false positive rate (FPR), that is, the proportion of negative samples that are misclassified as positive; the vertical axis represents the true positive rate (TPR), that is, the proportion of positive samples that are correctly classified as positive. The curve depicts the trend of the classification performance of the model with the false positive rate at different thresholds. The red curve in the figure represents the ROC curve of the model, which shows the performance of the model at different classification thresholds. The AUC value of the model is 0.97913, indicating that the model can effectively distinguish between positive and negative classes and has a high diagnostic accuracy. The AUC value is close to 1, indicating that the classification performance of the model is good and has strong robustness. The red curve rises rapidly when it approaches the upper left corner, indicating that the model can achieve a high true positive rate with a low false positive rate, which is also an important feature of an excellent classifier. Therefore, from the perspective of the ROC curve and AUC value, the SBOA-CNN-Transformer network demonstrates its superior performance in fault diagnosis tasks and can provide relatively stable and accurate fault prediction capabilities.
[0024] In order to more intuitively evaluate the classification performance of the proposed network in lithium battery short circuit fault diagnosis, Figure 6 The confusion matrix based on the SBOA-CNN-Transformer network is shown. As can be seen from the figure, the model has high classification accuracy on different fault categories, and the predicted categories are highly consistent with the true categories, indicating that the model can effectively distinguish different fault states and has excellent classification capabilities. Especially in each major category, the diagonal element values of the confusion matrix are significantly higher than the off-diagonal elements, indicating that the model has a high accuracy in assigning fault samples of different categories and a low misclassification rate.
[0025] In addition, the distribution of the confusion matrix can further verify the stability and robustness of the method proposed in this chapter. Compared with traditional methods, the network can capture fault characteristics more accurately, improve diagnostic accuracy, and maintain good discrimination between different fault categories. Therefore, after experimental analysis of data sets of lithium battery short-circuit faults of different degrees at 25°C, the SBOA-CNN-Transformer diagnostic network showed high generalization ability and reliability, providing effective technical support for lithium battery fault diagnosis.
[0026] On this basis, in order to further evaluate the adaptability and diagnostic accuracy of the proposed method under different temperature conditions, Table 1 lists the accuracy comparison of the two networks under three ambient temperatures of 10℃, 25℃, and 40℃.
[0027] Table 1 Accuracy of each diagnostic method As can be seen from Table 1, the accuracy of CNN-Transformer at three temperatures (10℃, 25℃, and 40℃) is 92.15%, 93.56%, and 93.11%, respectively. After the introduction of the snake heron optimization algorithm (SBOA), the corresponding accuracy of SBOA-CNN-Transformer is significantly improved to 99.35%, 99.63%, and 99.24%, indicating that SBOA-CNN-Transformer can always maintain higher and more stable diagnostic performance under different external ambient temperatures. This is consistent with the analysis results of the training accuracy curve, ROC curve, and confusion matrix mentioned above, that is, after the introduction of the SBOA optimization strategy, the network not only improves the ability to extract and classify fault features, but also has stronger adaptability and robustness to temperature changes. By constructing and training a CNN-Transformer model that integrates the snake heron optimization algorithm (SBOA), short-circuit faults in chemical energy storage batteries are accurately identified. Compared with the unoptimized model, SBOA-CNN-Transformer can adapt to different temperature conditions more effectively, with a diagnostic accuracy of about 99% in multiple tests, and shows good classification performance and robustness in indicators such as confusion matrix, ROC curve and AUC value.
Claims
1. A lithium battery micro-short circuit fault diagnosis method based on snake heron optimized CNN-transformer, characterized in that: The following steps are involved: Step 1: Use a high-frequency data acquisition card to continuously collect T0 seconds of lithium battery voltage at a frequency of 10kHz u ( t ), current i ( t ) time series data, T0 = 100 seconds, the first T0 / 2 seconds is the static state, and the last T0 / 2 seconds is the constant current discharge state. Continuous wavelet transform is used to transform u ( t ), i ( t ) to perform time-frequency analysis, and the voltage wavelet coefficients U ( a , b ) and current wavelet coefficients I ( a , b ) ratio to calculate the electrochemical impedance spectrum of the lithium battery Z ( a , b ), the solution formula of voltage wavelet coefficient U(a, b) and voltage wavelet coefficient I(a, b) is: (1) in, a is the scale parameter, which determines the frequency range of the wavelet. b is the translation parameter, which determines the position of the wavelet on the time axis. f b is the Gaussian window parameter, which determines the shape and width of the wavelet. f c is the center frequency parameter, which determines the center frequency of the wavelet frequency domain, j is the imaginary unit, is the normalization factor of the Morlet wavelet, conj is the conjugate operation, and exp is the exponential function symbol; Step 2: Use the Gram angle field to reveal the changing trend of the electrochemical impedance spectrum in different frequency ranges. First, reorganize the real and imaginary parts of the n data points of the electrochemical impedance spectrum into a vector Z=[z1,z2,…,z n ], and then normalize the vector Z to the interval [−1,1]. The normalization process can be expressed as: (2) in, is the data point mapped to the interval [−1,1] after normalization, z i represents the first i data points, max(Z) and min(Z) are the maximum and minimum values in vector Z respectively; Secondly, the normalized electrochemical impedance spectroscopy data is mapped to the polar coordinate space, so that the normalized value of each data point is converted to the corresponding angle through the angular cosine function, and its timestamp is regarded as the polar axis radius. The process is expressed as: (3) in, ϕ represents the angle in polar coordinates, r Represents the polar axis of polar coordinates ,t i is the timestamp, and N represents the number of sampling points contained in a single electrochemical impedance spectroscopy curve; Step 3: Based on the CNN network, the two-dimensional image data obtained by Gram angular field transformation is input into the model to perform preliminary recognition of its features; ResNet18 is used as the specific implementation of the CNN structure. ResNet18 consists of a 7×7 convolutional layer, 8 residual blocks and a fully connected layer. x To input the fault information of the network, F ( x ) represents the residual to be learned in the network, H ( x ) represents the output of the network, satisfying: (4) in, σ represents the activation function ReLU, W 1 and W 2 represent the weight parameters of the corresponding nonlinear layers; Step 4: Use the snake heron algorithm to optimize the feature weights. First, randomly initialize the fault features obtained by the sensor to form multiple candidate weight combinations: (5) in, w i,j Indicates i The current location of the snake heron, l bj and u bj are the lower and upper bounds of the j-th dimension of the search space, respectively. R is a random number in the interval [0, 1], M is the total number of snake egrets, and Dim is the dimension of the solution space; Referring to the predation behavior of snake herons, the iterative process is divided into three stages: finding prey, consuming prey, and attacking prey. The weight vector is then updated by wide-area search, local mining, and large-step jumps respectively: (6) (7) in, Indicates i The new state of the snake heron at this stage, w i,j For the i Snake Heron j The value of the problem variable, w random_1 and w random_2 is the iterative random candidate solution, t represents the current iteration number, T represents the maximum iteration number, w best is the current optimal solution, R1 represents a randomly generated array of dimension 1 × Dim in the interval [0,1], RB represents Brownian motion, an array of size 1×Dim randomly generated from a standard normal distribution (mean 0, standard deviation 1), Indicates its j The value of the dimension, Represents the fitness of its objective function, RL is a weighted Levy Flying, as shown in the following formula: (8) in, s represent Levy Scale factor of the distribution , for Levy Exponential parameter of the distribution ,u and v is a random number in [0,1], representing the gamma function; The weight combination corresponding to each snake heron individual is input into the ResNet18 network, and its fitness value is calculated based on the cross entropy loss of fault classification. If the fitness of the new weight solution is better than the original solution, it is updated to the new position, otherwise the original solution is kept unchanged. After multiple iterations, the optimal feature weight coefficient combination is obtained and fused into a fault feature map; Step 5: Input the obtained fused feature map into the Transformer model for secondary feature extraction and final classification: First, use the Embedding layer to spatially encode the optimized fused fault feature map according to the number of channels and convert it into an input that can be processed by the Transformer; then, in the Encoder layer composed of L stacked encoding modules, the global features are deeply modeled and interacted through the multi-head self-attention mechanism; finally, the MLP multi-layer perceptron of the Transformer model outputs the final classification result of the chemical energy storage battery micro-short circuit fault.
Citation Information
Cited By
Fault diagnosis and early warning method for intelligent thermal management system of power battery
CN120816907A
Deep learning-based lithium battery internal short circuit fault early warning and positioning method and system
CN121232039A
Lithium battery internal short circuit fault early warning and positioning method and system based on deep learning
CN121232039B
Energy storage equipment operation state monitoring method based on Internet of Things acquisition
CN121256577A
A method for monitoring the operational status of energy storage devices based on IoT data acquisition
CN121256577B