Yolo negative annotated examples do not export and not used for training

For YOLOv7 object detection, if you:

  1. include negative (no class present) images and corresponding negative annotation file and then
  2. export the dataset via download or API notebook import, then
  3. your entire dataset does not export, only the positive examples
  4. it may not use your negative examples for Roboflow training as well (but I can’t prove this because can’t see that level of detail)

I’ve read that some see negative examples as pointless for YOLO models (this may be contentious). My reasoning was to heavily penalize and prevent false positives. Curious if this is functioning as intended and Roboflow sees negative examples in YOLO models as pointless.

Hi @Kal_Clark, are you sure you marked the images as Null?

Null Image option in the Annotation Tool:

I just ran a test and didn’t find any issue exporting Null (background/negative) Images in YOLOv7 PyTorch format:

Additionally, when using Roboflow Train, we do consider Null images during training. You’ll see in Dataset Health Check that we even provide a count of the Null images within the dataset:

Thanks Mohamed for the examples. I think the issue is how Roboflow deals with NULL examples via the annotation import function (and maybe this is limited to the Retinanet CSV input method). For example, for an object detection exercise, try importing 4 positive and 1 null example via the Retinanet CSV standard which should be (I think) like this (with the null example having 5 commas). In Roboflow, if I look at the images+annotations in the browser after import it looks like the null example is throwing off the loader (getting weird class names which correspond to the bounding box coordinates, class names like “object”).

0aa271ebb7ca76714687fcc79717faf8_png.rf.e5a8c7e59b2c7e90b37d4acc689efe82.jpg,1,1,200,200,fracture
0b21649c6437ef528ddde1a775df2ed5_png.rf.b13792a76b98e5bf9283933d7a8ade8b.jpg,,,,,
3a34768d6f0470429df6cc4b3e26027e_png.rf.157e2994fa2051201dcbfe7ab4adea07.jpg,1,1,200,200,fracture
5bdbc01937017b57d40885c9ff6cfcc5_png.rf.b29b86efb2080ce1b573ee72a52befb7.jpg,1,1,200,200,fracture
5c422818404cd5a3d9d41984d93752ac_png.rf.2997a3a1c7820e5395c1a2b2616a916b.jpg,1,1,200,200,fracture
1 Like

Thx @Mohamed. I think we can narrow this to the import action because it looks like export is solid.
What about this angle: If I import the RetinaNet CSV file like this then I think it’s throwing off the RF loader. When using the RF browse tool it looks like the NULL example is throwing off the class names. I think the question is: how should we pass Retinanet CSV files to RF in order for it to be successfully marked as NULL?

0aa271ebb7ca76714687fcc79717faf8_png.rf.e5a8c7e59b2c7e90b37d4acc689efe82.jpg,1,1,200,200,fracture
0b21649c6437ef528ddde1a775df2ed5_png.rf.b13792a76b98e5bf9283933d7a8ade8b.jpg,,,,,
3a34768d6f0470429df6cc4b3e26027e_png.rf.157e2994fa2051201dcbfe7ab4adea07.jpg,1,1,200,200,fracture
5bdbc01937017b57d40885c9ff6cfcc5_png.rf.b29b86efb2080ce1b573ee72a52befb7.jpg,1,1,200,200,fracture
5c422818404cd5a3d9d41984d93752ac_png.rf.2997a3a1c7820e5395c1a2b2616a916b.jpg,1,1,200,200,fracture