Fault Diagnosis of EV Charging Stations Based on Improved One-Dimensional Convolutional Neural Network

With the rapid development of electric vehicles (EVs) worldwide, the reliability and safety of EV charging stations have become critical concerns. These stations are prone to various faults during long-term operation, which can affect charging efficiency and pose safety risks. Traditional fault diagnosis methods, such as manual inspection or basic machine learning approaches, often struggle with complex fault patterns and high-dimensional data. To address these challenges, this study proposes an improved fault diagnosis model for EV charging stations, leveraging a one-dimensional convolutional neural network (1DCNN) enhanced with multi-head attention (MHA) and global average pooling (GAP). The model parameters are optimized using an improved whale optimization algorithm (IWOA), which incorporates Lévy flight and nonlinear convergence factors to enhance global search capabilities and avoid local optima. This approach aims to improve fault diagnosis accuracy, reduce overfitting, and enhance the generalization of EV charging station monitoring systems.

The core of the proposed method lies in integrating MHA into the 1DCNN architecture to capture important features from fault data across different subspaces. The MHA mechanism allows the model to focus on multiple aspects of the input data simultaneously, improving feature representation and computational efficiency. Additionally, the GAP layer replaces the fully connected layers in traditional 1DCNN, significantly reducing the number of parameters and mitigating overfitting risks. The IWOA algorithm is employed to optimize the hyperparameters of the MHA-1DCNN-GAP model, ensuring robust performance. Experimental results on real-world EV charging station data demonstrate that this model achieves high diagnostic accuracy and low loss, outperforming conventional methods like BP neural networks and GRU models. This research contributes to the development of intelligent fault diagnosis systems for EV charging stations, promoting safer and more reliable EV infrastructure.

The architecture of the 1DCNN is fundamental to the proposed model. It consists of an input layer, convolutional layers, batch normalization (BN) layers, pooling layers, and a GAP layer. The convolutional layers extract spatial features from the input data using weight sharing and sliding windows, while BN layers accelerate training and improve generalization by reducing internal covariate shift. The MHA mechanism is embedded after the convolutional layers to compute attention across multiple heads, allowing the model to prioritize relevant features. Mathematically, the MHA operation can be expressed as follows: for each attention head \(i\), the output is computed as:

$$ \text{head}_i = \text{Attention}(\mathbf{Q}_i, \mathbf{K}_i, \mathbf{V}_i) = \text{softmax}\left(\frac{\mathbf{Q}_i \mathbf{K}_i^T}{\sqrt{d_k}}\right) \mathbf{V}_i $$

where \(\mathbf{Q}_i\), \(\mathbf{K}_i\), and \(\mathbf{V}_i\) are the query, key, and value matrices for head \(i\), and \(d_k\) is the dimensionality of the key vectors. The multi-head output is then concatenated and linearly transformed:

$$ \text{MultiHead}(\mathbf{Q}, \mathbf{K}, \mathbf{V}) = \text{Concat}(\text{head}_1, \text{head}_2, \dots, \text{head}_h) \mathbf{W}^O $$

Here, \(h\) is the number of attention heads, and \(\mathbf{W}^O\) is a linear projection matrix. This mechanism enhances the model’s ability to capture diverse feature interactions in EV charging station data.

The GAP layer further optimizes the model by replacing fully connected layers. It computes the average of each feature map, reducing parameters and improving generalization. For a feature map with \(c\) channels and \(n\) features per channel, the GAP output for channel \(c\) is given by:

$$ y_c = \frac{1}{n} \sum_{i=1}^{n} x_i^c $$

where \(x_i^c\) is the \(i\)-th feature value in channel \(c\). This simplification helps in deploying the model for real-time fault diagnosis in EV charging stations.

The IWOA algorithm is crucial for tuning the MHA-1DCNN-GAP parameters. Traditional WOA simulates the hunting behavior of humpback whales, including encircling prey, bubble-net feeding, and random search. However, it often suffers from local optima and slow convergence. IWOA introduces Lévy flight to enable larger jumps in the search space, defined by the Lévy distribution:

$$ \text{Levy}(\beta) \sim \frac{\mu}{|\nu|^{1/\beta}}, \quad 0 < \beta \leq 2 $$

where \(\mu\) and \(\nu\) follow normal distributions: \(\mu \sim N(0, \sigma^2)\) and \(\nu \sim N(0, 1)\). The scale parameter \(\sigma\) is computed as:

$$ \sigma = \left( \frac{\Gamma(1+\beta) \cdot \sin(\pi \beta / 2)}{\Gamma((1+\beta)/2) \cdot \beta \cdot 2^{(\beta-1)/2}} \right)^{1/\beta} $$

Here, \(\Gamma\) denotes the Gamma function. The position update with Lévy flight is:

$$ \mathbf{x}(k+1) = \mathbf{x}(k) + a \cdot \text{Levy}(\beta) \odot \mathbf{x}^*(k) $$

where \(a\) is a random number, \(\text{Levy}(\beta)\) is the random step, and \(\mathbf{x}^*(k)\) is the best solution. Additionally, a nonlinear convergence factor \(a\) is used to balance exploration and exploitation:

$$ a = 2 – 2 \sin\left(\frac{\pi t}{\text{max\_iter}} + \varphi\right) $$

where \(t\) is the current iteration, \(\text{max\_iter}\) is the maximum iterations, and \(\varphi\) is a phase shift. This factor ensures dynamic adjustment during optimization, improving the performance for EV charging station fault diagnosis.

To validate the IWOA, benchmark functions were tested against PSO, GWO, and WOA. The results showed that IWOA achieved faster convergence and higher accuracy, making it suitable for optimizing the MHA-1DCNN-GAP model. The overall fault diagnosis process involves data collection from EV charging stations, preprocessing, model training with IWOA-optimized parameters, and evaluation. The model structure includes multiple convolutional and pooling layers, followed by MHA and GAP, as summarized in the table below.

Parameter Name Parameter Value Output Feature Size
C1 Number of Kernels 16 256 × 16
C1 Kernel Size 15 256 × 16
C1 Stride 1 256 × 16
C1 Activation ReLU 256 × 16
P1 Pooling Type Max Pooling 2×2 128 × 16
P1 Stride 2 128 × 16
C2 Number of Kernels 32 128 × 32
C2 Kernel Size 3 128 × 32
C2 Stride 1 128 × 32
C2 Activation ReLU 128 × 32
P2 Pooling Type Max Pooling 2×2 64 × 32
P2 Stride 2 64 × 32
F1 Nodes 2048 1 × 2048
Dropout Rate 50%
Softmax 10-class 1 × 10

Experiments were conducted using data from AC EV charging stations in a specific region, including parameters like input voltage/current, output voltage/current, CP signal, leakage current, and switch temperature. The dataset comprised 1,700 training samples and 400 test samples, covering 10 common fault types such as output overvoltage, output undervoltage, CP signal abnormality, leakage fault, switch power fault, output overcurrent, short circuit, ground fault, module overtemperature, and CC signal abnormality. These faults represent typical issues in EV charging stations that can impact operational safety.

The training and testing process involved comparing the proposed IWOA-optimized MHA-1DCNN-GAP model with traditional WOA-optimized and other baseline models. The results indicated that the IWOA approach significantly improved accuracy and reduced loss. For instance, the WOA-optimized model achieved an accuracy of 96.88% with a loss of 0.26, but it exhibited overfitting. In contrast, the IWOA-optimized model reached an accuracy of 99.18% and a loss of 0.06, demonstrating better generalization. The confusion matrix for fault classification showed that most faults were correctly identified, with only two misdiagnoses, highlighting the model’s robustness for EV charging station applications.

Further comparisons with BP neural networks and GRU models revealed the superiority of the proposed method. The table below summarizes the performance metrics, where the MHA-1DCNN-GAP model outperformed others in both accuracy and loss, making it a reliable solution for fault diagnosis in EV charging stations.

Fault Diagnosis Model Accuracy (%) Loss Value
MHA-1DCNN-GAP 99.18 0.06
GRU 96.88 0.26
BP 95.06 0.13

In conclusion, this study presents an advanced fault diagnosis framework for EV charging stations, combining 1DCNN with MHA and GAP, optimized by IWOA. The integration of MHA allows for effective feature extraction from multi-dimensional data, while GAP reduces model complexity. The IWOA algorithm enhances parameter optimization, leading to high diagnostic accuracy and efficiency. Future work could explore real-time implementation and adaptation to other EV infrastructure components, further improving the reliability of EV charging stations. This research underscores the potential of deep learning and metaheuristic algorithms in advancing smart grid and EV technologies.

Scroll to Top