# Self-Attention GAN for Electromagnetic Imaging of Uniaxial Objects
## 3 Neural Network  
CNN is a type of feedforward architecture that operates based on three core concepts: sparse connectivity, parameter sharing, and equivariance to translation. Its standard structure includes convolutional layers, pooling layers, activation functions such as ReLU, and fully connected layers. Among these, the convolutional layer is essential for feature extraction from the input data. The process typically begins by representing the input image in matrix form, allowing the network to learn spatial patterns through localized filters. Various convolutional kernels slide across this matrix, performing calculations that yield a transformed image. Each resulting feature map retains information from the original input image, while parameters such as kernel size and stride length significantly influence the operation of this layer. Pooling layers function to down sample the spatial resolution of feature maps, effectively decreasing the dimensionality of the data. This reduction leads to fewer trainable parameters, which in turn helps prevent overfitting during model training. Pooling operations, such as max pooling, extract the most significant values from regions within the feature maps, minimizing redundant information while ensuring that the sliding windows do not overlap. In the fully connected layer, all neurons are interconnected, allowing the network to perform classification based on the extracted features. The ReLU layer enhances the network's ability to model nonlinear relationships. This activation function introduces nonlinearity, aiding in better function approximation during training, though its direct impact on final results may not always be highly pronounced. A notable example of CNN application is the Fully Convolutional Network (FCN) introduced by the University of Freiburg in 2015. Their image segmentation method demonstrated that, despite training with a limited dataset, the approach could still achieve highly precise segmentation results [18; 19]. The selection of the U-Net architecture is motivated by the following considerations:  
1. U-Net exhibits strong generative capabilities, allowing it to achieve favorable training outcomes even with limited training data. 2. To address the strong correlation between input and output features, skip connections are introduced to directly link corresponding layers. This technique helps alleviate the vanishing gradient problem commonly encountered during network training. 3. The down-sampling shrinking network in U-Net enhances receptive field coverage, thereby improving the accuracy of pixel-wise predictions. 4. Batch normalization layers accelerate training by stabilizing gradient updates and reducing sensitivity to parameter initialization, leading to improved network performance. 5. As established in [20], under the TM configuration, the reconstruction of \(\varepsilon_{1\text{z}}\) is feasible when the incident field consists solely of the \(\text{E}_{1\text{z}}^{\text{i}}\) component. In contrast, the TE case involves incident fields \(\text{E}_{1\text{x}}^{\text{i}}\) and \(\text{E}_{1\text{y}}^{\text{i}}\). For uniaxial objects, where \(\varepsilon_{1\text{x}}\) and \(\varepsilon_{1\text{y}}\) are equal, these components can be individually recovered, provided that their corresponding incident fields are sufficiently strong to excite the desired responses. This section provides a detailed explanation of the GAN architecture shown in Figure 2. We begin by generating an initial estimate of the image, denoted as \(\varepsilon_{1}\). This estimated image \(\varepsilon_{1}\) is then fed into the generator to produce the output image \(G_{\theta}(\varepsilon_{1})\). Subsequently, the discriminator evaluates the difference between the real image \(Y\) and the generated image \(G_{\theta}(\varepsilon_{1})\), which is used to compute the loss function. Here, \(\theta\) represents the unknown parameters in the generative network.