## 3 Method
### Network Architecture  
In this section, a generative adversarial network is designed to process log-mel spectrograms, primarily composed of a generator, a discriminator and an extra encoder. As Figure 4 shows, the generator's structure can be further divided into an encoder \(E_{1}\) and a decoder \(D_{1}\), whose objective is to map the input log-mel spectrogram \(X\) to a latent representation \(Z\) and then decode it back into a reconstructed log-mel spectrogram \(\hat{X}\). The discriminator \(\mathcal{D}(\cdot)\) is used to distinguish between real and fake log-mel spectrograms. The encoder \(E_{1}\) of the generator consists of three convolution blocks (ConvBlocks) and a parallel attention block (PA). The input log-mel spectrogram \(X\) first undergoes progressive feature extraction and downsampling via ConvBlock1, ConvBlock2, and ConvBlock3. Each convolutional block includes a convolution layer, a batch normalization layer, and a LeakyReLU activation layer to learn the spatial features of the data. Subsequently, the data enters the parallel attention block (PA), which enhances the model's focus on important features through an attention mechanism, improving the robustness and distinctiveness of the feature representation. After processing by the encoder, the features are compressed into a latent representation \(Z\), whose dimensionality is usually much lower than that of  
Figure 4: The architecture of network. the original input data but retains its key feature information. The decoder \(D_{1}\) conducts an inverse structure compared to the encoder, consisting of a parallel attention block (PA) and three transposed convolutional blocks (CTB3, CTB2, CTB1). The latent representation \(Z\) first passes through the parallel attention block (PA) to further enhance feature expressiveness. The data then sequentially undergoes CTB3, CTB2, and CTB1, where these transposed convolutional blocks gradually restore the spatial resolution of the data through upsampling while learning feature details via convolutional layers. Finally, the decoder outputs the reconstructed log-mel spectrogram \(\hat{X}\), whose dimensions and structure should be the same as input \(X\). Additionally, there is an extra encoder \(E_{2}\) in the network, which encodes the reconstructed log-mel spectrogram \(\hat{X}\) to obtain another estimated latent representation \(\hat{Z}\). The structure of this encoder \(E_{2}\) is similar to that of \(E_{1}\), also consisting of multiple convolutional blocks and a parallel attention block. The discriminator \(\mathcal{D}(\cdot)\) has a structure similar to the DCGAN's [24]. Its objective is to classify the \(X\) and the \(\hat{X}\) as real or fake, respectively. Formally, the encoder \(E_{1}\) of the generator can be expressed by  
\[Z=E_{1}(X), \tag{13}\]  
where \(X\) is the input log-mel spectrogram and \(Z\) is the latent representation. The decoder \(D_{1}\) process is  
\[\hat{X}=D_{1}(Z), \tag{14}\]  
where \(\hat{X}\) is the reconstructed log-mel spectrogram. Similarly, encoder \(E_{2}\) encodes the reconstructed log-mel spectrogram \(\hat{X}\) to produce the following:  
\[\hat{Z}=E_{2}(\hat{X}), \tag{15}\]  
where \(\hat{Z}\) is the latent representation of the reconstructed data. The output of the discriminator \(\mathcal{D}(\cdot)\) can be represented as 1 or 0. Table 1 illustrates the details of our network, where we only list the encoder due to the limited space, as the decoder's configuration is the inverse version of the encoder. The overall training objective of the network is to optimize the loss functions of the generator and the discriminator. The generator aims to minimize the reconstruction error and the discriminator's misjudgment probability for generated data, while the discriminator aims to maximize the correct classification probability for real and fake data. Additionally, encoder E2's aim is to generate the correct latent representation from reconstructed log-mel spectrogram. By training the whole network on the normal audio data, it can learn to