Inspiration

In 2024, Americans reported losing $470 million to scams that started with a text, five times more than in 2020 (FTC Data Spotlight, Top Text Scams of 2024). We all get them: an "unpaid toll", a "missed USPS delivery", a "locked bank account", a "dream remote job". Most people can't tell in the moment, and the tools that do help usually want you to upload your private messages to a server. We wanted a scam checker that's instant, explains itself, teaches you the patterns, and keeps your texts private.

What it does

  • Scan: paste any text. A sonar gauge springs to a risk score in milliseconds. Every word glows red or green by how much it pushed the AI's verdict. Red-flag cards explain why, for example "mentions E-ZPass but links to ezpass-ny.toll-pay.xyz, which isn't its official site". You then get concrete next steps: don't tap the link, check through the official app, forward to 7726, report at ReportFraud.ftc.gov. It separates smishing (dangerous phishing by text) from plain spam (annoying marketing), so it doesn't cry wolf.
  • Train: a live Model Lab. Press train and a fresh model learns from 4,631 real labelled SMS in your browser, step by step: animated loss curve, live confusion matrix, the signals it learned, a scoreboard against Naive Bayes, and an ROC chart with a threshold slider that shows the trade-off between catching scams and false alarms.
  • Play, "Hook or Not?": 10 real messages the model never trained on. Call each one safe, spam or smishing, then see what the AI saw, with streaks, confetti and a final score against the AI. It's media-literacy training disguised as a game.
  • Trust: a responsible-AI panel covering privacy, explainability, false alarms, a dataset card and honest limits.

How we built it

A zero-backend static web app written in vanilla JS ES modules with no frameworks. All of the ML is written from scratch:

  • Tokenizer that turns URLs (with their host), money, phone, premium-rate and shortcode numbers into features, plus unigrams, bigrams and "shouting".
  • Multinomial Naive Bayes (3 classes) and softmax regression trained with mini-batch Adam on sparse, L2-normalised sublinear-TF features, class-weighted for the heavy safe/threat imbalance. Training takes about 0.5 s on device.
  • Transparent red-flag engine with 13 human-readable rules: urgency, threats, prizes, credential requests, parcel/toll lures, payment/crypto, job lures, premium numbers, shorteners, throwaway TLDs, IP links, and brand impersonation (a brand is named but the link isn't its official domain). Links to a brand's official domain earn a trust bonus.
  • Fusion: a weighted blend of model threat probability and rule score, with a rule floor so clear danger evidence can't be out-voted by a model that never saw a lure. Word-level explanations combine the Naive Bayes log-likelihood ratios with the regression weights.
  • Alive UI: a 60 fps canvas ocean and sonar that take on the verdict's colour, spring physics for the gauge, kinetic card deals, confetti, and Web Audio sound cues with a mute toggle (M).
  • Data: Mishra & Soni (2022) SMS Phishing Dataset (CC BY 4.0, 5,971 messages labelled ham/spam/smishing). Mojibake was repaired, the data de-duplicated so nothing leaks between train and test, conflicting labels dropped, and a seeded stratified 80/20 split made.

Results (held-out: 1,158 messages never seen in training)

Model Threat precision Recall F1 False alarms (of 966 friendly) ROC-AUC
Naive Bayes 96.8% 95.3% 96.1% 6 0.983
Softmax regression 97.3% 95.3% 96.3% 5 0.994
Unhook (fused) 97.9% 95.3% 96.6% 4 0.995

At the default scam threshold, Unhook catches 92.7% of spam and smishing with 0 false scam alarms across 966 friendly texts. Accuracy is 97.2% for Naive Bayes and 96.8% for regression on the 3-class task.

Challenges we ran into

  • Old corpus vs. new scams: the labelled data (2012–2022, UK/India-heavy) barely mentions tolls or US parcel scams. The model alone even reads "toll" as safe. We solved this honestly with a transparent rule layer plus fusion, and the app shows the disagreement instead of hiding it.
  • False alarms: a scam detector that flags your mom's texts gets ignored. We tuned the fusion so that, on held-out data, no friendly text reaches the scam level, and we built the threshold slider so anyone can see the trade-off.
  • Alignment: painting a heatmap behind a live, editable textarea while staying pixel-perfect across fonts, wrapping and scrolling.

Accomplishments that we're proud of

  • Real ML trained live in the browser in about half a second, with no API keys, no server and no data leaving the device. Our E2E suite checks that zero network requests happen after load.
  • Every verdict is explainable down to the word.
  • QA: 37 unit tests, ESLint with 0 warnings, and 20 headless-Chrome end-to-end checks (every flow, keyboard accessibility, reduced motion, mobile and tablet layouts, privacy, zero console errors).

What we learned

Explainability and privacy aren't add-ons. They're what makes people trust an AI's warning. And a simple, well-engineered model that people can understand beats a black box they can't.

What's next for Unhook

An Android share-target and iOS shortcut ("Share → Unhook"), multilingual models (Spanish first), a community-reported lure feed that updates the rule layer, and a browser extension for web-based messages.

Responsible AI & limitations

English only. The corpus skews UK/India and 2012–2022, so newer US lures rely more on the rule layer. Unhook is a second opinion, not a guarantee. It never blocks, deletes or replies. The sample messages in the scanner are illustrative and use made-up lookalike domains. Data: CC BY 4.0 (Mishra & Soni, 2022). Code: MIT.

Built With

Share this project:

Updates

Submission history