
Source: Chalapathy et al.
Introduction
Anomaly detection (also called outlier detection or novelty detection) is the task of identifying data points, events, or patterns that deviate from what “normal” looks like for a system or dataset. Unlike traditional supervised learning, anomaly detection is typically performed without labeled examples of abnormal behavior. Instead of learning what is “bad,” we try to learn what is “normal” and flag anything that does not conform to that understanding.The goal of anomaly detection isn’t just to find “rare” points, but rather to identify meaningful deviations that could indicate things like fraud, machine failure, cybersecurity incidents, data quality issues, or unusual user behavior.
One important concept to keep in mind is that an anomaly is always defined relative to a notion of normality. Yet “normal” might mean “typical historically,” “typical for a given segment,” “typical under a physics model,” or “typical under a learned distribution.” The structure for normal vs abnormal may be statistical, temporal, relational, or geometric, depending on the data. Therefore, anomaly detection is as much about problem framing as it is about algorithms.
Why Anomaly Detection is Hard
At first glance, anomaly detection seems simple: identify what a normal dataset should look like and then identify the points that stand out. In practice, it is difficult for several reasons. First of all, anomalies are rare by definition, so data is heavily imbalanced. Normal behavior also evolves over time (concept drift) causing the model’s accuracy to degrade because underlying patterns it was trained against are no longer valid. What counts as abnormal could be highly context-dependent and anomalies may not be extreme values, but only unusual in combination with other features.
Univariate vs Multivariate Anomaly Detection

Source: MIT Foundry Blog
Univariate anomaly detection looks at one feature at a time. For example: “Is today’s CPU usage unusually high?” or “Is this transaction amount too large?” Common univariate detection approaches include Z-score and standard deviation calculations, boxplot rules, and univariate time-series models such as moving average and Exponentially Weighted Moving Average (EWMA). Univariate detection is simple, straightforward, and fast. It works well when a single feature truly captures abnormality. However, it tends to miss anomalies that only appear in feature relationships and is easily fooled by multimodal data, where there are multiple legitimate “normal” groups. Determining the threshold for “abnormal” can also be difficult to fine-tune.
Multivariate anomaly detection considers multiple features simultaneously and evaluates whether a data point is unusual given the joint behavior of those features. Instead of asking whether a single value is extreme, it asks whether a combination of values is rare or inconsistent with normal patterns. For example, a user’s login location and device type might each be common on its own, but their combination may be highly unusual. Common multivariate approaches include distance-based methods such as K-Nearest Neighbors and boundary-based models such as One-Class SVM. Multivariate detection is powerful because it can capture correlations, dependencies, and complex relationships between features that univariate methods cannot. However, it is typically more computationally expensive, harder to interpret, and more sensitive to feature scaling, irrelevant variables, and the curse of dimensionality. It also requires more data to accurately learn what “normal” looks like in high-dimensional spaces.
Counter-Intuitive Anomaly Case: Normal Individually, Anomalous Jointly

