Data-Driven Fault Detection and Diagnosis of Electric Vehicle Battery Packs

In my research, I focus on the safety, reliability, and early fault detection of the electric vehicle battery pack because this component determines driving safety, customer confidence, and the long-term sustainability of electric mobility. The electric vehicle battery pack is not a single homogeneous unit; it is a complex electrochemical and thermal system composed of many cells, modules, sensors, connectors, and management circuits. Consequently, a fault in the electric vehicle battery pack can originate from manufacturing defects, mechanical abuse, electrical abuse, thermal abuse, or management system failure. These faults are often hidden, gradual, and coupled with normal aging, which makes them difficult to separate from ordinary operating variations. My objective is to develop a data-driven framework that can accurately identify and diagnose faults in the electric vehicle battery pack using real-world vehicle operational data.

The motivation for my study comes from the observation that the electric vehicle battery pack is exposed to highly variable conditions. Vehicle speed, acceleration, braking, ambient temperature, charging behavior, and driver habits all influence the internal states of the electric vehicle battery pack. At the same time, the fault data are extremely scarce compared with normal data. In my dataset, the ratio between fault records and normal records was approximately 1:550 before reconstruction, which creates a severe class imbalance problem. If I train a conventional classifier directly on such data, the model will be biased toward the majority normal class and will fail to recognize the rare but critical fault states of the electric vehicle battery pack. Therefore, I designed a complete pipeline that includes fault tree analysis, fault level reconstruction, feature engineering, data augmentation, and ensemble diagnosis.

I begin with data preprocessing and fault reconstruction. The raw data came from real-world electric vehicles and contained time stamps, vehicle states, charging states, speed, state of charge, temperature, cumulative mileage, and general alarm flags. I divided the operation records into three segments: parking, charging, and discharging. When the vehicle state and charging state remained unchanged for a defined interval, I treated the boundary as a segment split. I removed duplicate samples, handled missing and invalid values, and reordered the data chronologically. This step was essential because the electric vehicle battery pack operates differently in parking, charging, and discharging modes, and mixing these modes without segmentation would introduce artificial noise.

To reconstruct the fault labels, I applied fault tree analysis. Fault tree analysis is a top-down deductive method that starts from an undesired top event and decomposes it into intermediate events and basic events through logic gates. In my case, the top event was a safety-critical failure of the electric vehicle battery pack. I used AND gates to represent conditions that must occur simultaneously and OR gates to represent single-point failure paths. Through this process, I identified the main fault mechanisms of the electric vehicle battery pack: temperature difference, high temperature, overvoltage, undervoltage, low state of charge, high state of charge, state-of-charge jump, poor cell consistency, insulation failure, and DC-DC abnormal states. I then reclassified these conditions into four severity levels: level 0 for no fault, level 1 for minor fault, level 2 for moderate fault, and level 3 for severe fault.

Alarm Flag Alarm Information Threshold Fault Level Basis
0 Temperature difference Greater than 5 degrees C 1 National standard and internal temperature spread
1 Battery high temperature Greater than 53 degrees C 3 Statistical characteristics and Arrhenius law
2 Energy storage overvoltage Above rated upper limit 3 Voltage safety range
3 Low state of charge Below 10 percent 1 State-of-charge safety range
4 Cell overvoltage Greater than 4500 mV 3 Statistical characteristics
5 Cell undervoltage Below 3540 mV 2 Statistical characteristics
6 High state of charge Above configured threshold 2 State-of-charge safety range
7 State-of-charge jump Greater than 2 percent per minute 1 National standard
8 Poor cell consistency Greater than 80 mV 2 Cell voltage standard deviation
9 Insulation alarm Below 100 ohm per volt 3 Insulation requirement
10 DC-DC temperature Greater than 85 degrees C 1 National standard
11 DC-DC state Disconnected and not shut down 2 Reference study

