SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Models

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Li, Xinfeng, Yang, Yuchen, Deng, Jiangyi, Yan, Chen, Chen, Yanjiao, Ji, Xiaoyu, Xu, Wenyuan
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866910653406511104
author Li, Xinfeng
Yang, Yuchen
Deng, Jiangyi
Yan, Chen
Chen, Yanjiao
Ji, Xiaoyu
Xu, Wenyuan
author_facet Li, Xinfeng
Yang, Yuchen
Deng, Jiangyi
Yan, Chen
Chen, Yanjiao
Ji, Xiaoyu
Xu, Wenyuan
contents Text-to-image (T2I) models, such as Stable Diffusion, have exhibited remarkable performance in generating high-quality images from text descriptions in recent years. However, text-to-image models may be tricked into generating not-safe-for-work (NSFW) content, particularly in sexually explicit scenarios. Existing countermeasures mostly focus on filtering inappropriate inputs and outputs, or suppressing improper text embeddings, which can block sexually explicit content (e.g., naked) but may still be vulnerable to adversarial prompts -- inputs that appear innocent but are ill-intended. In this paper, we present SafeGen, a framework to mitigate sexual content generation by text-to-image models in a text-agnostic manner. The key idea is to eliminate explicit visual representations from the model regardless of the text input. In this way, the text-to-image model is resistant to adversarial prompts since such unsafe visual representations are obstructed from within. Extensive experiments conducted on four datasets and large-scale user studies demonstrate SafeGen's effectiveness in mitigating sexually explicit content generation while preserving the high-fidelity of benign images. SafeGen outperforms eight state-of-the-art baseline methods and achieves 99.4% sexual content removal performance. Furthermore, our constructed benchmark of adversarial prompts provides a basis for future development and evaluation of anti-NSFW-generation methods.
format Preprint
id arxiv_https___arxiv_org_abs_2404_06666
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Models
Li, Xinfeng
Yang, Yuchen
Deng, Jiangyi
Yan, Chen
Chen, Yanjiao
Ji, Xiaoyu
Xu, Wenyuan
Computer Vision and Pattern Recognition
Artificial Intelligence
Computation and Language
Cryptography and Security
Text-to-image (T2I) models, such as Stable Diffusion, have exhibited remarkable performance in generating high-quality images from text descriptions in recent years. However, text-to-image models may be tricked into generating not-safe-for-work (NSFW) content, particularly in sexually explicit scenarios. Existing countermeasures mostly focus on filtering inappropriate inputs and outputs, or suppressing improper text embeddings, which can block sexually explicit content (e.g., naked) but may still be vulnerable to adversarial prompts -- inputs that appear innocent but are ill-intended. In this paper, we present SafeGen, a framework to mitigate sexual content generation by text-to-image models in a text-agnostic manner. The key idea is to eliminate explicit visual representations from the model regardless of the text input. In this way, the text-to-image model is resistant to adversarial prompts since such unsafe visual representations are obstructed from within. Extensive experiments conducted on four datasets and large-scale user studies demonstrate SafeGen's effectiveness in mitigating sexually explicit content generation while preserving the high-fidelity of benign images. SafeGen outperforms eight state-of-the-art baseline methods and achieves 99.4% sexual content removal performance. Furthermore, our constructed benchmark of adversarial prompts provides a basis for future development and evaluation of anti-NSFW-generation methods.
title SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Models
topic Computer Vision and Pattern Recognition
Artificial Intelligence
Computation and Language
Cryptography and Security
url https://arxiv.org/abs/2404.06666