# Removal of Color-Document Image Show-Through Based on Self-Supervised Learning
## 3 Proposed Methods
### Loss Functions  
In the CycleGAN network, this paper utilizes multiple loss functions to train the network; these aim to capture different objectives between the generator and discriminator. (1) Adversarial loss \(\mathcal{L}_{adv}\)  
Adversarial loss was used for adversarial learning between the generator and discriminator. The goal of the generator is to generate realistic fake images that the discriminator cannot distinguish from real images. On the other hand, the goal of the discriminator is to precisely differentiate between real and fake images. For the generators \(Re\) and \(S\) and the discriminator \(D_{show-through}\), the adversarial loss for generating show-through images can be defined as shown in Equation (3). This loss encourages the generator to generate images that are more similar to the real images, while the discriminator aims to distinguish between the generated show-through images and real images that have not been subjected to show-through removal. \[ \begin{split}&\mathcal{L}_{re-adv}\big{(}Re,S,D_{show-through},Y,X \big{)}\\ &=\mathbb{E}_{X\sim p_{show-through}(X)}\big{[}\log D_{show-through }(X)\big{]}\\ &+\mathbb{E}_{Y\sim p_{non-show-through}(Y)}\big{[}\log(1-D_{ show-through}(Re(Y)))\big{]}\\ &+\mathbb{E}_{Y\sim p_{non-show-through}(Y)}\big{[}\log(1-D_{ show-through}(S(Re(Y))))\big{]}\end{split}  \tag{3}\]  
In the equation, \(Re\) represents the show-through-generation network, \(S(De)\) represents the similarity-guided show-through-generation network, and \(D_{show-through}\) aims to distinguish between the generated bleeding images \(Re(Y)\) and the real bleeding images \(X\). Similarly, the adversarial loss for images that have not been subjected to show-through removal is defined as shown in Equation (4). This loss encourages the generator to generate images that are more similar to the real non-show-through images, while the discriminator aims to differentiate between the generated non-show-through-removal images and the input non-show-through images. Figure 9: The network architecture of discriminator \(D\). \[ \begin{array}{l}\mathcal{L}_{de-adv}\left(De,S,D_{non-show-through},X,Y\right)\\ =\mathbb{E}_{Y\sim P_{non-show-through}(Y)}\left[\log D_{non-show-through}(Y) \right]\\ +\mathbb{E}_{X\sim P_{show-through}(X)}\left[\log(1-D_{non-show-through}(De(X))) \right]\\ +\mathbb{E}_{X\sim P_{show-through}(X)}\left[\log(1-D_{non-show-through}(S(De(X))) )\right]\end{array}  \tag{4}\]  
In the aforementioned equations, \(De\), \(S\), and \(Re\) minimize the target values, while the discriminators \(D_{show-through}\) and \(D_{non-show-through}\) attempt to maximize them. However, when using the adversarial loss is used, some artifacts may appear in the generated results. 1. Cycle consistency loss \(\mathcal{L}_{cycle}\)  
To better correct the bleeding images and preserve more details, we introduced a cycle consistency loss [6] function for show-through images. The goal of this function is to minimize the difference between the show-through image \(X\) and its reconstructed bleeding images \(Re(De(X))\) and \(Re(S(De(X)))\), as well as the difference between the non-show-through image \(Y\) and its reconstructed non-show-through images \(De(Re(Y))\) and \(De(S(Re(X)))\) (as illustrated in Figures 1 and 2). Through this loss function, the consistency of the images can be maintained after they have been transformed in both directions. That is, an image that has been transformed into a show-through image should be able to be restored back to the original domain. This loss function helps to reduce information loss and maintain the content of the images. The cycle consistency loss from domain \(X\) to domain \(Y\) is defined as follows:  
\[ \begin{array}{l}\mathcal{L}_{cycle\_de}(De,S,Re)\\ =\mathbb{E}_{X\sim P_{show-through}(X)}\left[\left|\left|Re(De(X))-X\right| \right|_{1}\right]\\ +\mathbb{E}_{X\sim P_{show-through}(X)}\left[\left|\left|Re(S(De(X)))-X\right| \right|_{1}\right]\end{array}