Skip to Content
  • Article
  • Open Access

30 July 2026

19 Pages

A Hybrid ResNet-iTransformer Model for False Data Injection Attack Detection in Electric Vehicle Fast-Charging Stations

,
,
,
,
and
1
State Grid Henan Economic Research Institute, Zhengzhou 450052, China
2
State Grid Henan Electric Power Company, Zhengzhou 450018, China
*
Author to whom correspondence should be addressed.

Abstract

As a crucial flexible regulation resource in distribution networks, electric vehicle fast-charging stations exhibit high-power, stochastic fluctuation characteristics. This randomness makes false data injection attack (FDIA) particularly challenging to detect with conventional methods, thereby posing a significant threat to the secure operation of vehicle-to-grid cyber–physical systems. To address this issue, this paper proposes an FDIA detection method based on ResNet-iTransformer. Firstly, a residual network (ResNet) is employed to capture abnormal patterns in the measurement data layer by layer. Secondly, the dimension reversal technique of iTransformer is utilized to model the interrelationships among channels, enabling information exchange among feature variables through multi-head self-attention. Then, attention pooling is introduced to filter multi-channel features and focus on key channels, thereby achieving accurate attack detection. Finally, simulation tests are conducted on the IEEE 33-bus system. The results show that, compared with existing common detection methods, the proposed method achieves significant improvements in detection precision, recall, and F1 score, enabling more accurate detection of FDIA in the vehicle-to-grid cyber–physical system.

1. Introduction

Electric vehicles (EVs), which combine transportation and energy-storage functions with the advantages of low-carbon energy, have emerged as an important dispatchable resource in power systems [1]. As EV adoption expands, charging stations can aggregate EVs into clusters and exploit their distributed energy-storage potential through vehicle-to-grid (V2G) interactions. Through V2G technology, the power grid can guide EVs to engage in coordinated charging or feed power back to the grid during specific time windows [2], thereby facilitating peak shaving, mitigating renewable energy intermittency, and providing technical support for the secure, stable, and economical operation of novel power systems [3,4]. Furthermore, advances in V2G technology have enabled charging station operators to achieve economic revenues while extending battery cycle life [5]. EVs can also supply power to households, enabling users to reduce daily electricity costs [6].
However, the cyber–physical system (CPS) of V2G interaction, which deeply couples EVs and the power grid, faces severe cybersecurity challenges. Among various cyberattacks, false data injection attacks (FDIA) maliciously tamper with data to disrupt grid stability or seek economic gains [7,8]; they represent one of the most serious threats to power system security. The load data of fast-charging stations and the complex interaction links between V2G platforms and grid dispatch centers can serve as potential entry points for external malicious attacks. By injecting and altering critical data such as charging loads, attackers can fabricate charging demands, mislead dispatch instructions, and consequently induce local grid overload [9,10].
In recent years, FDIA detection methods can be broadly categorized into data-driven approaches [11] and model-based approaches [12]. Model-based detection methods require physical and mathematical system models and detect FDIAs by comparing model residuals with predefined thresholds. These methods demand less data and offer strong interpretability. In Ref. [13], an improved adaptive square-root unscented Kalman filtering algorithm was proposed based on grid modeling and attack characteristic analysis, achieving effective FDIA detection. In Ref. [14], a detection method integrating cubature Kalman filtering was proposed for FDIA in DC microgrids, where local residuals were utilized to determine attack occurrence. However, model-based approaches rely on accurate system topology and parameter modeling. As grid data volumes continue to increase and uncertainties from generation, grid, load, and storage intensify, the complexity of power system modeling rises significantly [15], making it difficult to guarantee FDIA detection accuracy and thereby severely limiting the applicability of such methods.
By contrast, data-driven methods leverage machine learning and deep learning models to learn differences between normal and attack data, thereby enabling FDIA detection and identification [16] without complex system modeling. In Ref. [17], principal component analysis was first employed for dimensionality reduction, followed by distributed support vector machine training with Gaussian kernel functions to construct classification boundaries. In Ref. [18], a Kalman filter and recurrent neural network were utilized to learn the linear and nonlinear components of smart grid data, respectively, and their prediction results were combined for FDIA detection. In Ref. [19], an unsupervised detection method based on deep autoencoding Gaussian mixture models was proposed, where the optimal threshold for distinguishing normal and anomalous samples was determined to achieve FDIA detection.
Nevertheless, the aforementioned studies primarily focus on conventional power systems, with limited exploration of FDIA detection specifically for EV fast-charging stations. In the context of FDIA detection at EV fast-charging stations, the load characteristics exhibit high volatility and stochasticity, which makes them difficult to distinguish from FDIA [20]. Furthermore, attack patterns operate across different time scales, encompassing anomalous disturbances formed by injecting abrupt changes into single or multiple operational state variables over short durations, as well as stealthy attacks that employ gradual drift to create deviations in trends. This imposes more stringent requirements on FDIA detection models regarding anomalous feature extraction.
Regarding feature extraction, convolutional neural network (CNN) has been extensively adopted in FDIA detection methods owing to its ability to capture local temporal fluctuations [21]. Nevertheless, as network depth increases, traditional CNN suffers from gradient vanishing and feature degradation. Residual network (ResNet), as a variant of CNN, introduces residual structures that enable gradients to bypass intermediate layers and flow directly to shallow networks via identity mappings during backpropagation, thereby effectively alleviating gradient attenuation caused by the weights of intermediate convolutional layers. As network depth grows, ResNet prevents the loss of original features and achieves richer feature extraction, demonstrating remarkable advantages in anomalous feature capture.
Furthermore, in EV fast-charging station scenarios, various electrical quantities exhibit coupling relationships, which FDIA frequently exploit to evade detection by disrupting such couplings. Consequently, mining the intrinsic coupling relationships among multiple variables is imperative. However, most existing FDIA detection methods predominantly emphasize temporal modeling to capture the temporal dependencies of anomalous features. In Ref. [22], a Transformer-based framework integrating anomalous attention mechanisms and generative adversarial networks was proposed to enhance the feature separability between normal and attack data, validating the superiority of Transformer in FDIA detection. Nevertheless, when processing multivariate time series, Transformer treats multiple variables at identical time steps as tokens, which dilutes the intrinsic correlations among individual variables. To address this issue, researchers proposed the iTransformer model, which reverses the dimensional arrangement of time steps and feature variables, treating the entire time series of a single variable as a token, thereby enabling the model to effectively learn correlations among different variables. Currently, the iTransformer model has been applied in the field of anomaly detection due to this advantage [23,24], but research on FDIA detection is still lacking.
In light of the above, this paper proposes an FDIA detection method for EV fast-charging stations based on ResNet-iTransformer. The proposed method employs multiple stacked residual convolutional blocks in ResNet to hierarchically extract anomalous features at different time scales from temporal data. Its residual connections directly propagate detailed information from shallow layers to deep layers, achieving feature fusion and thereby effectively enhancing the model’s sensitivity to FDIA. Additionally, the dimensional inversion mechanism of iTransformer is used to model interactions among feature variables and fuse their information, while a multi-head self-attention mechanism is incorporated. A channel attention pooling module is utilized to reinforce the learning of critical channels and suppress interference from irrelevant noise, ultimately enabling the discrimination between normal and attack states in EV fast-charging station data.

