Manuscript Offprint
arXiv:2609.31378ContraFM-S2O: Flow Matching-Based One-step SAR-to-Optical Image Translation Model with Contrastive Learning
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
In recent years, diffusion models and GAN-based models have become the mainstream approaches for SAR-to-optical image translation, owing to their advantages, such as high-quality generation and stable training. However, they have shortcomings such as high inference latency and the generated optical images suffer from low detail fidelity, often resulting in blurred edges and loss of fine textures. Thus, we propose ContraFM-S2O, which is a flow matching-based model for SAR-to-optical image translation. Unlike conventional diffusion models, ContraFM-S2O learns to predict the velocity field in training and solves ODE instead of SDE during inference to improve the sampling efficiency. In addition, ContraFM-S2O replaces instantaneous velocity with average velocity along the interpolation path to realize one-step SAR-to-optical image translation and uses contrastive learning to improve the quality of the generated optical images. Experiments show our model achieves state-of-the-art on SAR2Opt and QXS datasets, outperforming baselines, and reduces inference latency via one-step generation.
Index Terms— SAR-to-optical, Image Translation, Flow-Matching, Average Velocity, Contrastive Learning
1. INTRODUCTION
SAR-to-optical image translation has emerged as a pivotal research area, aiming to leverage the all-weather, day-and-night imaging capabilities of SAR with the high interpretability and rich spectral information of optical sensors [1]. Besides, SAR-to-optical image translation plays a critical role in emergency detection, geological monitoring and others.
GAN-based methods such as Cycle-GAN [2], Pix2Pix [3] and PCGL-GAN [4] could generate high-quality optical images but are prone to mode collapse and the generated optical images often suffer from blurred edges, distorted textures, and color discrepancies. Methods based on diffusion models like S2ODPM [5] and cBBDM [6] could realize stable training and generate optical images with higher detail fidelity, but the inference latency is high, which makes real-time SAR-to-optical image generation challenging. To overcome these questions, we propose ContraFM-S2O, which is capable of one-step SAR-to-optical image generation and could generate optical images with sharp edges and high detail fidelity.
To achieve one-step SAR-to-optical image generation, ContraFM-S2O replaces instantaneous velocity with average velocity, which is defined as the ratio of displacement to a time interval, with displacement given by the time integral of the instantaneous velocity [7]. Besides, to prevent the predicted average velocity fields from overlapping when different SAR images are used as conditional inputs during training, ContraFM-S2O employs contrastive learning to distinguish flows conditioned on different SAR images (see Figure 1).
Our experiments validate that ContraFM-S2O could reach the sota performance across baselines and achieve inference acceleration compared to PCGL-GAN (the second-best model). And contrastive learning contributes more to the quality of generated optical images and average velocity contributes more to inference acceleration.
2.1. SAR-to-Optical Image Translation
Recently, SAR-to-optical image translation methods have been broadly divided into those based on generative adversarial networks (GANs) and those based on diffusion models. GAN-based methods such as ICGAN [8] and PCGL-GAN [4], are all implemented based on the discriminator-generator architecture for SAR-to-optical image translation. ICGAN enhances contour sharpness, texture fine-grainedness, and color fidelity through a parallel feature fusion generator, a multi-scale discriminator, and a chromatic aberration loss, respectively. PCGL-GAN enhances visual consistency and structural fidelity through perception correlative learning in the feature space and collaborative modeling of global-local features with cross-scale compensation. To improve the quality of the generated optical image, researchers propose methods based on diffusion models. S2ODPM [5] uses SAR images as condition to guide the reverse denoising process, achieving superior visual quality and structural consistency compared to GAN-based methods. cBBDM [6] incorporates explicit spatial conditions from the pixel space into the latent diffusion process to outperform GAN-based and conditional diffusion models in both structural fidelity and visual quality. However, these methods
#: Equal contribution.
*: Corresponding author.

