Diffusion models are known for generating high-quality images, causing serious security concerns. To combat this, most efforts rely on deep neural networks (e.g., CNNs and Transformers), while largely overlooking the potential of traditional machine learning models. In this paper, we freshly investigate such alternatives and proposes a novel Dynamic Assembly Forest model (DAF) to detect diffusion-generated images. Built upon the deep forest paradigm, DAF addresses the inherent limitations in feature learning and scalable training, making it an effective diffusion-generated image detector. Compared to existing DNN-based methods, DAF has significantly fewer parameters, much lower computational cost, and can be deployed without GPUs, while achieving competitive performance under standard evaluation protocols. These results highlight the strong potential of the proposed method as a practical substitute for heavyweight DNN models in resource-constrained scenarios. Our code and models are available at https://github.com/OUC-VAS/DAF.
Figures & tables
Figure 1: The overview of our proposed DAF model.
Figure 2: The detailed explanation of our proposed dynamic assembly strategy.
Figure 3: The detailed process of Task-specific Feature Extraction. (a) The input image is first divided into multiple patches. In each patch, we use HOG to extract spatial features. We also extract the frequency features of each patch and combine these two types of features together. (b) We employ sliding windows on batches to obtain multi-scale features.
Eval set ↓
Train set →
LSUN-B ( ADM )
Imagenet ( ADM )
Detector →
CNNDet
AERO-
DIRE
Fake-
FIRE
DAF
CNNDet
AERO-
DIRE
Fake-
FIRE
DAF
BLADE
Inversion
(Ours)
BLADE
Inversion
(Ours)
Imagenet
ADM
73.4/57.6
99.1/98.3
99.4/96.4
100.0/99.8
100.0/100.0
96.5/99.9
99.6/99.3
100.0/100.0
100.0/100.0
100.0/100.0
100.0/100.0
99.5/100.0
SD‑v1
67.3/53.4
98.7/97.4
98.3/95.2
99.7/97.6
100.0/100.0
94.7/98.9
87.2/84.7
99.7/98.3
100.0/99.6
100.0/100.0
100.0/100.0
91.6/99.6
LSUN‑B
ADM
96.8/93.7
100.0/100.0
100.0/100.0
100.0/100.0
100.0/100.0
99.9/100.0
76.0/54.2
98.4/97.5
100.0/99.7
100.0/100.0
100.0/100.0
99.6/100.0
DDPM
75.3/55.1
98.9/97.8
100.0/100.0
100.0/100.0
100.0/99.8
99.9/100.0
68.4/45.1
99.1/98.2
100.0/97.7
100.0/100.0
100.0/100.0
99.7/100.0
Table 1: Detection performance of different methods (ACC%/AUC%).
Detector
Acc.(%)
CNNDet
60.11
FreDect
56.86
Fusing
57.07
GramNet
60.95
LNP
55.63
UniFD
55.62
Table 2: Detection performance of different methods on Chameleon dataset (ACC%).
Eval set ↓
Train set →
LSUN-B ( ADM )
Imagenet ( ADM )
Detector →
Forensics
DAF
Forensics
DAF
Forest
(Ours)
Forest
(Ours)
Imagenet
ADM
87.5/98.2
90.2/97.9
97.3/99.7
97.8/99.9
SD‑v1
84.5/91.6
89.6/94.0
86.3/96.2
79.7/98.3
LSUN‑B
ADM
92.0/99.0
98.0/100.0
94.0/98.1
97.5/99.9
DDPM
91.0/98.6
98.9/99.9
94.4/98.3
97.2/99.9
Table 3: Comparison results of our method and ForensicsForest on a fair set (ACC%/AUC%).
Eval set ↓
Train set →
LSUN-B ( ADM )
Imagenet ( ADM )
Detector →
Single
Multi (Recalc.)
Multi (Avg.)
Single
Multi (Recalc.)
Multi (Avg.)
Imagenet
ADM
96.3/99.7
94.7/99.9
96.5/99.9
98.1/100.0
99.7/100.0
99.5/100.0
SD‑v1
93.7/98.6
94.3/98.6
94.7/98.9
90.1/98.5
84.7/99.3
91.6/99.6
LSUN‑B
ADM
99.8/99.9
99.9/100.0
99.9/100.0
99.5/99.9
98.3/100.0
99.6/100.0
DDPM
99.7/99.9
99.8/100.0
99.9/100.0
99.5/99.9
98.9/100.0
99.7/100.0
IDDPM
99.9/100.0
99.9/100.0
100.0/100.0
99.7/100.0
99.1/100.0
99.9/100.0
Table 4: Effect of multi-scale features.
Figure 4: Effect of the number of image patch partitions.
Figure 5: The effect of different p values on ACC (%) on ImageNet and LSUN-B datasets with three settings: Single, Multi (Recalc.), Multi (Avg.).
Figure 6: The visualization results trained on the LSUN-B dataset and tested on DALLE-2 and SD-v2 of the LSUN-B dataset.
Figure 7: The visualization results trained on the Imagenet dataset and tested on DALLE-2 and SD-v2 of the LSUN-B dataset.
Figure 8: Robustness under various perturbations, including Gaussian blur (top) and JPEG compression (bottom).
Eval set ↓
Train set →
LSUN-B ( ADM )
Imagenet ( ADM )
Detector →
w.
wo.
w.
wo.
Imagenet
ADM
94.2
96.5
99.5
99.5
SD‑v1
94.1
94.7
90.9
91.6
LSUN‑B
ADM
99.8
99.9
99.5
99.6
DDPM
99.7
99.9
99.9
99.7
IDDPM
99.8
100.0
100.0
99.9
Table 5: Discussion: ACC (%) performance of our method with( w. ) or without( wo. ) on-the-fly data augmentation.
Eval set ↓
Train set →
LSUN-B ( ADM )
Imagenet ( ADM )
Detector →
w.
wo.
w.
wo.
Imagenet
ADM
54.7
96.5
99.9
99.5
SD‑v1
40.3
94.7
98.3
91.6
LSUN‑B
ADM
100.0
99.9
50.0
99.6
DDPM
99.9
99.9
56.6
99.7
IDDPM
100.0
100.0
50.0
99.9
Table 6: Discussion: ACC (%) performance of our method with( w. ) or without( wo. ) ResNet18 feature extraction.
The remarkable realism of images generated by diffusion models poses critical detection challenges. Current methods utilize reconstruction error as a discriminative feature, exploiting the observation that real images exhibit higher reconstruction errors when processed through diffusion models. However, these approaches require costly reconstruction computations and depend on specific diffusion models, making their performance highly model-dependent. We identify a fundamental difference: real images are more difficult to fit with Gaussian distributions compared to synthetic ones. In this paper, we propose Forgery Identification via Noise Disturbance (FIND), a novel method that requires only a simple binary classifier. It eliminates reconstruction by directly targeting the core distributional difference between real and synthetic images. Our key operation is to add Gaussian noise to real images during training and label these noisy versions as synthetic. This step allows the classifier to focus on the statistical patterns that distinguish real from synthetic images. We theoretically prove that the noise-augmented real images resemble diffusion-generated images in their ease of Gaussian fitting. Furthermore, simply by adding noise, they still retain visual similarity to the original images, highlighting the most discriminative distribution-related features. The proposed FIND improves performance by 11.7% on the GenImage benchmark while running 126x faster than existing methods. By removing the need for auxiliary diffusion models and reconstruction, it offers a practical, efficient, and generalizable way to detect diffusion-generated content.
Jie Li, Yingying Feng, Chi Xie +3
Xiamen University · Northeastern University · Tongji University +1
Recently, detecting AI-generated images produced by diffusion-based models has attracted increasing attention due to their potential threat to safety. Among existing approaches, reconstruction-based methods have emerged as a prominent paradigm for this task. However, we find that such methods exhibit severe security vulnerabilities to adversarial perturbations; that is, by adding imperceptible adversarial perturbations to input images, the detection accuracy of classifiers collapses to near zero. To verify this threat, we present a systematic evaluation of the adversarial robustness of three representative detectors across four diverse generative backbone models. First, we construct adversarial attacks in white-box scenarios, which degrade the performance of all well-trained detectors. Moreover, we find that these attacks demonstrate transferability; specifically, attacks crafted against one detector can be transferred to others, indicating that adversarial attacks on detectors can also be constructed in a black-box setting. Finally, we assess common countermeasures and find that standard defense methods against adversarial attacks provide limited mitigation. We attribute these failures to the low signal-to-noise ratio (SNR) of attacked samples as perceived by the detectors. Overall, our results reveal fundamental security limitations of reconstruction-based detectors and highlight the need to rethink existing detection strategies.
Haoyang Jiang, Mingyang Yi, Shaolei Zhang +4
Renmin University of China, Beijing, China · Tencent Inc., Shenzhen, China
Diffusion-based image generation models have advanced rapidly but pose a safety risk due to their potential to generate Not-Safe-For-Work (NSFW) content. Existing NSFW detection methods mainly operate either before or after image generation. Pre-generation methods rely on text prompts and struggle with the gap between prompt safety and image safety. Post-generation methods apply classifiers to final outputs, but they are poorly suited to intermediate noisy images. To address this, we introduce FlowGuard, a cross-model in-generation detection framework that inspects intermediate denoising steps. This is particularly challenging in latent diffusion, where early-stage noise obscures visual signals. FlowGuard employs a novel linear approximation for latent decoding and leverages a curriculum learning approach to stabilize training. By detecting unsafe content early, FlowGuard reduces unnecessary diffusion steps to cut computational costs. Our cross-model benchmark spanning nine diffusion-based backbones shows the effectiveness of FlowGuard for in-generation NSFW detection in both in-distribution and out-of-distribution settings, outperforming existing methods by over 30% in F1 score while delivering transformative efficiency gains, including slashing peak GPU memory demand by over 97% and projection time from 8.1 seconds to 0.2 seconds compared to standard VAE decoding.
Jinghan Yang, Yihe Fan, Xudong Pan +1
Fudan University, Shanghai, China · Fudan University, Shanghai Innovation Institute, Shanghai, China