## 4 Simulation Test and Result Analysis
### Data-Balancing Tests  
To enhance the training of the FDIA detection model, our attention was drawn to the relatively limited presence of false data samples within the foundational dataset, which could potentially impact the model's efficacy. In response to this data imbalance, an evaluation of data-balancing processing was undertaken using the GAN-GRU framework. This evaluation was conducted under the premise of a standard working condition involving an attack 2-norm of 1. Within this evaluation, synthetic false data samples were generated via the GAN-GRU framework to augment the scarcity of false data within the original dataset. The generator and discriminator of the GAN-GRU model were formulated as neural network architectures endowed with a certain level of complexity and expressive capacity. The generator's objective is to produce synthetic data that closely resemble authentic false data samples, whereas the discriminator's task is to ascertain whether the input data are genuine or artificially generated. In the course of our experimentation, the parameters for the GAN's generator and discriminator were established as follows: An input size of 1, 128 hidden neurons, and the incorporation of two GRU layers were initialized in a batch-first dimensionality manner. Specifically, the generator undertakes the role of generating synthetic data to emulate authentic data samples. By utilizing a noise vector with an input size of 1 as the generator's input, a sequence of neural network layers and activation functions were employed to yield a final output resembling synthetic data akin to genuine data samples. The inclusion of 128 hidden neurons within the generator implies that 128 hidden units, instrumental in capturing potential features of the input data, were incorporated. Meanwhile, the discriminator, responsible for discerning between genuine and synthetically generated data, similarly adopted a network architecture featuring a GRU layer with 128 hidden neurons. Through training, the discriminator is endowed with the capacity to accurately classify both genuine and synthetic data. The loss function for the generator was defined as the mean-squared error, serving as a measure of the discrepancy between the synthetic data generated by the generator and the authentic data. In essence, it quantifies the mean-squared error between the output data and the target data. Conversely, the discriminator's loss function was stipulated as the binary cross-entropy loss. This loss function gauges the discriminator's precision in categorizing the input data by contrasting the predictions made for genuine and synthetic data with their corresponding labels. With these parameter configurations and loss function formulations, the GAN models were trained, facilitating the generation of high-quality synthetic data by the generator while enabling the discriminator to aptly discern disparities between genuine and synthetic data. During testing, the generator and discriminator's loss functions were continuously recorded, and their fluctuations were plotted against the number of training iterations. These graphical representations furnish insights into the loss function's behavior throughout model training, consequently aiding the comprehension of the models' learning progression and performance, as shown in Figure 6.  
By plotting the loss functions of the generator and discriminator against epochs, the training progression and performance trajectory of the model can be effectively observed. The oscillatory behavior exhibited by these two loss functions illustrates the dynamic interplay inherent in the adversarial training process. As the training unfolds, both the generator's and discriminator's loss functions gradually stabilize at elevated levels. This convergence signifies the successful optimization of both the generator and the discriminator over the course of the training process.