# Wasserstein Generative Adversarial Network Based De-Blurring Using Perceptual Similarity
## 3 Proposed Algorithm
### Total Loss Function of Network  
The objective of the proposed method is to generate de-blurring image from the blurred image, \(I_{\text{B}}\), by extracting the perceptual style information from the sharp image, \(I_{\text{S}}\). The network learns the similarity of the sharp image, and it reconstructs the de-blurred image from the blurred image by using micro-edge information and perceptual similarity. The similarity can be improved by minimizing the difference of distribution between \(I_{\text{S}}\) and \(I_{\text{B}}\). As a result, well-trained generator, component of network, generates output image that include edge information.  
To train the network, a discriminator and generator are alternately learned by blurred and sharp images. The learning direction of the discriminator in the WGAN-GP is decided to find the optimal solution by minimizing the Wasserstein distance between joint distributions of the generated and sharp images. The loss function of the discriminator is as follows:  
\[\mathcal{L}_{\text{D}}=\ \sum_{n=1}^{N}[L(I_{\text{s}})-L(G_{\theta}(I_{\text{B}}) )\ +\ \lambda\Big{(}\big{\|}\text{VL}(eI_{\text{S}}+(1-\epsilon)G_{\theta}(I_{ \text{B}}))\big{\|}_{2}-1\Big{)}^{2}], \tag{11}\]  
where \(L\) is a differentiable function, which is 1-Lipschitz only if it has gradients with norm at most 1 everywhere. \(G\) and \(\epsilon\) are generator and random number U[0,1], respectively, and \(\lambda\) is the gradient penalty coefficient set to 10. The gradient penalty term penalizes the network if the gradient norm moves away from its target norm value 1.  
The discriminator is trained first, along with the training of a generator, to generate the de-blurring image. To make generator reconstruct images with perceptual style, the total objective function is obtained by the combination of generator loss function and style loss as shown in Equation (12):  
\[\mathcal{L}=\ \mathcal{L}_{\text{G}}+\ \lambda\cdot\mathcal{L}_{style}, \tag{12}\]  
where \(\mathcal{L}_{\text{G}}\) is generator loss function of WGAN-GP, and \(\mathcal{L}_{style}\) is style loss function to capture the perceptual style from sharp image. Also, \(\lambda\) is a constant value of weight parameter that determines how much perceptual style should be adapted. In more detail, \(\mathcal{L}_{\text{G}}\) is calculated by WGAN-GP method.  
\[\mathcal{L}_{\text{G}}=\ \sum_{n=1}^{N}-L(G_{\theta}(I_{\text{B}})), \tag{13}\]  
Figure 11: Generated image using low-level feature.  
where \(L\) is the critic function as mentioned above and \(G\) is the generator. Moreover, \(\theta\) is parameter of the network which minimizes loss function:  
\[\mathcal{L}_{style}\ =\ \sum_{m=1}^{M}\ \frac{1}{C_{j}H_{j}W_{j}}\Big{\|}G_{j}^{ \varnothing}\ (G_{\theta}(I_{B}))-G_{j}^{\varnothing}(I_{S})\Big{\|}_{\text{F}}^{2}, \tag{14}\]  
where \(M\) is the number of feature map which is extracted from VGG16. Proposed method uses five feature maps of high layer in VGG16. Using fewer feature maps cannot express perceptual style, and if more feature maps are used, more calculation and lot of training time are needed. In summary, a novel combined loss function consisting of WGAN-GP and style loss function is proposed to reconstruct edge preserved de-blurring image with perceptual style.