Key takeaways
- Anomaly detection scores how far each data point strays from normal and flags the ones past a cutoff that someone has to choose.
- The main methods are statistical thresholds, isolation forests, one-class models and autoencoders, and most learn from normal or unlabeled data because examples of abuse are scarce.
- When real abuse is rare, most flags from even an accurate detector land on innocent cases, which is what Google said happened in a viral account suspension on November 29, 2026.
Anomaly detection is the practice of finding the data points that don't look like the rest: a card payment from a country you have never visited, a login at 4 a.m. from a new device, a server whose error count triples in a minute. A system learns what normal looks like, scores each new event by how far it strays, and flags whatever crosses a line. The catch is that unusual and harmful are different things, and a detector only measures the first.
That catch made news this week. Google said on November 29 that a developer's viral account suspension was a false positive. 9to5Google quotes the company blaming "automated systems that look for anomalous signals of potential account hijacking or abuse". Android Authority reports that Google compared those systems to a bank watching for fraudulent access.
How anomaly detection works
A 2020 review of the field by Guansong Pang and three co-authors defines it as detecting data instances that deviate significantly from the majority. It also goes by outlier detection or novelty detection.
Ordinary classification learns from many labeled examples of each class. That doesn't work here. Anomalies are rare, so there are few examples, and the review points out that a new kind of fraud or network intrusion stays unknown until it happens. Most detectors therefore learn from normal data, or from unlabeled data that is assumed to be mostly normal.
What comes out is a score, and a score flags nothing until someone chooses a cutoff. In scikit-learn, a Python machine learning library, that choice is a parameter called contamination: the share of the data you expect to be outliers. The library's documentation says it controls the threshold applied to the scores. Tell a detector that 1% of its training data is anomalous and it will flag about 1% of it, whether or not anything is wrong.
Some anomalies are single odd records. Others are strange only as a group. The review's example is fake accounts in a social network: each can look as normal as a real account, but together they form an unusually dense cluster.
The main anomaly detection methods
| Method | How it decides | Where it struggles |
|---|---|---|
| Statistical thresholds | Assumes normal data follow a known distribution and flags points far from its center | Data that doesn't fit the assumed shape |
| Isolation forest | Counts how many random splits it takes to separate a point from the rest | Data with very many dimensions |
| One-class models | Draw a boundary around normal data and flag what falls outside | Training data that already contains outliers |
| Autoencoders | Compress and rebuild each record, then flag the ones that rebuild badly | Noisy training data, which teaches the network to rebuild anomalies too |
Statistical thresholds are the simplest. scikit-learn's EllipticEnvelope assumes the normal data are Gaussian, fits an ellipse around the central points and measures how far each point lies from it.
The isolation forest comes from a 2008 paper by Fei Tony Liu, Kai Ming Ting and Zhi-Hua Zhou. Earlier methods built a profile of normal data. Liu's team went straight for the anomalies, on the grounds that they are "few and different". Pick a random feature, pick a random split value, repeat, and an odd point ends up alone after only a few cuts. In the paper's first figure a normal point takes twelve random partitions to isolate and an anomaly takes four. The authors found that 100 trees built on samples of 256 records were usually enough, and scikit-learn's IsolationForest still ships with those defaults in version 1.9.1. On a network-intrusion dataset the paper reports scoring 283,748 records in 7.6 seconds.
A one-class support vector machine, introduced by Bernhard Schölkopf and colleagues, draws a frontier around the training data and treats anything beyond it as new. scikit-learn's documentation warns that it is sensitive to outliers in the training set.
Autoencoders are the deep learning version. An autoencoder is a neural network that squeezes each record through a narrow middle layer and then tries to rebuild it. It gets good at the common patterns, so the size of the rebuilding error becomes the anomaly score. Pang's review names the weak point: the network is trained to compress data, and noise in the training set can teach it to rebuild anomalies just fine.
Where anomaly detection is used
Fraud is the classic case. Liu's paper opens with credit card transactions, and a bank is the comparison Google reached for. Security is the second: unusual network traffic may be an intruder, and an unusual login may be a stolen password. Pang's review adds compliance, financial surveillance, medical risk and AI safety.
Monitoring is the third, because machines log more than people can read. In a 2000 paper on intrusion detection, Stefan Axelsson assumed that one small site with a couple of dozen users would produce about a million audit records a day.
Why false positives are built in
Axelsson's paper explains why these systems misfire. His example is a medical test that is 99% accurate, for a disease that one person in 10,000 has. If you test positive, the chance you are sick is about 1%. Healthy people outnumber sick ones so heavily that the test's 1% error rate, applied to all of them, swamps the real cases. Forgetting this is the base-rate fallacy.
The same arithmetic applies to accounts. The table below is an illustration with made-up round numbers, not data from Google or anyone else.
| Hijacked accounts | Normal accounts | |
|---|---|---|
| Total (invented for the example) | 100 | 999,900 |
| Flagged by a detector that catches 99% of hijacks and wrongly flags 1% of normal accounts | 99 | 9,999 |
| Flagged if the wrong-flag rate falls to 0.01% | 99 | about 100 |
In the first case about 99 of every 100 flags land on someone innocent, from a detector that sounds 99% accurate. Cut the wrong-flag rate a hundredfold and half the flags are still wrong.
Axelsson concluded that the false alarm rate, more than the detection rate, limits how useful a detector can be. Twenty years later Pang's review still listed false positives among the largely unsolved problems. It also raised a fairness worry: people who are simply rare in the data can end up flagged for it.
What Google's case shows
Google hasn't said which methods its account systems use. According to 9to5Google, the developer's sign-in page said the account appeared to have been created or used with multiple other accounts to break Google's policies. Google says false positives are rare, and that may well be true. At Google's scale, rare still means real people get locked out.
The base-rate math says no detector will fix this alone, so what a flag triggers matters as much as how accurate it is. A bank that distrusts one payment can decline that one payment. Here the flag disabled a whole Google account. Google's announced fix works on that side: it is expanding SMS verification so a flagged user can pass a second check by text and get back in without waiting for a review.
Google also said it is rolling out improvements to produce fewer false positives. It hasn't published an error rate, and until it does nobody outside can check how rare.
Frequently asked questions
What is an example of anomaly detection?
A bank flagging a card payment that doesn't match the cardholder's usual pattern is the classic example. Others are spotting unusual network traffic that may be an intruder, and flagging a login that may come from a stolen password.
What are the main anomaly detection algorithms?
The common ones are statistical thresholds, isolation forests, one-class models such as the one-class support vector machine, and autoencoders. scikit-learn ships the first three as EllipticEnvelope, IsolationForest and OneClassSVM, plus a density method called Local Outlier Factor.
Why does anomaly detection produce false positives?
Because real anomalies are rare. Normal cases outnumber them so heavily that even a small error rate, applied to all the normal cases, produces more wrong flags than right ones. Stefan Axelsson's 2000 paper on intrusion detection calls the false alarm rate the limiting factor.
How does an isolation forest work?
It splits the data at random again and again and counts how many splits it takes to leave each point alone. Anomalies are few and different, so they get isolated in fewer splits than normal points, and a short average path across many random trees marks a point as anomalous.
Sources
- Deep Learning for Anomaly Detection: A ReviewarXiv
- Isolation ForestLiu, Ting and Zhou, IEEE ICDM 2008
- Novelty and Outlier Detectionscikit-learn
- IsolationForestscikit-learn
- The Base-Rate Fallacy and the Difficulty of Intrusion DetectionStefan Axelsson, ACM Transactions on Information and System Security
- Google 'significantly expanding' SMS verification to reduce Google Account suspensions9to5Google
- A Google account ban just went viral and now the company is promising to make things rightAndroid Authority

