atlas

Research map / Image generation / Text-to-image diffusion

Detect-and-Guide: Self-regulation of Diffusion Models for Safe Text-to-Image Generation via Guideline Token Optimization

CVPR 2025 · Image generation › Text-to-image diffusion · approach: Concept erasure in diffusion models · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes Detect-and-Guide (DAG), which optimizes guideline token embeddings on a small annotated set to detect nudity via cross-attention maps during sampling and applies region-restricted, adaptively scaled safety guidance to erase sexual content from Stable Diffusion without fine-tuning.

Problem

Post-hoc safe generation for text-to-image diffusion models: existing unlearning methods are text-centric and fine-tuning or guidance methods cause severe mode shifts and poor text alignment on multi-concept real-world prompts, when erasing sexual content.

Approach

Optimize a few guideline token embeddings with a CAM loss (background leakage and negative sample losses) so that cross-attention maps from high-level U-Net layers precisely localize unsafe regions at each timestep; use these maps as a gate and magnitude scaler for classifier-free safety guidance, so guidance only edits detected regions with adaptive strength.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use DAG's optimized guideline-token detection maps and region-restricted adaptive safety guidance instead of SDv1.4 without a defenseSDv1.4 · I2P-sexualNudeNet total: 1070 -> 86Helped
Use DAG instead of SDv1.4 without a defenseSDv1.4 · COCO-1KVQA Score: 0.70 -> 0.72Helped
Use DAG instead of SDv1.4 without a defenseSDv1.4 · COCO-1KFIDreal: 58.03 -> 58.22Hurt
Use DAG instead of SDv1.4 without a defenseSDv1.4 · COCO-1KFIDSDv1.4: 0 -> 23.67Hurt
Use a single-step attention map rather than aggregating maps across multiple steps (ablation)DAG · Sexual-content detectionDetection performanceNo clear effect
Optimize guideline-token embeddings using a small annotated datasetDAG · Unsafe-region detectionDetection-map specificityHelped

Surprising findings

Limitations

Experimental setup

Datasets: I2P COCO-1K (resampled from MS-COCO validation) Ring-A-Bell adversarial prompts MMA adversarial prompts

Benchmarks: I2P-sexual I2P-sexual-complex Ring-A-Bell MMA COCO-1K

Metrics: NudeNet number of detected unsafe classes erase rate FID vs real images FID vs SDv1.4 VQA score VQA Score-SG

Baselines: ESD SLD-weak SLD-medium SLD-strong SPM SA SalUn Self-Dis SEGA MACE AdvUnlearn SDv2.1

Builds on: safety guidance (SLD) SEGA token optimization for cross-attention maps (Token Optimization for segmentation classifier-free guidance

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy