text-classification ยท text ยท WASM ยท ~64 MB
A DistilBERT classifier fine-tuned to tell phishing emails and malicious URLs from legitimate ones. Paste any email or link and it scores it PHISHING or LEGITIMATE with a confidence โ then look inside to see which exact words tripped the alarm. Everything runs on your device; the message never leaves the page.
| Model | onnx-community/phishing-email-detection-distilbert_v2.4.1-ONNX |
|---|---|
| Original weights | cybersectony/phishing-email-detection-distilbert_v2.4.1 |
| Task / pipeline | text-classification |
| Labels | 4 logits โ card mapping: legitimate_email, phishing, legitimate_url, phishing_url_alt. We report threat = P(phishing)+P(phishing_url_alt) |
| Architecture | DistilBERT base uncased, fine-tuned 3 epochs on PhishingEmailDetectionv2.0 (card-reported accuracy 99.58%) |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~64 MB, cached after first load |
| License | Apache-2.0 |
| Web APIs | WebAssembly, Web Workers โ all Baseline widely available |
Paste an email or URL. The verdict re-scores automatically (debounced) a moment after you stop typing. The dual meter shows the probability split between the threat and legitimate classes; the bars below show all four raw class scores.
This is occlusion attribution: we re-run the model with each word removed and see how much the phishing score shifts (measured in log-odds, because the model is so confident that raw percentages barely move). Remove a word that was pushing "phishing" and the score drops โ so that word gets a red weight. Remove a word that was keeping it looking legitimate and the score rises โ green. No gradients, no hand-waving: just the model's own predictions, N+1 of them.
Phishing is the single most common way breaches start โ and the lures arrive by email, SMS, and chat faster than any blocklist can follow. Running the detector in the browser means a suspicious message can be scored the moment it is read, with its contents never leaving the device: no round-trip, no logging of the very credentials the attacker wants.
Type an email, get PHISHING / LEGITIMATE + confidence, updating live as you type.
Paste a reported-phish queue and watch it auto-triage into Threat and Clear columns.
Adversarial lab: obfuscate a lure with leetspeak and zero-width characters and watch how far you can fool the detector.
Phish-gate a mailbox, then summarize only the legitimate messages with DistilBART.
Classification is one call; top_k: 4 returns every class score:
import { pipeline } from "@huggingface/transformers";
const classify = await pipeline(
"text-classification",
"onnx-community/phishing-email-detection-distilbert_v2.4.1-ONNX",
); // downloads + caches ~64 MB once
const out = await classify("URGENT: verify your password now", { top_k: 4 });
// โ [{ label: "LABEL_1", score: 0.9999 }, โฆ]
// Card mapping: LABEL_0 legitimate_email ยท LABEL_1 phishing ยท
// LABEL_2 legitimate_url ยท LABEL_3 phishing_url_alt
"See inside" re-uses that same call: it classifies the full message plus one copy per word with that word deleted (batched in a single pass), then subtracts the threat log-odds to attribute the shift to each word. All of it runs in a Web Worker so typing never janks.