Multi-label image classification: how to label image belonging to none of the classes

Hi all, I haven’t found an answer anywhere for this. Is it possible to include random ‘wrong’ images (essentially false positives) inside the training set to train a multi-label image classification model? The goal would be to train the model to recognize subtle differences between similar images when a class is present in one image and not present in the other image.

If this is possible, how do you label the images that belong to none of the classes? Would it just be ‘(whitespace).jpg’?



I think what you are looking for is label smoothing - this is were you introduce noise to your labels, so instead of your class labels for an image being:
cat, dog, fish [0,0,1]

they would be…

cat, dog, fish [0.2, 0.2, 0.8]

It’s not quite adding false positives but it has the effect of helping generalise the model (and improve performance a bit) which I think is what you were going for with wanting to add false positives.

CutMix is also a really good data augmentation strategy which help here as well.

If you are wanting to compare two images against each other you might want to have a look at
siamese networks.

Hope that helps answer things!

1 Like

Thanks! That led me to think about using mixup. Great idea!

I actually just found this code that makes use of false positives in the context of spectrogram analyses:

That’s exactly what I was looking for. Pretty cool!