The approach consists of three tightly coupled stages. First, we train a diffusion-based visible-to-thermal translation model using a small paired visible–thermal dataset. Second, we apply the trained translation model to large-scale real or synthetic visible face datasets, generating a synthetic thermal counterpart for each visible image and thereby constructing paired visible–synthetic thermal training data. Finally, we fine-tune a face recognition model on this paired data so that visible and thermal samples of the same identity are aligned in the feature space.
Visible-to-Thermal Diffusion Model
We formulate visible-to-thermal translation as an image-editing problem and build on Qwen-Image-Edit, a large-scale editing model based on a Multimodal Diffusion Transformer (MMDiT). The model couples a Qwen2.5-VL multimodal encoder that extracts high-level semantic conditioning with a variational autoencoder (VAE) that provides low-level appearance features, and is trained with a flow-matching objective in the VAE latent space.
Let \( x_0 = \mathcal{E}(I_T) \) denote the latent of the target thermal image and \( x_1 \sim \mathcal{N}(0, I) \) a sampled noise vector. Following the rectified-flow formulation, the intermediate latent and its target velocity are \( x_t = t\,x_0 + (1-t)\,x_1 \) and \( v_t = x_0 - x_1 \). Given the user input \( S \) (a text prompt combined with an image), the multimodal encoder \( \phi \) yields the guidance latent \( h = \phi(S) \), and the transformer \( v_\theta \) is trained with the flow-matching loss
\[
\mathcal{L}_{\mathrm{flow}} = \frac{1}{B} \sum_{i=1}^{B}
\bigl\lVert\, v_\theta\!\left(x_t^{i}, t_i, h_i\right) - \left(x_0^{i} - x_1^{i}\right) \bigr\rVert_2^2 .
\]
Low-Rank Adaptation. Fully fine-tuning a 20B-parameter editing model on a small paired dataset is prone to overfitting, so we adapt it with LoRA. Trainable low-rank updates are inserted into the attention projections and the MLP and modulation layers of both the image and text streams of the MMDiT, while the VAE and the Qwen2.5-VL encoder remain frozen.
Identity preservation. We add a proxy identity loss computed within the thermal modality: at low-noise timesteps the predicted clean thermal image is decoded through the VAE and compared with the ground-truth thermal image of the same subject in the feature space of a frozen EdgeFace-Base model,
\[
\mathcal{L}_{\mathrm{id}} = 1 - \frac{f(\hat{I}_{T})^{\top} f(I_{T})}{\left\| f(\hat{I}_{T}) \right\|_{2}\left\| f(I_{T}) \right\|_{2}},
\qquad
\mathcal{L} = \mathcal{L}_{\mathrm{flow}} + \lambda_{\mathrm{id}} \mathcal{L}_{\mathrm{id}},
\]
with \( \lambda_{\mathrm{id}} = 0.1 \) in our experiments.
PACT: Preservation-Aware Cross-Spectral Tuning
Rather than training a cross-spectral model from scratch, we start from a lightweight EdgeFace backbone pretrained on a large-scale RGB face dataset and adapt it with PACT, which aligns visible and thermal embeddings while regularizing them towards the pretrained visible-domain representation. Given a paired thermal and visible sample \( (x_i^t, x_i^v, y_i) \), we extract \( \ell_2 \)-normalized embeddings \( \mathbf{z}_i^t \) and \( \mathbf{z}_i^v \), and define the scaled similarity \( s_{ij} = {\mathbf{z}_i^t}^{\top}\mathbf{z}_j^v / \tau \).
For each anchor \( i \), all mini-batch samples sharing its identity, \( \mathcal{P}(i) = \{ j \mid y_j = y_i \} \), are treated as positives. The symmetric, identity-aware, multi-positive InfoNCE loss is the average of the two directional terms:
\[
\mathcal{L}_{t \rightarrow v} = -\frac{1}{B}\sum_{i=1}^{B} \log \frac{\sum_{j\in\mathcal{P}(i)}\exp(s_{ij})}{\sum_{j=1}^{B}\exp(s_{ij})},
\qquad
\mathcal{L}_{v \rightarrow t} = -\frac{1}{B}\sum_{i=1}^{B} \log \frac{\sum_{j\in\mathcal{P}(i)}\exp(s_{ji})}{\sum_{j=1}^{B}\exp(s_{ji})},
\]
\[
\mathcal{L}_{\mathrm{NCE}} = \tfrac{1}{2}\left( \mathcal{L}_{t \rightarrow v} + \mathcal{L}_{v \rightarrow t} \right).
\]
To mitigate catastrophic forgetting, PACT retains a frozen copy of the pretrained model and encourages consistency between the adapted and original visible-image embeddings,
\[
\mathcal{L}_{\mathrm{preserve}} = 1-\frac{1}{B}\sum_{i=1}^{B} \cos\!\left(\mathbf{z}_i^v, \mathbf{z}_{i,\mathrm{teacher}}^v\right),
\]
giving the overall objective
\[
\mathcal{L}_{\mathrm{PACT}} = \lambda_{\mathrm{NCE}}\mathcal{L}_{\mathrm{NCE}} + \lambda_{\mathrm{preserve}}\mathcal{L}_{\mathrm{preserve}}.
\]
Implementation Details
The generator is adapted from Qwen-Image-Edit-2511 with LoRA rank 32 on spatially aligned (visible, thermal) pairs from the training split of the MCXFace VIS–THERMAL protocol, at a resolution of \( 112 \times 112 \), for 20 epochs with a learning rate of \( 1 \times 10^{-4} \) on an NVIDIA H100 GPU. Generation uses 20 denoising steps per image, taking roughly 10 seconds per image. For CFR adaptation, EdgeFace-Base is fine-tuned with AdamW, a learning rate of \( 1 \times 10^{-5} \), batch size 128, and 20 epochs, with \( \lambda_{\mathrm{NCE}} = \lambda_{\mathrm{preserve}} = 1 \) and temperature \( \tau = 0.07 \).