After applying fault tree analysis and threshold-based reconstruction, I obtained a cleaner and more interpretable dataset. The normal records numbered 1,339,250. Level 1 faults numbered 69,214. Level 2 faults numbered 42,838. Level 3 faults numbered 44,599. The overall fault proportion became approximately 10.47 percent. This reconstruction was critical because the original alarm information contained unrelated signals, delayed alarms, missing alarms, and false alarms. By removing unrelated alarms and redefining the fault levels of the electric vehicle battery pack, I created a dataset that supports supervised learning with meaningful class labels.

Class Number of Records Proportion
Normal (Level 0) 1,339,250 89.53 percent
Level 1 fault 69,214 4.63 percent
Level 2 fault 42,838 2.86 percent
Level 3 fault 44,599 2.98 percent
Total 1,495,901 100 percent

Feature engineering is the next major step in my framework. The electric vehicle battery pack produces multi-dimensional signals, and raw signals alone are often insufficient for separating normal aging from early fault development. I therefore extracted features from three dimensions: battery consistency, driving behavior, and time context. For battery consistency, I computed the coefficient of variation, the maximum deviation rate, the standard deviation, and the range of cell voltages and temperatures. These features measure how uniformly the cells inside the electric vehicle battery pack behave. A growing inconsistency often precedes a serious fault.

The coefficient of variation for a set of cell measurements is defined as:

$$
C_v = \frac{\sqrt{\frac{1}{n}\sum_{i=1}^{n}(K_i – \bar{K})^2}}{\bar{K}} \times 100\%
$$

The maximum deviation rate is defined as:

$$
D_v = \frac{K_{\max} – K_{\min}}{\bar{K}} \times 100\%
$$

Here, \(K_i\) represents the temperature or voltage of the \(i\)-th cell, and \(\bar{K}\) is the mean value. Larger values of \(C_v\) and \(D_v\) indicate poorer consistency inside the electric vehicle battery pack. I also extracted driving features such as speed, acceleration, braking frequency, and their standard deviations. These features reflect the load profile imposed on the electric vehicle battery pack. Finally, I extracted time features such as season, day type, and day section. These contextual features help the model distinguish between different operating environments of the electric vehicle battery pack.

Feature Dimension Example Features Purpose
Battery state Total voltage, maximum temperature, total current, insulation resistance, mileage Describe the macroscopic operating state of the electric vehicle battery pack
Battery consistency Temperature coefficient of variation, voltage deviation rate, voltage coefficient of variation, voltage coefficient of variation standard deviation Measure cell imbalance inside the electric vehicle battery pack
Driving behavior Vehicle speed Represent dynamic load on the electric vehicle battery pack
Time context Morning, early morning Capture environmental and usage patterns

To avoid redundancy and irrelevant information, I used Pearson correlation and mutual information for feature selection. The Pearson correlation coefficient between two variables \(X\) and \(Y\) is:

$$
r_{XY} = \frac{\sum_{i=1}^{n}(X_i – \bar{X})(Y_i – \bar{Y})}{\sqrt{\sum_{i=1}^{n}(X_i – \bar{X})^2}\sqrt{\sum_{i=1}^{n}(Y_i – \bar{Y})^2}}
$$

Mutual information is defined as:

$$
MI(X;Y) = \sum_{x \in X}\sum_{y \in Y} p(x,y)\log\left(\frac{p(x,y)}{p(x)p(y)}\right)
$$

I selected the top candidates based on both criteria and then used a heatmap to remove highly correlated or weakly relevant variables. This process left me with 13 core features. These 13 features form the final input to my diagnosis models. The selected variables include total voltage, maximum temperature difference, maximum temperature, mileage, total current, insulation resistance, temperature coefficient of variation, voltage deviation rate, voltage coefficient of variation, voltage coefficient of variation standard deviation, vehicle speed, morning indicator, and early morning indicator. I found that these features provided a strong balance between interpretability and predictive power for the electric vehicle battery pack.

