## 3 Gas Turbine Rotor System Fault Diagnosis Method Based on Improved DCGAN
### Loss Function Optimization Based on Gradient Penalty  
In the process of Generative Adversarial Network training, the loss function is the key to the quality of network learning. If the loss function is incorrect, it will lead to training instability and even exploding gradient problems, and difficulty to train the correct model. The loss function in GAN is used still in DCGAN continuously. Based on DCGAN, an improved method with a gradient penalty is adopted in the proposed method, in which the original loss function in GAN is abandoned and an additional gradient penalty is added to the loss function of the discriminator to solve the vanishing gradient problem and the exploding gradient problem in training. The sparse gradient penalty algorithm is used as the loss function in the process of model training, the negative gradient direction is used as the search direction, and the minimum value is solved along the gradient descent direction, so as to approach the minimum deviation in a recursive way. In the training process, after each forward propagation, the real values of loss value and output value will be obtained. The smaller the loss value, the better the model. Firstly, the samples \(x_{r}\) and \(x_{g}\) are obtained in the real sample space \(P_{r}\) and the generated sample space \(P_{g}\), respectively, and then \(\hat{x}\) is obtained by random interpolation between the real sample \(x_{r}\) and the generated sample \(x_{g}\), as shown in Equations (7) and (8):  
\[x_{r}\sim P_{r},x_{g}\sim P_{g},\varepsilon\sim U[0,1] \tag{7}\]  
\[\hat{x}=\varepsilon x_{r}+(1\ -\ \varepsilon)x_{g} \tag{8}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Model**} & **Network Layer** & \multirow{2}{*}{**Kernel Size**} & **Activation Function** & **Kernel Number** \\ \hline Generator & Conv1 & 32 & 8 & ReLU & 20 \\  & Conv2 & 3 & 1 & ReLU & 20 \\  & Conv3 & 3 & 1 & ReLU & 40 \\  & Conv4 & 3 & 1 & ReLU & 40 \\  & Deconv1 & 3 & 1 & ReLU & 128 \\  & Deconv2 & 3 & 2 & ReLU & 64 \\  & Deconv3 & 3 & 2 & ReLU & 32 \\  & Deconv4 & 3 & 2 & Tanh & 1 \\ Discriminator & Conv1 & 3 & 2 & LeakReLU & 32 \\  & Conv2 & 3 & 2 & LeakReLU & 64 \\  & Conv3 & 3 & 2 & LeakReLU & 128 \\  & Conv4 & 3 & 2 & LeakReLU & 256 \\  & Conv5 & 2 & 1 & & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Structure parameters and hyper-parameters of Improved DCGAN. where \(\varepsilon\) represents the random sampling of the samples. According to the joint space sampling \(\hat{x}\), the discriminator output \(D(\hat{x})\) is made, and then the joint derivation is carried out. \[grad=\sum_{i=1}^{N}\frac{\partial D(\hat{x})}{\partial\hat{x}} \tag{9}\]  
where \(i\) represents the number of batch size samples. Equation (9) is used for the square difference processing to the joint derivative \(grad\). In order to adapt to the sample characteristics, the joint space sample loss function \(loss_{eps}\) is finally obtained after the square difference. The gradient penalty term is shown in Equation (10):  
\[GP=E_{x\sim\varepsilon}[(\parallel\
abla_{x}D(x)\parallel_{2}-1)^{2}] \tag{10}\]  
where \(\
abla_{x}D(x)\) represents the gradient of the discriminator output value in the X direction; \(E_{x\sim\hat{x}}\) represents the mathematical expectation when the input of the discriminator is a random interpolation. \[loss_{eps}=\lambda\times\frac{1}{N}\sum_{i=1}^{N_{grad}}\left(\text{Rel}u(( \sum_{i=1}^{N}\left(grad^{2}\right)_{i})^{\frac{1}{2}}-1)\right) \tag{11}\]  
where \(N_{grad}\) represents the row number of the matrix _grad_; \(\lambda\) represents the gradient penalty parameter. The original loss function of the discriminator is shown in Equation (12):  
\[D_{original}=E_{x\sim P_{g}}[D(x)]-E_{x\sim P_{g}}[D(x)] \tag{12}\]  
where \(E_{x\sim P_{g}}[D(x)]\) represents the mathematical expectation when the inputs of discriminator are generated samples; \(E_{x\sim P_{g}}[D(x)]\) represents the mathematical expectation when the inputs of the discriminator are real samples.