Latent Guard: a Safety Framework for Text-to-image Generation

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Liu, Runtao, Khakzar, Ashkan, Gu, Jindong, Chen, Qifeng, Torr, Philip, Pizzati, Fabio
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866909289713500160
author Liu, Runtao
Khakzar, Ashkan
Gu, Jindong
Chen, Qifeng
Torr, Philip
Pizzati, Fabio
author_facet Liu, Runtao
Khakzar, Ashkan
Gu, Jindong
Chen, Qifeng
Torr, Philip
Pizzati, Fabio
contents With the ability to generate high-quality images, text-to-image (T2I) models can be exploited for creating inappropriate content. To prevent misuse, existing safety measures are either based on text blacklists, which can be easily circumvented, or harmful content classification, requiring large datasets for training and offering low flexibility. Hence, we propose Latent Guard, a framework designed to improve safety measures in text-to-image generation. Inspired by blacklist-based approaches, Latent Guard learns a latent space on top of the T2I model's text encoder, where it is possible to check the presence of harmful concepts in the input text embeddings. Our proposed framework is composed of a data generation pipeline specific to the task using large language models, ad-hoc architectural components, and a contrastive learning strategy to benefit from the generated data. The effectiveness of our method is verified on three datasets and against four baselines. Code and data will be shared at https://latentguard.github.io/.
format Preprint
id arxiv_https___arxiv_org_abs_2404_08031
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Latent Guard: a Safety Framework for Text-to-image Generation
Liu, Runtao
Khakzar, Ashkan
Gu, Jindong
Chen, Qifeng
Torr, Philip
Pizzati, Fabio
Computer Vision and Pattern Recognition
Artificial Intelligence
Machine Learning
With the ability to generate high-quality images, text-to-image (T2I) models can be exploited for creating inappropriate content. To prevent misuse, existing safety measures are either based on text blacklists, which can be easily circumvented, or harmful content classification, requiring large datasets for training and offering low flexibility. Hence, we propose Latent Guard, a framework designed to improve safety measures in text-to-image generation. Inspired by blacklist-based approaches, Latent Guard learns a latent space on top of the T2I model's text encoder, where it is possible to check the presence of harmful concepts in the input text embeddings. Our proposed framework is composed of a data generation pipeline specific to the task using large language models, ad-hoc architectural components, and a contrastive learning strategy to benefit from the generated data. The effectiveness of our method is verified on three datasets and against four baselines. Code and data will be shared at https://latentguard.github.io/.
title Latent Guard: a Safety Framework for Text-to-image Generation
topic Computer Vision and Pattern Recognition
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2404.08031