2. FDIA Scenarios in EV Fast-Charging Stations

2.1. Principle of FDIA

FDIA is a stealthy attack targeting measurement data. Its core lies in constructing false measurement data that are mathematically consistent with the actual system state, thereby bypassing traditional bad data detection (BDD) mechanisms and misleading the state estimation and decision-making instructions of the dispatch center [25]. As shown in Figure 1, in V2G interaction scenarios, EV fast-charging stations serve as flexible loads connected to the distribution network, with their measurement data tightly coupled with the operating states of the distribution grid. Attackers can inject false data into the measurement data acquired by sensors [26], causing the dispatch center to receive corrupted measurements and potentially make erroneous dispatch decisions.
Figure 1. FDIA scenario of electric vehicle fast-charging stations.

2.2. FDIA Construction

When the supervisory control and data acquisition (SCADA) system transmits the collected measurement data to the dispatch center, the dispatch center performs state estimation by utilizing the measurement data in conjunction with network topology and line parameters. The measurement vector includes nodal active and reactive power injections and active and reactive power flows on the branches. The measurement equation can be expressed as:
z = h ( x ) + e
where z denotes the measurement vector; x denotes the state vector; h(x) denotes the nonlinear measurement function; and e denotes the measurement error.
Equation (1) is typically solved iteratively using the Weighted Least Squares (WLS) method. The system state estimate is obtained by solving the following WLS optimization problem:
x ^ = arg min x [ z − h ( x ) ] T W [ z − h ( x ) ]
where W is a diagonal matrix.
To eliminate bad measurement data caused by equipment failures, environmental noise, communication interference, and other factors, the dispatch center typically employs the BDD mechanism. Through the largest normalized residual (LNR) detection method [27], the normalized residuals are computed and the maximum value is identified:
r i N = | z i − h i ( x ^ ) | Ω i i
where r i N is the i-th element of the residual vector, Ω i i is the i-th diagonal element of residual covariance matrix.
τ is set as the detection threshold. If the maximum normalized residual is greater than the threshold τ, the measurement data are considered to be bad data.
When an attacker intends to bypass BDD, an attack vector a must be constructed such that the tampered measurement satisfies the condition that the residual after attack remains essentially unchanged from that before the attack and does not exceed τ:
| | z a − h ( x ^ a ) | | 2 ≈ | | z − h ( x ^ ) | | 2 ≤ τ
where z a denotes the measurement vector after attack; x ^ a represents the compromised state estimate satisfying x ^ a = x ^ + c , and c is the state deviation vector injected by the adversary.
Because the measurement function in alternating-current state estimation (ACSE) is nonlinear, the attack vector a satisfying the stealth constraint is evaluated from the nonlinear difference in Equation (5):
a = h ( x ^ a ) − h ( x ^ )
Following the treatment methodology delineated in Reference [28], the Jacobian matrix extracted from the final converged iteration of the ACSE is utilized to perform first-order Taylor linearization:
h ( x ^ + c ) ≈ h ( x ^ ) + H c
Substituting Equation (6) into Equation (5) yields that the attack vector selected by the attacker satisfies a = Hc,
The post-attack measurement residual is subsequently derived as:
r a = z a − h ( x ^ a ) ≈ z + a − h ( x ^ ) − H c ≈ r
where r and r a signify the pre-attack and post-attack residuals, respectively.
As indicated by Equation (7), the residual remains unchanged before and after the attack; therefore, BDD is unable to detect the attack.

3. FDIA Detection Model Based on ResNet-iTransformer

