What is the difference between binary and multiclass classification?
Binary classification predicts between two classes, while multiclass classification predicts one class from three or more mutually exclusive classes.
Binary classification
Binary classification has exactly two possible classes.
Examples:
- Spam vs not spam
- Fraud vs not fraud
- Positive vs negative
A neural network often uses a single output value with a sigmoid activation for this type of problem.
See “What is Binary Classification ?” for the dedicated explanation.
Multiclass classification
Multiclass classification has three or more possible classes, where each example belongs to one class.
Examples:
- Cat, dog, or horse
- Red, green, or blue
- Digit 0 through 9
A neural network commonly uses one output score per class and applies softmax to produce class probabilities.
See “what is Multi-class classification ?” for the dedicated explanation.
Main difference
- Binary classification: choose between 2 classes.
- Multiclass classification: choose 1 class from 3 or more classes.
- Binary output: often one sigmoid output.
- Multiclass output: often multiple outputs with softmax.
Multiclass classification should not be confused with multilabel classification, where one example can belong to multiple classes at the same time.
In short, binary classification chooses between two classes, while multiclass classification chooses one class from three or more possible classes.
Learning Sequence
Deep Learning Curriculum
What is class imbalance and how does it affect deep learning models?
Explore Related Questions
Deepen your understanding across related Deep Learning topics.