1
$\begingroup$

In this link, the author has implemented a CNN which classifies 15 classes and has used Binary Cross Entropy as the loss function. But since it's multiclass classification, is it valid to use Binary Cross Entropy? Or should we use Categorical Cross Entropy instead?

$\endgroup$
0
$\begingroup$

Use categorical_crossentropy when it comes for Multiclass classification, Because multiclass have more than one exclusive targets which is restricted by the binary_cross_entrophy.

binary_cross_entrophy is used when the target vector has only two levels of class.

In other cases when target vector has more than two levels categorical_crossentropy can be used for better model convergence.

$\endgroup$
0
$\begingroup$

It depends on the problem at hand.

Follow this schema:

  • Binary Cross Entropy: When your classifier must learn two classes. Used with one output node, with Sigmoid activation function and labels take values 0,1.

  • Categorical Cross Entropy: When you When your classifier must learn more than two classes. Used with as many output nodes as the number of classes, with Softmax activation function and labels are one-hot encoded.

It follows that Binary CE can be used for multiclass classification in case an observation can belong to multiple classes at the same time. In that case, belonging to one class doesn't inform the model on belonging to a different class and it's like if any node is an independent output.

$\endgroup$
0
$\begingroup$

I think you can. each of your classes need to have a sigmoid output which makes each prediction independent of other classes. there you can use binary cross entropy to calculate the overall error/loss.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.