In the context of FDIA detection for EV fast-charging stations, the anomalous patterns induced by attacks may be obscured by the high-power stochastic fluctuation of fast-charging loads [29]; Furthermore, although FDIA are mathematically consistent with the state-estimation model, they disrupt correlations among measurement variables [30]. To address these issues, this paper proposes an FDIA detection model based on ResNet-iTransformer, which leverages the complementary strengths between the constituent models to achieve superior performance in FDIA detection scenarios for EV fast-charging stations.
The architecture of the proposed detection model is shown in Figure 2. Firstly, deep features from multivariate sequences are extracted by stacked residual convolutional blocks. Each block utilizes residual connections to mitigate deep network degradation, progressively learning rich local patterns to output multi-channel features. Then, the complete time series of each feature variable is compressed by the inverted embedding layer into a fixed-dimensional vector via a learnable projection, inverting the tensor dimensions from temporal to feature variables so that each feature channel serves as a token input to the iTransformer. The global modeling of inter-variable dependencies is conducted by multi-head self-attention mechanism, enabling the model to capture correlations among diverse anomalous patterns caused by FDIA. Finally, the channels are weighted and fused by attention pooling adaptively to emphasize key features associated with attacks, and the detection result is output by the classification head.
Figure 2. ResNet-iTransformer model.

3.1. ResNet

Although ResNet was originally designed for two-dimensional image recognition [31], this paper adapts its architecture to sequential data by converting 2D residual blocks into one-dimensional counterparts, thereby constructing a deep residual network tailored for sequence modeling that progressively extracts abstract temporal anomalous features.
Firstly, the model transforms the dimensions of the original sequence into B × L × D, where B denotes the batch size, L denotes the sequence length, and D denotes the feature dimension.
Subsequently, k residual blocks are stacked, yielding output channels C. The output of the k-th residual block is defined as:
Z k = ResConv 1 DBlock ( Z k − 1 ) , Z 0 = X ′
As the network depth increases, enabling the model to capture increasingly complex feature patterns; however, this escalation in representational capacity is accompanied by growing computational overhead and heightened susceptibility to gradient vanishing. To mitigate this, a shortcut connection is introduced within each residual block, which establishes an identity mapping that allows gradients to bypass the stacked nonlinear transformations and propagate directly to shallower layers. When the input and output channel dimensions are mismatched, a 1 × 1 convolutional projection shortcut is employed to align the feature dimensions, thereby preserving the additive operation and ensuring stable optimization of deep architectures.
The internal structure of each residual block is shown in Figure 3. The input data first pass through a one-dimensional convolutional layer, followed by batch normalization and ReLU activation. The data then pass through a second one-dimensional convolutional layer and batch normalization. The main-path output is added to the shortcut output, and the sum is passed through ReLU activation to produce the block output.
Figure 3. Structure of the Residual Block.
The final output data are denoted as Z K ∈ R B × L × C , where C represents the number of channels, with each channel corresponding to abstract local temporal features that provide information for the subsequent detection model.

3.2. iTransformer

The proposed iTransformer model consists of an inverted embedding layer, an encoding module, an attention pooling layer, and an output layer. Built upon the Transformer architecture, iTransformer transforms time series data from the conventional temporal perspective to the feature perspective. Specifically, when a multivariate time series is input to Transformer, each token comprises the channel features at a single time step, emphasizing the modeling of dependencies between time steps; whereas when the same multivariate time series is input to iTransformer, the feature and sequence dimensions are inverted through the inverted embedding layer, and the token at this point represents the entire time series under the same feature. Subsequently, each feature’s time series is projected to a unified hidden dimension, enabling the self-attention mechanism to compute the correlations among different feature channels. The dimension inversion process of iTransformer is illustrated in Figure 4.
Figure 4. Dimension inversion of iTransformer.
The encoding module is composed of stacked Transformer encoders to extract correlations among different channel sequences from the output of the inverted embedding layer. Its structure comprises a multi-head self-attention mechanism layer, layer normalization, and a feed-forward network.
The self-attention mechanism allows each element in the sequence to interact with other elements, thereby capturing the relationships among them. Firstly, the input data are transformed by three weight matrices into the query matrix Q, key matrix K, and value matrix V; secondly, the query matrix Q is multiplied by the transpose of the key matrix K via matrix multiplication to obtain the raw attention scores, which are then scaled and normalized to [0,1] through the softmax function; finally, the normalized weights are multiplied by the value matrix V to obtain the attention-weighted output:
Attention ( Q , K , V ) = softmax ( Q K T d k ) ⋅ V
where d k is the dimensionality of each key vector and is used to scale the attention scores.
Multi-head self-attention concatenates the outputs of multiple parallel self-attention mechanisms to capture dependencies in different subspaces of the sequence, yielding the multi-head attention output:
Mulithead ( Q , K , V ) = Concat ( head 1 , … , head n ) W O
head i = Attention ( Q W i Q , K W i K , V W i V )
where W i Q , W i K , W i V , and W O denote the weight matrices for query, key, value, and output, respectively; Concat(·) denotes the concatenation function; and head i denotes the output of the i-th self-attention head.
Layer normalization standardizes feature representations to zero mean and unit variance, reducing differences in feature distributions and improving the stability of model training.
The feed-forward network layer enhances the model’s capability to extract temporal patterns of each variable by combining nonlinear activation functions with fully connected layers, thereby improving the modeling efficacy for complex nonlinear temporal relationships.
To enable the model to focus on key channels, attention pooling is introduced. Attention pooling allows the model to concentrate on channels significantly affected by attacks while suppressing interference from noise or irrelevant channels, thereby enhancing detection precision and robustness.
Firstly, an attention score is computed for each feature channel through a learnable attention network:
e b , j = W 2 T tanh ( W 1 h b , j + l )
where h denotes the encoder output; b and j denote the batch and channel indices, respectively; W 1 and l denote the weight and bias of the first linear layer; W 2 denotes the weight of the second linear layer; tanh ( ⋅ ) denotes the nonlinear activation function.
Then, the scores are normalized via softmax along the channel dimension to obtain the attention weights:
s b , c = exp ( e b , c ) ∑ j ′ = 1 C exp ( e b , j ′ )
where exp ( ⋅ ) denotes the exponential function; j ′ denotes the channel index for summation.
Finally, the channel-wise representations are aggregated through weighted summation:
h b ′ = ∑ j = 1 C s b , j ⋅ h b , j
The output layer comprises two linear layers, a GELU activation function, and Dropout regularization. Firstly, a dimension-reduction linear layer compresses the high-dimensional feature space into a unified hidden dimension, reducing parameter complexity. Then, the GELU activation function introduces nonlinear transformations to enhance the model’s expressive capability. Subsequently, Dropout is applied for regularization to prevent overfitting. Finally, a linear projection layer maps the fused features to the classification task, yielding the detection result.

