# Data-Decoupled Scattering Imaging Method Based on Autocorrelation Enhancement
## 2 Materials and Methods
### Model and Data Design
#### 2.2.2 Neural Network Model  
To transform speckle autocorrelation images with low signal-to-noise ratios into autocorrelation images with high signal-to-noise ratios, a generative adversarial network (GAN) was chosen as the base model in this paper [29; 30; 31; 32; 33]. GAN produces better output by balancing two modules, that is, the generative model and discriminative model. On the one hand, the generative model adopts the U-Net architecture, which is more suitable for recovery as a general encoder-decoder model, employing similar downsampling and upsampling operations to capture extraction and recovery. Currently, several methods based on the prototype U-Net architecture can achieve the effect of speckle reconstruction and can recover their target objects to varying degrees. In addition, their generative models aim to generate new images that are as similar as possible to the real target image. On the other hand, the goal of the discriminative model is to distinguish the generated image from the real image. As for the network structure details, the feature extraction step uses a 3 \(\times\) 3 size-convolution kernel to generate 512 \(\times\) 512 \(\times\) 64 feature maps from the input data using LeakyRelu as the activation function. Consequently, the input layer outputs 64 feature maps, each of which is 512 \(\times\) 512 pixels. Image recovery is performed using a 3 \(\times\) 3 convolution kernel for the deconvolution operation while adding jump connections in the upsampling and downsampling with respect to ResNet. High-level features from deeper layers are combined with low-level features from shallower layers to better recover the structural details of the image. Owing to limitations in the size of the convolutional kernel, the GAN's generators can only capture relationships in local regions. Traditional convolutional GANs generate high-resolution details and can only be used as a function of local points in low-resolution feature mappings. Consequently, multiple convolutional layers are computationally inefficient in establishing global dependencies. The self-attention mechanism provides a global perceptual domain. It learns the relationship between a pixel point and all other locations, so that the generation of each location no longer depends solely on the other locations in the vicinity. Instead, more distant, and informative locations are introduced, and the features of each location are computed as a weighted sum of all other locations. In this study, we construct a generative adversarial network with a self-attention mechanism to obtain global feature information of the image. This not only better eliminates the effect of background noise but also preserves the details of the image. In addition, the discriminator uses a simple convolutional neural network, where the last layer is the activation layer. The specific network structure is shown in Figure 4.  
Figure 3: A-eGAN algorithm flow: (**a**) ground truth; (**b**) speckle autocorrelation image; (**c**) high signal-to-noise autocorrelation image output by the deep-learning model; and (**d**) reconstruction result of phase recovery. For the self-attentive mechanism shown in module c in Figure 4, the function of this module is to replace the traditional convolutional feature map with a self-attentive feature map. For the feature map output after the convolution layer, the three branches of the \(1\times 1\) convolution structure are \(f(x)\), \(g(x)\), and \(h(x)\), H and W denote the length and width of the feature map, and C represents the number of channels. The output matrix of \(f(x)\) is transposed and multiplied with the output matrix of \(g(x)\) and normalized by SoftMax to obtain the attentional feature map. The attentional feature map is multiplied with the \(h(x)\) output matrix and convolved by \(1\times 1\), and the output is integrated into the self-attentive feature map. The _MSE_ loss function is used in this study.