Northwind Electronics ENTERPRISE
#505

Anomaly Detection

Find unusual transactions: huge amounts, odd hours, bursts and new merchants - with the reason.

Technique: Robust z-score (median / MAD), hour-of-day rarity, velocity window, rolling 3-sigma band
Read the code: src/main/java/com/study/advlab/anomaly/AnomalyDetector.javasrc/main/java/com/study/advlab/anomaly/AnomalyService.java
Payments checked
2,168
last 90 days
Flagged
30
176,574 THB in total
Confirmed fraud
0
after a person checked
False alarms
0
use them to tune the threshold
Every payment red = flagged · log scale
Sensitivity
more alertsfewer alerts

  • Amount - far from the account's usual amount (median / MAD)
  • Hour - night payment from a daytime account
  • Velocity - 4+ payments in 10 minutes
  • New category - first time, and more than usual
Flagged payments
PaymentAmountWhyScoreReview
ACC-1021 · Luxury Watch Boutique
Jewellery · 15 Sep 14:09
4,999.27 • Amount 22.8x the usual (z = 11.7)• First ever payment in "Jewellery" 3.94
ACC-1009 · Luxury Watch Boutique
Jewellery · 15 Oct 14:09
29,553.06 • Amount 29.9x the usual (z = 10.1)• First ever payment in "Jewellery" 3.49
ACC-1005 · Luxury Watch Boutique
Jewellery · 12 Oct 14:09
15,487.61 • Amount 23.1x the usual (z = 9.2)• First ever payment in "Jewellery" 3.23
ACC-1025 · Luxury Watch Boutique
Jewellery · 20 Aug 14:09
29,296.07 • Amount 25.9x the usual (z = 8.3)• First ever payment in "Jewellery" 2.98
ACC-1013 · Luxury Watch Boutique
Jewellery · 17 Sep 14:09
5,223.00 • Amount 31.1x the usual (z = 7.8)• First ever payment in "Jewellery" 2.84
ACC-1029 · Luxury Watch Boutique
Jewellery · 21 Sep 14:09
15,817.97 • Amount 17.8x the usual (z = 7.6)• First ever payment in "Jewellery" 2.77
ACC-1001 · Luxury Watch Boutique
Jewellery · 18 Oct 14:09
3,329.47 • Amount 15.5x the usual (z = 7.6)• First ever payment in "Jewellery" 2.76
ACC-1007 · Online Casino Top-up
Gaming · 26 Aug 03:13
4,335.85 • Amount 4.4x the usual (z = 4.6)• Night-time payment (03:13)• First ever payment in "Gaming" 2.70
ACC-1022 · Online Casino Top-up
Gaming · 19 Aug 03:10
1,716.89 • Amount 3.9x the usual (z = 4.3)• Night-time payment (03:10)• First ever payment in "Gaming" 2.64
ACC-1012 · Online Casino Top-up
Gaming · 09 Aug 03:17
6,399.32 • Amount 3.8x the usual (z = 4.0)• Night-time payment (03:17)• First ever payment in "Gaming" 2.55
ACC-1017 · Luxury Watch Boutique
Jewellery · 06 Sep 14:09
34,895.13 • Amount 14.7x the usual (z = 6.8)• First ever payment in "Jewellery" 2.55
ACC-1002 · Online Casino Top-up
Gaming · 16 Sep 03:03
6,002.12 • Amount 3.8x the usual (z = 3.7)• Night-time payment (03:03)• First ever payment in "Gaming" 2.45
ACC-1027 · Online Casino Top-up
Gaming · 22 Aug 03:31
1,723.47 • Night-time payment (03:31)• First ever payment in "Gaming" 2.33
ACC-1017 · Online Casino Top-up
Gaming · 01 Oct 03:38
7,754.47 • Night-time payment (03:38)• First ever payment in "Gaming" 2.26
ACC-1010 · Gift Card Hub
Gift cards · 15 Sep 23:14
398.14 • 5 payments within 10 minutes 1.10
ACC-1010 · Gift Card Hub
Gift cards · 15 Sep 23:14
398.14 • 5 payments within 10 minutes 1.10
ACC-1010 · Gift Card Hub
Gift cards · 15 Sep 23:12
398.14 • 5 payments within 10 minutes 1.10
ACC-1010 · Gift Card Hub
Gift cards · 15 Sep 23:11
398.14 • 5 payments within 10 minutes 1.10
ACC-1010 · Gift Card Hub
Gift cards · 15 Sep 23:11
398.14 • 5 payments within 10 minutes 1.10
ACC-1021 · Tops Market
Grocery · 28 Sep 19:36
595.82 • Amount 2.7x the usual (z = 3.7) 1.07
ACC-1024 · Gift Card Hub
Gift cards · 23 Sep 23:15
972.79 • 5 payments within 10 minutes 1.05
ACC-1024 · Gift Card Hub
Gift cards · 23 Sep 23:13
972.79 • 5 payments within 10 minutes 1.05
ACC-1024 · Gift Card Hub
Gift cards · 23 Sep 23:13
972.79 • 5 payments within 10 minutes 1.05
ACC-1024 · Gift Card Hub
Gift cards · 23 Sep 23:11
972.79 • 5 payments within 10 minutes 1.05
ACC-1024 · Gift Card Hub
Gift cards · 23 Sep 23:10
972.79 • 5 payments within 10 minutes 1.05
ACC-1003 · Gift Card Hub
Gift cards · 23 Oct 23:15
518.04 • 5 payments within 10 minutes 1.03
ACC-1003 · Gift Card Hub
Gift cards · 23 Oct 23:14
518.04 • 5 payments within 10 minutes 1.03
ACC-1003 · Gift Card Hub
Gift cards · 23 Oct 23:13
518.04 • 5 payments within 10 minutes 1.03
ACC-1003 · Gift Card Hub
Gift cards · 23 Oct 23:11
518.04 • 5 payments within 10 minutes 1.03
ACC-1003 · Gift Card Hub
Gift cards · 23 Oct 23:10
518.04 • 5 payments within 10 minutes 1.03
Daily total with a rolling 3-sigma band outside the band = unusual day
Test a new payment

Try 03:00 at night, a huge amount, or a category the account never used.