How to Work with Multiple Instance Detection Network and OICR

Dec 23, 2020 | Data Science

Welcome to our comprehensive guide on how to leverage the power of the Online Instance Classifier Refinement (OICR) framework for weakly supervised object detection. This guide is designed to help you navigate through the installation, training, and evaluation processes using the OICR codebase.

Understanding OICR

OICR stands as a pinnacle in weakly supervised object detection, akin to a sophisticated artist transforming fragments of a picture into a vivid masterpiece. The method achieves remarkable results on datasets like Pascal VOC 2007 and 2012, thanks to the ingenuity of deep convolutional networks.

Requirements

  • Software Requirements:
  • Hardware Requirements:
    • NVIDIA GTX TITAN X or equivalent (~12G of memory)

Installation Guide

Follow these step-by-step instructions to install OICR:

  1. Clone the OICR repository (using the recursive option):
  2. git clone --recursive https://github.com/ppengtang/oicr.git
  3. Build the Cython modules:
  4. cd $OICR_ROOT/lib
    make
  5. Build Caffe and Pycaffe:
  6. cd $OICR_ROOT/caffe-oicr
    # Follow Caffe installation instructions here:
    #   http://caffe.berkeleyvision.org/installation.html
    make all -j 8
    make pycaffe

Setting Up for Training and Testing

To effectively utilize OICR, you’ll need to gather the data:

  1. Download the necessary datasets:
  2. 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/voc2012/VOCdevkit_18-May-2011.tar
  3. Extract the downloaded tars into a single directory named “VOCdevkit”:
  4. tar xvf VOCtrainval_06-Nov-2007.tar
    tar xvf VOCtest_06-Nov-2007.tar
    tar xvf VOCdevkit_18-May-2011.tar
  5. Create symlinks for the PASCAL VOC dataset:
  6. cd $OICR_ROOT/data
    ln -s $VOCdevkit VOCdevkit2007

Training and Evaluation Procedures

Equipped with your dataset, it’s time to train and test the OICR networks:

  1. **Train the OICR network:** For example, use the following command to train a VGG16 network on the VOC 2007 trainval:
  2. ./tools/train_net.py --gpu 1 --solver models/VGG16/solver.prototxt --weights data/imagenet_models/$VGG16_model_name --iters 70000
  3. **Test the OICR network:** Use the command below to test the VGG16 network on VOC 2007 test:
  4. ./tools/test_net.py --gpu 1 --def models/VGG16/test.prototxt --net output/default/voc_2007_trainval/vgg16_oicr_iter_70000.caffemodel --imdb voc_2007_trainval

Troubleshooting Tips

If you encounter any issues throughout the setup or training process, consider the following troubleshooting ideas:

  • Ensure that all dependencies are properly installed, particularly Caffe with Python support.
  • Double-check paths for datasets and ensure they are correctly symlinked.
  • Monitor system memory usage; ensure your GPU is properly configured and has sufficient memory allocated.
  • Review any error messages carefully for clues regarding missing packages or incompatible versions.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Final Thoughts

OICR is truly a remarkable tool for researchers delving into weakly supervised object detection. At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox