Clear Filters
Clear Filters

there's no object in object detection on Pascal VOC data

5 views (last 30 days)
Hello there,
I am preparing a dataset for a object detection model of deep learning, which is based on images and their respective Pascal VOC data annotation (.xml) which describe the objects positions.
My question is if is coherent train the model of object detection with an image without objects, and how it is annotated in a Pascal VOC file.
Thank you very much!

Answers (1)

Sai Pavan
Sai Pavan on 26 Sep 2023
Hi Josep,
I understand that you are trying to know whether training an object detection model with images without target object is beneficial and want to know how such an image is annotated in Pascal VOC format.
It is generally not necessary to train an object detection model with images that do not contain any objects of interest. The purpose of object detection is to identify and localize objects within an image, however, by including images without objects, the model may learn to detect and classify non-existent objects or generate false positives, which can negatively impact the model's performance. Hence it is not recommended to include such images in the training dataset of the model.
The annotation of images without objects in Pascal VOC format can be created but the annotations should indicate that there are no objects present. For an image without objects, you can create an XML file with an empty <objects> tag or can omit the <object> tag entirely.
Here's a reference code of how an XML file for an image without objects may look like:
<annotation>
<folder>images</folder>
<filename>image_without_objects.jpg</filename>
<size>
<width>640</width>
<height>480</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<objects></objects>
</annotation>
Hope it helps.
Regards,
Sai Pavan

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!