Deep learning Implementation: Multilabel Classifier
No Bullshit: Multi-label Text classification Using Keras
The goal of this blog is to dig right into the weeds of implementing a multilabel text classifier using Keras. If you have clicked on this story, I assume you are familiar with the problem formulation and how it differs from a traditional multiclass classifier. So let’s cut right to the chase.
- For a multilabel text classifier, for each training example, we have multiple labels. As a result, LabelBinarizer should be replaced by MultiLabelBinarizer.
- ‘‘Sigmoid’’ activation should be used in the final layer instead of “Softmax” activation.
- Each class in a multilabel setup is assumed to be a Bernoulli random variable and hence we shall use
binary_cross_entropyloss function instead of a
- Finally, the choice of evaluation metric is pivotal while training a multilabel classifier. Traditional evaluation metrics like accuracy do NOT make sense in the multilabel universe. We shall leverage a custom evaluation metric called α- Evaluation metric introduced by Boutell et. al. in Learning multi-label scene classification.
That's all you need to know to train a robust neural network for solving the multilabel classification problem.
- This blog post aims at laying out the deal-breaking differentiators between a multiclass classifier and a multilabel classifier.
- If you are looking for a more comprehensive discussion on various aspects of a Multilabel classifier, I would encourage you to check out the blogs mentioned below.
Multi-Label Text Classification Using Keras
Gotchas to avoid while training a multilabel classifier.
A Survey of Evaluation Metrics for MultiLabel Classification
In a traditional classification problem formulation, classes are mutually exclusive. In other words, under the…
- As always, feel free to reach out to me via LinkedIn if you have any questions or feedback.