Py-faster-rcnn: How to try fine-tuning with 2 class labels on my own dataset

Created on 12 Apr 2016  路  11Comments  路  Source: rbgirshick/py-faster-rcnn

Hello.

I don't know how to train py-faster-rcnn with my own dataset.
I could not understand how to handle dataset with this py-faster-rcnn.

My dataset has a person bounding box and I want to train py-faster-rcnn as a person detecter.
Label => Class: Person or Background , Person Coordinate: Left top and Right bottom of Rectangle

Does anyone know how to fine-tune py-faster-rcnn with any dataset excepting VOC dataset?

Most helpful comment

Hi @GBJim,
I though that faster-rcnn was handling this issue by filling every area without any specified class bounding box with the --background-- class. If so, you just need to reference the negative image without adding any class bounding box. But I may be naive...

As you probably saw, this issue was already asked several times, without any precise answer.
To investigate more maybe you can benchmark the accuracy difference between 2 models:

  • "main class" vs "--background--"
  • "main class" vs "fake background class" vs "--background--" (as FangLinHe's proposal), with adding manually a fake class covering the whole image

I'm sorry it's all I got now :'(

All 11 comments

Hi @ryuuji5 ,

You can try the following tutorial. https://github.com/coldmanck/fast-rcnn/blob/master/README.md

Hi @Sancerio ,

Thank you for your putting URL!
I will try the tutorial.

Hi @ryuuji5 ,

Another tutorial for fast-rcnn, on a person classifier :
https://github.com/zeyuanxy/fast-rcnn/tree/master/help/train

Basically you can skip the "Run Selective Search" part if you are using py-faster-rcnn.

Hi @deboc,

I can use py-faster-rcnn.
Thank you for your information!!

I really thankful to these URLs!!

Hi @deboc
Thank you for the tutorial! I am still wondering how to annotate negative examples.
Since I have training images contains only background, how do I annotate them?
Should I assign one bounding box with background class covering the whole image or a zero area bounding box?

Hi @GBJim,
I though that faster-rcnn was handling this issue by filling every area without any specified class bounding box with the --background-- class. If so, you just need to reference the negative image without adding any class bounding box. But I may be naive...

As you probably saw, this issue was already asked several times, without any precise answer.
To investigate more maybe you can benchmark the accuracy difference between 2 models:

  • "main class" vs "--background--"
  • "main class" vs "fake background class" vs "--background--" (as FangLinHe's proposal), with adding manually a fake class covering the whole image

I'm sorry it's all I got now :'(

@deboc!
Thank you for answering! Now I know why I couldn't find a solid solution.
Abou the "reference the negative image without adding any class bounding box" you stated.
How is this be done in detail?

From my understanding, the imdb class attempts to parse the annotation file based on the image index. Since negative examples have no annotation files, isn't that causing an error?

Uh... You're right !
In fact I had not tested anything like that before, and it's causing an error indeed. I wasn't expecting that.
You still can try this approach. It's pretty simple but really seems weird since faster-rcnn has a dedicated --background--. For now I can't find any other attempt to properly add negative examples.

@deboc:
Thanks for sharing! I will do some experiments about this. ;)

@deboc
I am also working on that problem. At first I trained the standard experiments with pascal voc successfully, afterwards I used your repo and reimplemented the experiments on the pascal voc dataset for detecting cars (and background) only. My accuracy dropped from the 75% (on detecting cars) to approximately 20% just because of the reimplementation for the 2 classes.

Do you have any idea why the accuracy dropped?

Thanks for any help!

@deboc
Some Background: I am using CPU_ONLY py-faster-rcnn. I have already run demo with CPU only mode.

I have followed your documentation for training over INRIA dataset from here,
https://github.com/deboc/py-faster-rcnn/blob/master/help/Readme.md

I got through every step, but finally while running the training command, I get error:
train_faster_rcnn_alt_opt.py: error: unrecognized arguments: --cpu
Is there no way to force use the cpu mode as I did for the demo run for py-faster-rcnn?
I don't have gpu on my pc and have been running cpu mode only.

Was this page helpful?
0 / 5 - 0 ratings