IMMA: Immunizing text-to-image Models against Malicious Adaptation
Amber Yijia Zheng
Raymond A. Yeh
Purdue University

Code Paper

Abstract

Advancements in text-to-image models and fine-tuning methods have led to the increasing risk of malicious adaptation, i.e., fine-tuning to generate harmful/unauthorized content. Recent works, e.g., Glaze or MIST, have developed data-poisoning techniques which protect the data against adaptation methods. In this work, we consider an alternative paradigm for protection. We propose to immunize the model by learning model parameters that are difficult for the adaptation methods when fine-tuning malicious content; in short IMMA. Empirical results show IMMA's effectiveness against malicious adaptations, including mimicking the artistic style and learning of inappropriate/unauthorized content, over three adaptation methods: LoRA, Textual-Inversion, and DreamBooth.

Method

Our proposed method IMMA modifies pre-trained model weights $\theta^p$ with immunization methods $\mathcal{I}$ before adaptation $\mathcal{A}$, such that $\mathcal{A}$ fails to capture the target concept $\mathbf{c}'$ in the training images $\mathbf{x}'$ by training on immunized model weights $\mathcal{I}(\theta^p)$. To achieve this goal, we propose the following bi-level program: $$\overbrace{\max_{\theta_{\in\mathcal{S}}} L_{\mathcal{A}}(\mathbf{x}'_{\mathcal{I}}, \mathbf{c}'; \theta, \phi^\star)}^{\text{upper-level task}} \ \text{s.t.}\ \phi^\star = \overbrace{ \arg\min_\phi L_{\mathcal{A}}(\mathbf{x}'_{\mathcal{A}}, \mathbf{c}'; \theta, \phi)}^{\text{lower-level task}}.$$ Here, the set $\mathcal{S}$ denotes a subset of $\theta$ that is trained by IMMA. This set is a hyperparameter that we choose empirically. $\phi$ denotes the parameters that are being fine-tuned by $\mathcal{A}$.

Qualitative Results

By dragging the slider bar under each block of images, the visualized images vary along fine-tuning epochs for each of the method. We show quantitative comparison between without (the 2nd row) and with (the 3rd row) our proposed immunization method (IMMA) on the personalized content setting in Sec. 5.2. As in the paper, we use the prompt "A $[V]$ on the beach" following DreamBooth. In general, you will observe that without the immunization of IMMA, the models learn the concepts in the reference images in several epochs. On the other hand, models with IMMA struggle or fail to learn the concepts.

gas pump

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

tench

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

french horn

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

church

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

english springer

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

golf ball

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

garbage truck

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

parachute

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

cassette player

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

chain saw

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

Kelly Mckernan

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

Kirbi Fagan

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

Van Gogh

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

Kilian Eng

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

Tyler Edlin

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

Ajin Demi Human

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

Claude Monet

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

Thomas Kinkade

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

Pablo Picasso

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

decoritems houseplant

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

scene lighthouse

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

scene castle

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

wearable glasses

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

decoritems woodenpot

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

transport car

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

furniture chair

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

transport motorbike

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

instrument music

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

luggage purse

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

decoritems houseplant

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

scene lighthouse

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

scene castle

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

wearable glasses

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

decoritems woodenpot

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

transport car

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

furniture chair

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

transport motorbike

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

instrument music

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

luggage purse

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

decoritems houseplant

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

scene lighthouse

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

scene castle

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

wearable glasses

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

decoritems woodenpot

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

transport car

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

furniture chair

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

transport motorbike

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

instrument music

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

luggage purse

Reference

w/o IMMA

w/ IMMA

Fine-tuning Epoch :

Citation

@misc{zheng2023imma,
 title={IMMA: Immunizing text-to-image Models against Malicious Adaptation},
 author={Amber Yijia Zheng and Raymond A. Yeh},
 year={2023},
 eprint={2311.18815},
 archivePrefix={arXiv},
 primaryClass={cs.CV}
}