Scribble at 2024-10-15 20:27:03 Last modified: 2024-10-15 20:27:37
Recently, text-to-image models have been thriving. Despite their powerful generative capacity, our research has uncovered a lack of robustness in this generation process. Specifically, the introduction of small perturbations to the text prompts can result in the blending of primary subjects with other categories or their complete disappearance in the generated images. In this paper, we propose Auto-attack on Text-to-image Models (ATM), a gradient-based approach, to effectively and efficiently generate such perturbations. By learning a Gumbel Softmax distribution, we can make the discrete process of word replacement or extension continuous, thus ensuring the differentiability of the perturbation generation. Once the distribution is learned, ATM can sample multiple attack samples simultaneously. These attack samples can prevent the generative model from generating the desired subjects without tampering with the category keywords in the prompt. ATM has achieved a 91.1\% success rate in short-text attacks and an 81.2\% success rate in long-text attacks. Further empirical analysis revealed three attack patterns based on: 1) variability in generation speed, 2) similarity of coarse-grained characteristics, and 3) polysemy of words. The code is available at https://github.com/duchengbin8/StableDiffusionis_Unstable
上記の abstract で末尾に紹介されている GitHub の URL は間違いである。正しくは:https://github.com/duchengbin8/Stable_Diffusion_is_Unstable
この論文は、txt2img の拡散モデルである Stable Diffusion について、些細なプロンプトを混ぜるだけで余計なオブジェクトが追加されたり、必要なオブジェクトが消えてしまうという脆弱性を紹介しており、そのための攻撃手法も提案している。SD の利用者である僕らも参考になる内容だと思う。
Stable Diffusion のモデルには、たとえば生成速度の速いイメージと遅いイメージというのがあって、出力される画像の形成においては生成速度の速いイメージに全体が引っ張られる傾向があるらしい。そして、生成されるときの特性が類似しているイメージどうしは混ざり合う傾向があるという。それから多義語について特定の意味になる関連語を注入することによって、想定されていた意味合いを除去できる。
ただ、ここまでの説明でも気づくと思うが、キーワードがもつメタ・データどうしの「距離」を測って、出力されるイメージの類似性とか再現性のようなものを表現しているのだから、こんなノイズを入れたら Diffusion モデルの安定性が損なわれるなんてことは、僕らのようなレベルのユーザにすら分かるような話であろう。特に最後の、異なる脈絡で意味をもつキーワードを追加したら、想定していた意味とは違う脈絡でキーワードを解釈してしまうなんてことは、そんなの当たり前だと思う人も多いだろう。なので、これで "stable diffusion is unstable" と言われても、そんなキーワードを混ぜるからに決まってるだろうとしか言えない。もう少し丁寧に読まないといけないのだろうとは思うが、どうもなんだか学部レベルのレポートを読まされているような印象を受ける。