2.4.1. Reconstruction loss

Based on the reversibility of the encoder and decoder, an objective function that enables the cycle consistency of image and feature coding is constructed. The use of cross-domain reconstruction consistency constrains the spatial diversity of the encoding and decoding between multiple domains, and it stabilizes spectral-domain translation results. Previous studies have found adding reconstruction loss with L1 loss is conducive to reducing the probability of model collapse [13,29].

### 1. Within domain reconstruction loss

Given an image sampled from the data distribution, its spectral image and latent code after encoding and decoding can be reconstructed, and the within-domain reconstruction loss can be defined as:

$$L\_{\text{macro}}^{x\_{i}} = \lambda\_{1} \mathbb{E}\_{\mathbf{x}\_{i}, r \sim p(\mathbf{x}\_{i}, r)}[\|G\_{i}(E\_{i}(\mathbf{x}\_{i}, r)) - \mathbf{x}\_{i}\|\_{1}] + \lambda\_{\text{E}} \mathbb{E}\_{\mathbf{x}\_{i}, r \sim p(\mathbf{x}\_{i}, r)}[\|E\_{i}(G\_{i}(E\_{i}(\mathbf{x}\_{i}, r))) - E\_{i}(\mathbf{x}\_{i}, r)\|\_{1}] \tag{1}$$

where *λ*I and *λ*E are the weights that control the importance of image reconstruction term and latent code reconstruction term, respectively.

2. Cross domain reconstruction loss

Given two spectra domain images sampled from the joint data distribution, their spectral images after exchanging encoding and decoding can be reconstructed, and its cross domain reconstruction loss can be defined as:

$$\mathbf{L}\_{\mathbf{Recon}}^{\mathbf{x}\_{i},\mathbf{x}\_{j}} = \mathbb{E}\_{\mathbf{x}\_{i}\mathbf{x}\_{j}r \sim p(\mathbf{x}\_{i}\mathbf{x}\_{j}r)} \left[ \left\| G\_{i}(\mathbf{E}\_{j}(\mathbf{x}\_{j},r)) - \mathbf{x}\_{i} \right\|\_{1} \right] + \mathbb{E}\_{\mathbf{x}\_{i}\mathbf{x}\_{j}r \sim p(\mathbf{x}\_{i}\mathbf{x}\_{j}r)} \left[ \left\| G\_{j}(\mathbf{E}\_{i}(\mathbf{x}\_{i},r)) - \mathbf{x}\_{j} \right\|\_{1} \right] \tag{2}$$

$$L\_{\text{Reccon}} = \lambda\_{\text{within}} \sum\_{i=1}^{N} L\_{\text{Reccon}}^{x\_i} + \lambda\_{\text{cross}} \sum\_{i=1}^{N} \sum\_{j=i+1}^{N} L\_{\text{Reccon}}^{x\_i, x\_j} \tag{3}$$

where *L*Recon is the sum of the multi-domain reconstruction loss; *λ*within and *λ*cross are weights that control the importance of the within-domain reconstruction term and crossdomain reconstruction term, respectively.
