Home

Awesome

GOCA

Guided Online Cluster Assignment for Self Supervised Video Representation Learning. <br> <sub>Official PyTorch Implementation of the ECCV 2022 Paper. Feel free to contact hcoskun-at-snap.com if you have questions.</sub>

Overview

We propose a principled way to combine two views. Specifically, we propose a novel clustering strategy where we use the initial cluster assignment of each modality as prior to guide the final cluster assignment of the other modality. This idea will enforce similar cluster structures for both modalities, and the formed clusters will be semantically abstract and robust to noisy inputs coming from each individual modality. <br> You can find the implementation of this idea in sinkhorn_withprior <img src="figs/architecture-1.jpg" width="1584">

Link:

[Arxiv]

Prerequisites

Preparing Dataset

  1. Download dataset sh datasets/ds_prep/kinetics-400/download.sh
  2. Extract rar files sh datasets/ds_prep/kinetics-400/extract.sh
  3. We use the TVL1 algorithm to compute optical-flow. We modified the MemDPC Code for efficient GPU utilization to compute optical flow.
    1. Run this script python datasets/ds_prep/efficent_optical_flow_with_GPU.py
    2. If you have more than one-GPU to dedicate computing the optical flow, you can run this script for each GPU.
    3. Unfortunately, I couldn't find a way to batch-wise optical flow computation with open-CV. If you can manage it, please let me know.

Pretrain Instruction

  1. Generate prototypes python prots/prototypes.py

    1. It will save the prototypes to "prot/fls/" and the model will load from there. If you save another location please update "helper/opt_aug.py".
    2. Please be sure that use_precomp_prot set true otherwise model will use randomly generated prototypes.
    3. Trained prototypes should look like Figure 3 (on the right) in the paper.
  2. Run pre-training: sh scripts/pretrain_on_cluster.sh

    1. The above script is for multi-node slurm training, however, code can be used for single node training as well.
    2. Please setup your dataset location in ".sh" file or in "helper/opt_aug.py" file.

Nearest-neighbour Retrieval Instruction

You can use the following script for evaluation. You need to be sure that "root_dir" argument is correctly set.

 sh scripts/knn_on_cluster.sh

please update "root_dir" for your computed features. Model generates features during the evaluation stage. You can set where to save in the

Acknowledgements

We used code from Selavi, SWaV, VICC, and CoCLR

Notes On Code

Citation

@inproceedings{goca,
  title={GOCA: Guided Online Cluster Assignment for Self Supervised Video Representation Learning},
  author={Coskun, Huseyin and Zareian, Alireza and Moore, Joshua L and Tombari, Federico and Wang, Chen},
  booktitle={ECCV},
  year={2022}
}