Fig. 1: The training pipeline of ContraFM-S2O, which replaces instantaneous velocity with average velocity to realize one-step generation and contrastive learning to prevent the flows between unpaired SAR and optical images from overlapping.
are limited by several shortcomings, including high inference latency and insufficient clarity of edge and texture details in the generated optical images and ContraFM-S2O models the average velocity to realize one-step SAR-to-optical generation and utilizes contrastive learning to distinguish transport flows between different SAR and optical images to achieve high-quality generation.
2.2. Flow Matching-Based Image Generation
Flow Matching (FM) [9] addresses image generation by learning a continuous and deterministic transport map between source and target domains through an ordinary differential equation. By directly regressing the velocity field rather than simulating a stochastic denoising process, FM achieves faster inference with minimal sampling steps. Representative works such as Rectified Flow [10], Conditional Flow Matching [11] and MeanFlow [7] all achieve high-quality image generation. Rectified Flow learns to transport data between two distributions along straight-line paths, enabling computationally efficient and stable image generation and translation with minimal discretization steps. Conditional Flow Matching provides a simulation-free training objective for continuous normalizing flows by conditioning on paired source and target samples, enabling generalization to arbitrary source distributions, while its optimal transport variant (OT-CFM) further improves training and inference efficiency by approximating dynamic optimal transport. MeanFlow introduces the concept of average velocity to derive a principled identity with instantaneous velocity, enabling highly effective one-step generative modeling from scratch without pre-training, distillation, or curriculum learning.
3. BACKGROUND
Flow Matching [9, 10, 11] is a family of generative models that learn to match the flows, represented by velocity fields, between two probabilistic distributions [7]. During the training phase, the basic idea of Flow Matching is to make the model's output fit the instantaneous velocity .
3.1. Conditional Velocity
Given data and prior , ( and commonly), where ' denotes the time derivative. We call as conditional velocity [9]. The conditional Flow-Matching loss is defined as follows:
where the target is the conditional velocity, since a can be obtained from different pairs, the same leads to different conditional velocities.
3.2. Marginal Velocity
Essentially, Flow Matching constructs a model of the expectation over every possible case, also known as the marginal velocity [9].
A neural network parameterized by is learned to fit the marginal velocity field [7] and is defined as follows:
Although computing this loss function is infeasible due to the marginalization in Eq. (1), it is proposed to instead evaluate the conditional Flow Matching loss. Minimizing is equal to minimizing [7, 9].
Given a marginal velocity field , samples are generated by solving an ODE for :
starting from . The solution can be written as: , where we utilize to denote another time step. [7]
4. CONTRAFM-S2O
To reduce the inference latency and achieve one-step generation, ContraFM-S2O learns to predict the average velocity instead of instantaneous velocity. In addition, ContraFM-S2O uses contrastive learning to prevent the flow from overlapping and improve the quality of generated optical images.
4.1. Average Velocity
Motivated by MeanFlow [7], we model the average velocity field instead of instantaneous velocity field. Firstly, we use u to denote average velocity and v to denote instantaneous velocity. Given two time steps t, r the average velocity u is formally defined as [7]:
where is the flow path and , and are predefined schedules ( and commonly). The instantaneous velocity , where ' denotes the time derivative and as , there is . To have a formulation amenable to training, we rewrite Eq. (5) as:
We differentiate both sides with respect to t, treating r as independent of t and rearrange the terms, we could get:
To compute the term in Eq. (6), note that denotes a total derivative, which can be expanded in terms of partial derivatives:
Eq. (4) shows that and , , we could get another relation between and :
The total derivative, as shown in this equation, is simply the Jacobian–vector product (JVP) of the Jacobian matrix with the tangent vector . Finally, we could get the target average velocity which serves as the ground-truth signal:
The velocity in Eq. (9) is marginal velocity in Flow Matching [9] and we replace it with conditional velocity:
In SAR-to-optical image translation, instantaneous velocity often focuses on local variations, potentially overlooking global structural coherence but average velocity accounts for the overall migration trend in the path integral, helping to preserve global contours and spatial layouts of ground objects during generation, thus reducing geometric distortions.
4.2. Training with Contrastive Learning and Average Velocity
To enable the model to distinguish optical images generated from different SAR images, thereby improving the quality of SAR-to-optical image translation, We adopt contrastive learning to make the flows predicted from different SAR images distinct from each other. In detail, Given a batch of SAR images and their paired optical images , we first construct the interpolation path , where and then compute the instantaneous velocity . Next, for each sample in the batch, we concatenate the interpolation path with the each SAR image in the batch along the channel dimension and get the concatenated tensors . The concatenated tensors are then passed through a VAE encoder (with frozen parameters) for spatial dimensionality reduction. The resulting compressed feature maps are fed into a U-Net architecture, which comprises ResNet blocks and self-attention blocks. Subsequently, we apply a Jacobian-Vector Product (JVP) operation to the U-Net output to obtain the predicted average velocities and the partial time derivative . The target average velocity is then computed according to Eq. (10).
where i ranges from 0 to B - 1. Finally, the loss function is defined as follows:
where is a fixed parameter that controls the strength of contrastive regularization.
4.3. One-step Inference
Conventional GAN-based methods and diffusion-based methods could generate high-quality optical images but they face challenge that the inference latency is high, to reduce the inference latency, we design the one-step inference method. Given , , and for one-step SAR-to-optical translation, we have:
5. EXPERIMENTS
5.1. Datasets and Evaluation Metrics
To comprehensively assess the generalization capability of our model for SAR-to-optical translation under varying scene types and seasonal conditions, we utilize two datasets: QXS-SAROPT [12] and SAR2Opt [13]. The QXS-SAROPT dataset contains 20,000 pairs of SAR and optical images collected from the Gaofen-3 satellite and Google Earth, mainly covering several port cities. Each image patch has a size of 256 by 256. The approximate split ratio of training and test set for SAR2Opt and QXS-SAROPT is 4:1. The SAR2Opt dataset provides 2,076 pairs of SAR and optical images acquired from the TerraSAR-X satellite and Google Earth, covering multiple Asian cities. Each image patch has a size of 600 by 600. This dataset follows the official split, with 1,450 images in the training set and 627 images in the test set. The evaluation metrics we use are SSIM [14], FID [15], PSNR [14], and LPIPS [16]. S:SSIM, F:FID, L:LPIPS, P:PSNR