Feature Dimension Selected Feature Description
Battery state total_volt Total voltage of the electric vehicle battery pack
Battery state max_temp_diff Maximum temperature difference inside the electric vehicle battery pack
Battery state max_temp Maximum temperature
Battery state mileage Cumulative mileage
Battery state total_current Total current
Battery state isulate_r Insulation resistance
Battery consistency cell_temp_CV Temperature coefficient of variation
Battery consistency cell_volt_DV Voltage deviation rate
Battery consistency cell_volt_CV Voltage coefficient of variation
Battery consistency cell_volt_CV_std Voltage coefficient of variation standard deviation
Driving behavior speed Vehicle speed
Time context day_section_1 Morning indicator
Time context day_section_0 Early morning indicator

After feature engineering, I addressed the class imbalance problem. The electric vehicle battery pack fault data are rare, and standard classifiers tend to ignore minority classes. I first used an improved Border-SMOTE strategy. The classic SMOTE algorithm generates synthetic minority samples by interpolating between a minority sample and one of its nearest minority neighbors:

$$
x_{\text{new}} = x_i + \alpha (x_{zi} – x_i)
$$

where \(\alpha\) is a random number between 0 and 1, \(x_i\) is a minority sample, and \(x_{zi}\) is a randomly selected minority neighbor. Although SMOTE reduces overfitting compared with random duplication, it can generate noisy samples when minority samples are located inside majority regions. Border-SMOTE improves this by focusing on borderline minority samples. For each minority sample, Border-SMOTE computes its \(k\) nearest neighbors in the full training set and counts how many belong to the majority class. If more than half of the neighbors are majority samples, the sample is treated as a danger sample and is used for oversampling. If all neighbors are majority samples, the sample is treated as noise and ignored. If most neighbors are minority samples, the sample is treated as safe and is not prioritized.

In my implementation, I used Border-SMOTE2, which is more conservative than Border-SMOTE1. For each danger sample, it searches for nearest neighbors in both the minority and majority classes and generates new samples close to the original borderline sample. This strategy strengthens the decision boundary of the electric vehicle battery pack fault classifier without expanding the minority region into unsafe areas.

Method Sampling Focus Risk Behavior on the Electric Vehicle Battery Pack Data
Random oversampling Copy minority samples High overfitting risk Improves balance but may memorize rare faults
Classic SMOTE All minority samples Noise generation Can interpolate inside majority regions
Border-SMOTE Borderline minority samples Lower noise risk Improves boundary recognition of the electric vehicle battery pack
Border-SMOTE2 Danger samples with conservative interpolation Very low noise risk Clarifies boundaries without unsafe expansion

After balancing the data, I built a Stacking heterogeneous ensemble diagnosis model. The first layer used three complementary base learners: LightGBM, XGBoost, and Random Forest. LightGBM is efficient on large-scale high-dimensional data and captures complex nonlinear relationships. XGBoost provides strong regularization and robustness against noise. Random Forest reduces variance by averaging many decision trees. The second layer used logistic regression as the meta-learner to combine the outputs of the base learners. I used five-fold cross-validation to generate out-of-fold predictions for training the meta-learner, which reduces information leakage and improves generalization.

The metrics I used to evaluate the diagnosis of the electric vehicle battery pack include accuracy, precision, recall, and F1-score. They are defined as follows:

$$
\text{Accuracy} = \frac{TP + TN}{TP + TN + FP + FN}
$$

$$
\text{Precision} = \frac{TP}{TP + FP}
$$

$$
\text{Recall} = \frac{TP}{TP + FN}
$$

$$
F1 = \frac{2 \times \text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}}
$$

I also used Bayesian optimization with five-fold cross-validation to tune the hyperparameters of each base model. This ensures a fair comparison and prevents overfitting. The results after Border-SMOTE data augmentation are summarized in the table below.

Model Accuracy (%) Average Precision (%) Average F1 (%) Average Recall (%) Training Time (s)
LightGBM 94.41 94.09 94.20 94.38 14
XGBoost 94.50 95.06 94.55 94.10 11
Random Forest 91.94 93.21 92.05 91.22 48
Stacking 97.20 97.22 97.17 97.13 85

