Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Tensorflow Object Detection API to detect small objects in images

I'd like to use the Tensorflow Object Detection API to identify objects in a series of webcam images. The Faster RCNN models pre-trained on the COCO dataset appear to be suitable, as they contain all the object categories I need.

However, I'd like to improve the performance of the model at identifying fairly small objects within each image. If I understand correctly, I need to edit the anchor scales parameter in the config file to get the model to use smaller bounding boxes.

My questions are:

  • Do I need to re-train the model on the entire COCO dataset after I adjust this parameter? Or is there a way to change the model just for inference and avoid any re-training?
  • Are there any other tips/tricks to successfully identifying small objects, short of cropping the image into sections and running inference on each one separately?

Background info

I'm currently feeding 1280x720 images to the model. At around 200x150 pixels I'm finding it harder to detect objects.

like image 866
tobycoleman Avatar asked Jan 15 '18 22:01

tobycoleman


People also ask

What is the object detection API in TensorFlow?

This API comes ready to use with pre-trained models which will get you detecting objects in images or videos in no time. The object detection API does not come standard with the TensorFlow installation.

Can I use the object detection inference walkthrough with TensorFlow?

I will be using the object detection inference walkthrough that’s available in the TensorFlow object detection API. The object detection API is not supported in TensorFlow versions earlier than 1.4.

How to use Protobuf with TensorFlow object detection API?

By default, the TensorFlow Object Detection API uses Protobuf to configure model and training parameters, so we need this library to move on. Go to the official protoc release page and download an archive for the latest protobuf version compatible with your operation system and processor architecture. For example, I’m using Ubuntu.

Is there a general approach for parameter tuning in TensorFlow object detection?

Those are the questions that I had at the very beginning of my work with the TensorFlow Object Detection API. If you feel like it’s not clear for you as well, don’t worry! Luckily for us, there is a general approach that can be used for parameter tuning, which I found very convenient and easy to use.


1 Answers

  1. You'll need to retrain completely unfortunately, since the weights do depend on the shape of the anchor.

  2. Having a feature map with higher resolution should help (but slow down the process), so changing the feature extractor to get one with less input size reduction (max poolings with stride >1 is usually what reduces the space size) or upscaling the image a bit in the initial image resizer.

like image 177
gdelab Avatar answered Sep 22 '22 08:09

gdelab