# Method for Recognition of Communication Interference Signals under Small-Sample Conditions
## 3 Data Enhancement Network
### The Generative Model WDCGAN-SA
The input to the discriminator consists of mixed images from the generator's output and real images. After symmetric convolutional feature extraction relative to the generator, the output is a \(512\times 4\times 4\) feature tensor. This tensor is reshaped into a one-dimensional feature vector, which is then fed into a fully connected layer to produce an output of 1 or 0, used to determine whether the image is a real or generated sample. Attention modules are placed in the same positions as in the generator to ensure that the discriminator can also capture the global feature information of the input images. The activation function used is the Leaky Rectified Linear Unit (LReLU) to address the issue of 'dead zones' in activation functions and to mitigate the problem of vanishing gradients. Traditional DCGAN network training strategies typically involve alternating training between the generator and discriminator. In the early stages of this approach, the competition between the generator and discriminator can lead to the model falling into local optima or experiencing training oscillations. Additionally, under this strategy, the discriminator is not trained sufficiently often, hindering its ability to fully learn the distribution characteristics of the data, making it difficult to differentiate between real and generated samples. Consequently, the training strategy is modified to involve multiple training cycles for the discriminator for every single cycle of the generator. This frequent training of the discriminator not only enhances its ability to distinguish between real and generated samples but also provides timely guidance to the generator to produce samples that more closely resemble real data. The model training is complete when the generator and discriminator are trained against each other until convergence. The proposed algorithm is depicted in Algorithm 1. ```
1. Input: Random noise \(z\) of dimensions \(100\times 1\times 1\); real sample time-frequency plots \(x\); number of discriminator iterations \(\mathfrak{m}=4\); coefficient for the gradient penalty term. 2. Output: Generated sample time-frequency plots \(\widetilde{\mathbf{x}}\). 3. Initialize weight parameters: \(\theta_{d}\) for the discriminator, \(\theta_{g}\) for the generator. 4. For epoch do:
5. For 1:m do:
6. Clear gradients;
7. The generator accepts random noise \(z\) as input and produces a minibatch of generated images \(\widetilde{\mathbf{x}}\);
8. d_loss_real \(=-E_{\mathbf{x}\sim P_{z}}[D(\mathbf{x})]\);
9. d_loss_fake \(=E_{\widetilde{\mathbf{x}}\sim P_{z}}[E(\widetilde{\mathbf{x}})]\);
10. Random interpolation sampling: \(\hat{\mathbf{x}}=\epsilon\mathbf{x}+(1-\epsilon)\widetilde{\mathbf{x}}\), \(\epsilon\sim Uniform[0,1]\);
11. gradient_penalty \(=\lambda\times\underset{\widetilde{\mathbf{x}}\sim P_{z}}{E}\big{(}(\| \
abla_{\widetilde{\mathbf{x}}}\widetilde{D}(\widetilde{\mathbf{x}})\|_{2}-1) ^{2}\big{)}\);
12. d_loss \(=-E_{\mathbf{x}\sim P_{z}}[D(\mathbf{x})]+E_{\widetilde{\mathbf{x}}\sim P_{ z}}[D(\tilde{\mathbf{x}})]+\lambda\times\underset{\widetilde{\mathbf{x}}\sim P_{ z}}{E}\big{(}(\|\
abla_{\widetilde{\mathbf{x}}}D(\widetilde{\mathbf{x}})\|_{2}-1) ^{2}\big{)}\);
13. d_loss backpropagation;
14. d_optimizer update model parameters;
15. end for
16. Clear gradients;
17. Generator \(G\) randomly generates a minibatch of images \(\widetilde{\mathbf{x}}\);
18. Calculate g_loss \(=-E_{\widetilde{\mathbf{x}}\sim P_{z}}[D(\widetilde{\mathbf{x}})]\);
19. g_loss backpropagation;
20. g_optimizer update model parameters;
21. End for
```  
**Algorithm 1**WDCGAN-SA data enhancement algorithm  
Figure 4: Self-Attention Embedded Generative Model WDCGAN-SA.