The Stacking model achieved the best performance across almost all metrics. Its accuracy reached 97.20 percent, which was 2.70 percentage points higher than the best single model. The average precision reached 97.22 percent, and the average F1-score reached 97.17 percent. The improvement was especially visible for level 2 and level 3 faults, which are the most safety-critical states of the electric vehicle battery pack. I also compared classic SMOTE with Border-SMOTE on the same Stacking framework.

Model Method Accuracy (%) Precision (%) Recall (%) F1 (%) Time (s)
Stacking SMOTE 96.06 96.20 95.90 96.04 91
Stacking Border-SMOTE 97.20 97.22 97.13 97.17 85

The Border-SMOTE version improved accuracy, precision, recall, and F1-score by more than one percentage point on average. This confirms that focusing on borderline samples is beneficial for diagnosing faults in the electric vehicle battery pack. However, Border-SMOTE still has limitations. It relies on interpolation between existing samples, so it may not fully capture the complex distribution of real fault data. It also has a higher risk of overfitting when the minority class is extremely small. To overcome these limitations, I introduced a WGAN-GP strategy for data augmentation.

The original generative adversarial network uses a min-max game between a generator and a discriminator:

$$
\min_G \max_D V(D,G) = \mathbb{E}_{x\sim p_{\text{data}}(x)}[\log D(x)] + \mathbb{E}_{z\sim p_z(z)}[\log(1 – D(G(z)))]
$$

Although GANs can generate realistic samples, they are difficult to train because the Jensen-Shannon divergence saturates when the real and generated distributions do not overlap. The Jensen-Shannon divergence is:

$$
JS(P_{\text{data}}||P_g) = \frac{1}{2} KL\left(P_{\text{data}}\left|\left|\frac{P_{\text{data}}+P_g}{2}\right.\right.\right) + \frac{1}{2} KL\left(P_g\left|\left|\frac{P_{\text{data}}+P_g}{2}\right.\right.\right)
$$

When two distributions have little or no overlap, the JS divergence becomes constant, and the generator receives almost no useful gradient. This causes mode collapse and unstable training. WGAN replaces the JS divergence with the Wasserstein distance, also called the Earth-Mover distance:

$$
W(P_r, P_g) = \inf_{\gamma \in \Pi(P_r, P_g)} \mathbb{E}_{(x,y)\sim \gamma}[||x-y||]
$$

The WGAN objective becomes:

$$
\min_G \max_D \mathbb{E}_{x\sim P_r}[D(x)] – \mathbb{E}_{z\sim p_z}[D(G(z))]
$$

WGAN removes the sigmoid output of the discriminator and uses weight clipping to enforce the Lipschitz constraint. However, weight clipping can cause gradient explosion or vanishing and can limit the capacity of the discriminator. WGAN-GP solves this problem by replacing weight clipping with a gradient penalty:

$$
L = \mathbb{E}_{\tilde{x}\sim P_g}[D(\tilde{x})] – \mathbb{E}_{x\sim P_r}[D(x)] + \lambda \mathbb{E}_{\hat{x}\sim P_{\hat{x}}}[(||\nabla_{\hat{x}}D(\hat{x})||_2 – 1)^2]
$$

The penalty is applied at random interpolation points between real and generated samples:

$$
\hat{x} = \epsilon x + (1-\epsilon)\tilde{x}, \quad \epsilon \sim U[0,1]
$$

In my experiments, the gradient penalty forced the critic to remain smooth across the data space. The discriminator output for real samples remained higher than that for generated samples, and the gradient norm stayed close to 1. The generator loss decreased steadily, indicating that the generated samples became increasingly similar to the real fault data of the electric vehicle battery pack. The training dynamics confirmed that WGAN-GP provided a stable and reliable data augmentation mechanism.

