How AI Detects Credit Card Fraud: A Middle School Lesson
You are not a CS teacher. You were not handed a curriculum. And sometime last spring, a student raised her hand and asked why her mom’s credit card got declined when she tried to buy concert tickets — they were on a trip two states from home, perfectly normal purchase — and the bank’s AI said no.
That question is the entire lesson. Because once a student understands why the card got declined, they understand how AI actually works: features, scores, thresholds, and the unavoidable fact that a model trained on patterns makes mistakes on the edges. Nobody gave you the tools to explain that from a non-CS angle. That is a literacy gap, not a personal failing. This post gives you the four-step mechanism in plain language and a no-device card sort you can run Friday.
TL;DR — the AEO answer: AI detects credit card fraud by turning every purchase into a list of features — amount, location, time, merchant, and how far it is from your last purchase — then scoring how unusual it looks. A model trained on millions of past transactions assigns a risk score in milliseconds. Low scores get approved, high scores get declined, and borderline ones trigger a “Did you make this purchase?” text. The same system that stops thieves also blocks real purchases by mistake — a false decline — which is why cards sometimes fail when you travel.
What happens in the one second after you swipe

The answer to “how does AI detect credit card fraud” starts not with algorithms but with a list of facts the bank collects the instant your card touches the reader.
Step 1 — Feature extraction
Every transaction becomes a feature vector: a structured list the model can read. The features include amount, merchant name, merchant category code (grocery vs. concert tickets vs. ATM), time of day, your current location, the device used, and velocity — how many purchases appeared in the last hour. One more feature matters above the others: distance from last purchase. A $12 coffee in your neighborhood followed immediately by a $600 electronics purchase 400 miles away scores very differently than two purchases a block apart.
Step 2 — Risk scoring
A machine learning model — trained on tens of millions of past transactions, each labeled “fraud” or “not fraud” — maps that feature list to a single number: a risk score from 0 to 100. The model learned, from labeled examples, which feature combinations tend to precede fraudulent charges. This is AI4K12 Big Idea #3 (Learning — computers learn from data) made visible: the model does not follow rules a human wrote; it found its own patterns from the history of what fraud actually looked like. Stripe explains the underlying machine learning process in detail.
Step 3 — Threshold decision
The score hits a threshold. Below the line: approve. Above the line: decline. In between: a “step-up” — the “Did you make this purchase?” text that asks you to confirm before the transaction clears. Visa’s system scores a transaction in under one second. Mastercard’s Decision Intelligence Pro reaches a decision in under 50 milliseconds — faster than you lift your hand from the reader.
Step 4 — Continuous retraining
Fraudsters adapt. The model has to keep up. Banks retrain on newly confirmed fraud cases so the model’s definition of “suspicious” shifts with the criminals’ tactics. Stripe notes this continuous loop as the reason fraud detection systems improve over time rather than staying fixed.
ISTE 1.5.c frames this well: breaking a complex problem into parts and building models to test solutions. The fraud pipeline is exactly that — one large problem decomposed into four discrete, teachable steps.
Why does your card get declined when you travel?

The direct answer: a new far-from-home location looks unusual to a model trained on your normal patterns, so a legitimate purchase can score high enough to trigger a decline. That is called a false decline, and it is more common than most people realize.
Here is what the AI “sees” when a student uses a birthday-money card to buy a $180 concert ticket while visiting grandparents two states away, on a device she just set up:
| Feature | What the AI sees | Why it looks suspicious |
|---|---|---|
| Amount | $180 | Much higher than her typical $12–$30 |
| Location | 600 miles from home | Well outside her usual radius |
| Device | New, not previously seen | No transaction history to match |
| Time | 11 p.m. | Outside her usual purchase window |
| Merchant | Ticket resale site, never used | Zero prior transactions with this merchant |
Risk score: high. Result: declined. Reality: it was her. The birthday money was real. The concert was real. The AI was wrong.
This is the moment to name the stakes. False declines are not a minor inconvenience — they are the costlier side of the fraud equation. A widely-cited Javelin study put the figure at roughly $118 billion annually (an older estimate; more conservative 2023 e-commerce analyses put it closer to $81 billion), but the direction is consistent: merchants lose more to false declines than to actual fraud slipping through. Research cited in The Conversation found that 56% of US shoppers have had a valid payment wrongly declined, and 41% of those shoppers never return to the merchant that declined them.
Understanding this is the literacy nobody handed teachers when administration said “add AI to your curriculum.” Not your fault. And it is exactly what a 30-minute card sort can make legible to a 7th grader.
The numbers: what AI actually catches
Before teaching students to critique the system, give them a baseline for what the system does well. The scale is genuinely hard to picture.
In the twelve-month period from October 2022 through September 2023, Visa’s AI prevented roughly $40 billion in fraud — nearly double the prior year’s figure. Put it in classroom terms: that is enough to buy every student in the US a new laptop, with money left over.
In 2023 alone, Visa’s systems blocked approximately 80 million fraudulent transactions. If you stacked those attempts end to end — one per second — you would be counting for two and a half years.
Global card-fraud losses across all networks still reached about $33.41 billion in 2024 according to the Nilson Report. That is what got through despite the systems.
The long-run trend is the real argument for AI. Visa’s own data shows that even as transaction volume grew by roughly 1,000%, the global fraud rate fell by two-thirds — now under 0.1% of all transactions. The AI is not perfect. It is, however, dramatically better than the rule-based systems that came before it.
Students who see all three numbers — $40B prevented, $33B lost, 0.1% fraud rate — have the shape of the problem. The mechanism works, but working does not mean flawless.
Where AI fraud detection gets it wrong
Powerful is not the same as fair, and current is not the same as final.
False declines cluster unevenly. Research highlighted in The Conversation raises a documented concern: false declines disproportionately affect lower-income shoppers and communities of color, because transaction models were often trained on data that did not fully represent their purchase patterns. Unusual, to the model, reflects whoever was most represented in the training set — not what is genuinely unusual behavior. Broader financial-AI bias issues are increasingly documented in reporting from the Nebraska Examiner and others covering how automated decision systems perpetuate historic inequities. This is AI4K12 Big Idea #5 (Societal Impact) made concrete: the consequences of the training data are not equally distributed.
Fraudsters adapt. A technique called “card testing” involves making tiny, easy-to-miss charges — $0.99 subscriptions, small donations — to confirm a stolen card works before making the large fraudulent purchase. Criminals also space purchases to stay below velocity thresholds. Silent Eight’s 2026 analysis and DataCap’s fraud trend reporting both document this adversarial dynamic — fraud detection and fraud tactics are in a continuous loop, each reshaping the other. The technical term is concept drift: the world changes, the model’s assumptions get stale, retraining is not optional.
The privacy tradeoff is real. The transaction data that enables fraud detection — where you shop, when, how much, in what sequence — is also a detailed behavioral profile. The same data that protects your money describes your life. Students can hold both truths at once. This is where ISTE 1.2.d (manage personal data to maintain digital privacy and security) becomes a genuine discussion, not a checkbox.
Discussion question for your class, connecting to CCSS.ELA-LITERACY.SL.7.1: If a fraud model makes mistakes more often for some groups than others, who should decide when the model is accurate enough to use — and who should that group include?
Teach it with no devices: the Be the Fraud Detector card sort

