← BACK TO THE BLOG

Anomaly detection: spotting the odd thing before it costs money

Person seen from behind facing a wall of lit monitors showing several video feeds at once in a dimly lit room

Most companies find out about their problems late, and always the same way: the May electricity bill, the month-end close, the customer complaint. The data that warned them was there weeks earlier — consumption that doubled on a Tuesday night, a run of credit notes to the same bank account, a machine that started producing 3 % more parts out of tolerance — but nobody looked. That is what anomaly detection is for: building something that looks every day at what a person only looks at once something has already gone wrong.

It isn't an artificial intelligence project by definition. Half the cases that end up working in a mid-sized company are well-placed rules on clean data. The other half need a model because "normal" changes with the day, the shift or the customer. This article is about working out which half you're in before you spend anything.

What is anomaly detection?

Detecting anomalies means identifying observations that depart from the expected behaviour of a series. The key word is expected: underneath, every anomaly detector is a model of normality. If you can't describe what normal looks like, you can't say what's odd, and you end up with a system that flags everything or nothing.

Three types are worth separating, because each is detected differently:

Most of the frustration comes from attacking a contextual anomaly with a tool built for point anomalies. A "more than €10,000" threshold never sees structuring, and "temperature > 80°" never sees the drift that has been warning you for three days.

Where does it actually pay off in a company?

The four places where we've seen it pay off soonest, easiest first:

Consumption and recurring costs. Energy, water, fleet fuel, cloud spend, phone lines. These are regular series with clear seasonality and an owner who already suffers the invoice. A detector that compares each day against the same day in previous weeks and flags deviations above 25 % finds leaks, equipment left running and wrongly applied tariffs. It's the best effort-to-result ratio there is; if you only do one, do this one.

Transactions and payments. Duplicates, amounts outside the usual pattern, new suppliers invoicing immediately, unusual credit notes. Much of this overlaps with fraud detection, but in an SME most of the value isn't fraud: it's keying errors and invoices paid twice.

Production and quality. Parts out of tolerance, micro-stoppages nobody declares, material consumption above the bill of materials. It requires the plant to capture data with some discipline; if you're still on paper job sheets, the first job is the production data, not the detector.

Customer behaviour. Sharp drops in orders from a regular customer, changes in frequency, clustered complaints. It's an early signal that connects directly to churn prediction, and it's often more actionable than a full churn model because it arrives with a name attached.

Threshold or model? Choosing without overcomplicating it

This is the decision that saves the most money, and it's almost always taken backwards. The practical rule: start with the dumbest method you can defend, measure how many useful alerts it produces, and move up a rung only when that method falls short for a reason you can articulate.

| Method | What it is | When it fits | What it needs | Where it fails | |---|---|---|---|---| | Fixed threshold | "Alert if it goes above X" | Known physical or contractual limits | Nothing but the data | Variable normality: over-alerts on legitimate peaks | | Statistical threshold | Rolling mean and deviation over the last N weeks | Noisy series without strong seasonality | 3-6 months of history | Series with a marked weekly or seasonal cycle | | Same-period comparison | Tuesday against Tuesday, shift against shift | Consumption, footfall, traffic, sales | 1 year if there's seasonality | Structural change (new line, new store) | | Time-series model | Predicts the expected value, flags large residuals | Many series with different patterns | Clean history and maintenance | Nobody retrains it and it degrades silently | | Multivariate model | Looks at many variables at once | Fraud, quality with many sensors | Labelled data or high volume | Explaining why it fired to whoever receives it |

Two warnings from someone who has watched this fail more than once. First: a model that can't explain its alert gets ignored within three weeks, however good it is. If the recipient is a maintenance supervisor or someone in accounts receivable, the alert has to say "Tuesday's consumption is 40 % above the previous four Tuesdays", not "score 0.87". Second: the "same-period comparison" rung covers, in our experience, most consumption and operations cases. It isn't unsophisticated, it's sufficient.

What does a false positive cost?

This is the question that decides whether the system survives, and almost nobody asks it up front. A detector has two possible errors: flagging something that was nothing (false positive) and missing something that was real (false negative). You can't minimise both at once: tightening the threshold reduces one and inflates the other.

To calibrate, put numbers on two concrete things:

With those two numbers the threshold almost falls out on its own. If reviewing is cheap and missing is expensive (fraud, safety, quality), you allow noise. If reviewing is expensive and what slips through is minor, you tighten up and accept that some get past.

An anomaly detector producing more than five alerts a day that nobody closes isn't an alerting system: it's a mail folder everyone has muted.

Add one operating rule from day one: every alert is closed with a reason (real / data error / expected). That labelling is what lets you recalibrate after a month and, if you ever want a supervised model, it's the training set you already have.

What data do you need before you start?

Less than people fear, but with conditions:

What you don't need: a data warehouse, a data lake, or a platform. The first consumption detector runs on a daily export and a scheduled job.

How do you build the first detector in six weeks?

| Week | What happens | What comes out | |---|---|---| | 1 | Pick a single series and the decision attached to it | One sentence: "if this spikes, X does Y" | | 2 | Dump the history and eyeball it | List of gaps, duplicates and structural changes | | 3 | Define normality and the method (start with the dumb one) | A documented threshold or comparison | | 4 | Run it silently over the history | How many alerts it would have raised and which were real | | 5 | Switch on alerts to one person, with a closing reason | Alerts in the channel they already use | | 6 | Recalibrate against real closures | Adjusted threshold and a decision to continue or stop |

Week 4 is the one almost everyone skips and the one that prevents the most grief: running the detector over the last six months tells you, without bothering anyone, whether your idea of "odd" matches reality. If it would have fired 300 times, you don't switch it on; you rebuild it.

From the second or third detector onwards it does make sense to think about a platform, because the cost shifts to maintenance: series that change, thresholds that go stale and models that degrade. That's the same problem we describe in MLOps, and it shows up sooner than you'd think.

Mistakes we see repeated

Frequently asked questions

Do you need artificial intelligence to detect anomalies?

Not always. For known limits and stable series, a well-calibrated rule works just as well and maintains itself. A model pays off when normality depends on context (day, shift, customer) or when you have to watch hundreds of series at once and can't define a threshold for each.

How much history do I need to start?

One full cycle of whatever you're watching. For energy consumption, with annual seasonality, that means a year. For transactions or tickets, six months is usually enough. You can start with less, accepting that the detector will over-alert for the first few months.

What if the detector doesn't fire for weeks?

That's a possible and good outcome, as long as you tested it against history first. What you can't do is assume it works: inject a known case from the past and check it would have been caught. An unverified detector with no alerts is indistinguishable from one that's switched off.

Can it be applied to customer data without legal problems?

Depends what for. Watching consumption or production touches no personal data. Profiling people's behaviour does, and then the GDPR rules on information and automated decisions apply. We cover it in GDPR and AI.

---

If you have a specific series in mind — the electricity bill, the credit notes, the scrap on one line — and you don't know whether you need a threshold or a model, that gets resolved in a short conversation looking at your history, not with a three-month proposal. You can request an audit to see which of your data is already ready to be watched, or simply get in touch and we'll look at it together.

Shall we apply it to your case?

The 360° AI Audit turns these ideas into a concrete plan for your company: three weeks, fixed price and the full picture of your AI before spending a euro.

See the 360° Audit→ Let's talk↗