Property GAN WGAN WGAN-GP
Discriminator output Probability 0 to 1 Real-valued score Real-valued score
Loss JS divergence Wasserstein distance Wasserstein distance plus gradient penalty
Constraint None Weight clipping Gradient penalty
Training stability Poor Better Excellent
Mode collapse risk High Moderate Low
Suitability for electric vehicle battery pack fault data Limited Moderate Strong

After generating synthetic fault samples with WGAN-GP, I repeated the same diagnosis experiments. The results improved dramatically. The Stacking model reached an accuracy of 99.81 percent, and several single models also achieved very high performance. This indicates that the quality of the generated data was substantially higher than that produced by Border-SMOTE. The electric vehicle battery pack fault diagnosis task became easier because the augmented data better represented the true fault distribution.

Model Accuracy (%) Average Precision (%) Average F1 (%) Average Recall (%)
LightGBM 93.08 93.56 93.37 93.23
XGBoost 99.17 99.23 99.22 99.21
Random Forest 98.82 98.97 98.85 98.73
Stacking 99.81 99.79 99.80 99.81

The Stacking model still achieved the best overall performance, but the gap between Stacking and the strongest single models became much smaller. XGBoost reached 99.17 percent accuracy, and Random Forest reached 98.82 percent accuracy. This suggests that when the data quality is high enough, even a single strong model can diagnose the electric vehicle battery pack with high reliability. I further tested additional base models, including AdaBoost, Gradient Boosting Decision Tree, and a multilayer perceptron.

Model Accuracy (%) Average Precision (%) Average F1 (%) Average Recall (%)
AdaBoost 97.73 97.79 97.70 97.64
GBDT 99.71 99.69 99.70 99.71
MLP 99.32 99.22 99.27 99.31
Stacking 99.81 99.79 99.80 99.81

The GBDT model reached 99.71 percent accuracy, and the MLP reached 99.32 percent accuracy. These results are very close to the Stacking model. The average gap between the best single model and the Stacking ensemble was only about 0.5 percentage points. This is an important finding: WGAN-GP data augmentation improved the separability of the electric vehicle battery pack fault classes so much that the advantage of a complex ensemble became less pronounced. In other words, high-quality data can reduce the need for highly complex model architectures, although the Stacking model remains the most robust choice when the highest possible accuracy is required.

I also examined the recall for each fault level. For the electric vehicle battery pack, level 1 faults are minor, level 2 faults are moderate, and level 3 faults are severe. The WGAN-GP augmented data allowed most models to achieve recall above 99 percent for level 2 and level 3 faults. This is critical because severe faults in the electric vehicle battery pack can lead to thermal runaway, fire, or loss of vehicle control. A high recall for level 3 faults means that the diagnosis system rarely misses a dangerous condition. The false negative rate for severe faults was extremely low in the Stacking model.

From a practical perspective, my framework shows that the fault diagnosis of the electric vehicle battery pack should not rely on a single technique. The best results came from combining fault tree analysis, feature engineering, data augmentation, and ensemble learning. Fault tree analysis provided interpretable fault levels. Feature engineering provided physically meaningful inputs. Border-SMOTE provided a first-stage solution to class imbalance. WGAN-GP provided a more advanced generative solution. Stacking provided a robust decision fusion mechanism. Each component contributed to the final performance.

The electric vehicle battery pack is also affected by driving behavior, weather, road conditions, and charging habits. In my current work, I included time context and driving speed, but future work should incorporate more multi-source data. For example, ambient temperature, road slope, charging power, and fast-charging frequency could further improve the diagnosis of the electric vehicle battery pack. I also plan to study the coupling between different fault types. A temperature difference fault may be caused by an internal short circuit, a connection fault, or a cooling system failure. If I can model these causal relationships, the diagnosis of the electric vehicle battery pack will become more explainable and more actionable.