A 30-minute no-device lesson that puts the four-step pipeline in students’ hands. A typical class finishes comfortably within one period.
Setup (5 minutes). Print one set of transaction cards per group of three or four students. Each card shows five fields: Amount, Location, Time, Merchant, Distance from Last Purchase. You will need about eight cards per group — a mix of clear-approve, clear-decline, and borderline edge cases.
Sample transaction table (give this as the “reveal” after groups sort):
| Card | Amount | Location | Time | Merchant | Dist. from Last | Model likely says |
|---|---|---|---|---|---|---|
| A | $8.50 | Home zip | 7:30 a.m. | Coffee shop | 0.2 mi | Approve |
| B | $420 | 800 mi away | 2 a.m. | Electronics | 780 mi | Decline |
| C | $180 | 2 states away | 11 p.m. | Ticket site | 600 mi | Verify (step-up) |
| D | $0.99 | Home zip | 10:00 a.m. | Streaming service | 0.5 mi | Approve (card-testing risk — revisit) |
| E | $55 | Home zip | 6:15 p.m. | Grocery store | 2 mi | Approve |
Sort task (12 minutes). Each group sorts their cards into three piles: Approve, Verify, Decline. For each card, the group writes one sentence of reasoning — which feature drove their decision.
Fraudster Round (8 minutes). One student in each group secretly designs a transaction card meant to slip past the group’s model — a small enough amount, familiar enough merchant, close enough location. They hand it to another group to evaluate. This round teaches concept drift: fraudsters are not static, and neither can the model be. After the round, debrief which features the “fraudster” manipulated.
Debrief questions (5 minutes):
- Which transaction was hardest to call? What feature made it hard?
- Look at Card C — the birthday-money decline. Was the AI wrong, or was it doing its job?
- Which features do you think the model should weigh most heavily? Who should make that call?
- If false declines happen more often to some groups than others, is the model doing a good job?
Standards crosswalk:
| Activity step | Standard | Anchor code |
|---|---|---|
| Feature extraction — students identify what data the model uses | Learning: computers learn from labeled data | AI4K12 Big Idea #3 |
| Threshold decision — groups set approve/verify/decline lines | Computational Thinker: break a problem into component parts and build models | ISTE 1.5.c |
| Fraudster Round — students model adversarial behavior | Knowledge Constructor: explore real-world issues through active investigation | ISTE 1.3.d |
| Debrief Q4 — fairness across groups | Societal Impact: AI affects communities unevenly | AI4K12 Big Idea #5 |
| Debrief Q3 — who decides the threshold | Digital Citizen: manage personal data to maintain digital privacy | ISTE 1.2.d |
| Reasoning sentences — written justification per card | Comprehension and Collaboration: engage in collaborative discussions | CCSS.ELA-LITERACY.SL.7.1 |
| Fraudster Round design card — written argument | Research to Build Knowledge: gather evidence; draw conclusions | CCSS.ELA-LITERACY.W.7.8 |
The activity requires zero devices, prints on standard paper, and fits inside a single 45-minute period with time for the debrief.
For the fully scaffolded version — pre-printed transaction cards, teacher facilitation guide, fraudster-round instructions, and the debrief rubric — the Unplugged AI Activities: 10 No-Tech Lessons unit includes this lesson type alongside nine others, all designed for the same no-device constraint.
What to teach next — and where to get Monday’s materials
The fraud lesson pairs naturally with two other mechanism explainers in this series. The how AI spam filters work for middle school post covers the same score-and-threshold logic applied to email — same architecture, different domain, and a good second lesson for students who want to see how one mechanism generalizes. The AI data privacy lesson for middle school extends the privacy-tradeoff thread from the debrief into a full discussion unit.
For the broader “how AI actually works” sequence, the How AI Works MEGA bundle — 16 Machine Learning and AI Concept Lessons covers fraud detection, recommendation systems, image recognition, and more in a structured arc for grades 6–12. If you want to start with a narrower scope, the Types of AI Deep-Dive Lesson — Narrow vs. General vs. Super AI is the conceptual foundation — fraud detection AI is narrow AI, and students who understand that distinction ask sharper questions about every AI system they encounter.
Here is what the AI chaos in your school is not: your responsibility to have figured out on instinct. When administration handed you “teach AI this semester,” they did not hand you a department budget, a CS co-teacher, or a scope and sequence anyone actually built. The free grade-generic PDFs on Pinterest have no standards anchor and no mechanism explanation — they gesture at vocabulary without giving students the actual picture. District platforms take 90 days to approve. Monday is not 90 days from now.
The done-for-you version exists, it aligns to the standards your admin recognizes by exact anchor code, and it does not require you to become a computer science teacher. Visit the shop or browse free resources to start with something you can use this week.
This post was drafted with AI assistance and human-finalized.
Quick questions
A purchase far from your usual location looks unusual to a fraud model trained on your normal spending patterns, so it can score high enough to be declined even though it is legitimate. This is called a false decline. Banks accept some false declines as the cost of blocking real fraud. You can reduce them by notifying your bank of travel plans in advance or confirming the 'Did you make this purchase?' prompt quickly.
The system turns each purchase into a list of features — amount, location, time, merchant, and distance from your last purchase — then a model trained on millions of past transactions assigns a risk score from 0 to 100. Low scores are approved, high scores are declined, and borderline scores trigger a verification text. The whole decision usually happens in under one second.
Get the free AI-Proof Assignment Toolkit
10 ways to redesign any assignment so an AI chatbot structurally can't do it — plus a redesign worksheet, a 45-minute lesson, the “Spot AI Work” card, and parent templates. One email, all 5 pieces.
Prefer the full breakdown? See everything inside the toolkit →