Skip to main content
XenonStack

Cognitive Automation

XenonStack Insights Anomaly Detection with Deep Learning: Practical Guide

| Published | Updated

Anomaly Detection with Deep Learning: Practical Guide
11:14
Anomaly Detection with Deep Learning: layers from clean normal data to alerts people can act on

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:

TypeWhat it meansExample
Point anomalyAn 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 anomalyA value that deviates from the norm in a specific context; it may look normal in isolationHigh home energy use at midday when nobody is usually home
Collective anomalyA set of data instances that together deviate from the norm, although each looks normal aloneA 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).

SetupWhat the model seesWhen it fitsMain risk
SupervisedLabelled normal and anomalous examplesYou hold a reliable labelled history of failures or fraudFew anomalies and imbalanced classes; misses new kinds of anomaly
UnsupervisedUnlabelled data that may include anomaliesNo labels exist and you want to find structureContaminated training data shifts what the model calls normal
Semi-supervised (novelty detection)Mostly normal data, sometimes a small labelled setPlenty of normal history and few known anomaliesNeeds 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.

Two columns pairing four data situations with the method to try first: IsolationForest or LOF, novelty detection, autoencoder and sequence model.
SituationMethod to try firstWhy it fits
Tabular data, no labels, modest sizeIsolationForest or LocalOutlierFactorFast to run and easy to explain to risk teams
Clean normal history, new data to scoreNovelty detection (OneClassSVM, LocalOutlierFactor with novelty set to true, or an autoencoder)Learns a frontier around normal only
High-dimensional or sensor dataAutoencoderReconstruction error scores each input
Time series with seasonalitySequence model or convolutional autoencoderLearns context, so contextual and collective anomalies can be caught
Plenty of reliable labelsSupervised classifierDirectly 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 caseWhat counts as anomalousWhere to read more
Network intrusion and security monitoringTraffic or log patterns that differ from normal behaviourAnomaly detection in cyber network security
Fraud detection in bankingTransactions that break a customer's usual pattern, or collective patterns across accountsCredit card fraud detection use case
Health monitoringSuspicious readings from scans, ECGs, glucose monitors or wearables that may signal a problem; a clinician must review any resultNot medical advice
Manufacturing qualityProducts that differ from the ideal, including those that passed earlier checksAnomaly detection in images and videos
IT operations and infrastructureMetrics or logs that drift from normal behaviourReal-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.

Table of Contents

dr-jagreet-gill

Dr. Jagreet Kaur

Chief AI Officer, XenonStack

LinkedIn profile

Dr. Jagreet Kaur specializing in Generative AI for synthetic data, Conversational AI, and Intelligent Document Processing. With a focus on responsible AI frameworks, compliance, and data governance, she drives innovation and transparency in AI implementation

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue