Search code examples
tensorflowobject-detectionobject-detection-apifaster-rcnnlabelimg

Is it necessary to label every object of a class on an image?


I labeled a bunch of Images for training a Faster-RCNN network for object detection with one class. There are about hundrets or thousands of objects of this class on every Image. Do I have to label all of them?

For now i labeled about 20 to 80 instances of the object on every Image. Therefore i picked the objects where i think reconition is easy.

When I start the training of the network with this dataset, the loss commutes between 0.9 and 20,000,000

Normally the loss should become smaller but in my case it decreases and has extreme high spikes.


Solution

  • Yes you should label every instance of the object in each training image. Because, whatever you don't label is considered as background (which is an implicit class which is labeled -1). So if you leave an instance of the object without label, it is considered as background and so the model will be confused when trying to distinguish the two classes, namely background class (-1) and object class (1 for example).

    If there are too many instances of the object in each image, maybe you could cut the images to smaller ones (like 1000 parts each containing ~100 objects).