With the rapid growth in electric vehicle (EV) adoption, EV charging stations have become critical infrastructure, requiring advanced fault diagnosis to ensure safety and reliability. However, issues such as incorrect installation, improper usage, and component aging can lead to failures in EV charging stations, potentially damaging battery systems or posing safety risks. Traditional fault diagnosis methods often rely on mechanical checks or single-parameter analyses, which are insufficient for handling the complex, time-series data generated by EV charging stations. In this study, we address these limitations by proposing a fault diagnosis approach based on a Genetic Algorithm (GA) optimized Long Short-Term Memory (LSTM) neural network. This method leverages the temporal dependencies in charging data, such as voltage, current, temperature, and power, to improve diagnostic accuracy and efficiency. By integrating GA for hyperparameter optimization, we enhance the LSTM model’s performance, reducing overfitting and local optima issues commonly associated with deep learning models. Our work demonstrates the potential of GA-LSTM networks as a robust solution for fault diagnosis in EV charging stations, contributing to the advancement of intelligent maintenance systems in the EV industry.
EV charging stations generate vast amounts of time-series data during operation, where previous time steps influence subsequent ones. This characteristic makes LSTM neural networks particularly suitable for modeling such data, as they can capture long-term dependencies through their gating mechanisms. The LSTM architecture includes forget gates, input gates, and output gates, which regulate the flow of information. For instance, the forget gate $f_t$ determines the retention of previous cell states, calculated as $f_t = \sigma(W_f \cdot [h_{t-1}, x_t] + b_f)$, where $\sigma$ is the sigmoid function, $W_f$ and $b_f$ are weights and biases, $h_{t-1}$ is the previous hidden state, and $x_t$ is the current input. Similarly, the input gate $i_t$ and candidate cell state $\tilde{C}_t$ update the cell state: $i_t = \sigma(W_i \cdot [h_{t-1}, x_t] + b_i)$ and $\tilde{C}_t = \tanh(W_C \cdot [h_{t-1}, x_t] + b_C)$. The cell state $C_t$ is then updated as $C_t = f_t \cdot C_{t-1} + i_t \cdot \tilde{C}_t$, and the output gate $o_t$ controls the hidden state $h_t = o_t \cdot \tanh(C_t)$, where $o_t = \sigma(W_o \cdot [h_{t-1}, x_t] + b_o)$. These equations enable the LSTM to model temporal patterns effectively, making it ideal for fault diagnosis in EV charging stations.
However, LSTM networks are prone to overfitting and local optima, especially with imbalanced or noisy data from EV charging stations. To mitigate this, we employ a Genetic Algorithm (GA) to optimize key hyperparameters, such as the number of neurons in LSTM and dense layers, dropout rates, and learning rates. GA mimics natural selection by initializing a population of solutions, evaluating their fitness (e.g., using Root Mean Square Error or RMSE), and iteratively applying selection, crossover, and mutation to evolve better solutions. The optimization process involves generating an initial population, computing fitness, selecting high-fitness individuals, performing crossover with a probability (e.g., 0.6), and applying mutation (e.g., with a rate of 0.1) to explore new solutions. This approach ensures that the LSTM model for EV charging station fault diagnosis is both accurate and generalizable.

Data preprocessing is crucial for handling real-world data from EV charging stations, which often contains missing values or noise. We apply normalization to scale the data to a [0, 1] range using the formula $X = \frac{X – X_{\text{min}}}{X_{\text{max}} – X_{\text{min}}}$, where $X$ is the original data point, and $X_{\text{min}}$ and $X_{\text{max}}$ are the minimum and maximum values, respectively. This step ensures that parameters like voltage and current are comparable and improves gradient stability during training. For missing data, we use Lagrange interpolation, which constructs a polynomial $P(x)$ that passes through known data points $(x_0, y_0), (x_1, y_1), \dots, (x_n, y_n)$. The polynomial is defined as $P(x) = \sum_{i=0}^{n} y_i \cdot L_i(x)$, where $L_i(x) = \prod_{0 \leq j \leq n, j \neq i} \frac{x – x_j}{x_i – x_j}$ is the Lagrange basis polynomial. This method effectively fills gaps in time-series data from EV charging stations, enhancing the dataset’s reliability for model training.
To evaluate the performance of our fault diagnosis model for EV charging stations, we use metrics such as Root Mean Square Error (RMSE) and Mean Percentage Absolute Error (MPAE). RMSE measures the average deviation between predicted and actual values, calculated as $\text{RMSE} = \frac{1}{m} \sum_{j=1}^{m} \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_{ij} – \hat{y}_{ij})^2}$, where $m$ is the number of output dimensions (e.g., multiple fault types), $n$ is the number of samples, $y_{ij}$ is the actual value, and $\hat{y}_{ij}$ is the predicted value. MPAE assesses the percentage error across predictions: $\text{MPAE} = \frac{1}{m} \sum_{j=1}^{m} \frac{1}{n} \sum_{i=1}^{n} \left| \frac{y_{ij} – \hat{y}_{ij}}{y_{ij}} \right| \times 100\%$. These metrics provide a comprehensive view of model accuracy, which is essential for ensuring reliable fault diagnosis in EV charging stations.
Our dataset comprises 10,000 samples from EV charging stations, including 7,500 normal operation points and 2,500 fault instances across 10 common fault types, such as overvoltage, overcurrent, short circuit, and communication failures. The data features parameters like input voltage, input current, output voltage, output current, output power, accumulated charge, temperature, relay signals, and grounding signals. Each fault type is assigned a label from 10 to 19, as summarized in the table below, which illustrates the mapping between fault types and labels for EV charging stations.
| Fault Type | Label |
|---|---|
| Output Overvoltage | 10 |
| Output Overcurrent | 11 |
| Output Short Circuit | 12 |
| Ground Protection Fault | 13 |
| Insulation Fault | 14 |
| Communication Fault | 15 |
| Relay Engagement Fault | 16 |
| Emergency Stop Fault | 17 |
| Charging Gun Fault | 18 |
| Fan Fault | 19 |
We split the data into 8,000 samples for training and 2,000 for testing, ensuring a balanced representation of normal and fault conditions. The GA-LSTM model architecture includes an LSTM layer followed by dropout layers, dense layers, and a Softmax classifier for multi-class fault diagnosis in EV charging stations. The hyperparameters optimized by GA include the number of LSTM neurons, dense layer neurons, dropout rates, and learning rate. For example, the GA configuration uses a population size of 20, mutation rate of 0.1, crossover probability of 0.6, elite retention ratio of 0.5, and a learning rate of 0.001. The fitness function is defined as the RMSE, and the optimization process runs for 10 iterations to find the best hyperparameters. The table below details the parameter settings and their impact on model performance for EV charging station fault diagnosis.
| Parameter | Value |
|---|---|
| Population Size | 20 |
| Mutation Rate | 0.1 |
| Crossover Probability | 0.6 |
| Elite Ratio | 0.5 |
| Learning Rate | 0.001 |
| Time (seconds) | 206.69 |
| RMSE | 0.879 |
The results demonstrate that the GA-LSTM model significantly outperforms the standard LSTM in predicting EV charging station parameters. For instance, the average RMSE values over 10 prediction runs are 2.032 for LSTM and 0.879 for GA-LSTM, representing a 56.7% reduction. Similarly, the MPAE decreases from 2.675 for LSTM to 1.063 for GA-LSTM, a 60.3% improvement. These metrics highlight the enhanced accuracy of GA-LSTM in capturing temporal patterns in EV charging station data. The following table compares the RMSE values for each run, emphasizing the consistency of GA-LSTM.
| Run | LSTM RMSE | GA-LSTM RMSE |
|---|---|---|
| 1 | 1.979 | 0.879 |
| 2 | 1.170 | 0.879 |
| 3 | 3.746 | 0.879 |
| 4 | 2.020 | 0.879 |
| 5 | 2.083 | 0.879 |
| 6 | 1.431 | 0.879 |
| 7 | 3.411 | 0.879 |
| 8 | 2.557 | 0.879 |
| 9 | 0.869 | 0.879 |
| 10 | 1.052 | 0.879 |
| Average | 2.032 | 0.879 |
In terms of fault diagnosis for EV charging stations, the GA-LSTM model achieves an accuracy of 97.40%, compared to 94.20% for LSTM, a 3.2% increase. This improvement is evident in the confusion matrices, where GA-LSTM reduces misdiagnoses and missed detections. For example, LSTM misdiagnoses 12 cases and misses 29, while GA-LSTM misdiagnoses only 5 and misses 13. The model excels in identifying faults like overcurrent, communication issues, and charging gun faults, which are critical for EV charging station safety. The precision, recall, and F1-score metrics further validate the superiority of GA-LSTM, with higher values across most fault labels. The evolution of the fitness function during GA optimization shows a steady improvement, converging to an optimal solution that enhances LSTM performance for EV charging station applications.
In conclusion, the GA-LSTM neural network offers a powerful approach for fault diagnosis in EV charging stations by effectively modeling time-series data and optimizing hyperparameters. The integration of GA addresses common challenges like overfitting and local optima, resulting in higher prediction accuracy and diagnostic reliability. Future work could explore real-time implementation and adaptation to diverse EV charging station environments, further advancing the intelligence of maintenance systems. This study underscores the value of deep learning techniques in ensuring the safety and efficiency of EV charging infrastructure.