3.3. FDIA Detection Workflow Based on ResNet-iTransformer for EV Fast-Charging Station

The FDIA detection workflow based on ResNet-iTransformer for EV fast-charging stations is as follows:
Step 1: Data Preprocessing. Missing values are imputed and outliers are corrected using interpolation, after which all features are normalized. The processed data are subsequently partitioned into training, validation, and test sets.
Step 2: Model Training. The partitioned datasets are fed into the ResNet-iTransformer model via a sliding window mechanism. In this paper, the window length is set to L = 96, the sliding stride to S = 4, and the labeling rule adopts majority voting over the terminal region of length equal to the stride as the window label. The loss function employed for model training is the standard cross-entropy loss, whose mathematical formulation is presented in Equation (15):
L = − 1 N ∑ i = 1 N ∑ m = 1 M y i , m log ( y ^ i , m )
where N denotes the number of samples; i denotes the sample index; m denotes the index of the classification category; and M denotes the total number of classes; y i , m is the ground-truth label, y ^ i , m is the predicted probability from the model.
Step 3: FDIA detection. The trained model is applied to the test set. For each time step T, a fixed-length input window is constructed, and the selected checkpoint classifies the current state as normal or under attack.

4. Evaluation Metrics

Based on the different combinations of true categories and predicted categories from the detection results, the outcomes are classified into true positive (TP), false positive (FP), true negative (TN), and false negative (FN), constituting the confusion matrix as defined in Table 1. TP and TN represent attack samples detected as attacks and normal samples detected as normal, respectively. FP and FN represent normal samples detected as attacks and attack samples detected as normal, respectively, i.e., false alarms and missed detections.
Table 1. Definition of the Confusion Matrix.
Furthermore, to comprehensively and objectively evaluate model performance, this paper selects typical metrics from the detection domain—Precision, Recall, and F1-score—as the evaluation criteria for the model, with the specific mathematical formulations given in Equations (16)–(18). Precision measures the credibility of the model in detecting attack samples; higher precision indicates fewer false alarms. Recall measures the capability of the model in detecting attack samples; higher recall indicates fewer missed detections. The F1-score is a comprehensive metric that balances precision and recall. The specific formulas are as follows:
(1)
Precision: The proportion of samples that are truly positive among those predicted as positive.
P = T P T P + F P
where P denotes precision, TP denotes true positive, and FP denotes false positive.
(2)
Recall: The proportion of positive instances correctly identified among all real positive samples.
R = T P T P + F N
where R denotes recall, and FN denotes false negative.
(3)
F1-score: The harmonic mean of precision and recall.
F 1 = 2 ⋅ P R P + R

5. Case Analysis

The topology of the modified IEEE 33-bus system is shown in Figure 5. The rated voltage and base power are 10 kV and 10 MVA, respectively. Other specific parameters can be found in [32]. Due to the different rated voltage levels, the load power is scaled proportionally according to the squared voltage ratio.
Figure 5. IEEE 33-Bus system.
On this basis, EV fast-charging stations are connected at bus 10, bus 14, and bus 30, respectively. The charging load data utilized in this paper are derived from actual fast-charging stations located in Henan Province, China. Due to confidentiality agreements, the detailed operational data of these fast-charging stations cannot be disclosed. The dataset comprises charging load records collected from three distinct districts within the region during the period from 1 January to 31 December 2023, with a temporal resolution of 15 min. All three charging stations are equipped with DC fast-charging facilities in a dual-gun-per-pile configuration. Specifically, Station 1 is configured with 20 DC charging piles rated at 130 kW each, yielding a total rated capacity of 2600 kW; Station 2 is configured with 18 DC charging piles rated at 180 kW each, yielding a total rated capacity of 3240 kW; and Station 3 is configured with 10 DC charging piles rated at 120 kW each, yielding a total rated capacity of 1200 kW. The data missing rate is 1.3%. For consecutive missing or anomalous values, imputation is performed using the historical mean of the same period; for single-point missing or anomalous values, temporal linear interpolation using adjacent values is employed. Clustering analysis of the data from the three fast-charging stations yields typical load curves under representative scenarios. As illustrated in Figure 6, all three curves exhibit pronounced volatility; fluctuations induced by false data injection may be masked by normal load fluctuations, thereby readily leading to false alarms or missed detections. This elevates the requirements for the model’s detection capability.
Figure 6. Typical load curves of fast-charging stations.

5.1. FDIA Generation for V2G Fast-Charging Stations

