Multi-Label Classification with Deep Learning
Multi-label classification involves predicting zero or more class labels.
Unlike normal classification tasks where class labels are mutually exclusive, multi-label classification requires specialized machine learning algorithms that support predicting multiple mutually non-exclusive classes or “labels.”
Deep learning neural networks are an example of an algorithm that natively supports multi-label classification problems. Neural network models for multi-label classification tasks can be easily defined and evaluated using the Keras deep learning library.
In this tutorial, you will discover how to develop deep learning models for multi-label classification.
After completing this tutorial, you will know:
Multi-label classification is a predictive modeling task that involves predicting zero or more mutually non-exclusive class labels.
Neural network models can be configured for multi-label classification tasks.
How to evaluate a neural network for multi-label classification and make a prediction for new data.
Let’s get started.
Multi-Label Classification with Deep Learning Photo by Trevor Marron , some rights reserved.
Tutorial Overview
This tutorial is divided into three parts; they are:
Multi-Label Classification
Neural Networks for Multiple Labels
Neural Network for Multi-Label Classification
Multi-Label Classification
Classification is a predictive modeling problem that involves outputting a class label given some input
It is different from regression tasks that involve predicting a numeric value.
Typically, a classification task involves predicting a single label. Alternately, it might involve predicting the likelihood across two or more class labels. In these cases, the classes are mutually exclusive, meaning the classification task assumes that the input belongs to one class only.
Some classification tasks require predicting more than one class label. This means that class labels or class membership are not mutually exclusive. These tasks are referred to as multiple label classification , or multi-label classification for short.
In multi-label classification, zero or more labels are required as output for each input sample, and the outputs are required simultaneously. The assumption is that the output labels are a function of the inputs.
We can create a synthetic multi-label classification dataset using the make_multilabel_classification() function in the scikit-learn library.
Our dataset will have 1,000 samples with 10 input features. The dataset will have three class label outputs for each sample and each class will have one or two values (0 or 1, e.g. present or not present).
The complete example of creating and summarizing the synthetic multi-label classification dataset is listed below.
# example of a multi-label...