Official PyTorch implementation of "Hypergraph Vision Transformers: Images are More than Nodes, More than Edges" [2025].
We proposed HgVT, a vision model that incorporates hypergraph-based structures into vision transformers, improving classification accuracy and enabling implicit feature interpretability.
- Python >= 3.9.0
- PyTorch >= 2.0.1+cu12.1
git clone https://github.com/RGenDiff/hgvt.git
cd hgvt
pip install -e .
PRECISION="bf16" && \
export ATTN_PRECISION="fp32" && \
export USE_XFORMERS=1 && \
export USE_APEX=0 && \
python train.py \
--precision "$PRECISION" \
--gpus 2 \
--name name_of_run \
--logdir path/to/log/dir \
--config config.yaml
- Network code
- Document architecture
- Training code
- Evaluation code
- Feature visualization code
This repository uses code from the following open-sourced codebases:
@InProceedings{Fixelle_2025_CVPR,
author = {Fixelle, Joshua},
title = {Hypergraph Vision Transformers: Images are More than Nodes, More than Edges},
booktitle = {Proceedings of the Computer Vision and Pattern Recognition Conference (CVPR)},
month = {June},
year = {2025},
pages = {9751-9761}
}