The simulations are implemented in MATLAB R2023a, with AC power flow calculations performed using the MATPOWER 8.1 package to generate routine measurement data for the IEEE 33-bus distribution system. The measurement configuration comprises voltage magnitudes at all 33 buses, together with active and reactive power flows across 32 branches, yielding a total measurement vector dimension of 97, which subsequently serves as the input data for the model. To emulate realistic measurement errors encountered in actual operation, zero-mean Gaussian white noise is superimposed on all measurement data, with the noise variance uniformly set to 0.01.
This paper adopts a mixed-node random attack strategy to simulate FDIA, with the detailed procedure illustrated in Figure 7:
Figure 7. FDIA data generation flowchart.
Step 1: The true operating state of the system and the corresponding ideal measurements are obtained through AC power flow calculations. Gaussian measurement noise is superimposed on the ideal measurements to generate noisy actual measurements. WLS state estimation is performed on the actual measurements, with the maximum number of iterations set to 50 and the iterative convergence tolerance set to 1 × 10−5, to solve for the system state estimate.
Step 2: For each time snapshot, the generated measurement data are subjected to attack with a probability of 50%. To prevent the model from easily detecting fixed attack targets, the attacked buses are randomly selected from 1–3 EV fast-charging station nodes and 1–2 other load nodes whenever an attack is launched.
Step 3: The perturbation vector c is applied to the state vectors of the selected attack nodes, with the voltage phase angle perturbation measured in radians and the voltage magnitude perturbation in per unit. The 2-norm of the perturbation vector takes values from the interval [0.01, 0.03], and the attack direction is randomized to avoid detection bias arising from fixed perturbation directions.
Step 4: The attack vector a is constructed via the Jacobian matrix at the current operating point, and the measurement vector z is tampered accordingly.
Step 5: The compromised data undergo BDD testing. The detection threshold in this paper is set to τ = 3. If the maximum normalized residual is below 3, the attack is deemed successful and stealthy, and the attack sample is labeled accordingly. Otherwise, the normal measurement values are retained. Normal samples are labeled 0, and attack samples are labeled 1.
Through the above process, a measurement dataset containing both normal and attack samples is generated, where the successfully attacked samples account for 30% of the total dataset. Finally, the complete dataset is partitioned chronologically into training, validation, and test sets in a 6:2:2 ratio. The training set is used to train the model, the validation set is used to select the optimal checkpoint, and the unseen test set is used only for the final performance evaluation.

5.2. FDIA Data Analysis

To verify the stealthiness of the attack samples, this paper employs principal component analysis (PCA) for dimensionality reduction on the dataset, thereby assessing the data distribution and separability.
Figure 8 presents the PCA scatter plot of the raw data. PC1 and PC2 represent the first and second orthogonal directions of maximum variance; however, they cumulatively account for only 50.14% of the total variance, indicating that the information in the original data feature space is highly dispersed. As can be seen from Figure 8, attack samples and normal samples exhibit severe overlap in the two-dimensional projection and are not clearly separable. A linear classifier achieves only 69.95% accuracy on this projection, indicating that the dataset possesses inherent classification complexity, and relying solely on feature compression and linear models is insufficient for effective detection of anomalous data.
Figure 8. PCA scatter plot of raw data.
Figure 9 presents the LNR results over a 24-h period before and after the attack. As can be observed, the residuals exhibit no significant increase either before or after the attack and remain below the detection threshold, indicating that the compromised data can evade BDD.
Figure 9. Residual comparison before and after attack.
Figure 10 shows the variation in nodal voltage magnitudes before and after the attack. Although the post-attack nodal voltages deviate from their original values, the voltage magnitudes consistently remain within the normal operating range without causing any limit violations, thereby demonstrating that the attack possesses a certain degree of stealthiness.
Figure 10. Voltage magnitude before and after attack.

5.3. Detection Simulation Analysis

5.3.1. Parameter Settings and Experimental Configuration

The hardware platform employed in the experiments is a laptop computer equipped with an AMD Ryzen 7 7735H processor, 16 GB of RAM, and an NVIDIA GeForce RTX 4060 Mobile GPU. In this study, MATLAB is utilized for the generation of false data injection attack samples; the deep learning simulation framework is built upon PyTorch 1.7.1, with all experimental code written in Python 3.9, and code debugging, compilation, and model training executed via PyCharm 2024.1.4 and the system terminal.
To validate the superiority of the proposed model, graph convolutional network (GCN), ResNet, support vector machine (SVM), extreme mearning machine (ELM), Transformer, ResNet-Transformer and iTransformer are selected as benchmark models, with hyperparameter tuning performed for each model via grid search. The relevant hyperparameters of ResNet, Transformer, iTransformer, ResNet-Transformer and the proposed model are configured identically. The parameter settings for the remaining models are detailed in Table 2. To ensure a fair comparison, all deep learning-based models are trained with identical hyperparameters: a batch size of 32 and a learning rate of 1 × 10−4. Furthermore, to avoid overfitting during the training process, an early stopping mechanism is introduced with a patience count set to 6. The optimal results of the trained model on the validation set are compared; when the results show no improvement for multiple times and the count exceeds the patience value, the early stopping mechanism is triggered to save the optimal model.
Table 2. Parameter settings.

5.3.2. Detection Results Analysis

