Skip to content
Middle–Senior226 views

Why is sigmoid used for binary classification instead of softmax?

Practice

Asked at

AI answer

For binary classification, a sigmoid activation function is usually used instead of softmax for the following reasons:

  • Sigmoid transforms a scalar value into a probability of belonging to one of the two classes (value from 0 to 1). This is natural for binary classification, where only one output neuron is sufficient.

  • Softmax is used for multi-class classification and normalizes the output vector so that the sum of probabilities across all classes equals 1. For two classes, softmax can also be used, but it is redundant since the two outputs are mutually complementary.

  • Using sigmoid with binary cross-entropy loss is simpler and more effective, as the model learns to directly predict the probability of the positive class.

  • Softmax with two outputs requires more parameters and computations, which is not practical for a binary task.

Example: logistic regression is a linear model with a sigmoid output that predicts the probability of class 1.