Another important direction is online adaptation. The electric vehicle battery pack ages over time, and its normal behavior changes. A model trained on historical data may gradually lose accuracy. Therefore, future diagnosis systems should be able to update themselves as new data arrive. Transfer learning and continual learning are promising tools for this problem. They could allow the diagnosis model to adapt to different vehicle models, battery chemistries, and usage patterns without requiring a full retraining process. This would make the electric vehicle battery pack diagnosis more scalable and more practical for fleet-level deployment.

I also recognize that data privacy and data sharing are important challenges. Real-world electric vehicle battery pack data are often owned by manufacturers, fleet operators, or individual users. Building a large and diverse dataset for fault diagnosis requires cooperation among many stakeholders. Standardized data formats and privacy-preserving learning methods could help. Federated learning, for example, allows models to be trained across distributed datasets without sharing raw data. This could accelerate the development of robust fault diagnosis algorithms for the electric vehicle battery pack.

In summary, my research demonstrates that a data-driven framework can significantly improve the fault detection and diagnosis of the electric vehicle battery pack. The main contributions are as follows. First, I reconstructed fault levels using fault tree analysis and national standards, producing a clean and interpretable dataset. Second, I extracted and selected 13 key features from battery consistency, driving behavior, and time context. Third, I used Border-SMOTE to address class imbalance and built a Stacking ensemble model that achieved 97.20 percent accuracy. Fourth, I introduced WGAN-GP to generate high-quality synthetic fault data, which raised the Stacking accuracy to 99.81 percent and narrowed the gap between single models and the ensemble model. Fifth, I showed that high-quality data can reduce the burden on model complexity, which is an important insight for practical deployment.

The electric vehicle battery pack remains one of the most safety-critical components in electric mobility. As the number of electric vehicles continues to grow, the demand for accurate, early, and reliable fault diagnosis will only increase. I believe that combining physical knowledge, data-driven learning, and advanced generative models is a promising path toward safer electric vehicle battery packs. My future work will focus on multi-source data fusion, fault coupling analysis, online adaptation, and explainable artificial intelligence for the electric vehicle battery pack. These efforts will help move the field from reactive maintenance to predictive and preventive safety management.

Research Stage Method Purpose Key Result
Data preprocessing Segment division, cleaning, time reordering Prepare reliable electric vehicle battery pack data Removed duplicates and invalid values
Fault reconstruction Fault tree analysis Define interpretable fault levels Levels 0 to 3, fault ratio 10.47 percent
Feature engineering Pearson correlation, mutual information, heatmap Select informative variables 13 core features
Imbalance handling Border-SMOTE Generate borderline minority samples Stacking accuracy 97.20 percent
Advanced augmentation WGAN-GP Generate high-quality synthetic fault data Stacking accuracy 99.81 percent
Ensemble diagnosis Stacking with LightGBM, XGBoost, Random Forest, and logistic regression Fuse complementary models Best overall performance for the electric vehicle battery pack

I conclude that the electric vehicle battery pack fault diagnosis problem is fundamentally a data problem as much as it is a modeling problem. When the data are scarce, imbalanced, and noisy, even advanced models struggle. When the data are reconstructed, enriched, and balanced with appropriate generative methods, relatively simple models can achieve excellent performance. The Stacking ensemble remains the most accurate approach in my experiments, but the strong performance of XGBoost, GBDT, and MLP after WGAN-GP augmentation shows that data quality is the primary driver of success. Therefore, future research on the electric vehicle battery pack should continue to prioritize data collection, data standardization, and data augmentation alongside model development.

In my view, the most promising long-term solution is a hybrid framework that combines physics-based models, signal processing, and data-driven learning. Physics-based models can provide interpretability and extrapolation capability. Signal processing can extract early degradation signatures. Data-driven models can capture complex nonlinear patterns. Generative models such as WGAN-GP can fill the gaps in rare fault data. Ensemble learning can combine their strengths. Such a hybrid system would be more robust, more explainable, and more suitable for real-world deployment in electric vehicles. I intend to continue working on this direction to improve the safety and reliability of the electric vehicle battery pack.

Scroll to Top