扩散生成图像的检测面临严峻挑战:现有方法依赖重建误差,但该指标将固有数据噪声(aleatoric uncertainty)与模型知识缺口(epistemic uncertainty)混为一谈,导致真假图像分布严重重叠。DEUA 框架首次将扩散模型的认识论不确定性(DEU)作为核心特征,并结合非对称对比损失(Asymmetric Contrastive Loss)解决真实类分布宽泛的"sink class"问题,在 GenImage 和 DRCT-2M 等大规模基准上取得显著性能提升。Detecting diffusion-generated images is a severe challenge: existing methods rely on reconstruction error, but this metric conflates inherent data noise (aleatoric uncertainty) with the model's knowledge gap (epistemic uncertainty), leaving the distributions of real and fake images heavily overlapped. DEUA is the first framework to take the diffusion model's epistemic uncertainty (DEU) as a core feature and to combine it with an Asymmetric Contrastive Loss that addresses the "sink class" problem caused by the broad distribution of the real class, achieving substantial gains on large-scale benchmarks such as GenImage and DRCT-2M.
扩散模型生成的图像质量极高,现有检测方法普遍依赖重建误差来区分真假,但这一指标受固有数据噪声严重干扰,无法提供可靠的判别信号。Images produced by diffusion models are of extremely high quality, and existing detectors generally rely on reconstruction error to tell real from fake; yet this metric is badly disturbed by inherent data noise and cannot provide a reliable discriminative signal.
"Aleatoric uncertainty, arising from inherent data noise, creates ambiguity that impedes accurate detection of generated images. In contrast, epistemic uncertainty…represents the model's lack of knowledge about unfamiliar patterns, supports detection."
现有基于重建误差的方法存在两个核心问题:Existing reconstruction-error-based methods suffer from two core problems:
DEUA 框架由两个核心模块构成:基于 Last-Layer Laplace Approximation(LLLA)的扩散认识论不确定性估计(DEU),以及针对真假类别非对称建模的 Asymmetric Contrastive Loss。The DEUA framework comprises two core modules: Diffusion Epistemic Uncertainty estimation (DEU) built on the Last-Layer Laplace Approximation (LLLA), and an Asymmetric Contrastive Loss that models the real and fake classes asymmetrically.
论文通过 Lemma 1 推导出认识论不确定性的估计公式,其核心为对扩散模型最后一层参数在 MAP 点附近进行高斯后验近似:Through Lemma 1 the paper derives an estimator of epistemic uncertainty, whose core is a Gaussian posterior approximation of the diffusion model's last-layer parameters around the MAP point:
q(θ) = 𝒩(θ; θ_MAP, Σ)
Monte Carlo 采样 M 组参数、N 组噪声,估计逆扩散过程均值的方差:Monte Carlo sampling of M parameter draws and N noise draws estimates the variance of the reverse diffusion mean:
U(xt-1|x, t) = Vari(𝔼j(μθᵢ(…)))
实现上采用预训练 VAE 在潜在空间操作,DDIM 采样步数设为 t=200,在鲁棒性测试中 t∈[100, 400] 范围内均保持稳定性能。DEU 特征经多头注意力(Multi-Head Attention, MHA)生成空间注意力图:The implementation operates in latent space with a pretrained VAE and sets the DDIM sampling step to t=200; in robustness tests performance stays stable over t∈[100, 400]. The DEU feature is turned into a spatial attention map by Multi-Head Attention (MHA):
zv = MHA(ū, u, v)
针对真假类别边界不对称的特性,论文引入类别独立的 margin 参数:To address the asymmetry of the real/fake class boundaries, the paper introduces class-specific margin parameters:
非对称边界使分类器不再将真实类作为"兜底",有效压缩真实类特征空间,在 GAN 生成图像(与训练域差异大)上也获得显著的 margin 增益。The asymmetric boundary stops the classifier from using the real class as a catch-all, effectively compressing the real-class feature space and yielding a marked margin gain even on GAN-generated images, which differ greatly from the training domain.
实验在 GenImage(14 种生成器)和 DRCT-2M(大规模多样化扩散数据集)两大基准上进行,评估指标为平均准确率(ACC)和平均精度(AP)。基线方法包括 LaRE2、UniFD、DRCT 等。Experiments are conducted on two benchmarks, GenImage (14 generators) and DRCT-2M (a large-scale, diverse diffusion dataset), with average accuracy (ACC) and average precision (AP) as metrics. Baselines include LaRE2, UniFD and DRCT.
| 方法Method | DR 增强DR augmentation | 平均 ACCAverage ACC | Δ vs. prev. SOTA |
|---|---|---|---|
| LaRE2 | 无No | 79.1% | — |
| DEUA (ours) | 无No | 85.6% | +6.5% |
| DRCT | 有Yes | 89.1% | — |
| DEUA (ours) | 有Yes | 91.5% | +2.4% |
| 方法Method | 训练配置Training setup | 平均 ACCAverage ACC | Δ |
|---|---|---|---|
| LaRE2 | 无 DRNo DR | 88.0% | — |
| DEUA (ours) | 无 DRNo DR | 90.5% | +2.5% |
| DRCT / UniFD | 有 DR + SDv2With DR + SDv2 | 91.4% | — |
| DEUA (ours) | 有 DR + SDv2With DR + SDv2 | 98.8% | +7.4% |
| 方法Method | ACC | AP | 性能降幅Performance drop |
|---|---|---|---|
| LaRE2 | 53.7% | 65.0% | −32.5% |
| DEUA (ours) | 89.5% | 94.5% | −5.8% |
| 配置Setting | ACC | AP |
|---|---|---|
| Baseline(CLIP only)Baseline (CLIP only) | 76.1% | 90.7% |
| + DEU | 90.3% | 98.7% |
| + Asymmetric Loss | 81.7% | 93.8% |
| DEU + Asymmetric Loss(DEUA)DEU + Asymmetric Loss (DEUA) | 91.5% | 99.7% |
消融结果表明,DEU 单独贡献 +14.2% ACC 提升,非对称损失在 BigGAN 子集上带来 +22.0% ACC 增益,二者协同作用进一步将 AP 推至 99.7%。The ablation shows that DEU alone contributes a +14.2% ACC gain, the asymmetric loss brings a +22.0% ACC gain on the BigGAN subset, and the two together push AP further to 99.7%.
"When trained on the BigGAN subset, both methods performed poorly on diffusion-generated images"——GAN 生成图像与扩散生成图像在特征分布上存在本质差异,跨域检测仍是开放难题。非对称损失虽有缓解,但并未根本解决。"When trained on the BigGAN subset, both methods performed poorly on diffusion-generated images" — GAN-generated and diffusion-generated images differ fundamentally in feature distribution, and cross-domain detection remains an open problem. The asymmetric loss mitigates it but does not solve it at root.
当测试图像经扩散模型内绘(inpainting)等 DR 后处理时,DEUA 初期性能下降,需要引入 SDv2 重建数据作为额外训练样本才能恢复竞争力,增加了数据准备成本。When test images undergo DR post-processing such as diffusion inpainting, DEUA degrades at first and needs SDv2 reconstruction data as additional training samples to regain competitiveness, which raises the cost of data preparation.
DEU 估计需要 M 次参数采样 × N 次噪声采样的 Monte Carlo 过程,加之 VAE 编码与 DDIM 潜在空间重建,推理开销显著高于直接分类方法。DEU estimation requires a Monte Carlo procedure with M parameter samples × N noise samples; together with VAE encoding and DDIM latent-space reconstruction, inference cost is markedly higher than that of direct classification methods.
论文承认"the wide range of features exhibited by the real class"是核心挑战,非对称学习提供了有效缓解,但真实图像多样性带来的 sink class 效应并未被彻底消除。The paper concedes that "the wide range of features exhibited by the real class" is the core challenge; asymmetric learning offers effective mitigation, but the sink class effect brought by the diversity of real images is not fully eliminated.