Figure 11 show the loss curve and accuracy curve of the proposed model, respectively. As can be seen from these figures, while the training loss decreases, the validation loss fluctuates, and the validation accuracy gradually increases. The validation accuracy reaches its maximum at epoch 31 and does not improve during the next six epochs; consequently, early stopping is triggered at epoch 37.
Figure 11. Loss curves and Accuracy curves.
To evaluate the performance of each model in FDIA detection, this paper independently runs the experiments are independently run five times with different random seeds, and the mean and standard deviation of Precision, Recall, and F1-score are computed across the five runs. Meanwhile, the training time and single-sample inference latency of each model are recorded to assess computational efficiency. The confusion matrices of the respective models are visualized based on the mean values. Figure 12 presents the comparative results of the confusion matrices, and Table 3 provides the specific numerical results.
Figure 12. Confusion matrices of the evaluated models.
Table 3. Comparison of detection performance and computational efficiency among different models.
From the perspective of the confusion matrices, the proposed model yields the highest mean TP and TN counts across the five runs and the lowest mean FP and FN counts, indicating fewer false alarms and missed detections. In cyber–physical systems for vehicle–grid interaction, false alarms and missed detections are of particular concern: false alarms lead to frequent responses by operation and maintenance personnel, which increases labor costs and affects normal operations, whereas missed detections result in erroneous dispatching decisions and economic losses. Regarding false alarms and missed detections, the proposed model exhibits the lowest numbers of both, which demonstrates its reliability.
Based on the results in Figure 12, the core metrics of precision, recall, and F1-score for each model can be obtained using Equations (16)–(18). As shown in Table 3, the proposed model achieves optimal performance across all three core metrics, attaining a precision of 99.53 ± 0.29%, a recall of 96.59 ± 0.65%, and an F1-score of 98.03 ± 0.45%. In terms of precision, it achieves an average improvement of 6.41 percentage points over traditional machine learning models (ELM and SVM), and an average improvement of 1.74 percentage points over deep learning models (GCN, Transformer, ResNet, iTransformer, and ResNet-Transformer). This result highlights its advantage in reducing the false alarms. In terms of recall, it achieves an average improvement of 10.58 percentage points over traditional machine learning models, and an average improvement of 2.79 percentage points over deep learning models, which fully demonstrates its significant superiority in accurately identifying attack states. In terms of F1-score, it achieves an average improvement of 9.32 percentage points over traditional machine learning models, and an average improvement of 2.29 percentage points over deep learning models. This indicates that the proposed model achieves the optimal overall performance in FDIA detection.
To verify the statistical reliability of the improvements achieved by the proposed model, this paper conducts paired t-tests are conducted on the comprehensive metric F1-score (significance level α = 0.05, two-tailed test). As shown in Table 3, at the 0.05 significance level, the proposed model significantly outperforms all baseline models in terms of F1-score (all p < 0.05): compared with GCN, t = 16.14, p < 0.001; compared with ELM, t = 41.68, p < 0.001; compared with SVM, t = 34.05, p < 0.001; compared with ResNet, t = 9.08, p < 0.001; compared with iTransformer, t = 10.78, p < 0.001; compared with Transformer, t = 4.90, p = 0.0081; compared with ResNet-Transformer, t = 3.30, p = 0.0114. These results prove that the improvements do not stem from random factors.
To further verify the efficacy of each module in the proposed model, ablation experiments are conducted using ResNet, iTransformer, and ResNet-Transformer. According to the results in Table 3, compared with the standalone ResNet and iTransformer models, the proposed model achieves the optimal F1-score, demonstrating that it can leverage the complementary strengths of each constituent module to boost performance. Compared with ResNet-Transformer, the proposed model yields a notable performance gain, which stems from iTransformer’s modeling of correlations among anomalous features extracted by ResNet. The above analysis indicates that this hybrid architecture is more suitable for FDIA detection tasks in power systems.
To present the results more intuitively, we have visualized the results in Table 3. As illustrated in Figure 13, conventional machine learning models, including SVM and ELM, demonstrate limited efficacy in capturing the temporal anomalous features inherent in FDIA data, which consequently leads to suboptimal detection performance. Although deep learning models such as Transformer, ResNet, and iTransformer can improve detection accuracy to some extent, each still has shortcomings: Transformer and ResNet essentially model time steps, which makes it difficult to mine collaborative relationships among feature variables, while iTransformer lacks capability in anomalous feature extraction. By contrast, the proposed model—benefiting from its ability to extract anomalous features and mine collaborative relationships among feature variables—occupies the outermost layer across all three metric dimensions, forming the largest triangular area. This indicates that it outperforms other models in precision, recall, and F1-score.
Figure 13. Evaluation metrics of the evaluated models.
Figure 14 shows the receiver operating characteristic (ROC) curves of each model, illustrating the relationship between the true positive rate (TPR) and the false positive rate (FPR) of different models under different decision thresholds. The closer the curve approaches the upper-left corner and the nearer the AUC is to 1, the better the model performance. As can be seen from Figure 14, the proposed model achieves the highest AUC score; however, the performance margin relative to other models is not substantial. The primary reason is that the denominator of the FPR is dominated by a large number of TN samples, resulting in less pronounced variations in FP. From the perspective of curve morphology, the proposed model exhibits a curve shape closer to the upper-left corner than other models and achieves a larger AUC value, thereby corroborating its high-precision detection capability.
Figure 14. ROC curves of the evaluated models.
To intuitively validate the efficacy of the proposed model, the t-distributed stochastic neighbor embedding (t-SNE) algorithm is employed to visualize the model-processed data. The results are illustrated in Figure 15. Upon t-SNE dimensionality reduction, the normal and attack samples in the raw input exhibit substantial overlap. After processing by the ResNet-iTransformer model, the two classes achieve significant separation in the two-dimensional plane. The aforementioned results demonstrate that the proposed model exhibits a certain degree of rationality, capable of leveraging the respective advantages of each constituent module.
Figure 15. t-SNE scatter plot of ResNet-iTransformer Output Features.

6. Conclusions

