Key takeaway
- Anomaly detection with deep learning explained for enterprise teams: anomaly types, autoencoders, sequence models, baselines and when to avoid deep models.
Anomaly detection with deep learning means training a neural network on what normal data looks like, then flagging anything it cannot explain as unusual. The network is usually an autoencoder, a recurrent or convolutional model, or a transformer, and the signal is either how badly it reconstructs an input or how far the input sits from its learned picture of normal. It sits inside the wider field of anomaly detection and monitoring, which also includes simpler statistical and machine learning methods.
The short answer for enterprise teams: start with a simple baseline, move to deep learning only when the data is high dimensional, sequential or image-like, and plan labels, thresholds and alert handling before you pick a model. For streaming data, read our guide to real-time anomaly detection; for images and video, see anomaly detection in images and videos.
What is an anomaly?
An anomaly is an observation that deviates from expected behaviour. Anomaly detection is also called outlier analysis. It is used to surface events that matter, such as a system fault, an intrusion, a fraudulent payment or a failing machine. IBM, on its site, describes three types of anomaly:
| Type | What it means | Example |
|---|---|---|
| Point anomaly | An individual data point far outside the rest of the data set (also called a global outlier) | One transaction far larger than any other on the account |
| Contextual anomaly | A value that deviates from the norm in a specific context; it may look normal in isolation | High home energy use at midday when nobody is usually home |
| Collective anomaly | A set of data instances that together deviate from the norm, although each looks normal alone | A simultaneous traffic surge from many IP addresses |
Source: IBM, What is anomaly detection?, read 13 November 2026. Contextual and collective anomalies are common in time series, which is why sequence models matter. Our guide to anomaly detection in time series data goes deeper on that case.
Which learning setup should you use: supervised, unsupervised or semi-supervised?
The answer depends mainly on how many labelled anomalies you have. IBM notes that supervised detection is rarely used because labelled data is generally unavailable and the classes are imbalanced. scikit-learn draws a related line: outlier detection, where the training data may contain outliers, is "also known as unsupervised anomaly detection", and novelty detection, where the training data is clean and you test new observations, is "semi-supervised anomaly detection" (scikit-learn documentation, read 13 November 2026).
| Setup | What the model sees | When it fits | Main risk |
|---|---|---|---|
| Supervised | Labelled normal and anomalous examples | You hold a reliable labelled history of failures or fraud | Few anomalies and imbalanced classes; misses new kinds of anomaly |
| Unsupervised | Unlabelled data that may include anomalies | No labels exist and you want to find structure | Contaminated training data shifts what the model calls normal |
| Semi-supervised (novelty detection) | Mostly normal data, sometimes a small labelled set | Plenty of normal history and few known anomalies | Needs data that is genuinely clean of anomalies |
How does deep learning detect anomalies?
A survey by Pang, Shen, Cao and van den Hengel, Deep Learning for Anomaly Detection: A Review (arXiv 2007.02500, July 2020), organises deep anomaly detection into three high-level categories and 11 fine-grained categories, and sets out the intuitions, assumptions and pros and cons of each. It is the best single reference if you need to compare approaches in depth. In practice, enterprise teams meet three patterns most often.
Reconstruction with autoencoders
An autoencoder is trained to rebuild its input from a compressed form. If it is trained on normal data, it reconstructs normal inputs well and unusual inputs badly, so the reconstruction error becomes the anomaly score. The Keras example on time series anomaly detection uses a reconstruction convolutional autoencoder on the Numenta Anomaly Benchmark and sets the threshold to the maximum mean absolute error seen on the training samples; test samples above that value are labelled anomalies (keras.io, read 13 November 2026). That threshold rule is a teaching choice. In production, set thresholds against your own tolerance for false alarms.
Sequence models for time series
Recurrent, convolutional and transformer-based models can learn seasonality and trends, then flag points or windows that break the pattern. They suit contextual and collective anomalies, where the same value is normal at one time and abnormal at another. Evaluate them on streaming benchmarks such as the Numenta Anomaly Benchmark (Lavin and Ahmad, IEEE ICMLA 2015, arXiv 1510.03336), whose authors describe an ideal detector as one that finds anomalies quickly, raises few or no false alarms, works across domains and adapts to changing data.
Classical models as a baseline
Before building a network, test the estimators in scikit-learn. IsolationForest "isolates" observations by random splits and uses average path length as the measure of normality. LocalOutlierFactor looks for samples with a substantially lower density than their neighbours. OneClassSVM learns a frontier around the data but is sensitive to outliers and needs careful tuning of its nu parameter. EllipticEnvelope assumes the data is Gaussian (scikit-learn documentation, read 13 November 2026). If a baseline already meets the business need, deep learning adds cost without benefit.
Which method fits which situation?
Use this table as a starting point. It restates the sources above and is our guidance, not a benchmark result.
| Situation | Method to try first | Why it fits |
|---|---|---|
| Tabular data, no labels, modest size | IsolationForest or LocalOutlierFactor | Fast to run and easy to explain to risk teams |
| Clean normal history, new data to score | Novelty detection (OneClassSVM, LocalOutlierFactor with novelty set to true, or an autoencoder) | Learns a frontier around normal only |
| High-dimensional or sensor data | Autoencoder | Reconstruction error scores each input |
| Time series with seasonality | Sequence model or convolutional autoencoder | Learns context, so contextual and collective anomalies can be caught |
| Plenty of reliable labels | Supervised classifier | Directly learns known fault or fraud patterns |
Where is anomaly detection with deep learning used?
The use cases below are the ones our earlier version of this guide covered. We describe the task only; test any method on your own data before relying on it.
| Use case | What counts as anomalous | Where to read more |
|---|---|---|
| Network intrusion and security monitoring | Traffic or log patterns that differ from normal behaviour | Anomaly detection in cyber network security |
| Fraud detection in banking | Transactions that break a customer's usual pattern, or collective patterns across accounts | Credit card fraud detection use case |
| Health monitoring | Suspicious readings from scans, ECGs, glucose monitors or wearables that may signal a problem; a clinician must review any result | Not medical advice |
| Manufacturing quality | Products that differ from the ideal, including those that passed earlier checks | Anomaly detection in images and videos |
| IT operations and infrastructure | Metrics or logs that drift from normal behaviour | Real-time anomaly detection |
What should you plan before you deploy?
- Data. Decide what normal means, and whether your training data is clean. Contamination changes what the model learns as normal.
- Thresholds. Pick them against the cost of a missed event and the cost of a false alarm, and review them as data drifts.
- Explanations. Show which features or time window drove the score so a person can judge the alert quickly.
- Human review. Decide who triages alerts, who can block or approve an action, and how the decision is recorded.
- Retraining. Schedule model updates and check them against a held-out period before replacing the live model.
Deployment is also a governance question. The ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents, and Elixir Govern (formerly AgentGRC) checks autonomous agent actions against policy and records evidence for audit and risk teams. If your team wants to ask questions of data in plain language, AgentAnalyst lets teams ask questions of enterprise data sources in plain language. Each is described in its own site wording; check the product page for current scope.
When is deep learning the wrong choice?
It is the wrong choice when you have little data, when a simple rule or an IsolationForest already meets the need, or when regulators or risk teams need a decision they can explain line by line. Deep models add training cost, tuning effort and monitoring work, and a reconstruction score is harder to justify than a plain rule. Start simple and escalate only when the baseline fails on your own data.
To map one anomaly decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.
Frequently asked questions
What is anomaly detection with deep learning?
It is the use of neural networks, such as autoencoders and sequence models, to learn what normal data looks like and flag inputs that do not fit. The anomaly score is often the reconstruction error or distance from the learned normal.
What are the three types of anomaly?
According to IBM, point anomalies are individual points far outside the data, contextual anomalies deviate within a specific context, and collective anomalies are sets of instances that together deviate from the norm.
Is anomaly detection supervised or unsupervised?
Usually unsupervised or semi-supervised, because labelled anomalies are rare and the classes are imbalanced. scikit-learn calls outlier detection unsupervised anomaly detection and novelty detection semi-supervised anomaly detection.
How does an autoencoder find anomalies?
It is trained to rebuild normal inputs. Inputs it rebuilds badly get a high error and are flagged. The Keras timeseries example sets the threshold at the maximum training mean absolute error.
Should I use deep learning or a classical method?
Test a baseline such as IsolationForest or LocalOutlierFactor first. Move to deep learning when the data is high dimensional, sequential or image-like and the baseline falls short.
Ready to put AI agents to work? See an ElixirClaw demo: the agentic OS to build, orchestrate and govern AI agents across your enterprise systems.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE