Home

Awesome

TALISMAN: Targeted Active Learning for Object Detection with Rare Classes and Slices using Submodular Mutual Information

License: MIT

Official PyTorch implementation of ECCV 2022 paper "TALISMAN: Targeted Active Learning for Object Detection with Rare Classes and Slices using Submodular Mutual Information".

Suraj Kothawade, Saikat Ghosh, Sumit Shekhar, Yu Xiang, Rishabh Iyer

Overview

Deep neural networks based object detectors have shown great success in a variety of domains like autonomous vehicles, biomedical imaging, etc. It is known that their success depends on a large amount of data from the domain of interest. While deep models often perform well in terms of overall accuracy, they often struggle in performance on rare yet critical data slices. For example, data slices like "motorcycle at night" or "bicycle at night" are often rare but very critical slices for self-driving applications and false negatives on such rare slices could result in ill-fated failures and accidents. Active learning (AL) is a well-known paradigm to incrementally and adaptively build training datasets with a human in the loop. However, current AL based acquisition functions are not well-equipped to tackle real-world datasets with rare slices, since they are based on uncertainty scores or global descriptors of the image. We propose TALISMAN, a novel framework for Targeted Active Learning or object detectIon with rare slices using Submodular MutuAl iNformation. Our method uses the submodular mutual information functions instantiated using features of the region of interest (RoI) to efficiently target and acquire data points with rare slices. We evaluate our framework on the standard PASCAL VOC07+12 and BDD100K, a real-world self-driving dataset. We observe that TALISMAN outperforms other methods by in terms of average precision on rare slices, and in terms of mAP.

<!--- <a href="url"><img src="figures/talisman_flow.png" align="centre" height="400" width="400" ></a> -->

<hr>

Prerequisites

Install PyTorch

Refer to pytorch official website https://pytorch.org/get-started/locally/

Install MMCV

pip install mmcv-full

Install Submodlib

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ submodlib
<hr>

Clone Talisman repo from Github & Install dependencies

git clone https://github.com/surajkothawade/talisman.git # clone repository
cd talisman                                              # move inside talisman root directory
mkdir data                                               # create empty data directory
pip install -r requirements/build.txt                    # install build dependency
pip install -r requirements/runtime.txt                  # install runtime dependency
pip install -v -e .                                      # install talisman

Data Preparation

Prepare VOC Dataset

Download Pascal-VOC 07+12 dataset
wget http://pjreddie.com/media/files/VOCtrainval_06-Nov-2007.tar
wget http://pjreddie.com/media/files/VOCtrainval_11-May-2012.tar
wget http://pjreddie.com/media/files/VOCtest_06-Nov-2007.tar
Unzip compressed dataset inside ‘talisman/data’ folder
tar -xvf '<path to VOCtrainval_06-Nov-2007.tar>' -C '<path to talisman/data/>'
tar -xvf '<path to VOCtrainval_11-May-2012.tar>' -C '<path to talisman/data/>'
tar -xvf '<path to VOCtest_06-Nov-2007.tar>'     -C '<path to talisman/data/>'

Prepare BDD Dataset

pip install imgann
from imgann import Convertor
Convertor.coco2voc('<path to images/100k/train>', '<path to labels/det_20/det_train_coco.json>', '<train_voc annotation output path>', False)
Convertor.coco2voc('<path to images/100k/val>', '<path to labels/det_20/det_val_coco.json>', '<val_voc annotation output path>', False)

Alt Text

<hr>

Set Experiment Parameters in scripts inside talisman/strategies

Set training parameters within the script as per requirement (line 39-46)

Set config_filename as per experiment (line 61)

config_filename = 'faster_rcnn_r50_fpn_AL_voc0712.py'            # VOC - Rare experiment
config_filename = 'faster_rcnn_r50_fpn_AL_bdd100k_mc_rare.py'    # BDD - Rare Motorcycle
config_filename = 'faster_rcnn_r50_fpn_AL_bdd100k_ped_night.py'  # BDD - Pedestrian at night

Set split_cfg parameter (line 128) for rare class imbalance(VOC and BDD) & rare slice imbalance(BDD) as per below table

ParameterExperimentDatasetMeaning
per_imbclass_trainrare classVOC + BDDNo. of samples per rare class in the initial training set
per_imbclass_valrare classVOC + BDDTotal No. of samples of rare classes in the query set
per_class_trainrare classVOC + BDDNo. of samples per unrare class in the initial training set
per_imbclass_trainrare sliceBDDNo. of samples per rare class in the initial seedset which do not belong to rare slice
per_imbclass_attrrare sliceBDDNo. of samples per rare class in the initial seedset which belongs to rare slice
per_imbclass_valrare sliceBDDTotal No. of samples of rare classes in the query set which belongs to rare slice
per_class_trainrare sliceBDDNo. of samples per unrare class in the initial training set

Set imbalanced_classes parameter (line 137) for rare class imbalance(VOC and BDD) & rare slice imbalance(BDD) as per below table –

Class IndexVOC ClassesBDD Classes
0aeroplanepedestrian
1bicyclerider
2birdcar
3boattruck
4bottlebus
5bustrain
6carmotorcycle
7catbicycle
8chairtraffic light
9cowtraffic sign
10diningtableN/A
11dogN/A
12horseN/A
13motorbikeN/A
14personN/A
15pottedplantN/A
16sheepN/A
17sofaN/A
18trainN/A
19tvmonitorN/A

Set rare slice parameters (line 140-142) only for BDD rare slice experiments

attr_propertyattr_value
timeofdaynight
weatherrainy
scenehighway
<hr>

Run Experiments

DatasetExperimentStrategyScript Namearg-1arg-2arg-3Sample Command
VOCRare classFLMIsmi_VOC.py<gpu_id>fl2mipython smi_VOC.py 0 fl2mi
VOCRare classGCMIsmi_VOC.py<gpu_id>gcmipython smi_VOC.py 0 gcmi
BDDRare sliceFLMIsmi_BDD.py<gpu_id><file_name>.txtfl2mipython smi_BDD.py 1 ped_night.txt fl2mi
BDDRare sliceGCMIsmi_BDD.py<gpu_id><file_name>.txtgcmipython smi_BDD.py 1 ped_night.txt gcmi