File size: 3,182 Bytes
792f184
 
ac26558
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
license: mit
---

# Model Card for EAR

<!-- Provide a quick summary of what the model is/does. -->

This is an EAR (Erasing Autoregressive Models) model trained to erase specific concepts.

## Model Details

### Model Description

<!-- Provide a longer summary of what this model is. -->



- **Developed by:** IMMC
- **Model type:** AR model
- **License:** MIT
- **Finetuned from model :** Janus-Pro

### Model Sources

<!-- Provide the basic links for the model. -->

- **Repository:** [[link](https://github.com/immc-lab/ear)]
- **Paper:** [[link](https://arxiv.org/abs/2506.20151)]

## Installation Guide

### EAR Environment

```shell
git clone https://github.com/immc-lab/ear.git
cd ear
conda create -n ear python=3.12
conda activate ear
pip install -r requirements.txt
```

### Janus-Pro Environment

Ensure that your environment can run Janus-Pro, refer to its
official [Quick Start](https://github.com/deepseek-ai/Janus) for details.

## Training Guide

After installation, follow these instructions to train EAR model for Janus-Pro.

Please run the script in `train/` after checking the file path:

```shell
python train/ear_train_church.py 
```

## Generating Images with EAR

Image generation using the custom EAR model is a straightforward process. Please run the script in `infer/`.

For automated batch generation of evaluation images, utilize the following script:

```shell
python infer/infer_church.py
```

## Evaluation

You can execute the following command to evaluate the generated data. Please run the script in `eval/`.

The specific evaluation method can be found in our [paper](https://arxiv.org/pdf/2506.20151).

```shell
python eval/eval_object.py  --folder_path {args.output_dir} --topk 10 --batch_size 250
```

## References

This repo is the code for the paper *EAR: Erasing Concepts from Unified Autoregressive Models*.

Thanks for the creative ideas of the pioneer researches:

- https://github.com/rohitgandikota/erasing: **Erasing Concepts from Diffusion Models**
- https://github.com/Con6924/SPM: **One-dimentional Adapter to Rule Them All: Concepts, Diffusion Models and Erasing
  Applications**
- https://github.com/koushiksrivats/robust-concept-erasing: **STEREO: A Two-Stage Framework for Adversarially Robust
  Concept Erasing from Text-to-Image Diffusion Models**
- https://github.com/OPTML-Group/Diffusion-MU-Attack: **To Generate or Not? Safety-Driven Unlearned Diffusion Models Are
  Still Easy To Generate Unsafe Images ... For Now**
- https://github.com/deepseek-ai/Janus: **Janus: Decoupling Visual Encoding for Unified Multimodal Understanding and
  Generation**
- https://github.com/deepseek-ai/Janus: **Janus-Pro: Unified Multimodal Understanding and Generation with Data and Model
  Scaling**

## Citing our work

The preprint can be cited as follows

```bibtex
@misc{fan2025earerasingconceptsunified,
      title={EAR: Erasing Concepts from Unified Autoregressive Models}, 
      author={Haipeng Fan and Shiyuan Zhang and Baohunesitu and Zihang Guo and Huaiwen Zhang},
      year={2025},
      eprint={2506.20151},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2506.20151}, 
}
```