GithubHelp home page GithubHelp logo

d-c-a-i / dualvar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lzhangbj/dualvar

0.0 0.0 0.0 9.51 MB

code for BMVC 2021 poster paper "Inter-intra Variant Dual Representations for Self-supervised Video Recognition"

Python 91.50% Shell 8.50%

dualvar's Introduction

Official implementation for BMVC 2021 poster paper "Inter-intra Variant Dual Representations for Self-supervised Video Recognition"

Contrastive learning applied to self-supervised representation learning has seen a resurgence in deep models. In this paper, we find that existing contrastive learning based solutions for self-supervised video recognition focus on inter-variance encoding but ignore the intra-variance existing in clips within the same video. We thus propose to learn dual representations for each clip which (i) encode intra-variance through a shuffle-rank pretext task; (ii) encode inter-variance through a temporal coherent contrastive loss. Experiment results show that our method plays an essential role in balancing inter and intra variances and brings consistent performance gains on multiple backbones and contrastive learning frameworks. Integrated with SimCLR and pretrained on Kinetics-400, our method achieves 82.0% and 51.2% downstream classification accuracy on UCF101 and HMDB51 test sets respectively and 46.1% video retrieval accuracy on UCF101, outperforming both pretext-task based and contrastive learning based counterparts.

Overview

Set up

The code is based on Python3.8 and PyToch 1.8.1.

Data preparation

  1. Download UCF101, HMDB51 and Kinetics400 dataset.
  2. Slice videos into frames using process_data/src/extract_frame.py
  3. Write sliced frame into csv file using process_data/src/write_csv.py

Running experiment

Before running code

  1. Replace dataset directory in dataset/local_dataset.py

  2. Prepare your own running settings paper_scripts/*/*/sh

We provide pretrain, finetune, test and test retrieval command in paper_scripts. We also pack up all commands into one file in run mode. Select you running mode {mode} and experiment name {exp} , and run

bash paper_scripts/{mode}/{exp}.sh

Peformance comparison

Finetuning Comparison

Retrieval Comparison

Feature vistribution visualization

Feat_Distribution

Acknowledgement

We refer the code frameworks of CoCLR. Thank Tengda for his excellent work!

If you find our work useful, please cite it:

@article{lin2021dualvar
 author = {Lin, Zhang and Qi, She and Zhengyang, Shen and Changhu, Wang},
 booktitle = {BMVC},
 title = {Inter-intra Variant Dual Representations forSelf-supervised Video Recognition},
 year = {2021}
}

dualvar's People

Contributors

lzhangbj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.