惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
小众软件
小众软件
T
Tailwind CSS Blog
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
罗磊的独立博客
有赞技术团队
有赞技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Jina AI
Jina AI
量子位
云风的 BLOG
云风的 BLOG
Recent Announcements
Recent Announcements
Hugging Face - Blog
Hugging Face - Blog
P
Proofpoint News Feed
N
Netflix TechBlog - Medium
GbyAI
GbyAI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
腾讯CDC
美团技术团队

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How Machine Learning Detects Fraud: A Practical Breakdown
lisamangnani1122-sketch · 2026-06-20 · via DEV Community

lisamangnani1122-sketch

How Machine Learning Detects Fraud: A Practical Breakdown

Machine learning detects fraud by learning the patterns of past fraudulent
transactions and flagging new transactions that match those patterns —
combining models trained on known fraud cases with anomaly-detection methods
that catch fraud patterns no one has seen before. Most production fraud
systems use both approaches together, not one or the other.

Here's how that actually works, and what makes fraud detection a harder
problem than it first looks.

Why traditional rule-based systems fall short

Older fraud systems ran on fixed rules: flag any transaction over $5,000,
flag any purchase from a new country, flag any card used twice in 10 minutes.
Rules are easy to understand, but they break down fast:

  • Fraudsters adapt to known rules almost immediately once they're public or easily inferred
  • Legitimate customers get blocked by rules that don't account for context (a $5,000 purchase is normal for some customers, suspicious for others)
  • Rules don't scale — every new fraud pattern needs a brand-new hand-written rule, and the list grows forever

Machine learning replaces fixed thresholds with learned patterns that adjust
per customer, per merchant, and per context automatically.

How supervised models learn to spot fraud

Banks and payment processors have years of transactions already labeled
fraudulent or legitimate (often confirmed by customer disputes or
investigations). A supervised model trains on that history, learning which
combinations of features tend to appear in fraud cases.

Common features fed into the model:

  • Transaction amount relative to the customer's typical spending
  • Time since the customer's last transaction
  • Distance between this transaction's location and the last one
  • Merchant category and whether the customer has used it before
  • Device and IP address fingerprinting
  • Time of day relative to the customer's normal activity pattern

The model doesn't apply a fixed rule to any single feature — it learns the
combination of signals that historically correlates with fraud, which is
why it catches cases a simple rule would miss entirely.

Why unsupervised methods matter too

Supervised models are only as good as their training data — they're built
to catch fraud patterns that have already happened before. New fraud
techniques won't be in the training data
, which is exactly where
unsupervised anomaly detection earns its place.

Unsupervised models don't need a label called "fraud." Instead, they learn
what normal behavior looks like for a customer or system, and flag
anything that deviates significantly — whether or not it matches a known
fraud pattern. This is what catches genuinely new fraud techniques before
enough labeled examples exist to train a supervised model on them.

The real-time challenge

Fraud decisions for card transactions typically need to happen in well under
a second — the transaction is either approved or declined before the
customer's payment terminal moves on. This puts real constraints on the
system:

  • Models need to be fast enough to score a transaction in milliseconds
  • Features need to be pre-computed or cheap to calculate on the fly
  • Complex models (like large neural networks) sometimes get traded for faster, simpler ones specifically because of the latency budget

Balancing false positives and false negatives

Every fraud system makes a trade-off:

  • Too aggressive → legitimate customers get declined or flagged, which damages trust and costs sales
  • Too lenient → real fraud slips through, which costs money directly

There's no setting that eliminates both. Most systems use a risk score
rather than a binary yes/no, routing borderline transactions to additional
verification (a text message confirmation, a manual review) instead of an
outright block — reducing customer friction while still catching high-risk cases.

A simple example walkthrough

A customer who normally spends $50-$150 per transaction in their home city
suddenly has a $2,000 transaction from a country they've never shopped in,
at 3 a.m. local time, on a new device. No single feature here is
automatically fraud — large purchases, travel, and new devices all happen
legitimately. But the combination, scored against the customer's typical
pattern, produces a high risk score, and the transaction gets flagged for
extra verification rather than an automatic block.

The bottom line

Fraud detection works best as a layered system: supervised models catch
known fraud patterns with high accuracy, unsupervised models catch novel
patterns supervised models haven't seen yet, and a risk-scoring layer on top
decides whether to block, allow, or verify — balancing fraud prevention
against the cost of frustrating legitimate customers.