(a) SAR
(b) GT
(c) PCGL-GAN
(d) Ours
Fig. 2: Comparison of SAR-to-opticacl image translation results between the second-best model PCGL-GAN and our model. First row: SAR2Opt test set. Second row: QXS-SAROPT test set.
5.2. Baselines
The baselines we use are divided into GAN-based methods and diffusion-based methods. GAN-based methods include Pix2Pix [3], CycleGAN [2], and PCGL-GAN [4]. Diffusion-based methods include S2ODPM [5], cDDPM [6] and CycleDiff [17]. Contrastive learning-based methods include KANCUT [18] and CUT [19].
5.3. Implementation Details
We use 8×NVIDIA A100 PCIE (80GB) for training and a single NVIDIA A100 PCIE (80GB) for inference. We train our ContraFM-S2O for 400 epochs with the learning rate of 2e-4 and batch size of 128, the we set in Eq. (13) is 0.01.
5.4. Main Results
To evaluate our model, we train and test it on the QXS and SAR2Opt datasets, using SSIM, FID, LPIPS, and PSNR as evaluation metrics. We also compare the average inference latency per image between ContraFM-S2O and the baseline models. The inference steps for all diffusion-based models are 100, and our ContraFM-S2O employs one-step inference. Table. 1 shows that our ContraFM-S2O achieves the
Table 1: Performance comparison of different baseline models on two datasets. The best results are highlighted in bold and the second-best results are underlined
| Model | QXS | SAR2Opt | Latency | ||||||
|---|---|---|---|---|---|---|---|---|---|
| S | F | L | P | S | F | L | P | ||
| Pix2Pix | 0.235 | 130.2 | 0.451 | 23.12 | 0.138 | 166.1 | 0.384 | 26.12 | 0.43s |
| CycleGAN | 0.241 | 126.8 | 0.438 | 27.92 | 0.140 | 153.5 | 0.341 | 27.98 | 0.38s |
| PCGL-GAN | 0.279 | 107.2 | 0.349 | 28.02 | 0.175 | 144.4 | 0.316 | 28.18 | 0.44s |
| S2ODPM | 0.262 | 130.3 | 0.392 | 21.25 | 0.152 | 148.3 | 0.338 | 28.02 | 1.22s |
| cDDBM | 0.253 | 141.2 | 0.414 | 19.24 | 0.144 | 157.7 | 0.397 | 27.69 | 1.53s |
| CycleDiff | 0.241 | 135.7 | 0.376 | 27.92 | 0.149 | 165.6 | 0.379 | 28.04 | 1.69s |
| CUT | 0.236 | 113.5 | 0.383 | 27.95 | 0.126 | 162.4 | 0.359 | 27.99 | 0.83s |
| KANCUT | 0.229 | 119.7 | 0.341 | 27.96 | 0.123 | 177.8 | 0.373 | 27.92 | 0.98s |
| Ours | 0.298 | 102.42 | 0.311 | 31.22 | 0.196 | 137.6 | 0.307 | 29.03 | 0.10s |
state-of-the-art (sota) performance on QXS-SAROPT and SAR2Opt datasets across baselines, which demonstrates the effectiveness of ContraFM-S2O utilizing contrastive learning and modeling the average velocity. In addition, ContraFM-S2O could achieve 4.4× infer- ence speed acceleration compared to PCGL-GAN, which achieves the second-best SAR-to-optical image translation results. See Fig 2 for the qualitative results.
5.5. Ablation Studies
We conduct ablation studies on the influence of average velocity and contrastive learning, as well as the influence of in Eq. (13). We employ one-step inference in all ablations studies.
5.5.1. The Influence of Average Velocity and Contrastive Learning
Table 2: The influence of average velocity and contrastive learning. We compare ContraFM-S2O with variants without average velocity, without contrastive learning and without both, w/o: without. The best results are highlighted in bold and the second-best results are underlined
| Model | QXS | SAR2Opt | Latency | ||||||
|---|---|---|---|---|---|---|---|---|---|
| S | F | L | P | S | F | L | P | ||
| Full | 0.298 | 102.42 | 0.311 | 31.22 | 0.196 | 137.6 | 0.307 | 29.03 | 0.10s |
| w/o Avg | 0.243 | 158.91 | 0.357 | 27.77 | 0.134 | 167.5 | 0.373 | 25.33 | 0.52s |
| w/o CL | 0.197 | 184.09 | 0.407 | 23.24 | 0.183 | 210.9 | 0.416 | 22.55 | 0.14s |
| w/o Both | 0.148 | 235.96 | 0.454 | 19.17 | 0.117 | 254.3 | 0.465 | 19.87 | 0.73s |
Average velocity primarily speeds up inference (via simplifying integration to vector subtraction), while contrastive learning improves image quality by preventing velocity-field overlap, enabling detailed edge generation (Table 2). Optimal quality and speed occur at ; larger degrades quality by weakening SAR-optical feature association (Table 3).
5.5.2. The Influence of during training
Table 3: The influence of different during training. The best results are highlighted in bold and the second-best results are underlined
| λ | QXS | SAR2Opt | Latency | ||||||
|---|---|---|---|---|---|---|---|---|---|
| S | F | L | P | S | F | L | P | ||
| 0 | 0.197 | 184.09 | 0.407 | 23.24 | 0.183 | 210.9 | 0.416 | 22.55 | 0.14s |
| 0.01 | 0.298 | 102.42 | 0.311 | 31.22 | 0.196 | 137.6 | 0.307 | 29.03 | 0.10s |
| 0.05 | 0.304 | 113.44 | 0.333 | 26.71 | 0.191 | 176.7 | 0.388 | 26.55 | 0.13s |
| 0.1 | 0.154 | 167.29 | 0.389 | 22.35 | 0.143 | 189.1 | 0.424 | 21.65 | 0.29s |
| 0.2 | 0.127 | 209.23 | 0.411 | 20.87 | 0.128 | 222.1 | 0.477 | 18.38 | 0.28s |
6. CONCLUSION
We propose ContraFM-S2O, a flow-matching model for SAR-to-optical translation. It improves generation quality via contrastive learning and speeds up inference via average velocity modeling. Experimental results demonstrate that our model consistently achieves state-of-the-art performance across multiple benchmark datasets, outperforming various baseline models in terms of both inference speed and generation quality, validating that contrastive learning enhances input discrimination and detail preservation, while average velocity reduces computation by replacing multi-step ODE integration with a single efficient vector operation—together achieving strong speed-quality synergy.
7. REFERENCES
[1] Trevor Dove, Zhixiao Xie, Meng Tang, Yu Zhang, Xinyue Ye, Nathan Jacobs, and Gongbo Liang, “Recent advancements in deep learning for sar-to-optical image translation: A systematic literature review (2021–2025),” IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, vol. 19, pp. 14764–14775, 2026.
[2] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros, “Unpaired image-to-image translation using cycle-consistent adversarial networkss,” in Computer Vision (ICCV), 2017 IEEE International Conference on, 2017.
[3] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros, "Image-to-image translation with conditional adversarial networks," CVPR, 2017.
[4] Yu Chen, Weida Zhan, Yichun Jiang, Depeng Zhu, Xiaoyu Xu, Jinxin Guo, and Ziqiang Hao, “Towards sar-to-optical image translation via perception correlative learning and global-local feature collaboration,” Pattern Recognition, p. 114186, 2026.
[5] Xinyu Bai, Xinyang Pu, and Feng Xu, “Conditional diffusion for sar to optical image translation,” IEEE Geoscience and Remote Sensing Letters, vol. 21, pp. 1–5, 2023.
[6] Seon-Hoon Kim and Daewon Chung, “Conditional brownian bridge diffusion model for vhr sar to optical image translation,” IEEE Geoscience and Remote Sensing Letters, 2025.
[7] Zhengyang Geng, Mingyang Deng, Xingjian Bai, Zico Kolter, and Kaiming He, “Mean flows for one-step generative modeling,” Advances in Neural Information Processing Systems, vol. 38, pp. 75460–75482, 2026.
[8] Xi Yang, Jingyi Zhao, Ziyu Wei, Nannan Wang, and Xinbo Gao, “Sar-to-optical image translation based on improved cgan,” Pattern Recognition, vol. 121, pp. 108208, 2022.
[9] Yaron Lipman, Ricky TQ Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le, “Flow matching for generative modeling,” arXiv preprint arXiv:2210.02747, 2022.
[10] Xingchao Liu, Chengyue Gong, and Qiang Liu, “Flow straight and fast: Learning to generate and transfer data with rectified flow,” arXiv preprint arXiv:2209.03003, 2022.
[11] Alexander Tong, Nikolay Malkin, Guillaume Huguet, Yanlei Zhang, Jarrid Rector-Brooks, Kilian Fatras, Guy Wolf, and Yoshua Bengio, “Conditional flow matching: Simulation-free dynamic optimal transport,” arXiv preprint arXiv:2302.00482, vol. 2, no. 3, 2023.
[12] Meiyu Huang, Yao Xu, Lixin Qian, Weili Shi, Yaqin Zhang, Wei Bao, Nan Wang, Xuejiao Liu, and Xueshuang Xiang, “The qxs-saropt dataset for deep learning in sar-optical data fusion,” arXiv preprint arXiv:2103.08259, 2021.
[13] Yitao Zhao, Turgay Celik, Nanqing Liu, and Heng-Chao Li, “A comparative analysis of gan-based methods for sar-to-optical image translation,” IEEE Geoscience and Remote Sensing Letters, vol. 19, pp. 1–5, 2022.
[14] Alain Hore and Djemel Ziou, “Image quality metrics: Psnr vs. ssim,” in 2010 20th international conference on pattern recognition. IEEE, 2010, pp. 2366–2369.
[15] Yanchun Yu, Weibin Zhang, and Yun Deng, “Frechet inception distance (fid) for evaluating gans,” China University of Mining Technology Beijing Graduate School, vol. 3, no. 11, 2021.
[16] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang, “The unreasonable effectiveness of deep features as a perceptual metric,” in Proceedings of the IEEE conference on computer vision and pattern recognition, 2018, pp. 586–595.
[17] Shilong Zou, Yuhang Huang, Renjiao Yi, Chenyang Zhu, and Kai Xu, “Cyclediff: Cycle diffusion models for unpaired image-to-image translation,” IEEE Transactions on Image Processing, 2026.
[18] Arpan Mahara, Naphtali D Rishe, and Liangdong Deng, “The dawn of kan in image-to-image (i2i) translation: Integrating kolmogorov-arnold networks with gans for unpaired i2i translation,” in 2025 IEEE Conference on Artificial Intelligence (CAI). IEEE, 2025, pp. 747–754.
[19] Taesung Park, Alexei A Efros, Richard Zhang, and Jun-Yan Zhu, “Contrastive learning for unpaired image-to-image translation,” in European conference on computer vision. Springer, 2020, pp. 319–345.