matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.53k stars 11.68k forks source link

How are training images without any annotated target handled? #531

Open zhxgj opened 6 years ago

zhxgj commented 6 years ago

I am training this network on my own data. In my training dataset, I have many images without any annotated targets. These images are not unannotated. They are annotated by human but just do not contain any target object. For example, say I want to detect dogs. In addition to annotated images of dogs, I also show the network images of cat which do not have any annotated target as negative samples to teach the network what should not be dogs.

I modified balloon.py to train on my own data, where I commended the following line to include such images that do not have any annotated target.

# The VIA tool saves images in the JSON even if they don't have any
# annotations. Skip unannotated images.
# annotations = [a for a in annotations if a['regions']]

But when I test the trained model, I found it still detects some objects in my negative samples. So how are training images without any annotated target handled by your implementation? What should be the correct scenario to train the network with negative samples? Much appreciated for your help.

patrickcgray commented 5 years ago

I wanted to follow up on this. Should Mask R-CNN be trained on negative samples or are areas of the image without a mask inherently "negative samples"?

lackBfun commented 5 years ago

If a training image does not have mask (or the label), then it is a negative sample. I think the training dataset should contain some negative sample (10%~20% of all training images). The reason why the model detects some objects in the negative samples is that the model is not well-trained. Perhaps you can increase the number of training data.

MathiasKahlen commented 4 years ago

So would it work to add images without annotations if you get a lot of false-positives on certain objects, that never occur simultaneously with the objects you're tracking?