## 3 Methods
### Dual Contrastive Translation Network
#### 3.2.1 Generator  
Considering the existence of domain gaps between different domains, we use different embeddings (\(H_{X}\) and \(H_{Y}\)) to extract features of image \(X\) and image \(Y\) to capture variability in both two image domains. The generator module consists of \(G^{x-y}\) and \(G^{y-x}\) in translation networks TP and TR. Generator \(G^{x-y}\) and generator \(G^{y-x}\) use the same structure but represent translation in different directions, where \(G^{x-y}\) enables the mapping \(X\to Y\) and \(G^{y-x}\) enables the mapping \(Y\to X\). The generator \(G^{x-y}\) and generator \(G^{y-x}\) are both composed of the encoder, the decoder, nine residual blocks, and the multiscale feature fusion (MFF) module.  
We randomly select the query sample, the positive sample, and the negative samples from the input image pairs at each time, which are represented by the green, purple, and orange image patches in Figure 3, respectively. We map the query, positive, and N negative samples into \(K\)-dimensional vectors with two-layer MLP, denoted as \(g\), \(g^{+}\in\mathbb{R}^{K}\) and  
Figure 3: Structure of translation network TP.  
\(g^{-}\in\mathbb{R}^{N\times K}\). The distance between the computing query, positive, and negative samples is translated into a classification problem with \(N+1\) classes. The loss is defined as  
\[\ell(g,g^{+},g^{-})=-log\Bigg{[}\frac{exp(sim(g,g^{+})/\tau}{exp(sim(g,g^{+})/ \tau+\sum_{n=1}^{N}exp(sim(g,g_{n}^{-})/\tau}\Bigg{]} \tag{4}\]  
where \(sim(r,s)=r^{T}s/||r||||s||\) represents the cosine similarity. We set the value of \(\tau\) to 0.07.  
We use \(G_{enc}^{x\to y}\) to extract the L-layer features of the generator \(G^{x\to y}\) and employ \(H_{X}\) to map the image patches to a stack of features \(\{z_{l}\}_{L}=\left\{H_{Xl}(G_{enc}^{x\to y}l(X))\right\}_{L}\), where \(G_{enc}^{x\to y}l(X)\) represents the output of the selected \(l\)-layer, \(l\in 1,2,3,...,L\), and \(H_{X}\) is a two-layer MLP. For the transformed images \(Y^{{}^{\prime}}\), a two-layer MLP \(H_{Y}\) is used to extract features from domain Y. Likewise, we obtain another stack of features \(\hat{z}_{l}=\left\{H_{Yl}(G_{enc}^{y\to x}_{enc}l(TP(X)))\right\}_{L}\). For the mapping direction of \(Y\to X\), \(\{m_{l}\}_{L}=\left\{H_{Yl}(G_{enc}^{y\to x}_{enc}l(Y))\right\}_{L}\) and \(\hat{m_{l}}=\left\{H_{Xl}(G_{enc}^{x\to y}(TR(Y)))\right\}_{L}\), where \(m_{l}\) and \(\hat{m_{l}}\) represent the stack of features.  
**MFF module.** Compared with the original generator structure of DCL-GAN [32], the DT-GAN can capture local and global features by aggregating the spatial information of early feature maps. The structure of the MFF module is shown in Figure 3. MFF is employed to establish connections between the feature maps obtained during the downsampling path and the corresponding feature maps in the upsampling path. The MFF module is composed of two residual units, the separable convolution layer (SC), the convolution layer, the BatchNorm layer(BN), the Leaky-ReLU layer(LReLU), and the skip connection. The convolution layer kernel is 3 \(\times\) 3. The structure is formulated as  
\[z_{i}=LReLU(BN(Conv2D(LReLU(BN(SC(x_{i})))+x_{i})))+x_{i} \tag{5}\]  
where \(x_{i}\) and \(z_{i}\) represent input and output feature maps.