Few-Shot Object Detection via Association and DIscrimination

Related tags

Deep LearningFADI
Overview

Few-Shot Object Detection via Association and DIscrimination

Code release of our NeurIPS 2021 paper: Few-Shot Object Detection via Association and DIscrimination.

FSCE Figure

Bibtex

@inproceedings{cao2021few,
  title={Few-Shot Object Detection via Association and DIscrimination},
  author={Cao, Yuhang and Wang, Jiaqi and Jin, Ying and Wu, Tong and Chen, Kai and Liu, Ziwei and Lin, Dahua},
  booktitle={Thirty-Fifth Conference on Neural Information Processing Systems},
  year={2021}
}

Arxiv: https://arxiv.org/abs/2111.11656

Install dependencies

  • Create a new environment: conda create -n fadi python=3.8 -y
  • Active the newly created environment: conda activate fadi
  • Install PyTorch and torchvision: conda install pytorch=1.7 torchvision cudatoolkit=10.2 -c pytorch -y
  • Install MMDetection: pip install mmdet==2.11.0
  • Install MMCV: pip install mmcv==1.2.5
  • Install MMCV-Full: pip install mmcv-full==1.2.5 -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.7.0/index.html

Note:

  • Only tested on MMDet==2.11.0, MMCV==1.2.5, it may not be consistent with other versions.
  • The above instructions use CUDA 10.2, make sure you install the correct PyTorch, Torchvision and MMCV-Full that are consistent with your CUDA version.

Prepare dataset

We follow exact the same split with TFA, please download the dataset and split files as follows:

Create a directory data in the root directory, and the expected structure for data directory:

data/
    VOCdevkit
    few_shot_voc_split

Training & Testing

Base Training

FADI share the same base training stage with TFA, we directly convert the corresponding checkpoints from TFA in Detectron2 format to MMDetection format, please download the base training checkpoints following the table.

Name Split
AP50
download
Base Model 1 80.8 model  | surgery
Base Model 2 81.9 model  | surgery
Base Model 3 82.0 model  | surgery

Create a directory models in the root directory, and the expected structure for models directory:

models/
    voc_split1_base.pth
    voc_split1_base_surgery.pth
    voc_split2_base.pth
    voc_split2_base_surgery.pth
    voc_split3_base.pth
    voc_split3_base_surgery.pth

Few-Shot Fine-tuning

FADI divides the few-shot fine-tuning stage into two steps, ie, association and discrimination,

Suppose we want to train a model for Pascal VOC split1, shot1 with 8 GPUs

1. Step 1: Association.

Getting the assigning scheme of the split:

python tools/associate.py 1

Aligning the feature distribution of the associated base and novel classes:

./tools/dist_train.sh configs/voc_split1/fadi_split1_shot1_association.py 8

2. Step 2: Discrimination

Building a discriminate feature space for novel classes with disentangling and set-specialized margin loss:

./tools/dist_train.sh configs/voc_split1/fadi_split1_shot1_discrimination.py 8

Holistically Training:

We also provide you a script tools/fadi_finetune.sh to holistically train a model for a specific split/shot by running:

./tools/fadi_finetune.sh 1 1

Evaluation

To evaluate the trained models, run

./tools/dist_test.sh configs/voc_split1/fadi_split1_shot1_discrimination.py [checkpoint] 8 --eval mAP --out res.pkl

Model Zoo

Pascal VOC split 1

Shot
nAP50
download
1 50.6 association  | discrimination
2 54.8 association  | discrimination
3 54.1 association  | discrimination
5 59.4 association  | discrimination
10 63.5 association  | discrimination

Pascal VOC split 2

Shot
nAP50
download
1 30.5 association  | discrimination
2 35.1 association  | discrimination
3 40.3 association  | discrimination
5 42.9 association  | discrimination
10 48.3 association  | discrimination

Pascal VOC split 3

Shot
nAP50
download
1 45.7 association  | discrimination
2 49.4 association  | discrimination
3 49.4 association  | discrimination
5 55.1 association  | discrimination
10 59.3 association  | discrimination
Owner
Cao Yuhang
Cao Yuhang
The Body Part Regression (BPR) model translates the anatomy in a radiologic volume into a machine-interpretable form.

Copyright © German Cancer Research Center (DKFZ), Division of Medical Image Computing (MIC). Please make sure that your usage of this code is in compl

MIC-DKFZ 40 Dec 18, 2022
Changing the Mind of Transformers for Topically-Controllable Language Generation

We will first introduce the how to run the IPython notebook demo by downloading our pretrained models. Then, we will introduce how to run our training and evaluation code.

IESL 20 Dec 06, 2022
An efficient implementation of GPNN

Efficient-GPNN An efficient implementation of GPNN as depicted in "Drop the GAN: In Defense of Patches Nearest Neighbors as Single Image Generative Mo

