Saved in:
Bibliographic Details
Main Authors: Qiu, Huming, Chen, Guanxu, Zhang, Mi, Zhang, Xiaohan, You, Xiaoyu, Yang, Min
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2411.10329
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909579689852928
author Qiu, Huming
Chen, Guanxu
Zhang, Mi
Zhang, Xiaohan
You, Xiaoyu
Yang, Min
author_facet Qiu, Huming
Chen, Guanxu
Zhang, Mi
Zhang, Xiaohan
You, Xiaoyu
Yang, Min
contents In recent years, text-to-image (T2I) generation models have made significant progress in generating high-quality images that align with text descriptions. However, these models also face the risk of unsafe generation, potentially producing harmful content that violates usage policies, such as explicit material. Existing safe generation methods typically focus on suppressing inappropriate content by erasing undesired concepts from visual representations, while neglecting to sanitize the textual representation. Although these methods help mitigate the risk of misuse to some extent, their robustness remains insufficient when dealing with adversarial attacks. Given that semantic consistency between input text and output image is a core requirement of T2I models, we identify that textual representations are likely the primary source of unsafe generation. To this end, we propose Embedding Sanitizer (ES), which enhances the safety of T2I models by sanitizing inappropriate concepts in prompt embeddings. To our knowledge, ES is the first interpretable safe generation framework that assigns a score to each token in the prompt to indicate its potential harmfulness. In addition, ES adopts a plug-and-play modular design, offering compatibility for seamless integration with various T2I models and other safeguards. Evaluations on five prompt benchmarks show that ES outperforms eleven existing safeguard baselines, achieving state-of-the-art robustness while maintaining high-quality image generation.
format Preprint
id arxiv_https___arxiv_org_abs_2411_10329
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Safe Text-to-Image Generation: Simply Sanitize the Prompt Embedding
Qiu, Huming
Chen, Guanxu
Zhang, Mi
Zhang, Xiaohan
You, Xiaoyu
Yang, Min
Cryptography and Security
Artificial Intelligence
Computation and Language
In recent years, text-to-image (T2I) generation models have made significant progress in generating high-quality images that align with text descriptions. However, these models also face the risk of unsafe generation, potentially producing harmful content that violates usage policies, such as explicit material. Existing safe generation methods typically focus on suppressing inappropriate content by erasing undesired concepts from visual representations, while neglecting to sanitize the textual representation. Although these methods help mitigate the risk of misuse to some extent, their robustness remains insufficient when dealing with adversarial attacks. Given that semantic consistency between input text and output image is a core requirement of T2I models, we identify that textual representations are likely the primary source of unsafe generation. To this end, we propose Embedding Sanitizer (ES), which enhances the safety of T2I models by sanitizing inappropriate concepts in prompt embeddings. To our knowledge, ES is the first interpretable safe generation framework that assigns a score to each token in the prompt to indicate its potential harmfulness. In addition, ES adopts a plug-and-play modular design, offering compatibility for seamless integration with various T2I models and other safeguards. Evaluations on five prompt benchmarks show that ES outperforms eleven existing safeguard baselines, achieving state-of-the-art robustness while maintaining high-quality image generation.
title Safe Text-to-Image Generation: Simply Sanitize the Prompt Embedding
topic Cryptography and Security
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2411.10329