SC-Pro: Training-Free Framework for Defending Unsafe Image Synthesis Attack
Junha Park, Jaehui Hwang, Ian Ryu, Hyungkeun Park, Jiyoon Kim, Jong-Seok Lee
TL;DR
Diffusion-based image generation risks NSFW content bypassing safety checks. The authors introduce SC-Pro, a training-free defense that probes perturbed inputs—latent vectors, prompt embeddings, and image embeddings—using spherical or circular perturbations to detect unsafe outputs, computed as $ \mathcal{S}_{f,\mathcal{M}}(\lambda)=\mathbb{E}_{\lambda\in P_{\psi,k}}[f(\mathcal{M}(\lambda))]$ and decided via $\mathcal{F}^*_{f,\mathcal{M}}(\lambda)$ against a threshold $\mathcal{S}_{th}$. SC-Pro demonstrates strong protection for both T2I and I2I diffusion models across multiple safeties and attacks, and is designed as a plug-in with no training requirements. To improve practicality, SC-Pro-o leverages distilled one-step diffusion models to achieve roughly 30× throughput gains while maintaining robust detection, benefiting deployment in real-time or resource-constrained settings. Collectively, these methods offer a scalable, model-agnostic approach to safer diffusion-based content generation with broad applicability and significant efficiency gains.
Abstract
With advances in diffusion models, image generation has shown significant performance improvements. This raises concerns about the potential abuse of image generation, such as the creation of explicit or violent images, commonly referred to as Not Safe For Work (NSFW) content. To address this, the Stable Diffusion model includes several safety checkers to censor initial text prompts and final output images generated from the model. However, recent research has shown that these safety checkers have vulnerabilities against adversarial attacks, allowing them to generate NSFW images. In this paper, we find that these adversarial attacks are not robust to small changes in text prompts or input latents. Based on this, we propose SC-Pro (Spherical or Circular Probing), a training-free framework that easily defends against adversarial attacks generating NSFW images. Moreover, we develop an approach that utilizes one-step diffusion models for efficient NSFW detection (SC-Pro-o), further reducing computational resources. We demonstrate the superiority of our method in terms of performance and applicability.
