Jitesh Malipeddi
Jitesh Malipeddi

Reputation: 2385

Is it possible to modify the layers/associated parameters of the models present in the Tensorflow Object Detection API

I would like to know if there is any way in which we can change the base layers of the models offered by the Tensorflow Object Detection API and if so, is it possible to change things like pooling/padding size, number of layers and also hyperparameters like optimizer used, initial weights and the learning rate.

Upvotes: 0

Views: 541

Answers (1)

Danny Fang
Danny Fang

Reputation: 4071

The Object Detection API is fully customized by the pipeline.config file, so if you understand what all those fields within the config file stand for, you can then understand what can be changed.

Let's clarify some of the specific examples in your question.

The API used what is called a feature_extractor. This is basically a Convolutional Neural Network that is used for extracting the features from images, and they are typically classic networks like ResNet, Inception, MobileNet, etc. So it is not about being specific to change like pooling, padding size or the number of layers within the feature extractor part, instead the API just switches among all these feature extractors, so you will see a lot of different combinations like faster_rcnn_resnet101, faster_rcnn_resnet50, faster_rcnn_mobilenet, faster_rcnn_inception.

But for faster_rcnn model series, there is a ROI pooling layer that you can change the pool kernel size and stride size.

As for optimizer, the optimizer field within the config file is exactly used for setting different optimizers, you can choose among three different optimizers. (RMSPropOptimizer, MomentumOptimizer, AdamOptimizer) also you can change the learning rate of the optimizer as well as scheduling the learning rate.

The initial weights can also be configured, you can choose to start from scratch, or restore the weights from a specific checkpoint. You can even choose to freeze some layers during training.

So all in all, you need to focus on the pipeline.config file, try to understand the meaning of the fields within the file. There are a lot of sample config files available. And the official repo has provided quite good documentation, you should read them through before you want to train your own models.

Upvotes: 1

Related Questions