# Transmission Removal from a Single Glass Scene and Its Application in Photographer Identification
## 3 Proposed Method
### Loss Function
#### 3.3.3 Patch-Level Loss  
Exclusion Loss  
The most significant characteristic of a mixture image is that the intensity of the two images on the gradient is not the same. The critical observation in [10] is that the edges of the transmission and the reflection layers are unlikely to overlap. The dominance of the transmission layer in the mixture image means that its edges will also dominate the gradient. Edge information is critical in guiding transmission removal. In the beginning, the matrix evaluates the gradient can be calculated as  
\[\Psi_{z}(\mathbf{B},\hat{f}(\mathbf{R}))=\tanh\!\left(\frac{ \partial\mathbf{B}}{\partial z}\right)\otimes\tanh\!\left(\lambda_{z}\frac{ \partial f(\mathbf{R})}{\partial z}\right), \tag{7}\] \[z=H\;\text{or}\;V,\]  
where \(H\) and \(V\) stand for the horizontal and vertical directions, respectively, \(\lambda_{z}=\frac{\mathbb{E}[\partial\mathbf{B}/\partial z]}{\mathbb{E}[ \partial f(\mathbf{R})/\partial z]}\), \(z=H\;\text{or}\;V\), are two normalization factors in the horizontal and vertical directions, respectively, which are designed to balance \(\mathbf{B}\) and \(\hat{f}(\mathbf{R}),\otimes\) denotes the element-wise multiplication operation. Then, we calculate the exclusion loss to distinguish the transmission and the estimated reflection at the pixel level can be represented as  
\[L_{\mathrm{excl}}(\mathbf{B},\hat{f}(\mathbf{R}))=\frac{1}{T+1} \sum_{z}\sum_{t}\!\left\|\Psi_{z}\Big{(}\mathbf{B}_{t},\hat{f}(\mathbf{R})_{t }\Big{)}\right\|_{F}, \tag{8}\] \[t=0,1,\ldots,T,z=H\;\text{or}\;V,\]  
Figure 3: Comparison of original GAN and PatchGAN. where \(\|\mathbf{A}\|_{F}\) represents the Frobenius norm of matrix \(\mathbf{A}\) and determined by the square root of the sum of the absolute squares of its elements, i.e., \(\|\mathbf{A}\|_{F}=\sqrt{\sum a_{m,n}^{2}}\), where \(a_{m,n}\) represents the element of \(\mathbf{A}\), \(T\) reperesents the times of image downsampling, which is set as 2 in our experiments, and subscript \(t\) represents the corresponding resized image. It is not enough to rely on the adversarial loss of the GAN network to constrain the style of the predicted image; this adversarial loss only grabs the style on the global image. We expect the estimated image to be visually close to the ground truth. In the previous methods [11; 12], pixel-level \(L_{1}\) and \(L_{2}\) losses were used as the loss function to constrain the global information of the generated image and the ground truth. However, this will result in some local information loss, so the estimated images are often blurry and dim. The style feature maps can be extracted by constructing a Gram matrix [37], which takes advantage of the correlated feature map between the generated image and the target image to match in a manner. As mentioned in [10], there is color attenuation in the generated image. In contrast to restoring content using only pixel-level constraints, restoring style requires both global and local information and should be close to the ground truth. This makes it more challenging to preserve style than content. Some DL-based image style transfer methods can be used to obtain better visual quality in style on the generated results [37; 38; 39]. In our method, we use the style loss to consider the relevance of style; thus, the non-aligned color feature can help achieve the task of style transfer while preserving the ground truth. In detail, the style representation of images can be extracted by observing the activation of feature maps in the VGG19 network, as shown in Figure 4, and using the spatial correlation of their values. First, the dimensional reduction is carried out for the features, and the feature map of \(\mathbf{X}\) at layer \(l\) is denoted as \(F^{l}(\mathbf{X})\) with the size of \(H_{l}\times W_{l}\times C_{l}\), where \(C_{l}\) represents the number of channels in the feature map and the size of each channel is \(H_{l}\times W_{l}\).