This is the official code for the paper "Semantic Concentration for Self-Supervised Dense Representations Learning" accepted by IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI 2025).
Semantic Concentration for Self-Supervised Dense Representations Learning
Authors: Peisong Wen, Qianqian Xu*, Siran Dai, Runmin Cong, Qingming Huang*
| Method | Backbone | Linear Seg (mIoU) | kNN Cls (Acc) | Linear Cls (Acc) | Download |
|---|---|---|---|---|---|
| DINO+CoTAP | VIT-S/16 | 50.5 | 78.0 | 79.1 | link |
| Leopart+CoTAP | VIT-S/16 | 50.4 | 77.3 | 78.6 | link |
| iBOT+CoTAP | VIT-S/16 | 51.6 | 78.4 | 79.4 | link |
| Mugs+CoTAP | VIT-S/16 | 51.6 | 78.9 | 79.4 | link |
| DINO+CoTAP | VIT-B/16 | 52.2 | 79.2 | 80.2 | link |
| iBOT+CoTAP | VIT-B/16 | 53.9 | 80.1 | 80.8 | link |
| Mugs+CoTAP | VIT-B/16 | 52.1 | 80.8 | 81.7 | link |
| DINO+CoTAP | VIT-B/8 | 54.7 | 81.6 | 82.1 | link |
- Ubuntu 20.04
- CUDA 11.6
- Python 3.9.13
- Pytorch 1.13.1
See requirement.txt for others.
-
Clone this repository
git clone https://github.com/KID-7391/cotap.git
-
Create a virtual environment with Python 3.9 and install the dependencies
conda create --name CoTAP python=3.9 conda activate CoTAP
-
Install the required libraries
pip install -r requirements.txt
- Download ImageNet-1k, COCO, and COCOStuff164k.
- Download NNS (indices of the nearest neighbors).
- Place them in
datawith the following structure:CoTAP └── data ├── imagenet-1k | ├── train | | ├── n01440764 | | │ │── n01440764_18.JPEG | | │ └── ... | └── val | └── n01440764 | ├── ILSVRC2012_val_00000293.JPEG | └── ... ├── coco | ├── images | | ├── train2017 | | │ ├── 000000000009.jpg | | │ └── ... | | └── val2017 | | ├── 000000000139.jpg | | └── ... | ├── annotations | | ├── train2017 | | │ ├── 000000000009.png | | │ └── ... | | └── val2017 | | ├── 000000000139.png | | └── ... | └── curated └── nns ├── nns_vit_base_imagenet1k_train_None_224.npz └── ...
Download one of the following checkpoints for initialization. DINO checkpoints will be automatically downloaded.
| Method | Backbone | Linear Seg (mIoU) | kNN Cls (Acc) | Linear Cls (Acc) | Download |
|---|---|---|---|---|---|
| DINO | VIT-S/16 | 38.8 | 74.5 | 77.0 | - |
| Leopart | VIT-S/16 | 47.2 | 55.0 | 70.0 | link |
| iBOT | VIT-S/16 | 45.8 | 75.2 | 77.9 | link |
| Mugs | VIT-S/16 | 47.5 | 75.6 | 78.9 | link |
| DINO | VIT-B/16 | 44.0 | 76.1 | 78.2 | - |
| iBOT | VIT-B/16 | 49.6 | 77.1 | 79.5 | link |
| Mugs | VIT-B/16 | 49.6 | 78.0 | 80.6 | link |
| DINO | VIT-B/8 | 45.9 | 77.4 | 80.1 | - |
See configs and scripts for default hyperparameters. Run the following command for training.
bash scripts/run_[backbone]_[init_method].shFor examples:
bash scripts/run_vits16_dino.sh- Download the test datasets and place them into
data: COCOStuff27, PASCAL-VOC, ADE20k, and Cityscapes. - Modify
evaluate_groupinscripts/test_seg.shto choose test settings; modifymodelinscripts/test_seg.shandscripts/test_in1k_knn.shto setup model paths. - Run the following command for kNN classification and semantic segmentation:
bash scripts/test_in1k_knn.sh
bash scripts/test_seg.shIf you find this repository useful in your research, please cite the following papers:
@misc{wen2025semantic,
title={Semantic Concentration for Self-Supervised Dense Representations Learning},
author={Peisong Wen and Qianqian Xu and Siran Dai and Runmin Cong and Qingming Huang},
year={2025},
eprint={2509.09429},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2509.09429},
}
If you have any detailed questions or suggestions, you can email us: [email protected]. We will reply in 1-2 business days. Thanks for your interest in our work!
Our code is based on the official PyTorch implementation of DINO, Leopart, and STEGO.
