In the context of global clean-energy transition, electric vehicles have become one of the most effective pathways for reducing carbon emissions in the transportation sector. The EV battery, as the core energy storage device, determines the vehicle’s range, safety, and lifecycle cost. Nevertheless, field operation data reveal that voltage anomalies are among the most frequent and hazardous failure modes of modern lithium-ion EV batteries. In practice, the duration of fault conditions is usually much shorter than normal driving periods, so the collected data are heavily skewed: normal driving samples dominate while true fault samples are extremely scarce. This severe class imbalance restricts the development of accurate data-driven diagnostic algorithms.
In this work, we address the EV battery voltage fault diagnosis problem under imbalanced data conditions. The goal is to make full use of limited fault records and build a robust diagnostic framework that accurately detects single-cell undervoltage faults in dynamic driving scenarios. The key idea is to combine a least-squares generative adversarial network (LSGAN) to synthesize realistic fault samples, and then feed the augmented balanced dataset into a random forest classifier whose hyperparameters are optimized with the grey wolf optimizer (GWO). We evaluate the framework with real-world operating data collected from electric vehicles under normal and faulty conditions.
1. Introduction and Research Background
The continuous growth of new-energy vehicle ownership has put forward higher requirements for the reliability of EV battery systems. Lithium-ion batteries have become the preferred power source for EVs because of their high gravimetric energy density, long cycle life, and low self-discharge rate. However, a single-cell voltage failure inside the battery pack may degrade the pack performance, accelerate aging, and threaten vehicle safety. To mitigate such risks, an effective fault diagnosis system should be embedded in the battery management system (BMS) or in cloud-based monitoring platforms.
There are three broad categories of EV battery fault diagnosis methods: experience-based methods, model-based methods, and data-driven methods. Experience-based methods rely on threshold rules, expert knowledge, or fault tree analysis. For example, voltage drop gradients can be used as warning thresholds for micro-short circuits. Fuzzy expert systems map fault symptoms to possible causes. Model-based methods construct electrochemical, thermal, or equivalent-circuit models, and compare measured variables with model predictions. Residual signals are then analyzed for anomaly detection. With the rapid development of machine learning, data-driven methods have attracted increasing attention because they do not require accurate physical modeling and can automatically learn complex nonlinear relationships from operating data.
Despite the progress of prior research, two major challenges remain. The first is that many diagnostic models are validated only under laboratory conditions and fail under real-world dynamic traffic conditions. The second and more subtle challenge is the imbalanced nature of fault data. In an actual EV database, normal samples may represent more than 90% of the recorded instances, while fault samples are rare. If a classifier is trained on such data, it tends to be biased toward the majority class; consequently, even a high overall accuracy can hide a very poor detection rate for the minor fault class. The present study explicitly focuses on this imbalance problem by applying data augmentation techniques to enrich the minority fault samples.
In summary, this work makes several contributions:
- We present a complete data-preprocessing pipeline for real-world EV battery operating data, including abnormal-value cleaning and missing-value imputation.
- We perform a detailed statistical analysis of single-cell undervoltage faults under dynamic vehicle states and determine a realistic voltage threshold from historical trip records.
- We propose an LSGAN-based sample generation strategy that effectively expands the scarce fault sample set, and we verify the statistical similarity between generated and genuine fault data.
- We build an advanced diagnostic model by combining a random forest classifier with the grey wolf optimizer, and we compare its performance with several baseline algorithms.
- We validate the model with multiple evaluation metrics, and we further compare hyperparameter optimization methods including Bayesian optimization and particle swarm optimization.
2. Literature Review and Research Gap
2.1 EV Battery Fault Detection
Fault diagnosis of EV batteries has evolved from simple voltage threshold supervision to sophisticated multimodal data analytics. In early studies, fault alarms were triggered when the lowest cell voltage crossed a fixed lower limit. However, this method is ineffective under highly dynamic loading because voltage temporarily drops during peak acceleration even for healthy cells. Researchers thus introduced more informative indicators such as voltage differences, voltage standard deviations, and voltage rise/fall rates.
Experience-based systems often incorporate expert rules. For example, the over-discharge protection logic in a BMS may set several alarms with different severity levels. Fault tree analysis offers a structural way to evaluate system reliability, but its dynamic extension is still complicated by the coupling of thermal, electrical, and mechanical stresses.
Model-based approaches have been investigated for internal and external short-circuit faults. Thevenin equivalent-circuit models are popular because they balance accuracy and simplicity. By estimating the internal resistance or states with a Kalman filter, early-stage faults can be detected. Nevertheless, the model parameters change with temperature, SOC, and aging, which makes fixed-parameter models unreliable under real-world driving cycles.
Data-driven methods such as random forest, support vector machine, and neural networks have demonstrated strong performance in recognizing hidden fault patterns. In particular, the integration of multiple vehicle signals, such as cell voltage, SOC, total voltage, insulation resistance, and cumulative mileage, enables the model to differentiate normal transient phenomena from true faults. The data-driven method is now considered the mainstream solution for cloud-based EV battery monitoring.
2.2 Data Augmentation for Fault Diagnosis
Data augmentation is an effective way to overcome scarce fault samples. Generative adversarial networks (GANs) were introduced by Goodfellow in 2014 and have been applied to vibration-based bearing fault diagnosis. Several studies proposed novel architectures, including classification adversarial autoencoders and adversarial adaptive one-dimensional convolutional networks, to improve feature extraction and domain adaptation. In industrial applications, GAN-based augmentation has shown remarkable success in generating synthetic time-series fault samples. For EV battery voltage data, such augmentation can create new samples that resemble the statistical patterns of real undervoltage faults while preserving feature diversity.
Another research line combines GANs with oversampling strategies. Instead of directly duplicating minority samples, the generator learns the probabilistic distribution of the original fault data. The synthetic samples are then added to the training set to balance the class distribution. These methods reduce the overfitting risk caused by naive random oversampling and avoid the information loss of random undersampling.
2.3 Class Imbalance in Fault Diagnosis
The class imbalance problem has been investigated in many fault-diagnosis applications. There are two major solution categories: algorithmic-level methods and data-level methods. Algorithmic-level methods include cost-sensitive learning, where misclassification penalties of the minority class are increased. Data-level methods include random oversampling, random undersampling, SMOTE, and more advanced generative models. The choice among these methods depends on the data characteristics and the diagnosis objective.
In the context of EV battery voltage faults, real-world fault records are not only rare but also exhibit limited feature variations. A generative data-enhancement method is therefore preferable because it can synthesize multiple plausible fault patterns. After constructing a more balanced dataset, a conventional classifier can achieve better decision boundaries and higher recall for the fault class.
3. EV Battery Voltage Data Preprocessing
3.1 Lithium-ion Battery Voltage Fault Types
The core of an EV battery is a lithium-ion battery pack that stores electrical energy via repeated intercalation and deintercalation of lithium ions. The positive electrode reaction can be written as:
\[
\mathrm{LiMO_2} \rightleftharpoons \mathrm{Li}_{1-x}\mathrm{MO_2} + x\mathrm{Li}^+ + x e^-
\]
and the negative electrode reaction is:
\[
\mathrm{C}_n + x\mathrm{Li}^+ + x e^- \rightleftharpoons \mathrm{Li}_x\mathrm{C}_n
\]
Voltage faults in lithium-ion battery systems include overcharge, overdischarge, inconsistency of cell voltages, abnormal voltage fluctuation, and zero or negative voltage. Among them, undervoltage faults are more likely to occur during dynamic driving when heavily loaded cells are temporarily pushed below the lower safety bound. This paper specifically targets the single-cell undervoltage fault of an EV battery.
3.2 Description of the Experimental Dataset
The dataset used in this study was supplied by a new-energy vehicle manufacturer cooperating with our laboratory. All samples were collected from real electric vehicles under normal road conditions, and the sampling interval was 10 seconds. The data follow the GB/T 32960-2016 communication standard and include vehicle state, speed, SOC, total voltage, total current, insulation resistance, maximum and minimum cell voltages, and fault alarm logs.

