• Stars
    star
    142
  • Rank 258,495 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 5 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[CVPR'20] Implementation for the paper "ViewAL: Active Learning with Viewpoint Entropy for Semantic Segmentation"

ViewAL: Active Learning with Viewpoint Entropy for Semantic Segmentation

This repository contains the implementation for the paper:

Yawar Siddiqui, Julien Valentin and Matthias Niessner, "ViewAL: Active Learning with Viewpoint Entropy for Semantic Segmentation" (video)

VisualizationGIF

Running

Arguments

train_active.py [-h] [--backbone {resnet,xception,drn,mobilenet}]
                       [--out-stride OUT_STRIDE]
                       [--dataset {scannet,scenenet-rgbd,matterport3d,scannet-sample}]
                       [--workers N] [--base-size BASE_SIZE]
                       [--sync-bn SYNC_BN] [--loss-type {ce,focal}]
                       [--epochs N] [--batch-size N] [--use-balanced-weights]
                       [--lr LR] [--lr-scheduler {step}]
                       [--optimizer {SGD,Adam}] [--step-size STEP_SIZE]
                       [--use-lr-scheduler] [--momentum M] [--weight-decay M]
                       [--nesterov] [--gpu-ids GPU_IDS] [--seed S]
                       [--checkname CHECKNAME] [--eval-interval EVAL_INTERVAL]
                       [--memory-hog]
                       [--max-iterations MAX_ITERATIONS]
                       [--active-selection-size ACTIVE_SELECTION_SIZE]
                       [--region-size REGION_SIZE]
                       [--region-selection-mode REGION_SELECTION_MODE]
                       [--view-entropy-mode {soft,vote,mc_dropout}]
                       [--active-selection-mode {random,viewentropy_region,voteentropy_soft,voteentropy_region,softmax_entropy,softmax_confidence,softmax_margin,coreset,voteentropy_max_repr,viewmc_kldiv_region,ceal}]
                       [--superpixel-dir SUPERPIXEL_DIR]
                       [--superpixel-coverage-dir SUPERPIXEL_COVERAGE_DIR]
                       [--superpixel-overlap SUPERPIXEL_OVERLAP]
                       [--start-entropy-threshold START_ENTROPY_THRESHOLD]
                       [--entropy-change-per-selection ENTROPY_CHANGE_PER_SELECTION]

Run --help for more details.

Active Selection Modes

Apart from implementation of our method, we provide implementation of other popular active selection methods adapted for semantic segmentation.

Option Method
random RAND selection
voteentropy_max_repr MAXRPR selection
voteentropy_soft MCDR selection
voteentropy_region RMCDR selection
softmax_entropy ENT selection
softmax_confidence CONF selection
softmax_margin MAR selection
coreset CSET selection
ceal CEAL selection
viewmc_kldiv_region ViewAL selection

For a description of the methods, check out appendix section of the paper.

Example commands

View AL
# sample dataset
python train_active.py --dataset scenenet-rgbd --workers 2 --epochs 50 --eval-interval 5 --batch-size=6 --lr 0.0004 --use-lr-scheduler --lr-scheduler step --step-size 35 --checkname regional_viewmckldiv_spx_1_7x2_lr-0.0004_bs-6_ep-60_wb-0_lrs-1_240x320 --base-size 240,320 --max-iterations 7 --active-selection-size 2 --active-selection-mode viewmc_kldiv_region --region-selection-mode superpixel

# scenenet-rgbd
python train_active.py --dataset scenenet-rgbd --workers 2 --epochs 50 --eval-interval 5 --batch-size=6 --lr 0.0004 --use-lr-scheduler --lr-scheduler step --step-size 35 --checkname regional_viewmckldiv_spx_1_7x1500_lr-0.0004_bs-6_ep-60_wb-0_lrs-1_240x320 --base-size 240,320 --max-iterations 7 --active-selection-size 1500 --active-selection-mode viewmc_kldiv_region --region-selection-mode superpixel
Random
python train_active.py --dataset scenenet-rgbd --workers 2 --epochs 50 --eval-interval 5 --batch-size=6 --lr 0.0004 --use-lr-scheduler --lr-scheduler step --step-size 35 --checkname random_0_7x1500_lr-0.0004_bs-6_ep-60_wb-0_lrs-0_240x320 --base-size 240,320 --max-iterations 7 --active-selection-size 1500 --active-selection-mode random
Softmax Entropy
python train_active.py --dataset scenenet-rgbd --workers 2 --epochs 50 --eval-interval 5 --batch-size=6 --lr 0.0004 --use-lr-scheduler --lr-scheduler step --step-size 35 --checkname softmax_entropy_0_7x1500_lr-0.0004_bs-6_ep-50_wb-0_lrs-1_240x320 --base-size 240,320 --max-iterations 7 --active-selection-size 1500 --active-selection-mode softmax_entropy
Regional MCDR
python train_active.py --dataset scenenet-rgbd --workers 2 --epochs 50 --eval-interval 5 --batch-size=6 --lr 0.0004 --use-lr-scheduler --lr-scheduler step --step-size 35 --checkname regional_voteentropy_window_0_7x1500_lr-0.0004_bs-6_ep-60_wb-0_lrs-1_240x320 --base-size 240,320 --max-iterations 7 --active-selection-size 1500 --active-selection-mode voteentropy_region --region-selection-mode window
CEAL
python train_active.py --dataset scenenet-rgbd --workers 2 --epochs 50 --eval-interval 5 --batch-size=6 --lr 0.0004 --use-lr-scheduler --lr-scheduler step --step-size 35 --checkname ceal-0.00275_7x1500_lr-0.0005_bs-6_ep-50_wb-0_lrs-1_240x320 --max-iterations 7 --active-selection-size 1500 --base-size 240,320 --active-selection-mode ceal --start-entropy-threshold 0.0275 --entropy-change-per-selection 0.001815
MCDR
python train_active.py --dataset scenenet-rgbd --workers 2 --epochs 50 --eval-interval 5 --batch-size=6 --lr 0.0004 --use-lr-scheduler --lr-scheduler step --step-size 35 --checkname mcdropoutentropy_0_7x1500_lr-0.0004_bs-6_ep-50_wb-0_lrs-1_240x320 --base-size 240,320 --max-iterations 7 --active-selection-size 1500 --active-selection-mode voteentropy_soft
Full training
python train.py --dataset scenenet-rgbd --workers 2 --epochs 70 --eval-interval 5 --batch-size=6 --lr 0.0004 --use-lr-scheduler --lr-scheduler step --step-size 40 --checkname full-run_0_lr-0.0004_bs-6_ep-60_wb-0_lrs-0_240x320 --base-size 240,320

Files

Overall code structure is as follows:

File / Folder Description
train_active.py Training script for active learning methods
train.py Training script for full dataset training
constants.py Constants used across the code
argument_parser.py Arguments parsing code
active_selection Implementation of our method and other active learning methods for semantic segmentation
dataloader Dataset classes
dataset Train/test splits and raw files of datasets
model DeeplabV3+ implementation (inspired from here)
utils Misc utils

The datasets must follow the following structure

dataset # root dataset directory
β”œβ”€β”€ dataset-name
    β”œβ”€β”€ raw
        β”œβ”€β”€ selections
            β”œβ”€β”€ color # rgb frames
            β”œβ”€β”€ label # ground truth maps
            β”œβ”€β”€ depth # depth maps
            β”œβ”€β”€ pose # camera extrinsics for each frame
            β”œβ”€β”€ info # camera intrinsics
            β”œβ”€β”€ superpixel # superpixel maps
            β”œβ”€β”€ coverage_superpixel # coverage maps
    β”œβ”€β”€ selections
        β”œβ”€β”€ seedset_0_frames.txt # seed set
        β”œβ”€β”€ train_frames.txt 
        β”œβ”€β”€ val_frames.txt
        β”œβ”€β”€ test_frames.txt
    β”œβ”€β”€ dataset.lmdb # rgb frames + labels in lmdb format

A small example dataset is provided with this repository in dataset/scannet-sample.

Data Generation

To use this repository datasets must be in the structure described in last section. For creating the lmdb database, seed set, train / test splits and superpixel maps check helper scripts in dataset/preprocessing-scripts. We use this SEEDS implementation for generating superpixels (check this issue for troubleshooting). Further, to generate superpixel coverage maps (coverage_superpixel) check utils/superpixel_projections.py.

Citation

If you use this code, please cite the paper:

@misc{siddiqui2019viewal,
    title={ViewAL: Active Learning with Viewpoint Entropy for Semantic Segmentation},
    author={Yawar Siddiqui and Julien Valentin and Matthias Nießner},
    year={2019},
    eprint={1911.11789},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

More Repositories

1

mesh-gpt

MeshGPT: Generating Triangle Meshes with Decoder-Only Transformers
635
star
2

panoptic-lifting

[CVPR23 Highlight] Implementation for Panoptic Lifting
Python
321
star
3

retrieval-fuse

[ICCV21] Code for "RetrievalFuse: Neural 3D Scene Reconstruction with a Database"
Python
81
star
4

stylegan2-ada-3d-texture

Texturify Code
Python
74
star
5

SRmeetsPS-CUDA

CUDA implementation of the paper "Depth Super-Resolution Meets Uncalibrated Photometric Stereo"
C++
33
star
6

stylegan2-ada-lightning

Simplified pytorch lightning port of StyleGAN2-ADA
Python
32
star
7

single-view-3d-reconstruction

Python
24
star
8

texturify

Pytorch implementation for paper "Texturify: Generating Textures on 3D Shape Surfaces"
16
star
9

shape_sdf

Simple MLP for representing the SDF of a single shape
Cuda
13
star
10

deepfillv2-pylightning

Clean minimal implementation of Free-Form Image Inpainting with Gated Convolutions in pytorch lightning. Inspired from pytorch implementation by @avalonstrel.
Python
13
star
11

pointcloud-visualization

for rgbd -> pointcloud projection reference
C++
7
star
12

deep-joint-clustering

An image clustering algorithm using neural networks
Python
6
star
13

CADTextures

Python
4
star
14

image-to-atlas

Project an image to the texture atlas for a given mesh
Python
4
star
15

deep-learning-experiments

Small experiments on MNIST to evaluate ES and GA against SGD
Python
3
star
16

simple_overfit_test

Weirdly challenging Simple MLP overfitting problem
Python
2
star
17

deep-active-semantic-segmentation

Active learning for semantic segmentation with deep neural networks - documentation coming soon
Python
2
star
18

BiGAN

Simple implementation of a BiGAN
Python
2
star
19

render-browser

Quick browsing and marking of rendered images
CSS
2
star
20

coordconv-pytorch

Pytorch lightning implementation of CoordConv regression experiments
Python
1
star
21

boring-pl-model

Simple pytorch lightning boring model
Python
1
star
22

quickshift-gpu

Quickshift on cuda
Cuda
1
star
23

stylegan2-ada-render

Python
1
star
24

gamma-spot-removal-gpu

Gamma spots removal for Neutron radiography and tomography images using 'find and replace' strategy, this is a discriminative method, better than unique threshold substitution
C++
1
star