7 Apr 16, 2022
Official PyTorch implementation and pretrained models of the paper Self-Supervised Classification Network

Self-Classifier: Self-Supervised Classification Network Official PyTorch implementation and pretrained models of the paper Self-Supervised Classificat

Elad Amrani 24 Dec 21, 2022
Code for Paper "Evidential Softmax for Sparse MultimodalDistributions in Deep Generative Models"

Evidential Softmax for Sparse Multimodal Distributions in Deep Generative Models Abstract Many applications of generative models rely on the marginali

Stanford Intelligent Systems Laboratory 9 Jun 06, 2022
《Fst Lerning of Temporl Action Proposl vi Dense Boundry Genertor》(AAAI 2020)

Update 2020.03.13: Release tensorflow-version and pytorch-version DBG complete code. 2019.11.12: Release tensorflow-version DBG inference code. 2019.1

Tencent 338 Dec 16, 2022
Sibur challange 2021 competition - 6 place

sibur challange 2021 Решение на 6 место: https://sibur.ai-community.com/competitions/5/tasks/13 Скор 1.4066/1.4159 public/private. Архитектура - однос

Ivan 5 Jan 11, 2022
Unofficial implementation (replicates paper results!) of MINER: Multiscale Implicit Neural Representations in pytorch-lightning

MINER_pl Unofficial implementation of MINER: Multiscale Implicit Neural Representations in pytorch-lightning. 📖 Ref readings Laplacian pyramid explan

AI葵 51 Nov 28, 2022
✂️ EyeLipCropper is a Python tool to crop eyes and mouth ROIs of the given video.

EyeLipCropper EyeLipCropper is a Python tool to crop eyes and mouth ROIs of the given video. The whole process consists of three parts: frame extracti

Zi-Han Liu 9 Oct 25, 2022
A clean and extensible PyTorch implementation of Masked Autoencoders Are Scalable Vision Learners

A clean and extensible PyTorch implementation of Masked Autoencoders Are Scalable Vision Learners A PyTorch re-implementation of Mask Autoencoder trai

Tianyu Hua 23 Dec 13, 2022
Graduation Project

Gesture-Detection-and-Depth-Estimation This is my graduation project. (1) In this project, I use the YOLOv3 object detection model to detect gesture i

ChaosAT 1 Nov 23, 2021
Minimal implementation of PAWS (https://arxiv.org/abs/2104.13963) in TensorFlow.

PAWS-TF 🐾 Implementation of Semi-Supervised Learning of Visual Features by Non-Parametrically Predicting View Assignments with Support Samples (PAWS)

Sayak Paul 43 Jan 08, 2023
Animal Sound Classification (Cats Vrs Dogs Audio Sentiment Classification)

this is a simple artificial neural network model using deep learning and torch-audio to classify cats and dog sounds.

crispengari 3 Dec 05, 2022
Code for Fully Context-Aware Image Inpainting with a Learned Semantic Pyramid

SPN: Fully Context-Aware Image Inpainting with a Learned Semantic Pyramid Code for Fully Context-Aware Image Inpainting with a Learned Semantic Pyrami

12 Jun 27, 2022
Official implementation of DreamerPro: Reconstruction-Free Model-Based Reinforcement Learning with Prototypical Representations in TensorFlow 2

DreamerPro Official implementation of DreamerPro: Reconstruction-Free Model-Based Reinforcement Learning with Prototypical Representations in TensorFl

22 Nov 01, 2022
BADet: Boundary-Aware 3D Object Detection from Point Clouds (Pattern Recognition 2022)

BADet: Boundary-Aware 3D Object Detection from Point Clouds (Pattern Recognition

Rui Qian 17 Dec 12, 2022
Shōgun

The SHOGUN machine learning toolbox Unified and efficient Machine Learning since 1999. Latest release: Cite Shogun: Develop branch build status: Donat

Shōgun ML 2.9k Jan 04, 2023
Supplementary code for the experiments described in the 2021 ISMIR submission: Leveraging Hierarchical Structures for Few Shot Musical Instrument Recognition.

Music Trees Supplementary code for the experiments described in the 2021 ISMIR submission: Leveraging Hierarchical Structures for Few Shot Musical Ins

Hugo Flores García 32 Nov 22, 2022
A Review of Deep Learning Techniques for Markerless Human Motion on Synthetic Datasets

HOW TO USE THIS PROJECT A Review of Deep Learning Techniques for Markerless Human Motion on Synthetic Datasets Based on DeepLabCut toolbox, we run wit

1 Jan 10, 2022
PyTorch Implementation of our paper Explain Me the Painting: Multi-Topic Knowledgeable Art Description Generation

PyTorch Implementation of our paper Explain Me the Painting: Multi-Topic Knowledgeable Art Description Generation

Zechen Bai 12 Jul 08, 2022