Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow's Inception - Number of Classes

I'm wondering about the number of classes in Tensorflow's Inception implementation.

In their training script, they load the training set consisting of images and labels. Next, to calculate the loss, they define the number of classes as:

# Number of classes in the Dataset label set plus 1.
# Label 0 is reserved for an (unused) background class.
num_classes = dataset.num_classes() + 1

You can see that they use an "unused background class". You can also see this approach when they create their training set: build_image_data.py

So, why would you need such an unused background class? (Especially because you get one additional but useless prediction from the output layer)

like image 844
Namenlos Avatar asked Oct 30 '22 02:10

Namenlos


1 Answers

It's a convention we use for all our image datasets, and it didn't seem worth the trouble to break it for this particular model. As an aside, I wish all academic classification datasets had a 'none of the above' class in their test evaluation. A classifier which doesn't know when it doesn't know is not that useful in practice. (vanhoucke)

https://groups.google.com/a/tensorflow.org/forum/#!topic/discuss/9G-c2K_GCmk

like image 115
David Peer Avatar answered Nov 15 '22 06:11

David Peer