Official code of "Mitigating the Mutual Error Amplification for Semi-Supervised Object Detection"

Overview

CrossTeaching-SSOD

0. Introduction

Official code of "Mitigating the Mutual Error Amplification for Semi-Supervised Object Detection"

This repo includes training SSD300 and training Faster-RCNN-FPN on the Pascal VOC benchmark. The scripts about training SSD300 are based on ssd.pytorch (https://github.com/amdegroot/ssd.pytorch/). The scripts about training Faster-RCNN-FPN are based on the official Detectron2 repo (https://github.com/facebookresearch/detectron2/).

1. Environment

Python = 3.6.8

CUDA Version = 10.1

Pytorch Version = 1.6.0

detectron2 (for Faster-RCNN-FPN)

2. Prepare Dataset

Download and extract the Pascal VOC dataset.

For SSD300, specify the VOC_ROOT variable in data/voc0712.py and data/voc07_consistency.py as /home/username/dataset/VOCdevkit/

For Faster-RCNN-FPN, set the environmental variable in this way: export DETECTRON2_DATASETS=/home/username/dataset/VOCdevkit/

3. Instruction

3.1 Reproduce Table.1

Go into the SSD300 directory, then run the following scripts.

supervised training (VOC 07 labeled, without extra augmentation):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_ssd.py --save_interval 12000

self-labeling (VOC 07 labeled + VOC 12 unlabeled, without extra augmentation):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_pseudo39.py --resume weights/ssd300_12000.pth --ramp --save_interval 12000

supervised training (VOC 0712 labeled, without extra augmentation):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_ssd0712.py --save_interval 12000

supervised training (VOC 07 labeled, with horizontal flip):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_csd_sup2.py --save_interval 12000

self-labeling (VOC 07 labeled + VOC 12 unlabeled, with horizontal flip):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_csd.py --save_interval 12000

supervised training (VOC 0712 labeled, with horizontal flip):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_csd_sup_0712.py --save_interval 12000

supervised training (VOC 07 labeled, with mix-up augmentation):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_isd_sup2.py --save_interval 12000

self-labeling (VOC 07 labeled + VOC 12 unlabeled, with mix-up augmentation):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_only_isd.py --save_interval 12000

supervised training (VOC 0712 labeled, with mix-up augmentation):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_isd_sup_0712.py --save_interval 12000

3.2 Reproduce Table.2

Go into the SSD300 directory, then run the following scripts.

supervised training (VOC 07 labeled, without augmentation):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_ssd.py --save_interval 12000

self-labeling (VOC 07 labeled + VOC 12 unlabeled, confidence threshold=0.5):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_pseudo39.py --resume weights/ssd300_12000.pth --ramp --save_interval 12000

self-labeling (VOC 07 labeled + VOC 12 unlabeled, confidence threshold=0.8):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_pseudo39-0.8.py --resume weights/ssd300_12000.pth --ramp --save_interval 12000

self-labeling (random FP label, confidence threshold=0.5):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_pseudo102.py --resume weights/ssd300_12000.pth --ramp --save_interval 12000

self-labeling (use only TP, confidence threshold=0.5):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_pseudo36.py --resume weights/ssd300_12000.pth --ramp --save_interval 12000

self-labeling (use only TP, confidence threshold=0.8):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_pseudo36-0.8.py --resume weights/ssd300_12000.pth --ramp --save_interval 12000

self-labeling (use true label, confidence threshold=0.5):

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_pseudo32.py --resume weights/ssd300_12000.pth --ramp --save_interval 12000

Go into the detectron2 directory.

supervised training (VOC 07 labeled, go into VOC07-sup-bs16):

python3 train_net.py --num-gpus 8 --config configs/voc/voc07_voc12.yaml

self-labeling (VOC 07 labeled + VOC 12 unlabeled, go into VOC07-sup-VOC12-unsup-self-teaching-0.7):

python3 train_net.py --resume --num-gpus 8 --config configs/voc/voc07_voc12.yaml MODEL.WEIGHTS output/model_0005999.pth SOLVER.CHECKPOINT_PERIOD 18000

self-labeling (random FP label, go into VOC07-sup-VOC12-unsup-self-teaching-0.7-random-wrong):

python3 train_net.py --resume --num-gpus 8 --config configs/voc/voc07_voc12.yaml MODEL.WEIGHTS output/model_0005999.pth SOLVER.CHECKPOINT_PERIOD 18000

self-labeling (use true label, go into VOC07-sup-VOC12-unsup-self-teaching-0.7-only-correct):

python3 train_net.py --resume --num-gpus 8 --config configs/voc/voc07_voc12.yaml MODEL.WEIGHTS output/model_0005999.pth SOLVER.CHECKPOINT_PERIOD 18000

3.3 Reproduce Table.3

Go into the SSD300 directory, then run the following scripts.

cross teaching

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_pseudo137.py --resume weights/ssd300_12000.pth --resume2 weights/default/ssd300_12000.2.pth --save_interval 12000 --ramp --ema_rate 0.99 --ema_step 10

cross teaching + mix-up augmentation

CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train_pseudo151.py --resume weights/ssd300_12000.pth --resume2 weights/default/ssd300_12000.2.pth --save_interval 12000 --ramp --ema_rate 0.99 --ema_step 10

Go into the detectron2/VOC07-sup-VOC12-unsup-cross-teaching directory.

cross teaching

python3 train_net.py --resume --num-gpus 8 --config configs/voc/voc07_voc12.yaml MODEL.WEIGHTS output/model_0005999.pth SOLVER.CHECKPOINT_PERIOD 18000

Owner
Bruno Ma
Phd candidate in NLPR in CASIA
Bruno Ma
Visual Tracking by TridenAlign and Context Embedding

Visual Tracking by TridentAlign and Context Embedding (TACT) Test code for "Visual Tracking by TridentAlign and Context Embedding" Janghoon Choi, Juns

Janghoon Choi 32 Aug 25, 2021
A platform for intelligent agent learning based on a 3D open-world FPS game developed by Inspir.AI.

Wilderness Scavenger: 3D Open-World FPS Game AI Challenge This is a platform for intelligent agent learning based on a 3D open-world FPS game develope

46 Nov 24, 2022
Based on Stockfish neural network(similar to LcZero)

MarcoEngine Marco Engine - interesnaya neyronnaya shakhmatnaya set', kotoraya ispol'zuyet metod samoobucheniya(dostizheniye khoroshoy igy putem proboy

Marcus Kemaul 4 Mar 12, 2022
This is the winning solution of the Endocv-2021 grand challange.

Endocv2021-winner [Paper] This is the winning solution of the Endocv-2021 grand challange. Dependencies pytorch # tested with 1.7 and 1.8 torchvision

Vajira Thambawita 14 Dec 03, 2022
Facebook AI Research Sequence-to-Sequence Toolkit written in Python.

Fairseq(-py) is a sequence modeling toolkit that allows researchers and developers to train custom models for translation, summarization, language mod

20.5k Jan 08, 2023
Galactic and gravitational dynamics in Python

Gala is a Python package for Galactic and gravitational dynamics. Documentation The documentation for Gala is hosted on Read the docs. Installation an

Adrian Price-Whelan 101 Dec 22, 2022
Large scale PTM - PPI relation extraction

Large-scale protein-protein post-translational modification extraction with distant supervision and confidence calibrated BioBERT The silver standard

1 Feb 25, 2022
Tech Resources for Academic Communities

Free tech resources for faculty, students, researchers, life-long learners, and academic community builders for use in tech based courses, workshops, and hackathons.

Microsoft 2.5k Jan 04, 2023
a baseline to practice

ccks2021_track3_baseline a baseline to practice 路径可能会有问题,自己改改 torch==1.7.1 pyhton==3.7.1 transformers==4.7.0 cuda==11.0 this is a baseline, you can fi

45 Nov 23, 2022
Mscp jamf - Build compliance in jamf

mscp_jamf Build compliance in Jamf. This will build the following xml pieces to

Bob Gendler 3 Jul 25, 2022
Audio2Face - Audio To Face With Python

Audio2Face Discription We create a project that transforms audio to blendshape w

FACEGOOD 724 Dec 26, 2022
Data and Code for ACL 2021 Paper "Inter-GPS: Interpretable Geometry Problem Solving with Formal Language and Symbolic Reasoning"

Introduction Code and data for ACL 2021 Paper "Inter-GPS: Interpretable Geometry Problem Solving with Formal Language and Symbolic Reasoning". We cons

Pan Lu 81 Dec 27, 2022
A JAX implementation of Broaden Your Views for Self-Supervised Video Learning, or BraVe for short.

BraVe This is a JAX implementation of Broaden Your Views for Self-Supervised Video Learning, or BraVe for short. The model provided in this package wa

DeepMind 44 Nov 20, 2022
Versatile Generative Language Model

Versatile Generative Language Model This is the implementation of the paper: Exploring Versatile Generative Language Model Via Parameter-Efficient Tra

Zhaojiang Lin 17 Dec 02, 2022
Unsupervised Discovery of Object Radiance Fields

Unsupervised Discovery of Object Radiance Fields by Hong-Xing Yu, Leonidas J. Guibas and Jiajun Wu from Stanford University. arXiv link: https://arxiv

Hong-Xing Yu 148 Nov 30, 2022
This PyTorch package implements MoEBERT: from BERT to Mixture-of-Experts via Importance-Guided Adaptation (NAACL 2022).

MoEBERT This PyTorch package implements MoEBERT: from BERT to Mixture-of-Experts via Importance-Guided Adaptation (NAACL 2022). Installation Create an

Simiao Zuo 34 Dec 24, 2022
Answer a series of contextually-dependent questions like they may occur in natural human-to-human conversations.

SCAI-QReCC-21 [leaderboards] [registration] [forum] [contact] [SCAI] Answer a series of contextually-dependent questions like they may occur in natura

19 Sep 28, 2022
LAnguage Model Analysis

LAMA: LAnguage Model Analysis LAMA is a probe for analyzing the factual and commonsense knowledge contained in pretrained language models. The dataset

Meta Research 960 Jan 08, 2023
Code accompanying "Adaptive Methods for Aggregated Domain Generalization"

Adaptive Methods for Aggregated Domain Generalization (AdaClust) Official Pytorch Implementation of Adaptive Methods for Aggregated Domain Generalizat

Xavier Thomas 15 Sep 20, 2022
Analyses of the individual electric field magnitudes with Roast.

Aloi Davide - PhD Student (UoB) Analysis of electric field magnitudes (wp2a dataset only at the moment) and correlation analysis with Dynamic Causal M

Davide Aloi 7 Dec 15, 2022