Downloads ยท 30 days
0
HaHaJun1101/AdaFocal
AdaFocal is a machine learning model from HaHaJun1101. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as cc-by-4.0.
๐ Paper (arXiv) | ๐ Homepage | ๐ Code (GitHub) | ๐ค Dataset (OACIRR) | <a href="downloading-the-adafocal-weights" style="color: red;"๐ Download Weights Now ๐</a
Downloads ยท 30 days
0
Access
Public
Updated Jun 22, 2026
Repo size
5.5 GB
Likes
1
Public
Click a slice to open those files.
.pt5.5 GB ยท 100%
From the Hugging Face model README
๐ Paper (arXiv) | ๐ Homepage | ๐ Code (GitHub) | ๐ค Dataset (OACIRR) | <a href="#downloading-the-adafocal-weights" style="color: red;">๐ Download Weights Now ๐</a>
To address the core challenges of the OACIR task, we propose AdaFocal, an effective framework that dynamically modulates visual attention for precise, instance-level retrieval. Our approach augments a multimodal fusion backbone with a lightweight Context-Aware Attention Modulator (CAAM), enabling a nuanced balance between instance fidelity and compositional reasoning.
<p align="left"> <img src="https://huggingface.co/datasets/HaHaJun1101/OACIRR/resolve/main/figures/AdaFocal_framework.png" width="100%" alt="AdaFocal Framework Overview" /> </p>Specifically, AdaFocal employs a two-stage reasoning process: Contextual Perception and Adaptive Focus. It first perceives the query's compositional context to predict a modulation scalar (ฮฒ). This learned signal then drives an Attention Activation Mechanism, which explicitly and adaptively intensifies the visual focus on the user-specified instance region (provided via bounding box) during multimodal feature fusion.
By dynamically re-weighting the attention distribution, AdaFocal seamlessly synthesizes the anchored instance, the global visual scene, and the textual modification into a coherent representation, establishing a robust and flexible baseline for identity-preserving retrieval.
<a name="downloading-the-adafocal-weights"></a>
You can download the checkpoints using Git LFS:
cd OACIR
git lfs install
git clone https://huggingface.co/HaHaJun1101/AdaFocal ./checkpoints
Alternatively, download them via the Hugging Face Python API:
from huggingface_hub import snapshot_download
snapshot_download(repo_id="HaHaJun1101/AdaFocal", local_dir="OACIR/checkpoints", repo_type="model")
Once downloaded, you can directly evaluate the models using the evaluate.sh script provided in our GitHub codebase. Open evaluate.sh and set the path to your downloaded weights:
# Inside evaluate.sh
DATASET="Fashion"
MODEL_NAME="oacir_adafocal"
MODEL_WEIGHT="./checkpoints/adafocal_scalar.pt" # or adafocal_vector.pt
Then execute the script:
bash evaluate.sh
We provide two variants of the AdaFocal weights. You can instantly reproduce the following results using our provided evaluate.sh script.
| Model Variant | Component Type | R<sub>ID</sub>@1 (Avg) | R@1 (Avg) | R@5 (Avg) | Overall Avg | Weights File |
|---|---|---|---|---|---|---|
| AdaFocal (Scalar ฮฒ) | Default Configuration | 81.52 | 63.08 | 90.98 | 78.53 | adafocal_scalar.pt |
| AdaFocal (Vector ฮฒ) | Vector Ablation | 81.99 | 63.06 | 91.35 | 78.80 | adafocal_vector.pt |
Detailed breakdowns across the 4 domains:
| Variant | <font color=#990000>Fashion</font> (R<sub>ID</sub>@1 / R@1) | <font color=#CC3300>Car</font> (R<sub>ID</sub>@1 / R@1) | <font color=#003399>Product</font> (R<sub>ID</sub>@1 / R@1) | <font color=#006633>Landmark</font> (R<sub>ID</sub>@1 / R@1) |
|---|---|---|---|---|
| Scalar ฮฒ | 73.68 / 64.45 | 78.39 / 54.85 | 91.36 / 73.85 | 82.65 / 59.18 |
| Vector ฮฒ | 75.71 / 65.97 | 77.97 / 54.35 | 91.39 / 73.30 | 82.90 / 58.63 |
If you find our dataset, models, or codebase useful in your research, please consider citing our paper:
@inproceedings{yang2026beyond,
title={Beyond Semantic Search: Towards Referential Anchoring in Composed Image Retrieval},
author={Yang, Yuxin and Zhou, Yinan and Chen, Yuxin and Zhang, Ziqi and Ma, Zongyang and Yuan, Chunfeng and Li, Bing and Gao, Jun and Hu, Weiming},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={31155--31165},
year={2026}
}