Multilabel classification is a machine-learning task in which an input can belong to several categories simultaneously. A news article, for example, may be labeled “politics,” “economics,” and “international affairs,” while a photograph may be labeled “person,” “bicycle,” and “street.” In its standard supervised-learning formulation, a model learns from examples paired with sets of applicable labels and predicts a label set for each new input.
The defining feature is that labels are not mutually exclusive. This distinguishes the task from multiclass classification, where each example receives exactly one class from several alternatives. Multilabel methods must address both the relevance of individual labels and, where useful, relationships among them.
Formal definition
Let be an input space and let be a vocabulary of labels. A multilabel classifier learns a mapping
where denotes the set of all subsets of . Depending on the application, an empty label set may be allowed.
Each target set can be represented by a binary indicator vector:
This is often called a multi-hot representation, in contrast to one-hot encoding, which has exactly one active entry.
Many models first produce a score or estimated marginal probability
for every label. A decision rule then converts these outputs into a label set. One common rule is
where is a global or label-specific threshold.
Two descriptive properties of a dataset are:
- Label cardinality: the mean number of positive labels per example.
- Label density: label cardinality divided by the number of available labels.
These properties describe different aspects of difficulty. A dataset with thousands of possible labels may have low density even when each example has several relevant labels.
Relationship to other learning tasks
In binary classification, the target is one of two alternatives. A multilabel task can be decomposed into multiple binary tasks, but its overall output is a set rather than one binary decision.
Multiclass and multilabel classification are sometimes confused because both can involve many categories. The distinction is whether categories exclude one another. Classifying a document into exactly one primary department is multiclass classification; assigning every applicable subject tag is multilabel classification.
Multilabel classification also differs from several related settings:
- Multi-output classification is broader: each output may have its own set of possible values, rather than being a binary label indicator.
- Label ranking orders labels by relevance without necessarily deciding which labels are present.
- Hierarchical classification arranges categories in a taxonomy. It may be single-label or multilabel.
- Structured prediction models outputs with internal dependencies. Multilabel classification can be treated as a structured-prediction problem when label relationships are represented explicitly.
Multilabel image classification predicts which categories occur in an image but does not locate individual objects. Object detection additionally predicts object locations, while segmentation assigns categories or identities to image regions.
Main modeling approaches
Binary relevance
Binary relevance trains one binary classifier for each label:
The final prediction combines their outputs. The individual classifiers may use methods such as support vector machines, decision trees, or logistic regression.
Binary relevance is simple, modular, and naturally parallelizable. Its principal limitation is that one label’s prediction does not explicitly depend on the others.
This limitation is sometimes described too strongly as an assumption that labels must be independent. Independent per-label decisions can be optimal for an additive objective such as Hamming loss even when labels are statistically dependent. What binary relevance lacks is an explicit mechanism for using those dependencies to improve joint decisions or share information across labels.
Classifier chains
A classifier chain orders the labels and predicts each one using the input and preceding labels:
This factorization can represent label dependencies. During ordinary training, earlier ground-truth labels are used as features; during sequential prediction, earlier predictions are used instead.
Classifier chains can exploit patterns such as the frequent co-occurrence of “beach” and “sea,” but their behavior depends on label order. Incorrect early predictions can also affect later decisions. Ensembles of chains use multiple orderings to reduce sensitivity to a single sequence. Exact search for the highest-probability label vector may be expensive, so practical systems often use greedy or approximate inference.
Label powerset
The label powerset transformation treats each distinct label combination observed in training as one multiclass category. For example, and become separate classes.
This approach directly preserves observed combinations, but the number of possible combinations is . Many combinations may have few training examples, and the basic method cannot output an unseen combination as a new class. Variants train on smaller label subsets or combine several transformed problems.
Algorithm adaptation and neural models
Other approaches adapt an algorithm to produce multiple labels directly. Examples include neighbor-based methods that estimate label relevance from nearby examples and tree-based methods whose leaves contain label vectors or distributions.
In deep learning, a common architecture uses a shared representation network followed by output units. Each output usually applies a sigmoid function:
Unlike a softmax output, these probabilities are not constrained to sum to one, so several labels can receive high probabilities simultaneously. Softmax is therefore generally unsuitable as the sole output normalization for unrestricted multilabel classification.
Shared representations can transfer useful information between labels without explicitly modeling a joint label distribution. More elaborate models use label embeddings, graph structures, attention mechanisms, or sequential decoders. In text applications, transformer encoders can supply document representations for multilabel prediction.
Training objectives and decision rules
A widely used loss function is the sum or mean of binary cross-entropies:
This objective trains each output to estimate a label’s marginal probability. It does not, by itself, specify how the final label set should be selected.
A threshold of is appropriate for calibrated marginal probabilities when false positives and false negatives have equal cost under an additive per-label decision objective. It is not universally optimal. Different error costs, label frequencies, or evaluation metrics may favor other thresholds.
Common decision strategies include:
- Global thresholding: one threshold for all labels.
- Per-label thresholding: a separate threshold for each label.
- Top- selection: predict the highest-scoring labels.
- Cardinality prediction: estimate how many labels apply, then select that many.
- Constrained decoding: enforce requirements such as parent–child consistency in a taxonomy.
Top- selection imposes a fixed output size unless is predicted separately. This can be inappropriate when examples vary greatly in their number of relevant labels.
Thresholds and other hyperparameters are selected using a validation set, not the final test set. Choosing thresholds after inspecting test performance creates data leakage and makes reported results overly optimistic.
Evaluation
No single metric fully characterizes multilabel performance. Different metrics reward different kinds of correctness.
Exact-match accuracy
Also called subset accuracy, exact-match accuracy requires every predicted label decision for an example to be correct:
It is stringent: an otherwise correct prediction receives no credit if it omits or adds one label. It measures complete-set correctness but may be low when the vocabulary is large.
Hamming loss
Hamming loss measures the fraction of individual label decisions that are incorrect:
It treats each label decision equally. In sparse datasets, predicting no labels can yield a deceptively low Hamming loss because most label indicators are negative.
Precision, recall, and F-scores
Precision measures how many predicted positives are correct; recall measures how many true positives are recovered. Their harmonic mean is
For multilabel data, the averaging convention matters:
- Micro-averaging pools true positives, false positives, and false negatives across all labels before calculating the metric. Frequent labels have greater influence.
- Macro-averaging calculates the metric separately for each label and averages the results equally. It gives rare labels equal weight but can be unstable when their support is small.
- Weighted macro-averaging weights label-level results by their support.
- Example-based averaging calculates a metric for each example and then averages across examples.
An example-based Jaccard score measures intersection over union between predicted and true sets:
Cases involving empty sets or zero denominators require an explicitly stated convention.
Ranking metrics
When scores are important independently of a chosen threshold, ranking metrics are useful. Average precision rewards ranking relevant labels above irrelevant ones. Other measures include precision at , recall at , and ranking loss.
For a fixed example, a ranking metric can compare labels against one another. For a fixed label, a ranking metric can compare examples. These are different evaluation axes, so reports must identify which convention is used.
Data challenges and limitations
Imbalance and rare labels
Multilabel datasets often contain both common labels and a long tail of rare ones. A model can perform well overall while failing on infrequent categories. Class-weighted losses, resampling, shared representations, and transfer learning can help, but their effects depend on the dataset and evaluation objective.
Weights can also change the interpretation or calibration of output scores. Better ranking performance does not necessarily imply that the scores are accurate probabilities.
Missing and uncertain annotations
An absent annotation does not always mean that a label is false. Annotators may omit relevant labels, or a dataset may record only a subset of known positives. Treating all unrecorded labels as negatives can bias training and evaluation.
Where annotation status is known, unknown entries can be masked out of the loss. Other settings require assumptions about how labels are missing. These problems differ from fully annotated multilabel classification and cannot generally be resolved by changing a decision threshold alone.
Label dependence
Labels can co-occur because of semantic relationships, causal relationships, annotation conventions, or dataset-specific artifacts. Modeling dependence may improve prediction, but correlations need not remain stable under distribution shift.
For example, a system may learn that two topics usually appear together and then fail when one occurs independently. Enforcing a genuine taxonomy constraint is different from treating a frequent co-occurrence as mandatory.
Scale
In extreme multilabel classification, the label vocabulary may contain hundreds of thousands or millions of labels. Scoring every label for every input can be expensive, and rare labels may have very little training data.
Common strategies include hierarchical label organization, label embeddings, candidate retrieval, and sparse outputs. Retrieval-based systems first select a manageable candidate set and then rank or classify those candidates. Their final recall is limited by the relevant labels retained during candidate selection.
Applications and development
Early multilabel research was closely associated with document categorization, where texts naturally belong to several subjects. The field expanded into image annotation, audio tagging, biological function prediction, and large-scale content organization.
In natural language processing, applications include assigning topics, intents, or content attributes to documents and messages. In computer vision, multilabel models identify the categories present in an image without necessarily locating each instance. Audio systems use them to describe overlapping sound events or multiple musical attributes. Information retrieval systems use related methods to assign categories and improve search organization.
The development of shared neural representations has made it practical to learn from many labels jointly. Nevertheless, binary relevance remains an important baseline because it is straightforward, scalable, and sometimes well matched to the evaluation objective. Comparisons between multilabel methods depend not only on model architecture but also on annotation completeness, label frequency, threshold selection, and the definition of prediction quality.