Skip to content
KID-7391Public

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Repository files navigation

CoTAP

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).

paper

Semantic Concentration for Self-Supervised Dense Representations Learning

Authors: Peisong Wen, Qianqian Xu*, Siran Dai, Runmin Cong, Qingming Huang*

assets/pipeline.png

🚩 Checkpoints

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

💻 Environments

  • Ubuntu 20.04
  • CUDA 11.6
  • Python 3.9.13
  • Pytorch 1.13.1

See requirement.txt for others.

🔧 Installation

  1. Clone this repository

    git clone https://github.com/KID-7391/cotap.git
  2. Create a virtual environment with Python 3.9 and install the dependencies

    conda create --name CoTAP python=3.9
    conda activate CoTAP
  3. Install the required libraries

    pip install -r requirements.txt

🚀 Training

Dataset

  1. Download ImageNet-1k, COCO, and COCOStuff164k.
  2. Download NNS (indices of the nearest neighbors).
  3. Place them in data with 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
            └── ...
    

Initialization Checkpoints

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 -

Scripts

See configs and scripts for default hyperparameters. Run the following command for training.

bash scripts/run_[backbone]_[init_method].sh

For examples:

bash scripts/run_vits16_dino.sh

📊 Evaluation

  1. Download the test datasets and place them into data: COCOStuff27, PASCAL-VOC, ADE20k, and Cityscapes.
  2. Modify evaluate_group in scripts/test_seg.sh to choose test settings; modify model in scripts/test_seg.sh and scripts/test_in1k_knn.sh to setup model paths.
  3. Run the following command for kNN classification and semantic segmentation:
bash scripts/test_in1k_knn.sh
bash scripts/test_seg.sh

🖋️ Citation

If 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},
}

📧 Contact us

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!

🌟 Acknowledgements

Our code is based on the official PyTorch implementation of DINO, Leopart, and STEGO.

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages