Latent Guard: A Safety Framework for Text-to-Image Generation

Link
Abstract

With the ability to generate high-quality images, text-toimage (T2I) models can be exploited for creating inappropriate content. To prevent misuse, existing safety measures are either based on text blacklists, easily circumvented, or harmful content classification, using large datasets for training and offering low flexibility. Here, 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 we check the presence of harmful concepts in the input text embeddings. Our 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. Our method is evaluated on three datasets and against four baselines.

Synth

Problem:: Text-to-image 모델의 부적절한 콘텐츠 생성 위험 증가 / 기존 안전 방식(텍스트 블랙리스트, 유해 콘텐츠 분류)은 쉽게 우회되거나 유연성 부족 / 테스트 시간에 새 개념 추가 시 재학습 필요

Solution:: T2I 모델의 텍스트 인코더 위에 잠재 공간 학습 / 대조 학습으로 개념과 프롬프트 간 공동 임베딩 학습 / 재학습 없이 테스트 시간에 블랙리스트 조정 가능

Novelty:: 텍스트 프롬프트에서 유해성을 차단하는 문제에서 텍스트 임베딩을 적용한 최초의 연구 / 테스트 시간 적응 가능한 블랙리스트 시스템 구현 / 적대적 공격과 동의어에 강건한 안전 프레임워크

Note:: 문장인 프롬프트를 관련 단어에 집중하도록 임베딩 하고, 이 임베딩에 Contrastive Learning을 사용한 방식이 직관적임 → Contrastive의 영향이 특히 커보임 / OOD 성능 평가에 사용된 unseen이 완전히 새로운 유해 컨셉인 경우가 아님 → 완전히 새로운 유해 컨셉에 대해서는 학습이 필요할 수 있음

Summary

Motivation

Method

file-20250411002347160.png

Training Data Generation

file-20250411002615580.png

CoPro를 만드는 방식

Embedding Mapping

Contrastive Training

추론 단계

file-20250411003020055.png|500

Method 검증

실험 설정

성능 비교 결과

추가 분석