Source: AIML.com Research
In this scenario, a point may fall within normal ranges for both features individually, so each feature value looks normal when considered in isolation. However, if Feature 1 and Feature 2 are strongly correlated, then the relationship between the two features is unusual. Despite falling within the individual ranges for both features individually, it violates the learned relationship because it lies far away from that diagonal structure. This is a classic multivariate anomaly. Univariate detectors will miss it, but distance-based, density-based, and correlation-aware methods can catch it.
Common Anomaly Detection Methods
Now let’s examine the most common anomaly detection approaches and when to use them:
- Statistical Thresholding
These are the simplest and most interpretable methods. Examples include: Z-score thresholds, boxplot rules, and median absolute deviation (MAD). They work by assuming a statistical distribution for normal behavior and flagging points that lie far from the center. You should use one of these methods if you have one dominant metric and data is stable and unimodal. Unfortunately, statistical thresholds cannot capture feature relationships, are sensitive to skew and heavy tails, and break in multimodal data.
- Time-Series Anomaly Detection
Many anomalies are contextual: what is normal at one time may be abnormal at another. Therefore, time-based detection methods are also useful to consider. Examples include: moving average residuals, seasonal decomposition, and EWMA control charts. These methods are useful when monitoring sensor data, financial KPIs, and user activity over time. However, they require careful handling of seasonality and drift, and must be able to distinguish between spikes, level shifts, and regime changes.
- Distance-Based Methods
Distance-based methods, such as K-Nearest Neighbors, define anomalies as outlier points that are far from their neighbors. They are good to use when there is low to moderate dimensionality of the data, as well as clear separation between normal points and anomalies. They tend to be sensitive to feature scaling, suffer in high dimensions, and are computationally expensive at scale.
- Density-Based Methods
Density-based methods such as Local Factor Outlier (LOF) and Kernel Density Estimation (KDE) detect anomalies as points that lie in low-density regions. They are ideal for datasets where local density varies and clusters have distinctly different densities. However, they are sensitive to hyperparameters and may struggle in high dimensions.
- Clustering-Based Methods
These methods model normal behavior as clusters and anomalies are outliers. Examples include K-Means (link to article when published) and Gaussian Mixture Models (GMM). They are useful in datasets where there are multiple normal modes and segmented populations, but struggle when anomalies also cluster together and assumptions about cluster shapes fail.
- Tree-Based Isolation
Tree-based isolation, or IsolationForest, isolates points using random splits. Anomalies tend to be isolated in fewer splits than normal points, resulting in shorter average path lengths in the trees. Tree-based isolation works well with high-dimensional data, scales well to large datasets, and requires few assumptions about the data distribution. However, it is often less interpretable and more sensitive to irrelevant features.
- One-Class SVM
One-class SVM (link to article when published) learns a boundary around normal data and identifies the outliers as anomalies. It is good to use when dealing with mostly normal training data, moderate dimensionality, and clear boundary structure. It can be difficult to tune and sensitive to scaling.
- Reconstruction-Based Methods
Reconstruction-based methods learn a compressed representation of normal data and attempt to recreate each input from that representation. Because the model has only learned typical patterns, it struggles to accurately reconstruct abnormal or unusual points, resulting in high reconstruction error. This error is then used as an anomaly score, with larger errors indicating a higher likelihood of abnormality. Examples of dimensionality reduction methods include: Principal Component Analysis (PCA) and autoencoders. These methods work well with high-dimensional and correlated data, such as images and audio. However, they may be hard to interpret and can overfit.
In summary, different scenarios will call for different anomaly detection methods. For a general cheat sheet:
| Scenario | Recommended Methods |
|---|---|
| Single metric | Z-score, MAD |
| Seasonal time series | EWMA charts, forecasting errors |
| Multiple normal groups | GMM, K-Means |
| General multivariate | Isolation Forest |
| Local rarity | LOF |
| Mostly normal training set | One-Class SVM |
| High-dimensional numeric data | PCA |
| Complex patterns | Autoencoders |
Source: AIML.com Research
Conclusion
Anomaly detection is not about finding the most extreme points, but rather learning what “normal” means for your system and identifying meaningful deviations from it. The biggest mistakes in anomaly detection happen when we:
- Ignore feature relationships
- Use univariate logic on multivariate problems
- Assume rarity implies abnormality
- Forget that normality changes over time
The best anomaly detection systems are often a combination of segmentation, continuous monitoring, human-in-the-loop feedback, and periodic retraining to adapt to evolving data patterns. By incorporating context and learning from real-world corrections, these systems can remain accurate, robust, and relevant over time.
Video Explanations
- This video “Anomaly Detection 101” by DevOpsDays Silicon Valley provides an overview of anomaly detection, as well techniques for detecting anomalies in a DevOps environment. (Runtime: 30 mins)
- This video “AI Agents: Transforming Anomaly Detection & Resolution ” by IBM Technology explains how to use AI Agents to improve anomaly detection and perform root cause analysis. (Runtime: 39 mins)