To address the problems of insufficient anomalous feature extraction in existing FDIA detection algorithms for EV fast-charging stations and inadequate modeling of dependencies among feature variables that easily lead to false alarms and missed detections, this paper proposes an FDIA detection method for EV fast-charging stations based on ResNet-iTransformer, which can provide security assurance for system operation in V2G scenarios. Through case analysis using the modified IEEE 33-bus system, the following conclusions are obtained:
(1)
ResNet is utilized to extract diverse anomalous features from FDIA data. The residual structure effectively alleviates the vanishing-gradient problem. Consequently, anomalous patterns—such as abrupt local changes, medium-term fluctuations, and long-term trends—are separated and enhanced in deep feature channels, providing rich anomalous representations for subsequent detection.
(2)
iTransformer is introduced to model the collaborative relationships among feature variables, which can effectively capture cross-variable coupling anomalies caused by attacks, and leverage the attention mechanism to perform weighted focusing on key feature channels, thereby improving detection precision.
(3)
The proposed ResNet-iTransformer model demonstrates marked performance improvements over baseline models in terms of detection precision, recall, and F1-score, verifying its superiority in FDIA detection for EV fast-charging stations, and provides assurance for data authenticity when EV clusters participate in grid dispatch.
Due to difficulties in acquiring real measurement data, commercial confidentiality concerns, and the scarcity of attack datasets, future work will validate the proposed method under diverse grid conditions, EV penetration levels, and traffic patterns to verify its broader applicability. The isolated contribution of the channel attention pooling module within the proposed model will be further investigated. Additionally, constrained by training time costs, the developed approach is more suitable for offline training while supporting real-time inference.

Author Contributions

Conceptualization, D.H. and Y.W.; methodology, D.H. and S.W.; software, S.W. and D.S.; validation, S.W. and D.H.; data curation, L.D. and Q.L.; writing—original draft preparation, D.H. and S.W.; writing—review and editing, L.D., Q.L., D.S. and Y.W. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Science and Technology Project of State Grid Henan Electric Power Company, grant number 5217L0250003.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

Authors Shiqian Wang, Ding Han, Qiuyan Li, Yuanyuan Wang, Dawei Song were employed by the company State Grid Henan Economic Research Institute. Author Li Di was employed by the company State Grid Henan Electric Power Company. The authors declare that this study received funding from the Science and Technology Project of State Grid Henan Electric Power Company. The funder was not involved in the study design, collection, analysis, interpretation of data, the writing of this article or the decision to submit it for publication.

References

  1. Jie, B.; Baba, J.; Kumada, A. Contribution to V2G System Frequency Regulation by Charging/Discharging Control of Aggregated EV Group. IEEE Trans. Ind. Appl. 2024, 60, 1129–1140. [Google Scholar] [CrossRef] [Scilit]
  2. Pozo-Burgos, E.J.; Alpala, L.O.; Heredia-Campaña, A.L. Electric Mobility Transition, Intelligent Digital Platforms, and Grid–Vehicle Integration Models: A Systematic Review. World Electr. Veh. J. 2026, 17, 123. [Google Scholar] [CrossRef] [Scilit]
  3. Liang, Y.; Liu, Y.; Zhang, X.; Liu, G. Physically Secure and Privacy-Preserving Charging Authentication Framework with Data Aggregation in Vehicle-to-Grid Networks. IEEE Trans. Intell. Transp. Syst. 2024, 25, 18831–18846. [Google Scholar] [CrossRef] [Scilit]
  4. Zhong, J.; Lei, X.; Shao, Z.; Jian, L. A Reliable Evaluation Metric for Electrical Load Forecasts in V2G Scheduling Considering Statistical Features of EV Charging. IEEE Trans. Smart Grid 2024, 15, 4917–4931. [Google Scholar] [CrossRef] [Scilit]
  5. Li, T.; Zeng, X.; Qi, X.; Zhao, T.; Li, Z.; Lv, Y.; Qiao, Y.; Tan, Z.; Liu, J.; He, J.; et al. Economical Vehicle-Side Strategies for an Electric Bus Charging Station in Vehicle-to-Grid Services Based on Reinforcement Learning. Green Energy Intell. Transp. 2026, 5, 100387. [Google Scholar] [CrossRef] [Scilit]
  6. Irfan, M.; Tahir, T.; Deilami, S.; Huang, S.; Veettil, B.P. A Novel Predictive Strategy for Daily Energy Cost Reduction in Solar “PV + EV” System with V2G and V2H Modes. In Proceedings of the 2025 IEEE International Conference on Energy Technologies for Future Grids, Wollongong, Australia, 7–11 December 2025; pp. 1–6. [Google Scholar]
  7. Chen, B.; Wu, Q.H.; Li, M.; Xiahou, K. Detection of False Data Injection Attacks on Power Systems Using Graph Edge-Conditioned Convolutional Networks. Prot. Control Mod. Power Syst. 2023, 8, 16. [Google Scholar] [CrossRef] [Scilit]
  8. Li, X.; Wang, Y.; Lu, Z. Graph-Based Detection for False Data Injection Attacks in Power Grid. Energy 2023, 263, 125865. [Google Scholar] [CrossRef] [Scilit]
  9. Li, X.; Li, W.; Wang, N.; Zhang, Y. A Tri-Level Optimization Model for False Data Injection Attack Defense Based on Cyber Physical Power System. Proc. CSU-EPSA 2025, 37, 32–42. [Google Scholar]
  10. Yang, S.; Tan, B.; Guo, J. Detection of False Data Injection Attack for New-Type Energy Internet Based on Double Markov Chains. Electr. Power Autom. Equip. 2021, 41, 131–137. [Google Scholar]
  11. Xi, L.; Dong, L.; Cheng, C.; Tian, X.; Li, Z. Location Detection of a False Data Injection Attack in a Cyber-Physical Power System Based on a Hybrid Chimp Optimized Extreme Learning Machine. Power Syst. Prot. Control 2024, 52, 46–58. [Google Scholar]
  12. Živković, N.; Sarić, A.T. Detection of False Data Injection Attacks Using Unscented Kalman Filter. J. Mod. Power Syst. Clean Energy 2018, 6, 847–859. [Google Scholar] [CrossRef] [Scilit]
  13. Luo, X.; Pan, X.; Wang, X.; Guan, X. Detection of False Data Injection Attack in Smart Grid via Adaptive Kalman Filtering. Acta Autom. Sin. 2022, 48, 2960–2971. [Google Scholar]
  14. Zhang, J.; Zhang, J.; Wu, P. False Data Detection in DC Microgrids Based on Fusion of Cubature Kalman Filters. Smart Power 2024, 52, 87–93. [Google Scholar]
  15. Xi, L.; Peng, D.; Cao, W.; Chen, H.; Bai, F.; Wang, W. FDIA Location Detection for Data-driven Algorithms in Cyber-physical Power Systems. Proc. CSEE 2025, 45, 7110–7123. [Google Scholar]
  16. Liu, Z.; Wang, Q.; Xue, T.; Tang, Y. Research on Security Risks and Defense Methods of Data-driven Algorithms in Power Systems. Proc. CSEE 2023, 43, 4538–4554. [Google Scholar]
  17. Esmalifalak, M.; Liu, L.; Nguyen, N.; Zheng, R.; Han, Z. Detecting Stealthy False Data Injection Using Machine Learning in Smart Grid. IEEE Syst. J. 2017, 11, 1644–1652. [Google Scholar] [CrossRef] [Scilit]
  18. Wang, Y.; Zhang, Z.; Ma, J.; Jin, Q. KFRNN: An Effective False Data Injection Attack Detection in Smart Grid Based on Kalman Filter and Recurrent Neural Network. IEEE Internet Things J. 2022, 9, 6893–6904. [Google Scholar] [CrossRef] [Scilit]
  19. Chen, C.; Wang, Y.; Cui, M.; Zhao, J.; Bi, W.; Chen, Y.; Zhang, X. Data-Driven Detection of Stealthy False Data Injection Attack Against Power System State Estimation. IEEE Trans. Ind. Inform. 2022, 18, 8467–8476. [Google Scholar] [CrossRef] [Scilit]
  20. Zang, T.; Gong, Y.; Li, C.; Wang, S.; Liu, Y.; Zhou, B. Research Status and Prospect of Moving Target Defense Against False Data Injection Attacks in New Power Systems. Adv. Eng. Sci. 2025, 57, 114–133. [Google Scholar]
  21. Huang, D.; Yang, X.; Hu, A.; Bian, Z.; Sun, Y.; Sun, J. Detection of False Data Injection Attack in New Power System Based on CNN-BiGRU-XGBoost. Power Syst. Technol. 2025, 49, 2119–2127. [Google Scholar]
  22. Liu, Y.; Shi, L. A Joint FDIA Detection and Localization Scheme and Experimental Analysis Based on Adversarial Anomaly Transformer for Power Distribution System. IEEE Trans. Ind. Inform. 2025, 21, 9834–9845. [Google Scholar] [CrossRef] [Scilit]
  23. Ma, Y.; Liu, W.; Xu, C.; Bai, L.; Zhang, E.; Wang, J. Multivariate Time Series Anomaly Detection Based on Inverted Transformer with Multivariate Memory Gate. Entropy 2025, 27, 939. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  24. Li, M.; Si, G.; Lu, L.; Liu, Q.; Hao, H.; Zhou, F. Groundwater Level Forecasting and Seismic Precursor Anomaly Detection Based on RMMoTCN-iTransformer. Prog. Geophys. 2026, 41, 560–575. [Google Scholar]
  25. Xi, L.; He, Y.; Li, Z.; Cao, L.; Li, Z.; Shi, Y. False Data Injection Attack Detection Based on Focal Loss™-Transformer. South Power Syst. Technol. 2025, 19, 26–38. [Google Scholar] [CrossRef] [Scilit]
  26. Wang, W.; Tian, B.; Wu, F.; He, Y.; Wang, X.; Yang, M.; Feng, D. Modeling, Detection, and Defense Theories and Methods for Cyber-Physical Fusion Attacks in Smart Grids. J. Electron. Inf. Technol. 2025, 47, 1454–1468. [Google Scholar]
  27. Liu, Y.; Wen, M.; Wen, H.; Deng, R.; Peng, S.; Guo, N. False Data Injection Attacks in Power Distribution Systems Considering the Characteristics of Distributed Photovoltaic. IEEE Trans. Ind. Inform. 2025, 21, 2023–2032. [Google Scholar] [CrossRef] [Scilit]
  28. Khare, G.; Mohapatra, A.; Singh, S.N. Linearized Attack Vector Formulation against AC State Estimator. In Proceedings of the 2019 IEEE PES Innovative Smart Grid Technologies Europe, Bucharest, Romania, 29 September–2 October 2019; pp. 1–5. [Google Scholar]
  29. Cumplido, J.; Alcaraz, C.; Lopez, J. Collaborative Anomaly Detection System for Charging Stations. In Proceedings of the 27th European Symposium on Research in Computer Security, Copenhagen, Denmark, 26–30 September 2022; pp. 716–736. [Google Scholar]
  30. Hu, J.; Yang, X.; Yang, L.-X. A Framework for Detecting False Data Injection Attacks in Large-Scale Wireless Sensor Networks. Sensors 2024, 24, 1643. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  31. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 26 June–1 July 2016; pp. 770–778. [Google Scholar]
  32. Baran, M.E.; Wu, F.F. Network Reconfiguration in Distribution Systems for Loss Reduction and Load Balancing. IEEE Trans. Power Deliv. 1989, 4, 1401–1407. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.