Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,126 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
---
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
task_categories:
|
| 5 |
+
- image-retrieval
|
| 6 |
+
- vision-language-navigation
|
| 7 |
+
tags:
|
| 8 |
+
- composed-image-retrieval
|
| 9 |
+
- multimodal-retrieval
|
| 10 |
+
- pytorch
|
| 11 |
+
- aaai-2025
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
<a id="top"></a>
|
| 15 |
+
<div align="center">
|
| 16 |
+
<h1>(AAAI 2025) ENCODER: Entity Mining and Modification Relation Binding for Composed Image Retrieval (Model Weights)</h1>
|
| 17 |
+
<div>
|
| 18 |
+
<a target="_blank" href="https://lee-zixu.github.io/">Zixu Li</a><sup>1</sup>,
|
| 19 |
+
<a target="_blank" href="https://zivchen-ty.github.io/">Zhiwei Chen</a><sup>1</sup>,
|
| 20 |
+
<a target="_blank" href="https://haokunwen.github.io">Haokun Wen</a><sup>2,3</sup>,
|
| 21 |
+
<a target="_blank" href="https://zhihfu.github.io/">Zhiheng Fu</a><sup>1</sup>,
|
| 22 |
+
<a target="_blank" href="https://faculty.sdu.edu.cn/huyupeng1/zh_CN/index.htm">Yupeng Hu</a><sup>1✉</sup>,
|
| 23 |
+
<a target="_blank" href="https://homepage.hit.edu.cn/guanweili">Weili Guan</a><sup>2</sup>
|
| 24 |
+
</div>
|
| 25 |
+
<sup>1</sup>School of Software, Shandong University    </span> <br />
|
| 26 |
+
<sup>2</sup>School of Computer Science and Technology, Harbin Institute of Technology (Shenzhen),    </span> <br />
|
| 27 |
+
<sup>2</sup>School of Data Science, City University of Hong Kong    </span>
|
| 28 |
+
<br />
|
| 29 |
+
<sup>✉ </sup>Corresponding author  </span>
|
| 30 |
+
<br/>
|
| 31 |
+
|
| 32 |
+
<p>
|
| 33 |
+
<a href="https://aaai.org/Conferences/AAAI-25/"><img src="https://img.shields.io/badge/AAAI-2025-blue.svg?style=flat-square" alt="AAAI 2025"></a>
|
| 34 |
+
<a href="https://ojs.aaai.org/index.php/AAAI/article/view/32541"><img alt='Paper' src="https://img.shields.io/badge/Paper-AAAI.32541-green.svg"></a>
|
| 35 |
+
<a href="https://sdu-l.github.io/ENCODER.github.io/"><img alt='Project Page' src="https://img.shields.io/badge/Website-orange"></a>
|
| 36 |
+
<a href="https://github.com/Lee-zixu/ENCODER"><img alt='GitHub' src="https://img.shields.io/badge/GitHub-Repository-black?style=flat-square&logo=github"></a>
|
| 37 |
+
</p>
|
| 38 |
+
</div>
|
| 39 |
+
|
| 40 |
+
**One-sentence Introduction:** This repository hosts the official pre-trained model weights for **ENCODER**, a novel network designed to explicitly mine visual entities and modification actions, and securely bind implicit modification relations in Composed Image Retrieval (CIR).
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## π Model Information
|
| 45 |
+
|
| 46 |
+
### 1. Model Name
|
| 47 |
+
**ENCODER** (Entity miNing and modifiCation relation binDing nEtwoRk) Checkpoints.
|
| 48 |
+
|
| 49 |
+
### 2. Task Type & Applicable Tasks
|
| 50 |
+
- **Task Type:** Composed Image Retrieval (CIR).
|
| 51 |
+
- **Applicable Tasks:** Retrieving a target image based on a reference image and a corresponding modification text. The model excels at capturing fine-grained modification relations through multimodal semantic alignment.
|
| 52 |
+
|
| 53 |
+
### 3. Project Introduction
|
| 54 |
+
Existing CIR approaches often struggle with the modification relation between visual entities and modification actions due to irrelevant factor perturbation, vague semantic boundaries, and implicit modification relations.
|
| 55 |
+
|
| 56 |
+
**ENCODER** introduces three innovative modules to achieve precise multimodal semantic alignment:
|
| 57 |
+
- π **Latent Factor Filter (LFF):** Filters out irrelevant visual and textual factors.
|
| 58 |
+
- π **Entity-Action Binding (EAB):** Employs modality-shared Learnable Relation Queries (LRQ) to mine visual entities and actions, learning their implicit relations to bind them effectively.
|
| 59 |
+
- π§© **Multi-scale Composition (MSC):** Performs multi-scale feature composition to precisely push the retrieved feature closer to the target image.
|
| 60 |
+
|
| 61 |
+
### 4. Training Data Source & Hosted Weights
|
| 62 |
+
The models were trained across four widely-used CIR datasets: **FashionIQ**, **Shoes**, **Fashion200K**, and **CIRR**. This Hugging Face repository provides the pre-trained `.pt` checkpoint files for each corresponding dataset:
|
| 63 |
+
|
| 64 |
+
* π `cirr.pt`: Checkpoint trained on the open-domain CIRR dataset.
|
| 65 |
+
* π `fashion200k.pt`: Checkpoint trained on the Fashion200K dataset.
|
| 66 |
+
* π `fashioniq.pt`: Checkpoint trained on the FashionIQ dataset.
|
| 67 |
+
* π `shoes.pt`: Checkpoint trained on the Shoes dataset.
|
| 68 |
+
|
| 69 |
+
---
|
| 70 |
+
|
| 71 |
+
## π Usage & Basic Inference
|
| 72 |
+
|
| 73 |
+
These weights are designed to be evaluated seamlessly using the official [ENCODER GitHub repository](https://github.com/Lee-zixu/ENCODER).
|
| 74 |
+
|
| 75 |
+
### Step 1: Prepare the Environment
|
| 76 |
+
Clone the GitHub repository and install dependencies:
|
| 77 |
+
```bash
|
| 78 |
+
git clone [https://github.com/Lee-zixu/ENCODER.git](https://github.com/Lee-zixu/ENCODER.git)
|
| 79 |
+
cd ENCODER
|
| 80 |
+
conda create -n encoder_env python=3.9
|
| 81 |
+
conda activate encoder_env
|
| 82 |
+
pip install torch torchvision torchaudio --index-url [https://download.pytorch.org/whl/cu118](https://download.pytorch.org/whl/cu118)
|
| 83 |
+
pip install -r requirements.txt
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
### Step 2: Download Model Weights
|
| 87 |
+
Download the specific `.pt` files you wish to evaluate from this Hugging Face repository. Place them into a `checkpoints/` directory within your cloned GitHub repo.
|
| 88 |
+
|
| 89 |
+
### Step 3: Run Evaluation
|
| 90 |
+
To test your trained model on the validation set, use the `evaluate_model.py` script and point it to the downloaded weights:
|
| 91 |
+
```bash
|
| 92 |
+
python3 evaluation_model.py \
|
| 93 |
+
--model_dir checkpoints/fashioniq.pt \
|
| 94 |
+
--dataset fashioniq \
|
| 95 |
+
--fashioniq_path "path/to/FashionIQ"
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
To generate the predictions file for uploading to the [CIRR Evaluation Server](https://cirr.cecs.anu.edu.au/), run:
|
| 99 |
+
```bash
|
| 100 |
+
python src/cirr_test_submission.py checkpoints/cirr.pt
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## β οΈ Limitations & Notes
|
| 106 |
+
|
| 107 |
+
- **Version Compatibility:** Different versions of `open_clip` can impact model performance. To ensure consistent State-of-the-Art performance as reported in the paper, please strictly adhere to the environment dependencies specified in the `requirements.txt` file of the official repository.
|
| 108 |
+
- **State Dict Version:** These hosted weights are the updated "state_dict" version for stable evaluation.
|
| 109 |
+
|
| 110 |
+
---
|
| 111 |
+
|
| 112 |
+
## πβοΈ Citation
|
| 113 |
+
|
| 114 |
+
If you find this code or our paper useful for your research, please consider leaving a **Star** βοΈ on our GitHub repository and citing our AAAI 2025 paper:
|
| 115 |
+
|
| 116 |
+
```bibtex
|
| 117 |
+
@inproceedings{ENCODER,
|
| 118 |
+
title={Encoder: Entity mining and modification relation binding for composed image retrieval},
|
| 119 |
+
author={Li, Zixu and Chen, Zhiwei and Wen, Haokun and Fu, Zhiheng and Hu, Yupeng and Guan, Weili},
|
| 120 |
+
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
|
| 121 |
+
volume={39},
|
| 122 |
+
number={5},
|
| 123 |
+
pages={5101--5109},
|
| 124 |
+
year={2025}
|
| 125 |
+
}
|
| 126 |
+
```
|