LBBA-boosted WSOD

Overview

LBBA-boosted WSOD

Summary

Our code is based on ruotianluo/pytorch-faster-rcnn and WSCDN

Sincerely thanks for your resources.

Newer version of our code (based on Detectron 2) work in progress.

Hardware

We use one RTX 2080Ti GPU (11GB) to train and evaluate our method, GPU with larger memory is better (e.g., TITAN RTX with 24GB memory)

Requirements

  • Python 3.6 or higher
  • CUDA 10.1 with cuDNN 7.6.2
  • PyTorch 1.2.0
  • numpy 1.18.1
  • opencv 3.4.2

We provide a full requirements.txt (namely lbba_requirements.txt) in the workspace (lbba_boosted_wsod directory).

Additional resources

Google Drive

Description

  • selective_search_data: precomputed proposals of VOC 2007/2012
  • pretrained_models/imagenet_pretrain: imagenet pretrained models of WSOD backbone/LBBA backbone
  • pretrained_models/pretrained_on_wsddn: pretrained WSOD network of VOC 2007/2012, using this pretrained model usually converges faster and more stable.
  • models/voc07: our pretrained WSOD
  • models/lbba: our pretrained LBBA
  • codes_zip: our code template of LBBA training procedure and LBBA-boosted WSOD training procedure

Prepare

Environment

We use Anaconda to construct our experimental environment.

Install all required packages (or simply follow lbba_requirements.txt).

Essential Data

We have initialized all directories with gitkeep files.

first, cd lbba_boosted_wsod

then, download selective_search_data/* into data/selective_search_data

download pretrained_models/imagenet_pretrain/* into data/imagenet_weights

download pretrained_models/pretrained_on_wsddn/* into data/wsddn_weights

Datasets

Same with rbgirshick/py-faster-rcnn

For example, PASCAL VOC 2007 dataset

  1. Download the training, validation, test data and VOCdevkit

    wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
    wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
    wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCdevkit_08-Jun-2007.tar
  2. Extract all of these tars into one directory named VOCdevkit

    tar xvf VOCtrainval_06-Nov-2007.tar
    tar xvf VOCtest_06-Nov-2007.tar
    tar xvf VOCdevkit_08-Jun-2007.tar
  3. It should have this basic structure

    $VOCdevkit/                           # development kit
    $VOCdevkit/VOCcode/                   # VOC utility code
    $VOCdevkit/VOC2007                    # image sets, annotations, etc.
    # ... and several other directories ...
  4. Create symlinks for the PASCAL VOC dataset

    cd $FRCN_ROOT/data
    ln -s $VOCdevkit VOCdevkit2007

Evaluate our WSOD

Download models/voc07/voc07_55.8.pth to lbba_boosted_wsod/

./test_voc07.sh 0 pascal_voc vgg16 voc07_55.8.pth

Note that different environments might result in a slight performance drop. For example, we obtain 55.8 mAP with CUDA 10.1 but obtain 55.5 mAP using the same code with CUDA 11.

Train WSOD

Download models/lbba/lbba_final.pth (or lbba_init.pth) to lbba_boosted_wsod/

bash train_wsod.sh 1 pascal_voc vgg16 voc07_wsddn_pre lbba_final.pth

Note that we provide different LBBA checkpoints (initialization stage, final stage, or even one-class adjuster mentioned in the suppl.).

Citation

@InProceedings{Dong_2021_ICCV,
    author    = {Dong, Bowen and Huang, Zitong and Guo, Yuelin and Wang, Qilong and Niu, Zhenxing and Zuo, Wangmeng},
    title     = {Boosting Weakly Supervised Object Detection via Learning Bounding Box Adjusters},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    month     = {October},
    year      = {2021},
    pages     = {2876-2885}
}
You might also like...
Comments
  • 尝试训练模型时报错查找不到训练图片

    尝试训练模型时报错查找不到训练图片

    我在尝试训练模型时(运行提供的“bash train_wsod.sh 1 pascal_voc vgg16 voc07_wsddn_pre lbba_final.pth”命令),报错“AssertionError: Path does not exist: xxx/lbba_boosted_wsod/lbba_boosted_wsod/data/VOCdevkit2007/VOC2007/JPEGImages/001195.jpg” 我是按照本代码仓库中给出的链接下载的VOC2007数据集,我查看了下载的数据集,JPEGImages中确实没有001195.jpg这张图片,请问是哪里出现了问题,应该如何解决?

    opened by Lin-7 0
  • train model  on other dataset

    train model on other dataset

    Hello, thank you for your paper and code; I want to try to train your model on voc2012 and coco. What should I do. In addition,i try to run : bash train_wsod.sh 3 pascal_voc_12 vgg16 voc12_wsddn_pre lbba_final.pth but found an error : AssertionError: Number of boxes must match number of ground-truth images How can I solve it? Thanks 😄

    opened by fsted 5
  • How to train Learning Bounding Box Adjusters?

    How to train Learning Bounding Box Adjusters?

    Hi DongSky, I have a question that how to train learning bounding box adjusters? You have give the pth files such as LBBA_final.pth for using train_wsod.sh. But if I want to train the LBBA model without the lbba_init.pth, what should I do?

    opened by HMCCMH 1
  • Problems on GPU and CPU usage

    Problems on GPU and CPU usage

    Hi~ I meet some problems when training the model I have set CUDA_VISIBEL_DEVICES=0,1,2,3, however, the code may just use gpu0. At the same time, cpu usage rate is quite high.

    So how can I use more GPU to train the model? I would appreciate if you can answer the question

    opened by jwfanDL 1
Owner
Martin Dong
HIT student, major in Computer Science and Technology. CS.CV, object detection, segmentation, generation.
Martin Dong
Boosted CVaR Classification (NeurIPS 2021)

Boosted CVaR Classification Runtian Zhai, Chen Dan, Arun Sai Suggala, Zico Kolter, Pradeep Ravikumar NeurIPS 2021 Table of Contents Quick Start Train

Runtian Zhai 4 Feb 15, 2022
MBTR is a python package for multivariate boosted tree regressors trained in parameter space.

MBTR is a python package for multivariate boosted tree regressors trained in parameter space.

SUPSI-DACD-ISAAC 61 Dec 19, 2022
Multivariate Boosted TRee

Multivariate Boosted TRee What is MBTR MBTR is a python package for multivariate boosted tree regressors trained in parameter space. The package can h

SUPSI-DACD-ISAAC 61 Dec 19, 2022
MooGBT is a library for Multi-objective optimization in Gradient Boosted Trees.

MooGBT is a library for Multi-objective optimization in Gradient Boosted Trees. MooGBT optimizes for multiple objectives by defining constraints on sub-objective(s) along with a primary objective. The constraints are defined as upper bounds on sub-objective loss function. MooGBT uses a Augmented Lagrangian(AL) based constrained optimization framework with Gradient Boosted Trees, to optimize for multiple objectives.

Swiggy 66 Dec 6, 2022
Bonsai: Gradient Boosted Trees + Bayesian Optimization

Bonsai is a wrapper for the XGBoost and Catboost model training pipelines that leverages Bayesian optimization for computationally efficient hyperparameter tuning.

null 24 Oct 27, 2022
Boosted CVaR Classification (NeurIPS 2021)

Boosted CVaR Classification Runtian Zhai, Chen Dan, Arun Sai Suggala, Zico Kolter, Pradeep Ravikumar NeurIPS 2021 Table of Contents Quick Start Train

Runtian Zhai 4 Feb 15, 2022