# 循环一致性生成对抗网络

循环一致性生成对抗网络（CycleGAN）是一种无需成对训练样本、将图像从一个域转换到另一个域的方法。它使用两个生成器–判别器对，并通过循环一致性损失将它们绑定在一起，迫使每次转换都可逆。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> 它解决了这样一个问题：对于许多任务，例如把照片变成绘画或把马变成斑马，源图像和目标图像之间不存在可用于训练的一一对应关系。<sup>[2](https://www.tensorflow.org/tutorials/generative/cyclegan)</sup><sup> • </sup><sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 所解决的问题 | 无配对图像到图像转换，即域之间不存在可用于训练的一一映射<sup>[2](https://www.tensorflow.org/tutorials/generative/cyclegan)</sup> |
| 核心约束 | 原始论文所有实验中使用权重 \( \lambda = 10 \) 的循环一致性损失<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> |
| 架构 | 带实例归一化的 ResNet 生成器（128×128 时 6 个块，256×256 时 9 个块）和 70×70 PatchGAN 判别器<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> |
| 对抗目标 | 最小化皮尔逊（Pearson）\( \chi^{2} \) 散度的最小二乘（LSGAN）损失<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> |
| 感知真实性 | 在 256×256 下约四分之一的试验中骗过 AMT（Amazon Mechanical Turk）参与者；在 512×512 下，地图→航拍照片为 37.5%±3.6%，而 pix2pix 为 33.9%±3.1%<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> |
| 已知失败模式 | 几何变化、虚假特征（骑手身上的斑马条纹）、色调偏移，以及医学图像中的幻觉内容<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup><sup> • </sup><sup>[3](https://junyanz.github.io/CycleGAN/)</sup> |
| 当前状态 | 基于扩散的转换器目前在 FID 基准上保持最优，但复用了循环一致性思想<sup>[4](https://export.arxiv.org/pdf/2303.16280v2.pdf)</sup><sup> • </sup><sup>[5](https://doi.org/10.48550/arxiv.2508.06625)</sup> |

## 工作原理

仅靠对抗目标约束不足。只要容量足够大，网络可以把同一组输入图像映射为目标域中任意随机排列的图像，从而产生与目标分布匹配的输出分布，却把单个输入映射错。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> 因此，[CycleGAN](https://www.edgepedia.org/zh/cyclegan) 将正向映射 \( G: X \rightarrow Y \) 与逆向映射 \( F: Y \rightarrow X \) 耦合起来，并要求转换可逆。<sup>[3](https://junyanz.github.io/CycleGAN/)</sup>

循环一致性损失在两个方向上强制这种可逆性：<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup>

\[ \mathcal{L}_{\mathrm{cyc}}(G, F) = \mathbb{E}_{x \sim p_{\mathrm{data}}(x)} \left[ \| F(G(x)) - x \|_{1} \right] + \mathbb{E}_{y \sim p_{\mathrm{data}}(y)} \left[ \| G(F(y)) - y \|_{1} \right] \]

使得 \( F(G(x)) \approx x \) 且 \( G(F(y)) \approx y \)。完整目标将两个对抗项与循环项结合，<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup>

\[ \mathcal{L}(G, F, D_{X}, D_{Y}) = \mathcal{L}_{\mathrm{GAN}}(G, D_{Y}, X, Y) + \mathcal{L}_{\mathrm{GAN}}(F, D_{X}, Y, X) + \lambda \, \mathcal{L}_{\mathrm{cyc}}(G, F) \]

所有实验中 \( \lambda = 10 \)。另一个恒等损失会正则化每个生成器，使其在输入真实目标样本时接近恒等映射，<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup>

\[ \mathcal{L}_{\mathrm{identity}}(G, F) = \mathbb{E}_{y \sim p_{\mathrm{data}}(y)} \left[ \| G(y) - y \|_{1} \right] + \mathbb{E}_{x \sim p_{\mathrm{data}}(x)} \left[ \| F(x) - x \|_{1} \right] \]

这有助于保持色彩构成。

## 实现方式

训练在两个方向上交替更新生成器和判别器。生成器采用残差架构，包含两个步长为 2 的卷积、带实例归一化的残差块，以及两个分数步长卷积；6 个块用于 128×128 图像，9 个块用于 256×256 及更高分辨率。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> 实例归一化就是批大小为 1 的批归一化；在成对转换的前身 pix2pix 中，这一设置已被证明对图像生成有效。<sup>[6](https://openaccess.thecvf.com/content_cvpr_2017/papers/Isola_Image-To-Image_Translation_With_CVPR_2017_paper.pdf)</sup>

判别器是 70×70 PatchGAN，它判断重叠的 70×70 图像块是真实还是伪造，而不是判断整幅图像。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> 对抗损失用最小二乘损失替代负对数似然，最小化皮尔逊 \( \chi^{2} \) 散度，从而训练更稳定并生成更高质量的结果。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> 原始训练使用 Adam，批大小为 1，学习率为 0.0002，保持 100 轮，并在接下来的 100 轮内线性衰减到零；判别器更新使用一个可存 50 张先前生成图像的图像缓冲区。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> 官方 PyTorch 实现默认使用 resnet_9blocks 生成器、基础 PatchGAN 判别器和 lsgan 目标。<sup>[7](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix)</sup>

## 起源

CycleGAN 发表于论文《使用循环一致对抗网络的无配对图像到图像转换》（Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks）。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> 其成对转换前身 pix2pix 提供了 CycleGAN 所采用的生成器和 PatchGAN 设计选择。<sup>[6](https://openaccess.thecvf.com/content_cvpr_2017/papers/Isola_Image-To-Image_Translation_With_CVPR_2017_paper.pdf)</sup> 两篇同期论文着手解决同一个无配对问题：易子力（Zili Yi）及其同事（2017）的 DualGAN 将转换表述为无监督[对偶学习](https://www.edgepedia.org/zh/dual-learning)；<sup>[8](https://doi.org/10.48550/arxiv.1704.02510)</sup>刘明宇（Ming-Yu Liu）、托马斯·布罗伊尔（Thomas Breuel）和[扬·考茨](https://www.edgepedia.org/zh/jan-kautz)（Jan Kautz）（2017）的 UNIT 通过共享潜空间连接两个域。<sup>[9](https://doi.org/10.48550/arxiv.1703.00848)</sup>

## 变体

受 CycleGAN 启发的后继模型包括 StarGAN、SEAN、U-GAT-IT 和 CUT，旨在提升生成图像的质量和多样性。<sup>[4](https://export.arxiv.org/pdf/2303.16280v2.pdf)</sup>

**多模态与潜空间变体。** 黄勋（Xun Huang）及其同事（2018）的 MUNIT 将图像分解为所有域通用的内容编码和每个域特有的风格编码，并用双向重建损失（图像重建和潜变量重建）加对抗损失训练，从而支持多模态输出。<sup>[10](https://doi.org/10.48550/arxiv.1804.04732)</sup><sup> • </sup><sup>[11](https://export.arxiv.org/pdf/2112.12625v2.pdf)</sup>

**对比式变体。** CUT（对比无配对转换）使用恒等保持损失和 \( \lambda_{\mathrm{NCE}} = 1 \) 训练，学习到比 CycleGAN 更强的分布匹配；FastCUT 去掉恒等损失，使用 \( \lambda_{\mathrm{NCE}} = 10.0 \)，以一半的 GPU 内存和两倍的训练速度作为 CycleGAN 的更轻量替代方案。<sup>[12](https://github.com/taesungp/contrastive-unpaired-translation/)</sup> 现代化版 CycleGAN——UVCGAN——在 CelebA 的男→女转换上，FID 比此前最优结果提升超过 40%。<sup>[4](https://export.arxiv.org/pdf/2303.16280v2.pdf)</sup>

**基于扩散的后继模型。** 邹世龙（Shilong Zou）及其同事（2025）的 CycleDiff 用两个扩散模型替换 CycleGAN 的两个生成器来进行无配对转换，认为基于 GAN 的一步式映射会过拟合数据分布的个别点而非整个分布，并经常出现图像转换崩溃；它在扩散转换之上保留循环一致性损失，以保持源图像结构。<sup>[5](https://doi.org/10.48550/arxiv.2508.06625)</sup> 在医学成像中，蒋伟伟（Weiwei Jiang）及其同事（2025）的 CycleH-CUT 将两个 CUT 网络与循环一致性和混合对比损失结合。<sup>[13](https://doi.org/10.1088/1361-6560/adb2d7)</sup>

## 应用

原始论文展示了集合风格迁移、物体变形、季节转换和照片增强，这些任务都不存在成对训练数据。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> 此后，无配对转换被广泛应用于医学成像；基于 CycleGAN 的方法已被证明有效，但可能在生成图像中产生伪影。<sup>[13](https://doi.org/10.1088/1361-6560/adb2d7)</sup>

在[亚马逊土耳其机器人](https://www.edgepedia.org/zh/amazon-mechanical-turk)感知真实性任务中，CycleGAN 在 256×256 下约四分之一的试验中骗过参与者。在 512×512 下，与 pix2pix 一起训练以作比较，地图→航拍照片在 CycleGAN 上达到 37.5%±3.6%，而 pix2pix 为 33.9%±3.1%；航拍照片→地图为 16.5%±4.1% 对 8.5%±2.6%，因此无配对方法接近但仍不及成对训练。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup>

## 局限与替代方案

原始论文的消融实验表明，去掉 GAN 损失或循环一致性损失中的任意一个都会显著降低结果质量；只在单方向使用循环损失常常导致训练不稳定和模式崩溃。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> 该方法在需要几何变化的任务上失败：在狗→猫变形中，学到的转换退化为对输入做最小改动。马→斑马模型被人骑马的图像弄糊涂了，因为训练中使用的 ImageNet 同义词集缺少骑手，结果在人身上产生虚假条纹。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup> 与成对训练数据相比仍存在持久差距；例如，在照片→标签任务中，该方法会把树和建筑的标签弄混。<sup>[1](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)</sup>

**理论注意事项。** 原始作者已经指出，CycleGAN 可能存在多个解；色调偏移之所以出现，是因为对固定输入图像，多个不同色调的输出同样合理；有人建议加入恒等损失来缓解这一问题。<sup>[14](https://arxiv.org/html/2001.09061v1)</sup> CycleGAN、DualGAN 和 DiscoGAN 都假设底层域间映射是确定性的，并且只能学习一一映射；当真实对应关系不是双射时，这限制了它们。<sup>[15](https://ar5iv.labs.arxiv.org/html/2403.09646)</sup> 2025 年一项生物医学转换分析表明，循环一致性并非唯一：对于一对完全解耦的生成器，施加任意可逆变换 \( T_{A}, T_{B} \) 仍满足循环一致性，因此内容保持并不能被唯一保证。<sup>[16](https://en.papernotes.org/NeurIPS2025/medical_imaging/unpaired_image-to-image_translation_for_segmentation_and_signal_unmixing/)</sup>

**架构相关伪影。** 在同一分析中，实例归一化会使同一局部对象因全局上下文不同而产生显著不同的信号响应，导致液滴状伪影被误判为假阳性细胞核；该工作去掉归一化层，改用双向谱归一化。<sup>[16](https://en.papernotes.org/NeurIPS2025/medical_imaging/unpaired_image-to-image_translation_for_segmentation_and_signal_unmixing/)</sup> 在医学转换中，谱归一化同样被用来提高训练稳定性。<sup>[13](https://doi.org/10.1088/1361-6560/adb2d7)</sup>

作者提醒，CycleGAN 与任何基于 GAN 的方法一样，本质上是在凭空生成它所创建内容的一部分：正如它可能给天空加上奇异的云彩，使其看起来像梵高（Van Gogh）画的，它也可能在医学图像中添加并不存在的肿瘤，或删除确实存在的肿瘤，因此在 MRI 到 CT 转换等关键领域应极其谨慎地使用。<sup>[3](https://junyanz.github.io/CycleGAN/)</sup>

**替代方案。** 在 FID 基准上，扩散模型目前在无配对图像到图像转换上保持最优；不过，由于它们在训练时不使用源图像并依赖逐像素一致性，可能会执行次优转换。<sup>[4](https://export.arxiv.org/pdf/2303.16280v2.pdf)</sup> 官方实现的维护者后来发布了 CUT——一个快速且内存高效的无配对转换模型——以及 CycleGAN-Turbo 和 pix2pix-turbo，这些一步式转换方法同时支持成对和无配对训练，并利用预训练的 StableDiffusion-Turbo 模型。<sup>[7](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix)</sup>

## References

1. [Unpaired Image-To-Image Translation Using Cycle-Consistent Adversarial Networks](https://openaccess.thecvf.com/content_ICCV_2017/papers/Zhu_Unpaired_Image-To-Image_Translation_ICCV_2017_paper.pdf)
2. [CycleGAN | TensorFlow Core](https://www.tensorflow.org/tutorials/generative/cyclegan)
3. [CycleGAN Project Page](https://junyanz.github.io/CycleGAN/)
4. [UVCGAN: Unpaired Visible-to-visible translation (revisiting CycleGAN with modern architectures)](https://export.arxiv.org/pdf/2303.16280v2.pdf)
5. [Zou, Shilong and colleagues (2025). CycleDiff: Cycle Diffusion Models for Unpaired Image-to-image Translation. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2508.06625)
6. [Image-To-Image Translation With Conditional Adversarial Networks (pix2pix)](https://openaccess.thecvf.com/content_cvpr_2017/papers/Isola_Image-To-Image_Translation_With_CVPR_2017_paper.pdf)
7. [junyanz/pytorch-CycleGAN-and-pix2pix (official implementation)](https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix)
8. [Yi, Zili and colleagues (2017). DualGAN: Unsupervised Dual Learning for Image-to-Image Translation. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1704.02510)
9. [Liu, Ming-Yu, Breuel, Thomas, Kautz, Jan (2017). Unsupervised Image-to-Image Translation Networks. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1703.00848)
10. [Huang, Xun and colleagues (2018). Multimodal Unsupervised Image-to-Image Translation. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1804.04732)
11. [Comparison and Analysis of Image-to-Image Generative Adversarial Networks: A Survey](https://export.arxiv.org/pdf/2112.12625v2.pdf)
12. [Contrastive Unpaired Translation (CUT) official repository](https://github.com/taesungp/contrastive-unpaired-translation/)
13. [Weiwei Jiang and colleagues (2025). CycleH-CUT: an unsupervised medical image translation method based on cycle consistency and hybrid contrastive learning. Physics in Medicine and Biology.](https://doi.org/10.1088/1361-6560/adb2d7)
14. [Kernel of CycleGAN as a Principle homogeneous space](https://arxiv.org/html/2001.09061v1)
15. [On Unsupervised Image-to-image translation and GAN stability](https://ar5iv.labs.arxiv.org/html/2403.09646)
16. [Unpaired Image-to-Image Translation for Segmentation and Signal Unmixing (paper note, NeurIPS 2025)](https://en.papernotes.org/NeurIPS2025/medical_imaging/unpaired_image-to-image_translation_for_segmentation_and_signal_unmixing/)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Neural networks and deep learning › Titles A to H

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/cycle-consistent-generative-adversarial-network

English original: https://www.edgepedia.org/cycle-consistent-generative-adversarial-network
