Object detection - how to annotate negative samples I am using Tensorflow Object detection API to detect 2 objects. I need negative samples because it sometimes detects something random as one of the images . How should I annotate an image to be a 'negative sample'? I am using LabelImg to annotate the images. Do I draw the bounding box around the whole image and label it as 'none'?
 A: Short answer: 
You don't need negative samples to train your model. Focus on improving your model.
Long answer:
Ideally your detector after being trained on your 2 objects would detect them and place a bounding box around them. When you test it and get wrong results this could be caused by a variety of reasons:


*

*A wrong object is being detected if your detector just misinterpreted as belonging to one of the 2 objects you trained it on.

*When an image of your 2 objects is being thrown to the detector but it's not detected, then this also means your detector failed to detect your object.


Both cases could of course happen in the same image and also occur more than once. 
As far as I know images with no bounding box in them which would be your "negative examples" cannot be processed by the current model because tfrecord reader just fails. 
Negative samples do exist implicitly though. All region of your images that do not correspond to a bounding box is a "negative sample". Defining explicitly "negative samples" by selecting them in a bounding box will create a new class with name 'none'. You will have 3 classes then.
So, to make it simpler focus on your positive examples. If your model fails greatly then something is wrong. Check if:


*

*Your test images differ significantly from the trained ones. If so, try to find images similar to your test images and use them along your previous images to retrain your model.

*Examine that you have enough training samples to train your model. Enough is not defined strictly but may mean at least a few hundred images.

*Examine that your train model contains enough samples from both objects. If not the misrepresented class will be detected poorly compared to the other one.

*Examine that you don't have implicit negative examples of your object that could hinder training process. This means if you detect cars make sure at least all visually qualitative appearances in your image are being labels as cars. If you only label 1 car and also left 2 unlabeled ones then those two cars will hamper your training.

A: You can simply use the verify feature in LabelImg and it will create a file without annotations you can run through your process. Reading through this article it seems negative images are indeed needed.
A: The OP asked about negative samples in Tensorflow Object detection API. I agree that we do not specific images for negative samples in NNs-based Object Detection. All negatives samples are implicitly available when some areas of the images are not labelled (no bounding box on it). 
