# Multilabel

> Classification where examples can belong to multiple classes simultaneously

- **Category**: Machine Learning
- **Subcategory**: Problem Framing and Model Structure
- **Canonical URL**: https://designpattern.fyi/machine_learning/multilabel/

---

## Description
**Intent**: Handle classification problems where examples can legitimately belong to multiple categories at once, rather than the mutually exclusive assumption of standard multi-class classification.

**Context**: Many real problems don't fit the single-class assumption: a photo can be tagged both beach and sunset, a support ticket can be both billing and urgent at once. Standard softmax over mutually exclusive classes fails here.

**Solution**: Replace a single softmax over mutually exclusive classes with independent sigmoid outputs, one per possible label. Each sigmoid is interpreted as its own probability and trained with its own binary cross-entropy loss, allowing any combination of labels to be correct simultaneously.



## Use Cases
- Image tagging with multiple possible labels
- Document classification with multiple topics
- Support ticket categorization with multiple issue types
- Content classification with overlapping categories






## Trade-offs


### Advantages

- Handles naturally co-occurring labels correctly

- More realistic for many real-world classification tasks

- Independent probabilities per label enable flexible thresholding

- Supports zero or multiple labels per example




### Considerations & Drawbacks

- Independent sigmoids ignore correlations between labels

- Per-label threshold tuning adds ongoing work

- Evaluation requires multilabel-specific metrics

- More complex than standard multi-class classification







---
**Reference**: [Original Source](https://github.com/GoogleCloudPlatform/ml-design-patterns)

