# Anomaly Detection

> Finding the rare cases that do not fit, like a fake charge on a bank card.

**Field:** Artificial Intelligence  
**Category:** Machine Learning  
**Also known as:** Outlier Detection, Novelty Detection

## Think of it like

Think of it like a drawer of white socks. One red sock stands out.

## Definition

Anomaly detection is the task of finding the rare cases that do not fit the normal pattern. The model learns what normal looks like from lots of everyday data. Then it flags anything far from normal. It is used to catch card fraud, broken machines and break-ins. There are often very few bad cases to learn from, so it learns normal instead.

## Example

Jack's card is normally used for small shop payments in London. One night it buys 3,000 euros of phones abroad. The bank's model flags it at once.

## Why it matters

The rare cases are often the costly ones. Catching them early saves money and sometimes lives.

## Common mistake

Flagging everything that is just new. A first trip abroad is odd, but it is not fraud. Too many alarms get ignored.

## Three principles

- **Learn normal.** From lots of everyday data.
- **Flag the odd.** Far from the usual pattern.
- **Rare but costly.** Fraud, faults and break-ins.

## Related terms

- [Clustering](https://learn.benibix.com/term/ai/clustering)
- [Unsupervised Learning](https://learn.benibix.com/term/ai/unsupervised-learning)
- [Classification (Machine Learning)](https://learn.benibix.com/term/ai/classification)
- [Autoencoder](https://learn.benibix.com/term/ai/autoencoder)
- [Outlier](https://learn.benibix.com/term/general/outlier)
- [Fraud Detection](https://learn.benibix.com/term/ai/fraud-detection)

## Taught in

- [Clustering and PCA](https://learn.benibix.com/learn/ai-machine-learning/clustering-and-pca): Machine Learning, 11/18
- [Spam and Fraud Detection](https://learn.benibix.com/learn/ai-use-case/spam-and-fraud-detection): AI Assistants and Chatbots, 11/13

![A line of daily card spending that stays low and steady, with one tall spike circled and marked unusual.](https://learn.benibix.com/diagrams/ml-anomaly.svg)

---

Source: https://learn.benibix.com/term/ai/anomaly-detection
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