Four vehicles with different specifications were selected for the experiments. To respect privacy, the VINs are replaced by anonymous identifiers: Vehicle 1 through Vehicle 4. Table 1 summarizes the basic information of these vehicles.
| Vehicle | Driving distance (10,000 km) | Data collection period | Data volume (GB) |
|---|---|---|---|
| Vehicle 1 | 15.5 | 2023.07–2023.11 | 8.81 |
| Vehicle 2 | 14.8 | 2023.09–2023.11 | 9.62 |
| Vehicle 3 | 7.4 | 2023.10–2023.12 | 7.96 |
| Vehicle 4 | 28.5 | 2023.06–2023.12 | 10.22 |
The original dataset contains 56 data fields. Some important fields used in this study are listed in Table 2.
| Field | Meaning |
|---|---|
| Vehicle state | 1: running; 2: parking; 3: other |
| Charging state | 1: parking charge; 2: driving charge; 3: no charging; 4: charging complete |
| Speed | Vehicle speed in km/h |
| Cumulative mileage | Distance driven in km |
| SOC | State of charge (0–100%) |
| Total voltage | EV battery pack terminal voltage in V |
| Insulation resistance | Resistance between high-voltage circuit and chassis in kΩ |
| Max cell voltage | Maximum cell voltage in the pack (V) |
| Min cell voltage | Minimum cell voltage in the pack (V) |
| Alarm level | 0: no fault; 1~3: different severity levels |
| Battery undervoltage fault flag | 0: normal; 1: alarm |
3.3 Handling Abnormal Values
During the transmission from vehicle to cloud, data abnormalities are inevitable. Electromagnetic interference, sensor degradation, and communication errors may cause spike values, null values, or impossible physical parameters. Since the distribution of real engineering data is not always Gaussian, the popular 3-sigma criterion may be inappropriate. Here we use a dynamic threshold-filtering approach based on the statistical range of physical quantities. A data record is retained only when it falls within a physically meaningful interval. The specific thresholds used in this work are provided in Table 3.
| Feature | Retention range |
|---|---|
| Total voltage | \([n, 5n]\) V, where \(n\) is the number of cells in series |
| SOC | [0, 100] |
| Cell voltage difference | [0.5, 3] V |
| Speed | [0, 160] km/h |
Unlike conventional box-plot methods that may discard many edge samples, the dynamic threshold method only removes extreme outliers that are clearly beyond the possible range. This preserves the fault-related abnormal records and improves the sensitivity of the downstream diagnosis algorithm.
3.4 Handling Missing Values
Missing values can be divided into univariate missing patterns and multivariate missing patterns. A univariate missing pattern occurs when a single data field is missing for a consecutive period, whereas a multivariate missing pattern occurs when multiple fields are missing simultaneously. We also differentiate between non-continuous missing and continuous missing data.
In this work, if the missing duration is less than or equal to 60 seconds (i.e., no more than six consecutive missing records with a 10-s interval), the missing values are treated as non-continuous and filled by the average of neighboring valid samples. If the missing duration exceeds 60 seconds, the entire segment is deleted to avoid introducing artificial bias. The whole pre-processing flow is shown schematically in Algorithm-like steps below:
\[\text{Step 1: check missing values}; \quad \text{Step 2: if continuous missing > 6 records, remove segment};\quad \text{Step 3: otherwise apply mean imputation.}\]
4. Analysis of Single-Cell Undervoltage Faults
4.1 Equivalent-Circuit Model and BMS Architecture
To better understand the physical behavior, various equivalent-circuit models of lithium-ion EV batteries have been developed. The Rint model uses an ideal voltage source \(U_{oc}\) in series with an internal resistance \(R_0\). The first-order Thevenin model adds a parallel RC network to describe the polarization effect. The terminal voltage can be expressed as:
\[
U_{bat} = U_{oc} – R_0 I – U_1
\]
where \(U_1\) is the polarization voltage across the RC network. A second-order RC model includes another RC network for improved accuracy, but the increased number of parameters requires more computational effort.
The battery management system is responsible for data collection, state estimation, safety management, thermal management, and equalization. A typical BMS architecture can be either centralized or distributed. Centralized BMS integrates the control unit and cell monitoring modules into one board; distributed BMS separates cell monitoring units from a master control unit. Both architectures rely on reliable voltage measurements to detect abnormal cell behavior.
4.2 Key Features Affecting Undervoltage Faults
The raw dataset has 56 fields, but many of them are not directly relevant to undervoltage faults. To reduce the dimension and avoid overfitting, we select features by analyzing their linear correlation with the fault state. The Pearson correlation coefficient between two variables \(X\) and \(Y\) is defined as:
\[
r = \frac{\sum_{i=1}^{m}(X_i – \bar{X})(Y_i – \bar{Y})}
{\sqrt{\sum_{i=1}^{m}(X_i – \bar{X})^2}\sqrt{\sum_{i=1}^{m}(Y_i – \bar{Y})^2}}
\]
After computing the absolute values of the correlation coefficients, we keep seven features that have the strongest association with the undervoltage fault class: vehicle state, total voltage, maximum cell voltage, minimum cell voltage, SOC, cumulative mileage, and insulation resistance. These features form the input vector of both the data-generation model and the fault-diagnosis classifier.
4.3 Undervoltage Fault Threshold Determination
The single-cell undervoltage fault is declared when the minimum cell voltage falls below a certain threshold. In this work, the threshold is not taken from the cell datasheet but is derived from real operating data. We extract the minimum cell voltage measurements of the four vehicles during reported undervoltage alarms. The maximum value of the minimum cell voltage across all fault records is then selected as the threshold. The obtained threshold is \(3.16\,\text{V}\). More specifically, under normal operation of the selected EV battery, the minimum cell voltage remains above 3.16 V. When the undervoltage fault occurs, the minimum cell voltage drops below 3.16 V and remains below this bound for at least 30 seconds.
The fault snippets are extracted according to the vehicle status, the vehicle speed, and the alarm logs reported by the BMS. We observe that undervoltage faults usually happen during driving, especially when the vehicle undergoes frequent acceleration and deceleration. Because such operation demands high current from the battery pack, the weakest cell may exhibit the largest voltage drop, thereby triggering the undervoltage alarm.
5. LSGAN-Based Data Augmentation for EV Battery Faults
5.1 Generative Adversarial Networks
Generative adversarial networks consist of a generator \(G\) and a discriminator \(D\). The generator takes random noise \(z\) sampled from a prior distribution \(p_z(z)\) and outputs synthetic samples \(G(z)\). The discriminator receives both real samples \(x\) and synthetic samples \(G(z)\), and outputs the probability that its input belongs to the real dataset. The two networks play a minimax game with the value function:
\[
\min_G \max_D V(D,G) = \mathbb{E}_{x\sim p_{\mathrm{data}}(x)}[\log D(x)] + \mathbb{E}_{z\sim p_z(z)}[\log(1 – D(G(z)))]
\]
In the ideal case, the generator maps the latent noise to a distribution that closely approximates the real data distribution. The discriminator then cannot distinguish real samples from generated samples with better accuracy than random guessing. The loss functions of the generator and discriminator are optimized alternately.
5.2 LSGAN and Its Advantages
Conventional GANs often suffer from gradient vanishing or mode collapse when the generated data are far from the real distribution. In this paper, we adopt the Least-Squares Generative Adversarial Network (LSGAN), which replaces the cross-entropy loss of the discriminator with the least-squares loss. The objective functions are:
\[
\min_D V_{\mathrm{LSGAN}}(D) = \frac{1}{2}\mathbb{E}_{x\sim p_{\mathrm{data}}(x)}[(D(x)-b)^2] + \frac{1}{2}\mathbb{E}_{z\sim p_z(z)}[(D(G(z))-a)^2]
\]
\[
\min_G V_{\mathrm{LSGAN}}(G) = \frac{1}{2}\mathbb{E}_{z\sim p_z(z)}[(D(G(z))-c)^2]
\]
where \(a\) and \(b\) are the labels for generated samples and real samples respectively, and \(c\) denotes the value that the generator wants the discriminator to believe for generated samples. By setting \(a=0\) and \(b=c=1\), the generator is forced to produce samples that lie on the same side of the decision boundary as the real samples. This strategic modification provides more stable gradients and higher-quality generated time-series samples.
5.3 Network Architecture and Training Details
For the time-series fault data, the LSGAN generator is constructed with a mixture of LSTM layers, simple RNN layers, and dense layers. The discriminator uses dense layers followed by an LSTM layer to capture temporal dependencies. We use a normalized input representation to accelerate convergence:
\[
y_i = \frac{x_i – \min_{1\le j\le n}{x_j}}{\max_{1\le j\le n}{x_j} – \min_{1\le j\le n}{x_j}}
\]
where \(x_i\) is the original feature value and \(y_i\) is the normalized value in [0,1].
To prevent overfitting, a Dropout layer is added to the generator. Both networks use PReLU activation. The Adam optimizer is used with a learning rate of 0.0001, \(\beta_1=0.5\), and \(\beta_2=0.999\). The training process stops when the loss value is lower than 0.2 and remains stable for ten additional iterations. The overall training process for LSGAN is illustrated as follows: (1) sample a mini-batch of real fault data; (2) generate a mini-batch of synthetic fault samples; (3) update the discriminator; (4) fix the discriminator and update the generator; (5) repeat until convergence.
5.4 Training Data with Imbalance
To reproduce the real-world class-imbalance scenario, we sample 10,000 records from the selected feature set. Among these records, 9,000 are normal samples and 1,000 are genuine undervoltage fault samples. Thus the fault ratio is only 10%. This dataset is called the original imbalanced dataset. The LSGAN is then trained on the fault subset to generate additional undervoltage samples. After augmentation, we create two mixed datasets with fault ratios of 25% and 40%. The configurations of the datasets used in the diagnosis experiments are shown in Table 4.
| Dataset | Composition | Fault ratio |
|---|---|---|
| Dataset 1 | Original real data only | 10% |
| Dataset 2 | Real fault data (10%) + LSGAN-generated fault data (15%) | 25% |
| Dataset 3 | Real fault data (10%) + LSGAN-generated fault data (30%) | 40% |
The hidden features of generated data should mimic the inherent variability of real fault patterns. To verify this property, we compute several statistics of the generated samples and compare them with genuine fault samples. Figure-placeholder: the visual comparison shows that the distributions of the key features, such as the minimum cell voltage and total voltage, exhibit overlapping ranges and similar dynamic patterns.
5.5 Statistical Evaluation of Generated Samples
We use the Maximum Mean Discrepancy (MMD) as a quantitative similarity metric. MMD measures the distance between two distributions \(P\) and \(Q\) in a reproducing kernel Hilbert space:
\[
\mathrm{MMD}^2(P,Q) = \mathbb{E}_{x,x’ \sim P} k(x,x’) – 2\mathbb{E}_{x\sim P, y\sim Q} k(x,y) + \mathbb{E}_{y,y’ \sim Q} k(y,y’)
\]
where \(k(\cdot,\cdot)\) is a Gaussian kernel. A smaller MMD value indicates better agreement between the two distributions. We also perform a permutation test to compute the p-value. Table 5 lists the MMD results for the original GAN, the LSGAN, and a self-comparison of the original real data. The LSGAN achieves an MMD of 0.086 with a p-value of 0.120, indicating that the generated data are statistically indistinguishable from the original data at a significance level of 0.05.
| Method | MMD | p-value | Reference threshold |
|---|---|---|---|
| Standard GAN | 0.092 | 0.048 | 0.10 |
| LSGAN | 0.086 | 0.120 | 0.10 |
| Real data self-comparison | 0.015 | 0.750 | – |
These results confirm that the LSGAN-generated samples are plausible and can be used to enlarge the training set without significantly distorting the original fault feature distribution. Furthermore, the generated data contain a broader range of intermediate voltage values, which alleviates the problem of single pattern replication encountered in the original records.
6. RF-GWO Fault Diagnosis Model
6.1 Random Forest Classifier
Random forest (RF) is an ensemble learning method that constructs a large number of decision trees and aggregates their outputs by majority voting. Each tree is trained on a bootstrap sample of the original data, and each split is determined by a random subset of features. This mechanism increases diversity and reduces overfitting. The random forest classification result is given by:
\[
H(x) = \begin{cases}
C_{j}, & \text{if } \sum_{i=1}^{p} I(h_i(x)=C_j) > \frac{p}{2}, \\
\text{reject}, & \text{otherwise}.
\end{cases}
\]
where \(h_i\) are individual decision trees, \(p\) is the number of trees, and \(I(\cdot)\) is the indicator function.
For EV battery undervoltage diagnosis, random forest is suitable because it can handle mixed continuous/discrete features, and it provides a good trade-off between interpretability and accuracy.
6.2 Grey Wolf Optimizer
The hyperparameters of random forest, such as the number of trees, maximum depth, and minimum samples per leaf, have a considerable influence on its diagnostic performance. We adopt the Grey Wolf Optimizer (GWO) to search the hyperparameter space automatically. GWO mimics the hunting behavior and social hierarchy of grey wolves. The fittest solution is named \(\alpha\), the second and third best are \(\beta\) and \(\delta\), and all other solutions are \(\omega\). During each iteration, the wolves update their positions according to:
\[
\vec{D} = |\vec{C}\vec{X}_p(t) – \vec{X}(t)|,
\quad
\vec{X}(t+1) = \vec{X}_p(t) – \vec{A}\cdot\vec{D}
\]
where \(\vec{A}\) and \(\vec{C}\) are coefficient vectors, \(\vec{X}_p\) is the prey position, and \(t\) is the iteration index. The vectors are computed with:
\[
\vec{A}=2\vec{a}\cdot\vec{r}_1 – \vec{a},\qquad \vec{C}=2\vec{r}_2
\]
with \(\vec{a}\) linearly decreased from 2 to 0 over time. The \(\omega\) wolves update their positions based on the leading three positions \(\vec{X}_\alpha\), \(\vec{X}_\beta\), and \(\vec{X}_\delta\):
\[
\vec{D}_\alpha = |\vec{C}_1\vec{X}_\alpha – \vec{X}|,\quad
\vec{D}_\beta = |\vec{C}_2\vec{X}_\beta – \vec{X}|,\quad
\vec{D}_\delta = |\vec{C}_3\vec{X}_\delta – \vec{X}|
\]
\[
\vec{X}_1 = \vec{X}_\alpha – \vec{A}_1\vec{D}_\alpha,\quad
\vec{X}_2 = \vec{X}_\beta – \vec{A}_2\vec{D}_\beta,\quad
\vec{X}_3 = \vec{X}_\delta – \vec{A}_3\vec{D}_\delta
\]
\[
\vec{X}(t+1) = \frac{\vec{X}_1 + \vec{X}_2 + \vec{X}_3}{3}
\]
In this study, the GWO population size is set to 5 and the number of iterations is 50. The objective function is the classification accuracy of the random forest on the augmented validation dataset. The hyperparameter ranges to be optimized include:
- max_depth \(\in [1,10]\),
- max_features \(\in [0.1,0.5]\),
- min_samples_split \(\in [5,10]\),
- min_samples_leaf \(\in [3,7]\),
- n_estimators \(\in [1,10]\).
6.3 Diagnostic Accuracy Under Different Fault Ratios
After optimizing the random forest parameters, we evaluate the model on four metrics: mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE), and the coefficient of determination \(R^2\). The metrics are defined as:
\[
\mathrm{MSE} = \frac{1}{M}\sum_{i=1}^{M}(y_i-\hat{y}_i)^2
\]
\[
\mathrm{RMSE} = \sqrt{\frac{1}{M}\sum_{i=1}^{M}(y_i-\hat{y}_i)^2}
\]
\[
\mathrm{MAE} = \frac{1}{M}\sum_{i=1}^{M}|y_i-\hat{y}_i|
\]
\[
R^2 = 1 – \frac{\sum_{i=1}^{M}(y_i-\hat{y}_i)^2}{\sum_{i=1}^{M}(y_i-\bar{y})^2}
\]
The optimal hyperparameters obtained by GWO for each dataset are reported in Table 6.
| Fault proportion in training data | Optimal parameter tuple |
|---|---|
| 10% | (8, 0.38, 6, 7, 8) |
| 25% | (7, 0.36, 6, 7, 9) |
| 40% | (9, 0.43, 6, 7, 8) |
The tuple is arranged as (max_depth, max_features, min_samples_split, min_samples_leaf, n_estimators).
The performance comparison under the three unbalanced settings is shown in Table 7. It is clear that increasing the fault proportion from 10% to 40% dramatically improves all metrics. When the original data contain only 10% fault samples, the model cannot effectively learn the minor class, resulting in an \(R^2\) of -1.000. After LSGAN augmentation to a 25% fault ratio, the \(R^2\) increases to 0.868; with a 40% fault ratio, the \(R^2\) reaches 0.996. This proves that the LSGAN-generated samples are valuable for fault diagnosis because they provide enough examples for the classifier to build a robust decision boundary.
| Fault ratio | MSE | RMSE | MAE | \(R^2\) |
|---|---|---|---|---|
| 10% (original data) | 0.500 | 0.707 | 0.500 | -1.000 |
| 25% (mixed data) | 0.033 | 0.182 | 0.033 | 0.868 |
| 40% (mixed data) | 0.001 | 0.031 | 0.001 | 0.996 |
7. Comparative Validation of Diagnostic Models
7.1 Comparison with Conventional Classifiers
To further evaluate the proposed RF-GWO model, we select three commonly used fault diagnosis methods: Support Vector Machine (SVM), Gradient Boosting Machine (GBM), and Naive Bayes (NB). These baseline models are tested under the same Dataset 2, which consists of 10% real fault samples and 15% LSGAN-generated fault samples, yielding a 25% fault ratio. The classification accuracy is defined as:
\[
A = \frac{P_T + N_T}{P + N}
\]
where \(P_T\) denotes the number of true positives, \(N_T\) the number of true negatives, \(P\) the total positive fault samples, and \(N\) the total negative samples.
The comparison results are listed in Table 8.
| Diagnostic model | Accuracy (%) |
|---|---|
| SVM | 91.00 |
| GBM | 91.35 |
| NB | 92.65 |
| RF-GWO (proposed) | 99.85 |
It can be seen that the proposed RF-GWO framework improves the accuracy by 8.85, 8.50, and 7.20 percentage points over SVM, GBM, and NB, respectively. The main reason is that random forest benefits from the augmented feature space and ensemble voting, while GWO provides an optimal set of hyperparameters that balances the model complexity and generalization ability.
7.2 Comparison of Hyperparameter Optimization Algorithms
In addition to GWO, we compare two state-of-the-art optimization techniques: Bayesian optimization (BO) and particle swarm optimization (PSO). The search is performed on Dataset 2 with the same hyperparameter ranges. The optimal hyperparameter tuples of each optimizer are reposted in Table 9.
| Optimizer | Optimal tuple |
|---|---|
| RF-PSO | (7, 0.23, 7, 3, 9) |
| RF-BO | (7, 0.23, 6, 3, 9) |
| RF-GWO | (7, 0.36, 6, 7, 9) |
Among these algorithms, GWO achieves the highest classification accuracy. Moreover, GWO converges to a stable solution faster than the other two methods, mainly because its hierarchical search mechanism avoids premature convergence while maintaining a strong local search capability.
The convergence curves of the three optimizers reveal that BO initially converges quickly but then becomes trapped in a local optimum, while PSO gradually approaches a good solution but requires more iterations. In contrast, GWO achieves a smoother and faster convergence path, confirming its advantage for tuning the random forest model in EV battery voltage fault diagnosis.
7.3 Robustness Discussion
The results above demonstrate that the proposed data-augmentation and fault-diagnosis framework is robust under class-imbalance conditions. The introduction of LSGAN-generated samples not only improves the classifier’s recall for the minority fault class but also stabilizes the training process. Because the generated samples are statistically similar to the real fault samples, the diagnostic model does not overfit to simple duplicated data. Instead, it learns more generalizable patterns.
Furthermore, when compared with another conventional GAN, the LSGAN model yields a lower MMD and a non-significant p-value, which suggests that the generated EV battery fault patterns are more reliable for downstream tasks. The choice of the random forest classifier as the diagnostic core also contributes to robustness. Random forest can capture nonlinear relationships and interaction effects among the seven selected features, while its ensemble structure reduces the variance caused by noisy measurement signals.
8. Conclusion and Future Work
This paper studied the problem of EV battery voltage fault diagnosis from real-world operating data with a severe class imbalance. By combining LSGAN-based data augmentation with a random forest classifier optimized by the grey wolf optimizer, we established a complete diagnostic framework for single-cell undervoltage faults in EV batteries. The following conclusions can be drawn from this work:
- The raw data of the EV battery collected from the cloud platform contain many abnormal and missing values. A dynamic threshold-filtering strategy and a mean imputation strategy effectively improve data quality without losing critical fault information.
- Real vehicle data show that single-cell undervoltage faults are correlated with the minimum cell voltage. In our dataset, a minimum cell voltage threshold of 3.16 V is determined from historical fault alarms. When this threshold is crossed, the fault state persists for a long period and thus requires prompt warning and intervention.
- LSGAN is capable of generating realistic synthetic fault samples. The visual comparison of the total voltage and the minimum cell voltage distributions, as well as the MMD test, verifies the statistical consistency between the original and generated EV battery fault data.
- By increasing the fault proportion through data augmentation, the diagnostic model achieves significant improvement. The \(R^2\) metric increases from -1.000 to 0.868 for a 25% fault ratio and to 0.996 for a 40% fault ratio.
- Comparative experiments with SVM, GBM, and NB show that the proposed RF-GWO framework achieves the highest accuracy. In addition, GWO outperforms Bayesian optimization and particle swarm optimization in terms of convergence speed and final accuracy.
The main contribution of this work lies in a complete methodology for utilizing scarce fault resources. The combination of LSGAN and RF-GWO successfully mitigates the harmful effect of imbalanced fault data, and the proposed framework can serve as a valuable reference for cloud-based EV battery safety monitoring systems.
Several limitations and research opportunities remain. First, the LSGAN architecture used in this paper may not be optimal for all EV battery fault modes. In future work, more advanced architectures such as Wasserstein GANs, transformer-based generators, or diffusion models may be explored to improve the fidelity and diversity of generated samples. Second, the diagnostic model is applied only to voltage undervoltage faults; future studies should extend the approach to thermal faults, insulation faults, and multi-class open-circuit faults. Third, the current data are sampled with a fixed 10-second interval. To achieve faster fault detection, higher sampling rates and edge-computing implementation should be investigated. Finally, the integration of multi-source heterogeneous data, such as cell voltages, currents, temperatures, and vehicle states, can be further refined by using attention mechanisms and long-short-term memory networks to capture long-range dependencies.
In summary, the proposed data augmentation and diagnostic framework provides a practical solution for EV battery voltage fault diagnosis under imbalanced data conditions. With further improvement in data synthesis and deep feature extraction, it is expected to play an important role in the intelligent maintenance and safety management of electric vehicles.
