## 3 Method  
The improved DCGAN Algorithm 1 flow is presented below.  
```
0: Training datasets \(\mathcal{X}\), batch size \(m\), noise dimension \(z_{dim}\), total epochs \(E\), generator \(G\), discriminator \(D\), optimizer \(\theta_{G}\), \(\theta_{D}\)
0: Trained generator \(G^{*}\) and discriminator \(D^{*}\)
1: Initialize weights for \(G\) and \(D\)
2: Set Adam optimizer \(\theta_{G}\) for \(G\) with initial learning rate \(\alpha_{G}\)
3: Set Adam optimizer \(\theta_{D}\) for \(D\) with initial learning rate \(\alpha_{D}\)
4: Define label smoothing parameter \(\epsilon=0.1\)
5: Define learning rate schedulers \(\mathcal{S}_{G}\), \(\mathcal{S}_{D}\)
6:for epoch \(\gets 1\)to\(E\)do
7: Shuffle training data and create mini-batches
8:for each mini-batch \(\mathbf{x}\in\mathcal{X}\)do
9:Discriminator Training:
10: Generate noise vectors \(\mathbf{z}_{1},\mathbf{z}_{2}\sim\mathcal{N}(0,1)\)
11: Generate fake images \(\mathbf{\hat{x}}\leftarrow\mathbb{G}(\mathbf{z}_{1})\)
12: Compute real image loss:
13:\(\mathbf{y}_{real}\leftarrow(1-\epsilon)\cdot 1+\epsilon\cdot 0\)\(\triangleright\) Label smoothing
14:\(\mathcal{L}_{real}\leftarrow\) BCEWithLogitsLoss\((D(\mathbf{x}),\mathbf{y}_{real})\)
15: Compute fake image loss:
16:\(\mathbf{y}_{fake}\leftarrow(1-\epsilon)\cdot 0+\epsilon\cdot 1\)\(\triangleright\) Label smoothing
17:\(\mathcal{L}_{fake}\leftarrow\) BCEWithLogitsLoss\((D(\mathbf{\hat{x}}),\mathbf{y}_{fake})\)
18:\(\mathcal{L}_{D}\leftarrow(\mathcal{L}_{real}+\mathcal{L}_{fake})/2\)
19: Backpropagate \(\mathcal{L}_{D}\) and update \(\theta_{D}\)
20: Generator Training:
21: Generate new noise \(\mathbf{z}_{2}\sim\mathcal{N}(0,1)\)
22: Generate refined images \(\mathbf{\hat{x}}_{new}\gets G(\mathbf{z}_{2})\)
23: Compute generator loss:
24:\(\mathcal{L}_{G}\leftarrow\) BCEWithLogitsLoss\((D(\mathbf{\hat{x}}_{new}),\mathbf{y}_{real})\)
25: Backpropagate \(\mathcal{L}_{G}\) and update \(\theta_{G}\)
26: Apply Improvements:
27: Insert self-attention after deconv layers in \(G\)\(\triangleright\) Self-Attention
28: Apply minibatch discrimination before \(D\)'s output \(\triangleright\) Minibatch Discrimination
29: Update learning rate \(\alpha_{G}\leftarrow\mathcal{S}_{G}(\text{epoch})\)
30: Update learning rate \(\alpha_{D}\leftarrow\mathcal{S}_{D}(\text{epoch})\)
31:endfor
32:if epoch \(\mod\) save_interval \(=0\)then
33: Visualize intermediate generated samples
34: Save model checkpoints \(G_{\text{epoch}}\) and \(D_{\text{epoch}}\)
35:endif
36:endfor
```  
**Algorithm 1** Improved DCGAN Algorithm.  
The structure of the improved DCGAN is depicted in Figure 5. Incorporating MD network after the discriminator's final convolutional layer enhances its ability to differentiate between generated samples, mitigates mode collapse, and promotes the diversity of generated samples. Applying SN to each layer of convolution of the discriminator limits the number of spectral paradigms of the weight matrix, reduces the gradient explosion and vanishing problems, and makes the discriminator more accurate and stable in distinguishing between real and generated images. It is worth noting that citing SN does not eliminate the need for BN in the model. SN affects the weight of each layer, while BN affects the activation of each layer. Introducing SAM into the generator helps it better understand the global-local relationship, captures long-range dependencies between different regions in the image, and enables the generator to more accurately learn the structure and content of the image, thus generating more realistic images.