Inspiration
I've been scammed before. It's painful to lose hard-earned money. I live in an environment where fraud is unfortunately common and almost starts to feel normal. I see it happening around me, and I don't like it. But calling these people out directly and reporting them is dangerous; I can't put my safety at risk by snitching on them to their faces. That’s why I built Fraud AI to help fintech platforms integrate active fraud detection into their system. It’s my way of snitching on the bad actors using code and data without putting a target on my back.
What it does
Fraud AI is a digital real-time fraud detection system for bank accounts. It watches transactions in real-time and asks a simple question for every single transfer: "Is this weird?" Then I created different logic based on what observations I noticed from the bad actors and more research online.
It checks 10 different risk factors at once:
- Velocity: Is the user sending money way faster than usual? (e.g., 15 transactions in an hour).
- Volume Analysis: Is the amount unusually high compared to their 30-day average?
- Impossible Travel: Is the user suddenly in London when they were just in Lagos 2 hours ago?
- Login Integrity: Did they fail to log in multiple times before this? Are they using a suspicious mismatched device?
- New Device/Behavior: Is this device completely new? Is the session length weird?
- Structuring: Are they sending a constant value repeatedly to avoid the reporting limit?
- Transaction Spikes: Is there a sudden burst of activity in a dormant account?
- Cross-Border: Is money going to a high-risk country or a new country for this user?
- Historical Baseline: Does this break their usual pattern (e.g., they never spend on gambling, but now they do)?
- Volume Thresholds: Does this single transaction drain 90% of their account balance?
These checks are aggregated into 5 specific Risk Buckets:
- Account Compromise: (Logic: Login + New Device + Impossible Travel)
- Amount Anomaly: (Logic: Volume Analysis + Thresholds)
- AML Structuring: (Logic: Structuring patterns)
- Automation Abuse: (Logic: Velocity + Spikes)
- Geo Anomaly: (Logic: Cross-Border + Location)
The system then totals the score from these buckets to calculate a final "Risk Score." If the score is too high (e.g., >70%), the verdict is BLOCKED. If it's suspicious but not certain (>40%), it's HELD for review. Otherwise, it's APPROVED.
If it spots something fishy, it flags the transaction and tells you exactly why. It gives explanations like "Transaction flagged because the user is transferring to a high-risk country and using a new device."
How I built it
I built the the system and logics using Python and different libraries. It uses a hybrid engine to do detection analysis:
- Rule-Based Logic (60%): I wrote code for common sense checks. I used
geopyto calculate real distances between locations to catch impossible travel. - Machine Learning (40%): I trained AI models (Isolation Forest) to learn what "normal" spending looks like for each user, so it can spot the odd ones out.
Challenges I ran into
Figuring out risk is hard. A big transaction isn't always fraud; sometimes it can be rent or a big purchase.
- False Alarms: At first, the system was too paranoid. It flagged everything! I had to tweak the sensitivity so it wouldn't flag regular/normal transactions but would still stop a hacker.
- Logic Implementation and Machine Learning: It was hard to implement the logic and machine learning models. I had to do a lot of research and testing to get it right.
- Explanation: It was tricky to get the code to explain itself in plain English. I didn't want error codes like
ERR_503. I wanted it to say "This looks like money laundering." Teaching the system to speak human took some serious work.
Accomplishments that I'm proud of
I'm really proud, seeing the AI catch a test hack and explain exactly what happened is a good feeling. But mostly, I'm proud of building something that could actually help people keep their money safe.
What I learned
- Fraud is creative: Scammers are always finding new ways to steal. That means our code has to be flexible and easy to update.
- Context is king: $500 is a lot for a student but nothing for a business. I learned I had to build logic that learns who you are so it doesn't judge everyone by the same threshold.
What's next for Fraud AI
I want to make the AI smarter. Right now, it retrains every 30 days. I'd love for it to learn instantly from every new fraud attempt. I also want to add more "behavioral" checks, like detecting if someone is typing differently or holding their phone in a weird way, which could mean it's not the real owner. And maybe, just maybe, we can get this into real situations to help stop the scammers for good.
Built With
- geopy
- isolation-forest
- one-class-svm
- payslim
- python
- react
- scikit-learn
- sqlalchemy
- typescript
Log in or sign up for Devpost to join the conversation.