Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to represent the Null class in Multilabel Classification with Convolutional Neural Nets?

I'm trying to label images with the various categories that they belong to with a convolutional neural net. For my problem, the image can be in a single category, multiple categories, or zero categories. Is it standard practice to set the zero category as all zeroes or should I add an additional null class neuron to the final layer?

As an example, let's say there are 5 categories (not including the null class). Currently, I'm representing that with [0,0,0,0,0]. The alternative is adding a null category, which would look like [0,0,0,0,0,1]. Won't there also be some additional unnecessary parameters in this second case or will this allow the model to perform better?

I've looked on Stackoverflow for similar questions, but they pertain to Multiclass Classification, which uses the Categorical Crossentropy with softmax output instead of Binary Crossentropy with Sigmoid output, so the obvious choice there is to add the null class (or to do thresholding).

like image 224
Austin Avatar asked Sep 11 '25 13:09

Austin


1 Answers

Yes, the "null" category should be represented as just zeros. In the end multi-label classification is a set of C binary classification problems, where C is the number of classes, and if all C problems output "no class", then you get a vector of just zeros.

like image 174
Dr. Snoopy Avatar answered Sep 14 '25 03:09

Dr. Snoopy