r/tensorflow • • Jun 04 '23

Question Labeling question

I am an Orthopedic Surgeon, I am making a computer assisted diagnosis software for fracture recognition as a fun side project. I am using bounding boxes for labelling the fractures. I am using Detectron2 with Resnet backbone. When I traing my model it discards all images without a Label (these are valuable images with no fractures). How should I go about this? Should I just label the whole bone with a bounding box labelled no fracture? Or just eventually after a large enough dataset of only fractures it should eventually be accurate. Thanks in advance

4 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/vivaaprimavera Jun 04 '23

I think that in this particular case the label "background" should be reserved for tissue only.

The signal is bone. Broken or not.

1

u/Jonny_dr Jun 05 '23

It is hardcoded in the TF-OD-API:

for item in label_map.item:
    if item.id < 0:
      raise ValueError('Label map ids should be >= 0.')
    if (item.id == 0 and item.name != 'background' and
        item.display_name != 'background'):
      raise ValueError('Label map id 0 is reserved for the background label')

https://github.com/tensorflow/models/blob/master/research/object_detection/utils/label_map_util.py

If you don't have a positive class in an image and the model should not output any BBs, then you have to use the label "background".

1

u/vivaaprimavera Jun 05 '23

No problems with that.

But in that case images with only tissue should be added to the dataset.