|
from dataclasses import dataclass |
|
from enum import Enum |
|
|
|
@dataclass |
|
class Task: |
|
benchmark: str |
|
metric: str |
|
col_name: str |
|
|
|
|
|
|
|
|
|
class Tasks(Enum): |
|
|
|
task0 = Task("anli_r1", "acc", "ANLI") |
|
task1 = Task("logiqa", "acc_norm", "LogiQA") |
|
|
|
NUM_FEWSHOT = 0 |
|
|
|
|
|
|
|
|
|
|
|
TITLE = """<h1 align="center" id="space-title">UnlearnDiffAtk Benchmark</h1>""" |
|
|
|
|
|
SUB_TITLE = """<h2 align="center" id="space-title">Effective and efficient adversarial prompt generation approach for diffusion models</h2>""" |
|
|
|
|
|
INTRODUCTION_TEXT = """ |
|
This benchmark is evaluates the robustness of safety-driven unlearned diffusion models (DMs) |
|
(i.e., DMs after unlearning undesirable concepts, styles, or objects) across a variety of tasks. For more details, please visit the [project](https://www.optml-group.com/posts/mu_attack), |
|
check the [code](https://github.com/OPTML-Group/Diffusion-MU-Attack), and read the [paper](https://arxiv.org/abs/2310.11868).\\ |
|
Demo of our offensive method: [UnlearnDiffAtk](https://huggingface.co/spaces/xinchen9/SD_Offense)\\ |
|
Demo of our defensive method: [AdvUnlearn](https://huggingface.co/spaces/xinchen9/SD_Defense) |
|
""" |
|
|
|
|
|
LLM_BENCHMARKS_TEXT = f""" |
|
## How it works |
|
|
|
## Reproducibility |
|
To reproduce our results, here is the commands you can run: |
|
|
|
""" |
|
|
|
EVALUATION_QUEUE_TEXT = """ |
|
Evaluation Metrics: Attack success rate (ASR) into two categories: (1) the pre-attack success rate (pre-ASR), and (2) the post-attack success rate (post-ASR) |
|
Fréchet inception distance(FID) |
|
""" |
|
|
|
CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results" |
|
CITATION_BUTTON_TEXT = r""" |
|
@article{zhang2023generate, |
|
title={To Generate or Not? Safety-Driven Unlearned Diffusion Models Are Still Easy To Generate Unsafe Images... For Now}, |
|
author={Zhang, Yimeng and Jia, Jinghan and Chen, Xin and Chen, Aochuan and Zhang, Yihua and Liu, Jiancheng and Ding, Ke and Liu, Sijia}, |
|
journal={arXiv preprint arXiv:2310.11868}, |
|
year={2023} |
|
} |
|
|
|
@article{zhang2024defensive, |
|
title={Defensive Unlearning with Adversarial Training for Robust Concept Erasure in Diffusion Models}, |
|
author={Zhang, Yimeng and Chen, Xin and Jia, Jinghan and Zhang, Yihua and Fan, Chongyu and Liu, Jiancheng and Hong, Mingyi and Ding, Ke and Liu, Sijia}, |
|
journal={arXiv preprint arXiv:2405.15234}, |
|
year={2024} |
|
} |
|
""" |