Abnormal data prediction and state evaluation method for battery
By using the DTMAD framework, combined with dynamic autoencoders and self-attention mechanisms, the problems of difficult modeling and high computational cost in battery fault detection are solved, achieving efficient feature extraction and anomaly identification, and improving the accuracy and stability of battery state assessment.
Patent Information
- Application Number
- CN202511295858.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2025-12-12
AI Technical Summary
Existing battery fault detection methods face challenges such as modeling difficulties, limited feature extraction capabilities, poor model interpretability, and high computational costs when dealing with complex structures and high-dimensional data, especially in resource-constrained vehicle platforms where they are difficult to deploy efficiently.
The Dynamic Transformed Memory Autoencoder (DTMAD) framework is adopted, which combines a dynamic autoencoder and a gated recurrent unit as a joint feature encoder. The self-attention mechanism is used to capture long-term dependencies in time series data, and key response patterns of multi-source time series data are extracted through a memory parsing module and a residual contrastive learning mechanism. The results are then evaluated using the AUROC evaluation model.
It improves feature extraction efficiency, anomaly identification accuracy, and detection stability, and enhances fault detection accuracy and model stability under multi-source heterogeneous time-series data, making it suitable for battery status assessment under complex operating conditions.
Smart Images

Figure CN121114791A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of battery state prediction, more particularly to a battery abnormal data prediction and state evaluation method. BACKGROUND
[0002] With the rapid development of new energy vehicles, electric vehicles have become an important direction of transportation energy transformation. As the key energy carrier of electric vehicles, the operation safety and reliability of lithium ion batteries are receiving more and more widespread attention. Under complex working conditions such as charging and discharging, long-term operation and high and low temperature, the battery is prone to performance degradation, thermal runaway, internal short circuit and other faults, which may affect the performance of the whole vehicle, and even cause safety accidents. Real-time monitoring of system state, timely detection and handling of faults are important means to ensure the safety of electric vehicles. Therefore, real-time monitoring of battery operating state, timely identification and handling of potential faults have become a key link to ensure the safe operation of electric vehicles. In view of the various abnormal states that lithium ion batteries may face in actual working conditions, it is of great practical significance and engineering value to study efficient and intelligent fault detection.
[0003] Traditional fault detection methods mainly include model-based analysis, knowledge-based reasoning and signal-based statistical analysis. Niu et al. proposed an improved method combined with least square estimation, which effectively improved the robustness of early fault detection. Masoumi et al. used subspace method to estimate the eigenvalue of state matrix for synchronous generator fault, and constructed characteristic equation for fault diagnosis. To solve the problem of insufficient fault data in practical application, Purbowaskito et al. proposed a redundant diagnosis framework combining model residual and machine learning classifier, which enhanced the detection ability of unknown and early faults. Although these methods perform well in early fault detection, they gradually expose the problems of modeling difficulty, limited feature extraction ability and strong dependence on expert experience when dealing with complex structure and high-dimensional data in modern industrial systems. Therefore, data-driven methods have become a popular solution. Data-driven methods are mainly divided into two categories: shallow machine learning and deep learning. Shallow methods rely on hand-crafted features and combine support vector machines, random forests and other classifiers for anomaly recognition. In the aspect of shallow machine learning methods, Gunerkar et al. realized the rapid detection of bearing fault by combining wavelet transform with adaptive neural network; Chen Xin et al. proposed a support vector machine combined with variational modal decomposition and improved sparrow search algorithm optimization, which improved the accuracy and robustness of the model. To cope with the diagnosis challenges brought by complex operating modes and noise interference, Chen et al. proposed a self-transfer learning algorithm based on Gaussian process, which realized the modeling and anomaly detection of steam turbine multi-condition monitoring data. Maculotti et al. applied Gaussian Process (GP) regression method to interference correction of industrial surface measurement data, which improved the measurement accuracy and system robustness. Although these methods have achieved certain results, they still generally face the following problems: dependence on hand-crafted features, insufficient generalization ability, poor model interpretability and high computational cost, which limit their widespread application in industrial settings. In contrast, deep learning has end-to-end modeling capability and can automatically extract high-order abstract features, making it particularly suitable for high-dimensional, nonlinear and multi-modal fault detection tasks. Zhang et al. proposed Deep Support Vector Data Description (DeepSVDD), which constructs a compact data representation space and is suitable for unsupervised anomaly detection tasks. It can effectively identify abnormal behavior even when data labels are scarce. Deng et al. proposed Graph Deviation Network (GDN), which can capture dynamic dependencies between multiple variables and is suitable for modeling complex systems with topological structures between sensors. It has shown excellent fault diagnosis performance in battery management, industrial control and other scenarios.Tang et al. proposed an interpretable multivariate time series anomaly detection method based on GDN and GRU, which can improve the interpretability of the model while ensuring the detection performance. Hang et al. proposed an autoencoder framework combined with an interpretability module, which realized anomaly detection in the charging process of electric vehicles using actual data and introduced an encoding guide matrix to accelerate training convergence. Another study proposed a method combining self-supervised learning and adaptive memory networks, which significantly improved the modeling ability of normal patterns in unsupervised anomaly detection. VAE further improved the generative modeling ability of the model. Sun et al. proposed a GRU-VAE model that can effectively model the multivariate time series data of electric vehicle battery packs. Zhang et al. constructed a dynamic autoencoder framework (DyAD) and introduced social and financial information into battery anomaly detection, demonstrating its potential in safety and low-carbon economy. However, the single model structure makes it difficult to deal with complex abnormal patterns and high-dimensional time series features. The introduction of attention mechanisms and Transformer architecture further developed fault detection methods. Li et al. proposed a probabilistic dynamic modeling based on prototype distribution and Transformer, which realized diversified normal mode learning. Xu et al. proposed Anomaly Transformer, which uses correlation differences and min-max strategies to amplify the differences of abnormal points, significantly improving detection performance. Guo et al. proposed a multi-task convolutional neural network model based on hierarchical clustering and multi-head attention, which reduces data redundancy through hierarchical clustering and combines convolutional neural networks and multi-head attention mechanisms to more accurately extract fault features. Shreshth et al. proposed a method based on Transformer network and adversarial generation (TranAD), which uses an attention mechanism sequence encoder for fast reasoning and combines adaptive focus scores and adversarial training to enhance stability and robustness. Yu et al. proposed an unsupervised anomaly detection model based on adversarial learning, which combines a transformer encoder and adversarial training and introduces a dynamic threshold mechanism, significantly improving anomaly detection performance. Yang et al. proposed a contrastive learning model based on multi-scale dual attention, which uses dual attention mechanisms and pure contrastive loss to learn more discriminative time series representations, thereby improving anomaly detection performance.
[0004] Although the above model has outstanding performance, its multi-layer stacking structure and adversarial training mechanism bring significant computational burden, which is difficult to deploy efficiently in resource-constrained vehicle platforms. The vehicle battery system involves voltage, current, temperature, SOC and other heterogeneous characteristics. There is nonlinear coupling and dynamic correlation between these characteristics. The traditional method has insufficient ability to fuse and model these heterogeneous information, and it is difficult to capture key fault precursors. The generation model such as VAE and adversarial neural network is prone to training instability and overfitting when the sample is insufficient. Especially in the context of extremely scarce fault samples, it is still a challenge to accurately model the normal distribution and identify abnormal behavior. SUMMARY
[0005] The purpose of the present application is to provide a battery abnormal data prediction and state evaluation method, which can improve the feature extraction efficiency, abnormal identification accuracy, detection stability and generalization ability.
[0006] The present application provides a battery abnormal data prediction and state evaluation method, comprising the following steps: S1: preprocessing the experimental data set to obtain multi-dimensional time series data; S2: constructing a joint feature encoder, a pre-response encoder and a memory analysis module to realize a battery abnormal data fault prediction model; S3: training the battery abnormal data fault prediction model using the multi-dimensional time series data to obtain a trained battery abnormal data fault prediction model, predicting the to-be-predicted data using the trained battery abnormal data fault prediction model, and obtaining a prediction result; S4: calculating the reconstruction error of the prediction result and the original data, constructing an AUROC evaluation model, and evaluating the battery abnormal data fault prediction model.
[0007] The present application also provides a computer program product, comprising a computer program which, when executed by a processor, implements the steps of the above-mentioned battery abnormal data prediction and state evaluation method.
[0008] The battery abnormal data prediction and state evaluation method provided by the present application has the following beneficial effects: the present application focuses on the problems of multi-source heterogeneous time series modeling and sample scarcity in the detection of lithium-ion battery faults in electric vehicles, and proposes a prediction-evaluation framework based on a dynamic transformer memory autoencoder (DTMAD). First, a joint feature encoder combining a dynamic autoencoder (DyAD) and a gated recurrent unit is designed to fuse and reduce the dimension of multi-source time series data, extract cross-modal deep feature representation; at the same time, a pre-response encoder based on a self-attention mechanism is constructed to capture long-term dependencies in time series data and improve feature extraction efficiency and accuracy; and further introduce a memory analysis module, fuse the prediction path and the actual response path through the residual contrast learning mechanism, fuse the joint feature encoder and the pre-response encoder, extract the key response mode in the multi-source time series data, combine the memory analysis module and the residual contrast mechanism, and enhance the discriminant ability of abnormal detection; secondly, based on the distribution characteristics of reconstruction error, an evaluation model is designed by coordinating the abnormal detection algorithm. Through statistical modeling and area under the receiver operating characteristic curve (AUROC) evaluation of reconstruction error, the running state of the battery is accurately distinguished. Finally, through the comprehensive prediction-evaluation framework, the key response mode is extracted from the multi-source data under the condition of unsupervised learning and the potential abnormality is identified; the experimental results show that the framework has obvious advantages in fault detection accuracy and model stability compared with autoencoder (AE), deep support vector data description (DeepSVDD) and graph deviation network (GDN) on multiple sets of multi-source lithium-ion battery data sets. Compared with the benchmark model DyAD, the area under the curve (AUROC) of the DTMAD model is improved to 0.901, and the result fluctuation range is reduced from 0.029 to 0.026, which shows higher feature extraction efficiency, abnormal identification accuracy, detection stability and generalization ability, and is widely applicable to various complex working conditions. BRIEF DESCRIPTION OF DRAWINGS
[0009] The present application will be further described below in conjunction with the drawings and examples, wherein: Figure 1 is a flowchart of the battery abnormal data prediction and state evaluation method provided by the present application; Figure 2 is a schematic diagram of the prediction-evaluation framework provided by the present application; Figure 3 is an AUROC calculation flowchart provided by the present application; Figure 4 This is a schematic diagram of random sampling of temperature distribution provided by the present invention; Figure 5 This is a schematic diagram of the charging time slice sampling data provided by the present invention; Figure 6 This is a schematic diagram of the feature correlation coefficient provided by the present invention; Figure 7 This is a schematic diagram of the training process of different dimension losses provided by the present invention; Figure 8 This is a comparison of the predicted trends of different target features provided by the present invention; Figure 9 This is the reconstruction error comparison result provided by the present invention; Figure 10 This is the AUROC curve comparison result provided by the present invention. Detailed Implementation
[0010] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0011] Figure 1 A schematic diagram of the battery anomaly data prediction and state assessment method according to this embodiment is shown. In this embodiment, the battery anomaly data prediction and state assessment method includes the following steps: S1: Preprocess the experimental dataset to obtain multi-dimensional time series data; In one exemplary embodiment, the multi-dimensional time-series data includes multiple charging segments from multiple vehicles; each charging segment includes fault labels, input features, response features, and weakly supervised features; the fault labels include two states: normal and abnormal; the input features include remaining battery power and current; the response features include minimum temperature, maximum single-cell voltage, maximum temperature, minimum single-cell voltage, and voltage; and the weakly supervised features include mileage.
[0012] S2: Construct a joint feature encoder, a pre-response encoder, and a memory parsing module to realize a battery abnormal data fault prediction model; In one exemplary embodiment, the battery anomaly data fault prediction model includes a joint feature encoder, a pre-response encoder, and a memory parsing module. The joint feature encoder is used to encode and compress time-series response features and model latent variables to capture deep dependencies between features. The pre-response encoder is used to model the input sequence using a self-attention mechanism to achieve efficient parallel feature extraction. The memory parsing module is used to fuse the predicted path and the actual response path to construct a residual comparison mechanism to achieve the detection and evaluation of battery anomaly data.
[0013] In one exemplary embodiment, the joint feature encoder includes a GRU encoder, a VAE variational autoencoder, and a GRU decoder.
[0014] In one exemplary embodiment, the GRU encoder encodes the temporal response features, i.e., the feature sequence set, and uses update gates and reset gates to capture the temporal dependencies between input features, extracts the temporal information in the hidden state, and generates a hidden state sequence; the GRU decoder decodes based on the latent variables and additional input features to obtain the target output.
[0015] In one exemplary embodiment, the VAE variational autoencoder samples latent variables from a normal distribution based on the hidden state sequence of the GRU encoder, as shown in the formula: , , , in, As latent variables; Normal distribution The mean of the middle, For variance, This is standard normally distributed noise; The weight matrix is a mean matrix that maps the encoder's hidden representation to the mean of the latent space; This is the weight matrix used to calculate the standard deviation in the encoder neural network, which hides the variance parameter that maps to the latent space; This is the final hidden state obtained after the encoder processes the input data; This is the bias term in the neural network.
[0016] In one exemplary embodiment, the pre-response encoder is used to model the input sequence using a self-attention mechanism to achieve efficient parallel feature extraction; to enhance signal strength and adapt to subsequent self-attention calculations, the amplitude of the features is first adjusted through a scaling operation, as shown in the formula: , in, It is the input sequence; For feature dimensions; The input sequence is linearly transformed into a query, key, and value, as shown in the formula: , It is the input of multi-head attention, that is , including all The initial representation; It is the first The query weight matrix for each attention head determines the weight of each... In the What information should be considered in the size? This is the query vector. ; It is the first The key weight matrix of each attention head. It is the key vector The transpose of the query is used to... Perform a dot product and calculate the attention score; Each element represents the similarity between the query and the key; a higher score indicates greater similarity between the two. The stronger the connection between them; It is a value weight matrix; It is a value vector , containing each The attention weights are used to weight the content information and generate the final output. It is a scaling factor to prevent the dot product from becoming too large, thereby stabilizing the gradient; This is used to convert the scaled attention scores into a probability distribution, resulting in the attention weight matrix; It is a single-head output; Finally, the multiple inputs are concatenated to obtain the next input. ; , in, Indicates transpose; This is the result after normalization; Indicates normalization; This represents the self-attention mechanism.
[0017] In one exemplary embodiment, the memory parsing module models the output of the joint feature encoder, captures the dependencies between positions in the sequence, and outputs an enhanced target path representation as input to the memory parsing module. Information from the response features is used as external memory input to the memory parsing module. A multi-head cross-attention mechanism is utilized to model the dependencies between the two different input sequences, as shown in the formula: , in: It is the target output of the fusion context; This represents a multi-headed cross-attention mechanism; It is a query of the target sequence; These are the keys and values output by the encoder.
[0018] In one exemplary embodiment, the comprehensive loss function of the battery anomaly data fault prediction model is as follows: , in, This is the comprehensive loss function for the battery anomaly data fault prediction model; The main loss function for model training; It is a weakly supervised loss obtained based on the mileage characteristics of electric vehicles, calculated using mean square error, to enhance the model's sensitivity to abnormal behavior under changes in usage intensity; The latent space constraint loss is used to regularize the generated features of the variational autoencoder (VAE), thereby improving the smoothness and generalization ability of the latent space. The weights of the main loss function; It is the weight of the weak supervision loss; The weights for the potential spatial constraint loss; The main loss function is one of mean squared error, mean absolute error, or smoothing loss. The potential spatial constraint loss is as follows: , in, This refers to the batch size.
[0019] S3: Use the multi-dimensional time series data to train the battery abnormal data fault prediction model to obtain a trained battery abnormal data fault prediction model. Use the trained battery abnormal data fault prediction model to predict the data to be predicted to obtain the prediction result.
[0020] S4: Calculate the reconstruction error between the prediction result and the original data, construct the AUROC evaluation model, and evaluate the battery abnormal data fault prediction model; In one exemplary embodiment, the AUROC evaluation model is configured as follows: Based on the prediction results and the original data, the data is grouped by vehicle number, and the average reconstruction error is calculated. Obtain vehicle data array ,in, For the first The vehicle's serial number, For the first The vehicle's label, For the first Vehicle reconstruction error; Based on the vehicle data array, a set of binary pairs is obtained. ; The set of binary pairs is arranged according to Sort in descending order to obtain the sorted set of pairs; Initialize statistical variables, including the true count variable. False positive count variable True positive rate and false positive rate And calculate the number of positive samples. and negative sample count ; Based on the sorted set of pairs, for the pairs whose current sample label is 1, calculate the true count variable. False positive count variable True positive rate and false positive rate ; After traversing all the pairs, count the instances according to the given example variable. False positive count variable True positive rate and false positive rate The ROC curve is calculated, and the area under the ROC curve is used as the AUROC evaluation index.
[0021] In some embodiments, the above-described battery anomaly data prediction and state assessment method can also be implemented in the following ways.
[0022] 1. System Model Design 1.1 Overall Framework Overall framework as Figure 2 As shown. The prediction model learns key response patterns and identifies potential anomalous states from the original multi-source time series data. Its main goal is to accurately reconstruct the input data under unsupervised conditions and reflect the degree of anomalousness of the data through the reconstruction error. The evaluation model comprehensively assesses the performance of the prediction model based on the reconstruction error. The overall system process can be divided into the following two parts: (1) Prediction model: The joint feature encoder integrates the GRU and VAE structures to encode and compress the temporal response features and model the latent variables, capturing the deep dependencies between features; the pre-response encoder uses the self-attention mechanism to model the input sequence, realizing efficient parallel extraction of features; the memory parsing module integrates the prediction path and the actual response path, constructs the residual comparison mechanism, and completes the fault detection and discrimination.
[0023] (2) Evaluate the model: Evaluate the performance of the prediction model by reconstructing the loss.
[0024] 1.2 Prediction Model 1.2.1 Joint Feature Encoder The joint feature encoder consists of three parts: a GRU encoder, a VAE, and a GRU decoder. Its workflow is as follows: the first-layer GRU encoder encodes the temporal response features, extracting temporal information from the hidden states; the variational autoencoder generates latent features based on the first-layer encoding output; and the second-layer GRU decoder uses these latent features and additional conditional inputs to decode, ultimately generating the target output.
[0025] (1) First-layer GRU encoder: The input is the temporal response features, represented as a set of feature sequences. GRU captures the temporal dependencies between input features through update gates and reset gates, generating a sequence of hidden states. The final hidden state serves as a compressed representation of temporal information, and its dimension is determined by the hyperparameters of the GRU hidden layer size.
[0026] (2) Variational Autoencoder (VAE): The input to the VAE is the final hidden state H of the first-layer GRU encoder. Through fully connected layers, the hidden layer is mapped to the parameters of the latent space, namely the mean μ and variance σ. Through reparameterization, the parameters are derived from the normal distribution. The latent variable Z is obtained through sampling. This step introduces probability distribution characteristics into the subsequent generation process, improving the model's generalization ability.
[0027] (1) in, and Predicted by the encoder, This is standard normally distributed noise.
[0028] (2) (3) In variational autoencoders, equations (6) and (7) describe the process by which the encoder generates the latent variable distribution parameters from the hidden representation. Mean and standard deviation By hidden representation The Gaussian distribution used to construct the latent space is obtained through predictions from two independent fully connected layers.
[0029] (3) Second-layer GRU decoder: The input of this module is the output Z of the previous layer, which serves as the initial hidden state of the GRU decoder. and two additional input features The GRU decoder starts with the latent variables of the previous layer and gradually decodes to generate the output sequence. By capturing temporal dependencies, it ultimately generates the target features. This structure effectively models temporal dependencies using GRU and leverages VAE to generate latent features with probability distributions, thereby enhancing the model's generative capabilities.
[0030] 1.2.2 Pre-response encoder The pre-response feature encoder aims to efficiently process input data through an attention mechanism, enhancing the model's ability to model complex dependencies, and is particularly suitable for multivariate time series fault detection. This module's input is consistent with that of the joint feature encoder, supports parallel computation, and improves feature extraction efficiency. Input features It is a shape of The tensor represents the time-series data from multiple sensors. To enhance signal strength and accommodate subsequent self-attention calculations, the features are first scaled: (4) in, To ensure numerical stability of the computation, the feature dimension is scaled by taking the square root. For the timestamp relationships implicit in the original features, this embodiment employs positional encoding to indirectly inject temporal information and enhance the model's sequential modeling capability. Considering the low dimensionality of the original input, the features are first increased in dimensionality through a linear transformation to expand the feature representation space. The increased-dimensional features are then input into a multi-head self-attention module to capture complex global dependencies and improve feature expressiveness.
[0031] (5) To capture global and local dependencies within the sequence, the module introduces a hybrid attention mechanism and regularizes the weights using Dropout. The self-attention output is added to the input via a residual connection and then normalized using an applied layer. (6) Where: src is the input sequence, Attention(src) is the self-attention output, and residual is the normalized result memory. The output of the pre-response feature encoder will be used as the input of the next module.
[0032] 1.2.3 Memory Resolution Module The memory parsing module integrates the complementary relationship between the target path (output of the joint feature encoder) and the memory path (output of the pre-response feature encoder). (1) Target path self-attention: This module receives the output of the joint feature encoder to model and capture the dependencies between positions in the sequence. Finally, this module outputs an enhanced target path representation as the input of the memory parsing module. (2) Memory path: The memory path carries the information of the response features and serves as the external memory input in the decoder. The experiment uses a multi-head cross-attention mechanism to model the dependencies between two different input sequences, specifically represented as follows: (7) in: It is a query of the target sequence; These are the keys and values output by the encoder; This is the target output of the fusion context. The predicted output is obtained by calculating the reconstruction error using the fusion module output and response features.
[0033] 1.2.4 Loss Function The overall prediction model uses a weighted average of three dimensions of loss evaluation to obtain a comprehensive result. Training will be conducted, specifically as follows: (8) in: (1) The main loss for model training uses the three functions shown in Table 1.
[0034] Table 1: Three Loss Functions
[0035] (2) It is a weakly supervised loss obtained based on the mileage characteristics of electric vehicles, calculated using mean square error, to enhance the model's sensitivity to abnormal behavior under changes in usage intensity; (3) This is the latent space constraint loss, used to regularize the features generated by VAE, thereby improving the smoothness and generalization ability of the latent space. It is determined by the following formula, where Batch is the batch size: (9) (4) , , These are the weighting coefficients of the three types of loss functions, all of which are adjustable hyperparameters, comprehensively adjusting the impact of each loss on the model training objective. The weight of the main loss term, which occupies a dominant position, is usually set to a larger value. These are the weights for weak supervision loss, which are mainly used to guide the model to enhance its generalization ability in scenarios where labels are scarce or uncertain. They are usually set to a small value to avoid weak supervision dominating training. To adjust the smoothness of the potential spatial distribution, a mechanism of gradually increasing weights is used, typically initially set to 0.1.
[0036] 1.3 AUROC Evaluation Model This embodiment proposes a performance evaluation method for prediction models in unsupervised scenarios. Since accurate fault labels are lacking in actual working conditions, this embodiment employs an anomaly scoring mechanism based on reconstruction error, combined with the AUROC metric, to quantify the model's anomaly detection capability through collaborative anomaly detection. To comprehensively evaluate model performance, AUROC (area under the ROC curve) is used as the evaluation metric to reflect the model's classification ability at different thresholds. First, the input data is encoded using a joint feature encoder and a pre-response encoder, and then the output is decoded using a memory parsing module, calculating the reconstruction error between the prediction result and the original data. Second, the reconstruction error threshold for anomaly detection is adjusted, and the true positive rate (TPR) and false positive rate (FPR) are calculated at different thresholds. This allows for the plotting of the ROC curve and the calculation of its area, ultimately obtaining the model's AUROC value to comprehensively measure the model's classification performance and stability. The collaborative anomaly detection algorithm flow is as follows: Figure 3 As shown. The specific process of the AUROC evaluation model is as follows: (1) Group the data by vehicle number to obtain ; (2) For each group Calculate the average reconstruction error Extract vehicle tags ;save To the set of binary pairs S; (2) Arrange set S according to Sort in descending order; (4) Initialization: ; (5) Calculate P = number of positive samples, N = number of negative samples; (6) For each :like Then calculate and : , ; (7) Calculate the ROC curve and take the area under the curve as the AUROC score.
[0037] 2. Experiment and Results Analysis 2.1 Experimental Data The experimental dataset in this embodiment comes from the Tsinghua University Electric Vehicle Data Platform. Multi-dimensional time-series data from 100 electric vehicles under different charging scenarios were collected through the battery management system. The data includes multiple sets of battery data collected from the electric vehicles. This dataset contains 91 normal vehicles and 9 abnormal vehicles. The dataset uses the vehicle number (car_number) as a unique identifier, and each vehicle's data contains multiple charging segments. Each charging segment records the vehicle's operating status during a specific charging process and includes a fault label (00 for normal, 10 for abnormal) and cumulative mileage. The data for each charging segment is stored in a [128, 7] time-series matrix, and a mileage feature is also included in the metadata for weak supervision of the model. Each charging segment data contains the core features corresponding to Table 2.
[0038] Table 2: Feature Correspondence Table
[0039] Electric vehicle battery data exhibits multimodal and time-series characteristics, resulting in high feature complexity. The following section uses visualization and statistical analysis to compare the distribution differences between normal and faulty data. Figure 4 The results of random sampling of temperature distribution show a significant difference in battery temperature between normal vehicles and faulty vehicles; among them, Figure 4 (a) shows the maximum temperature distribution. Figure 4 (b) shows the minimum temperature distribution, with the horizontal axis representing the sample size and the vertical axis representing the temperature value, illustrating the temperature distribution of normal and faulty vehicles. The maximum temperature of normal vehicles is mainly distributed in the range of 10℃ to 25℃, while most faulty vehicles exceed 25℃. The minimum temperature range of normal vehicles is relatively wide, ranging from 6℃ to 33℃; in contrast, the minimum temperature of faulty vehicles is concentrated in the range of 23℃ to 33℃, with the lower limit shifting significantly upward. Figure 5 This is a sampling result of charging time slices for current and voltage data. The sample size of normal vehicles is relatively large, resulting in a more detailed data distribution and more comprehensive feature characterization after sampling; among them, Figure 5 (a) is the current sub-diagram. Figure 5(b) is a voltage subplot, with the horizontal axis representing the number of samples and the vertical axes representing current and voltage values, respectively, showing the current and voltage distribution of normal and faulty vehicles. The current values of normal vehicles are mostly stable around -20A, with small fluctuations and few outliers. Faulty vehicles are mainly distributed between -60A and -140A, with some samples falling within the -40A to 60A range, exhibiting a larger overall current variation. The voltage values of faulty vehicles are mainly concentrated between 43V and 46V, accounting for a high proportion and showing significant clustering. The voltage distribution of normal vehicles is more uniform, without any obvious concentrated range. Given that there is significantly more data from normal vehicles than from faulty vehicles, this embodiment uses an unsupervised learning method to alleviate the class imbalance problem. In the experimental design, 80% of the normal samples are used as the training set to train the model, while the test set consists of the remaining 20% of normal data and 80% of the faulty data. Five-fold cross-validation is used to improve the stability and reliability of the results.
[0040] In the model structure, the joint feature encoder receives data with the following shape: Multi-channel input features are used to extract deep representations across modalities. To achieve target reconstruction, the input shape in the decoding stage is... The output shares a latent space representation with the encoder, while the pre-response encoder uses a shape... The features are used as input, and the dependencies between time and variables are modeled through an attention mechanism to output a memory representation. Finally, the memory parsing module fuses the outputs of the joint encoder and the pre-response encoder to improve fault identification performance. The correlation coefficient matrix between features is as follows: Figure 6 As shown, the display , , , , , , The correlation coefficients between features are calculated, with values ranging from -1 to 1. Two hundred samples are randomly selected for max-min standardization to obtain the maximum and minimum values of their corresponding features. The standard deviation and mean are then calculated. Finally, all data are normalized. The formula is as follows: (10) in, These are the original eigenvalues. It is the mean of the features on the training set. It is the maximum value of the feature on the training set. It is the minimum value. That is the normalized value.
[0041] The reconstruction errors generated by the prediction models are compared. The reconstruction error is calculated using the following formula: (11) The reconstruction loss is calculated by averaging the squared differences between the true values and the model predictions to measure the reconstruction accuracy of the prediction results. Represents the total number of samples. For the first The true value of each sample This is the corresponding value predicted by the model.
[0042] 2.2 Experimental Analysis of the Prediction Model 2.2.1 Experimental Comparison Model The prediction model uses eight comparative models as shown below to verify its performance, covering traditional time series modeling methods, unsupervised anomaly detection models, graph neural network methods, and the improved model proposed in this embodiment. AE: Autoencoders detect anomalies through reconstruction errors and possess some time-series modeling capabilities, but lack explicit modeling of complex relationships between multiple variables; DeepSVDD: A typical unsupervised anomaly detection method, based on the support domain method, maps normal samples into a compact hypersphere in the embedding space, suitable for scenarios with a low proportion of anomalous samples; however, it cannot capture the dynamic interaction relationships between variables and has limited modeling capabilities for time-series data; GDN: Introduces a graph neural network structure to construct a dependency graph between multiple variables, thereby capturing the coupling relationships between variables and effectively improving the ability to perceive anomalous patterns in multidimensional time series; GP: Assumes that the latent distribution of the reconstruction residuals follows a Gaussian distribution, models the degree of sample anomaly from a statistical perspective, and can achieve discriminative anomaly detection boundaries, but has limited adaptability to complex structured data; DyAD: The basic model referenced in this embodiment, using a dynamic autoencoder structure to achieve prediction and reconstruction in the time dimension, but has not yet explicitly considered the correlation and interaction between variables; Dynamic Transformer Autoencoder Autoencoder (DTAD): Based on DyAD, it introduces a channel attention mechanism to dynamically adjust the model's attention to different input variables, improving its responsiveness to key variables and more effectively distinguishing outliers. It is also used as one of the comparison models in ablation experiments. Dynamic Memory Autoencoder (DMAD): Based on the basic DyAD model, it introduces a cross-attention structure to establish an explicit interaction pathway between input variables and the response target, strengthening the model's ability to model deep dependencies among multiple variables. It is also used as one of the comparison models in ablation experiments. Dynamic Transformed Memory Autoencoder (DTMAD): The final model, which integrates channel attention and cross-attention mechanisms, achieves multi-granularity dependency modeling based on joint feature encoding, significantly enhancing the model's generalization ability and detection performance in highly correlated multivariate anomaly detection tasks. The model numbers in Table 3 indicate the corresponding models.
[0043] Table 3: Comparison Models
[0044] 2.2.2 Prediction Model Parameter Settings The model parameter settings are shown in Table 4.
[0045] Table 4: Model Parameter Settings
[0046] 2.2.3 Comparative Analysis of Training Loss Functions for Predictive Models To verify the performance of different loss functions during model training, an experiment was designed to compare the performance of different loss functions. , as well as The training performance of three loss functions as the main loss was compared. The experiments were conducted under a uniform 20-epoch training condition, recording the average comprehensive training loss of the model across five response features. The results are shown in Table 5. The experimental results show that, in different contrastive and ablation models, In terms of training effectiveness, it is superior to all others. and This indicates a lower overall training loss. It exhibits better convergence performance and robustness in feature reconstruction tasks, and can improve the model's sensitivity and discriminative ability to abnormal patterns.
[0047] Table 5: Average Loss During Training with Different Loss Functions
[0048] 2.2.4 Analysis of the Overall Loss Effect of the Prediction Model Verification in experiments It showed superior performance in multiple comparative models. and The training effect. Therefore, this embodiment adopts... As the main loss function, the model is formally trained, and its performance across various loss dimensions is observed. Figure 7 The training process for different loss dimensions is given; as can be seen from the figure, from the 2nd to the 10th... When the M3 model converges faster and has better prediction accuracy, the overall loss comparison is shown in Table 6. The table shows that DTMAD has the optimal loss during training, indicating that the model learns better from normal data than other models, further demonstrating that the added modules effectively enhance the model's ability to perceive multivariate interactions.
[0049] Table 6: Comparison of Overall Losses
[0050] To evaluate the sensitivity of the model's performance to structural parameters, different... Impact on prediction performance. Experimental results show that the AUROC index changes relatively little within a certain range, but the reconstruction error fluctuates significantly, indicating that model capacity has a certain impact on feature representation ability. Therefore, in the final settings, a parameter combination with low reconstruction error was selected while maintaining stable performance. The experimental results are shown in Table 7.
[0051] Table 7: Model performance analysis under different hyperparameters
[0052] Experimental results show that as the hidden layer dimension increases from 32 to 256, the overall loss and AUROC of the model do not show a continuous upward trend, indicating that larger hidden layers do not necessarily lead to better performance. Meanwhile, when the batch size increases from 32 to 256, the overall loss actually increases, and the AUROC decreases, suggesting that excessively large batch sizes may negatively impact the model's generalization ability.
[0053] 2.2.5 Comparison of Forecasted Trends 3 main input response features , , The predicted trend is shown in the figure. The model outperforms other models in terms of prediction accuracy and trend fitting. , and Models, especially when dealing with features , and When making predictions, The model exhibits higher stability and accuracy. To evaluate the performance of different models on the feature reconstruction task, this study plotted a scatter plot of the reconstruction errors in order of magnitude, as shown below. Figure 8 As shown in the figure, the horizontal axis represents the indices of the 200 extracted samples, and the vertical axis represents the corresponding reconstruction error values, including... , , and Comparison results of the three models. From Figure 8 It can be seen from this that The reconstruction errors on the samples were all significantly lower than , and Its sorting curve is generally at a low level, indicating better reconstruction quality and stronger input fitting ability. This suggests that... It can more effectively capture the latent feature distribution of input data and has a stronger feature representation capability.
[0054] Figure 9To compare reconstruction errors, the horizontal axis represents the sample index, and the vertical axis represents the reconstruction error value, showing the distribution of reconstruction errors for different models.
[0055] 2.2.6 Evaluation of the computational complexity and timeliness of the prediction model To measure the computational complexity of each model, the average total time taken for multiple training and testing iterations is used as a reference. Since different hardware environments can affect the execution time, this embodiment does not evaluate absolute running time, but only uses it to compare the timeliness differences between models, as shown in Table 8.
[0056] Table 8: Comparison of Total Time Spent
[0057] The average computation time of the baseline model DyAD, the model incorporating a pre-response encoder, a memory parsing module, and the model combining both are presented. It can be seen that although the pre-response encoder needs to wait for synchronization with the output of DyAD, resulting in some synchronization overhead, the overall increase in time is relatively limited because the pre-response encoder can be processed in parallel with DyAD. Overall, the computation time of the model after introducing the attention mechanism and parallel structure remains relatively stable, without significantly increasing computational complexity, verifying that the proposed structure maintains good computational efficiency while improving fault detection performance.
[0058] 2.3 Evaluation Model 2.3.1 Evaluation Model Indicators This embodiment uses AUROC based on reconstruction error as the evaluation metric, primarily measuring the model's learning performance on normal data. A lower reconstruction error indicates that the model can capture the feature patterns of normal data better. AUROC is obtained by plotting the ROC curve and calculating the area under the curve by changing the anomaly detection threshold. The true positive rate is calculated as follows: (12) Formula for calculating false positive rate: (13) TP, FN, FP, and TN are four classification cases, as shown in Table 9.
[0059] Table 9: Confusion Matrix
[0060] A higher AUROC value (closer to 1) indicates a stronger ability of the model to distinguish between normal and faulty data; conversely, a value close to 0.5 indicates a weaker ability to distinguish between them. This embodiment uses the AUROC evaluation results to comprehensively reflect the effectiveness of the entire model in the vehicle-mounted lithium-ion fault detection task.
[0061] 2.3.2 Performance Evaluation of Reconstruction Based on Feature Combination To evaluate the impact of different input response features on the performance of the evaluation model, this embodiment selected multiple combinations of input response features to conduct AUROC evaluation experiments, and the results are shown in Table 10.
[0062] Table 10: Comparison of AUROC under different combinations of response characteristics
[0063] As can be observed from the table, the combination of features Y2, Y4, and Y5 exhibits superior AUROC evaluation performance compared to other feature combinations. This suggests that these three features may be better able to capture the potential patterns in electric vehicle battery fault data, thereby improving the model's classification performance.
[0064] 2.3.3 Comparison of the overall performance of the evaluation models This embodiment compares the AUROC of the DTMAD model with other methods to verify its overall performance. Based on the algorithm described above, the reconstruction error is calculated and the ROC curve is plotted. The input data for the comparison algorithm models undergoes the same preprocessing steps to avoid interference from differences in data processing. All models are trained on the same hardware platform and under the same deep learning framework to ensure a consistent operating environment, and the final comparison metric is AUROC. Furthermore, all comparison models are trained and tested using 5-fold cross-validation to avoid performance deviations due to differences in data distribution.
[0065] The AUROC curves below are all averages obtained from 5-fold experimental data. The AUROC values for each model are shown in Table 11.
[0066] Table 11 AUROC Comparison**
[0067] The AUROC evaluation curves for each comparative model are as follows: Figure 10 As shown in the figure, the proposed DTMAD model maintains a high true positive rate even in regions with low false positive rates, demonstrating superior anomaly detection ability and robustness. Compared to other methods, the DTMAD model shows a significant improvement in the area under the curve, validating its generalization performance and detection accuracy in complex time-series data.
[0068] In summary, this embodiment addresses the problems of insufficient signal feature extraction and limited accuracy of fault mode recognition in electric vehicle battery fault diagnosis by proposing an architecture combining a joint feature encoder and a pre-response encoder. Based on the evaluation results of the test set, the model not only performs excellently in capturing normal data features but also exhibits higher sensitivity to abnormal patterns in fault data, with a significant improvement in the AUROC metric. This demonstrates that the design, through modular design, feature processing, and memory module parsing of multivariate outputs, significantly improves fault detection performance, and its effectiveness has been verified experimentally.
[0069] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described battery anomaly data prediction and state assessment method.
[0070] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A method for predicting abnormal battery data and assessing battery condition, characterized in that, Includes the following steps: S1: Preprocess the experimental dataset to obtain multi-dimensional time series data; S2: Construct a joint feature encoder, a pre-response encoder, and a memory parsing module to realize a battery abnormal data fault prediction model; S3: Use the multi-dimensional time series data to train the battery abnormal data fault prediction model to obtain a trained battery abnormal data fault prediction model. Use the trained battery abnormal data fault prediction model to predict the data to be predicted to obtain the prediction result. S4: Calculate the reconstruction error between the prediction result and the original data, and construct an AUROC evaluation model to evaluate the battery abnormal data fault prediction model.
2. The battery anomaly data prediction and status assessment method according to claim 1, characterized in that, The battery anomaly data fault prediction model includes a joint feature encoder, a pre-response encoder, and a memory parsing module. The joint feature encoder is used to encode and compress time-series response features and model latent variables to capture deep dependencies between features. The pre-response encoder is used to model the input sequence using a self-attention mechanism to achieve efficient parallel feature extraction. The memory parsing module is used to fuse the predicted path and the actual response path to construct a residual comparison mechanism to achieve the detection and evaluation of battery anomaly data.
3. The battery anomaly data prediction and state assessment method according to claim 2, characterized in that, The joint feature encoder includes a GRU encoder, a VAE variational autoencoder, and a GRU decoder.
4. The battery anomaly data prediction and state assessment method according to claim 3, characterized in that, The GRU encoder encodes the temporal response features, i.e., the feature sequence set, and uses update and reset gates to capture the temporal dependencies between input features, extracts the temporal information in the hidden state, and generates a hidden state sequence; the GRU decoder decodes based on latent variables and additional input features to obtain the target output.
5. The battery anomaly data prediction and state assessment method according to claim 3, characterized in that, The VAE variational autoencoder samples latent variables from a normal distribution based on the hidden state sequence of the GRU encoder, as shown in the formula: , , , in, As latent variables; Normal distribution The mean of the middle, For variance, This is standard normally distributed noise; The weight matrix is a mean matrix that maps the encoder's hidden representation to the mean of the latent space; This is the weight matrix used to calculate the standard deviation in the encoder neural network, which hides the variance parameter that maps to the latent space; This is the final hidden state obtained after the encoder processes the input data; This is the bias term in the neural network.
6. The battery anomaly data prediction and state assessment method according to claim 2, characterized in that, The pre-response encoder is used to model the input sequence using a self-attention mechanism to achieve efficient parallel feature extraction. To enhance signal strength and adapt to subsequent self-attention calculations, the amplitude of the features is first adjusted through a scaling operation, as shown in the formula: , in, It is the input sequence; For feature dimensions; The input sequence is linearly transformed into a query, key, and value, as shown in the formula: , It is the input of multi-head attention, that is , including all The initial representation; It is the first The query weight matrix for each attention head determines the weight of each... In the What information should be considered in the size? This is the query vector. ; It is the first The key weight matrix of each attention head. It is the key vector The transpose of the query is used to... Perform a dot product and calculate the attention score; Each element represents the similarity between the query and the key; a higher score indicates greater similarity between the two. The stronger the connection between them; It is a value weight matrix; It is a value vector , containing each The attention weights are used to weight the content information and generate the final output. It is a scaling factor to prevent the dot product from becoming too large, thereby stabilizing the gradient; This is used to convert the scaled attention scores into a probability distribution, resulting in the attention weight matrix; It is a single-head output; Finally, the multiple inputs are concatenated to obtain the next input. ; , in, Indicates transpose; This is the result after normalization; Indicates normalization; This represents the self-attention mechanism.
7. The battery anomaly data prediction and state assessment method according to claim 2, characterized in that, The memory parsing module models the output of the joint feature encoder, captures the dependencies between positions in the sequence, and outputs an enhanced target path representation as input to the memory parsing module. It uses the information of the response features as external memory input to the memory parsing module and employs a multi-head cross-attention mechanism to model the dependencies between the two different input sequences, as shown in the formula: , in: It is the target output of the fusion context; This represents a multi-headed cross-attention mechanism; It is a query of the target sequence; These are the keys and values output by the encoder.
8. The battery anomaly data prediction and state assessment method according to claim 2, characterized in that, The comprehensive loss function of the fault prediction model is as follows: , in, This is the comprehensive loss function for the fault prediction model; The main loss function for model training; It is a weakly supervised loss obtained based on the mileage characteristics of electric vehicles, calculated using mean square error, to enhance the model's sensitivity to abnormal behavior under changes in usage intensity; The latent space constraint loss is used to regularize the generated features of the variational autoencoder (VAE), thereby improving the smoothness and generalization ability of the latent space. The weights of the main loss function; It is the weight of the weak supervision loss; The weights for the potential spatial constraint loss; The main loss function is one of mean squared error, mean absolute error, or smoothing loss. The potential spatial constraint loss is as follows: , in, This refers to the batch size.
9. The battery anomaly data prediction and state assessment method according to claim 1, characterized in that, The AUROC evaluation model is configured as follows: Based on the prediction results and the original data, the data is grouped by vehicle number, and the average reconstruction error is calculated. Obtain vehicle data array ,in, For the first The vehicle's serial number, For the first The vehicle's label, For the first Vehicle reconstruction error; Based on the vehicle data array, a set of binary pairs is obtained. ; The set of binary pairs is arranged according to Sort in descending order to obtain the sorted set of pairs; Initialize statistical variables, including the true count variable. False positive count variable True positive rate and false positive rate And calculate the number of positive samples. and negative sample count ; Based on the sorted set of pairs, for the pairs whose current sample label is 1, calculate the true count variable. False positive count variable True positive rate and false positive rate ; After traversing all the pairs, count the instances according to the given example variable. False positive count variable True positive rate and false positive rate Calculate the ROC curve and determine the area under the ROC curve, which serves as the AUROC evaluation metric.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the battery anomaly data prediction and state assessment method according to any one of claims 1-9.
Citation Information
Cited By
Large-model-based motor running state monitoring method, device and equipment
CN121388799A
Large model-lightweight model collaborative battery fault diagnosis method and system
CN121633859A
Energy storage charging abnormity detection method and system based on user switching behavior
CN121765604A
A Method and System for Detecting Energy Storage Charging Anomalies Based on User Switching Behavior
CN121765604B
Electricity carbon data anomaly detection method and device, medium and equipment
CN122241546A
