## 3 Depthwise Separable Convolution Super-Resolution Generative Adversarial Network
### Frequency Energy Similarity Loss Function  
In order to make the super-resolution image \(I^{SR}\) generated by the generator network, closer to the high-resolution image \(I^{HR}\), the loss function that best reflects the similarity between \(I^{SR}\) and \(I^{HR}\) is important. By optimizing the loss function, the quality of the image is better. The training process involves minimizing the loss function. The traditional loss function aims to reduce the mean squared error. \(I^{SR}\) and \(I^{HR}\) have their own characteristics as two-dimensional discrete signals, so this paper proposes a frequency energy similarity loss function. First, a fast Fourier transform (FFT) is used to convert between the frequency domain and the time domain. The FFT can be used to quickly convert the image from the time domain to the frequency domain (DFT). The traditional DFT is shown in Equation (10) in which \(x(n)\) is an analog signal, \(X(k)\) is the result of \(x(n)\) after DFT, and \(N\) is the length of signal samples:  
\[X(k)=\sum_{n=0}^{N-1}x(n)W_{N}^{kn},k=0,1...N-1,W_{N}=e^{-j\frac{2}{N}}, \tag{10}\]  
since the frequency domain does not take time into account. For example, there are two different signals about time \(t\), \(f_{1}(t)\), and \(f_{2}(t)\), where \(f_{2}(t)\) is the signal from \(f_{1}(t)\) which is delayed for some time \(\Delta t\), as shown in Equation (11):  
\[\begin{array}{c}f_{1}(t)=cos(2\pi t),\\ f_{2}(t)=cos[2\pi(t+\Delta t)].\end{array} \tag{11}\]  
Obviously, they have different magnitudes at the same time. However, the result of the Fourier transform is the same, and there is an error in directly using the result as a clue of signal similarity. As shown in Equation (12):  
\[\text{\emph{FFT}}\left[f_{1}(t)\right]\!=\!FFT\left[f_{2}(t)\right]. \tag{12}\]The processing of instantaneous local information in the \(f(t)\) is consistent and does not reflect the local characteristics of the signal. Therefore, it is proposed to use the FFT to implement the frequency domain conversion, and then separately calculate the energy corresponding to the two signals \(I^{SR}\) and \(I^{HR}\), and compare the energy as a cosine. The FFT is shown in Equations (13) and (14):  
\[\mathbf{I}_{FFT}^{SR}=FFT\big{(}I^{SR}\big{)}. \tag{13}\]  
\[\mathbf{I}_{FFT}^{HR}=FFT\big{(}I^{HR}\big{)}. \tag{14}\]  
Then it is necessary to further define the frequency energy similarity to compare \(I^{SR}\) and \(I^{HR}\), that is, the result after the fast Fourier transforms: \(\mathbf{I}_{FFT}^{SR}\) and \(\mathbf{I}_{FFT}^{HR}\). Inspired by [PERSON]'s theorem [20], the energy \(I_{E_{ij}}^{SR}\) of the \(I_{FFT}^{SR}\)-frequency component is calculated, and the energy \(I_{E_{ij}}^{HR}\) of the \(\mathbf{I}_{FFT}^{HR}\)-frequency component, cosine similarity. As shown in Equation (15), \(\mathbf{X}_{n\times m}\) and \(\mathbf{Y}_{n\times m}\) are matrix vectors whose dimensions are \(n\times m\):  
\[cos_{sim}(\mathbf{X},\mathbf{Y})=\frac{\mathbf{X}\cdot\mathbf{Y}}{\|\mathbf{X}\|.\|\mathbf{Y}\|}. \tag{15}\]  
The \(I^{SR}\) frequency-domain energy is \(\mathbf{I}_{E}^{SR}\), the \(I^{HR}\) frequency domain energy is \(\mathbf{I}_{E}^{HR}\), and the results are substituted into \(cos_{sim}\), as shown in Equation (16):  
\[F_{sim}\Big{(}\mathbf{I}_{E}^{SR},\mathbf{I}_{E}^{HR}\Big{)}=\frac{\mathbf{I}_{E}^{SR} \cdot\mathbf{I}_{E}^{HR}}{\|\mathbf{I}_{E}^{SR}\|.\|\mathbf{I}_{E}^{HR}\|}. \tag{16}\]  
The generator loss function of SRGAN and WGAN includes content loss and adversarial loss. The generator loss function of DSCSRGAN is shown in Equation (17):  
\[I^{SR}=\mathbf{I}_{X}^{SR}+\lambda I_{Gen}^{SR}+\mu F_{sim}\Big{(}\mathbf{I}_{E}^{SR}, \mathbf{I}_{E}^{HR}\Big{)}. \tag{17}\]  
The experimental results show that the overall visual effect of the super-resolution image generated by the generator network was improved by introducing a frequency energy similarity loss function. Image quality problems, including edge blur, image artifact, and texture deficiency, were improved.