โ† All models

text-classification ยท text ยท WASM ยท ~64 MB

Phishing email detector โ€” is this message trying to rob you?

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.

At a glance

Modelonnx-community/phishing-email-detection-distilbert_v2.4.1-ONNX
Original weightscybersectony/phishing-email-detection-distilbert_v2.4.1
Task / pipelinetext-classification
Labels4 logits โ€” card mapping: legitimate_email, phishing, legitimate_url, phishing_url_alt. We report threat = P(phishing)+P(phishing_url_alt)
ArchitectureDistilBERT base uncased, fine-tuned 3 epochs on PhishingEmailDetectionv2.0 (card-reported accuracy 99.58%)
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~64 MB, cached after first load
LicenseApache-2.0
Web APIsWebAssembly, Web Workers โ€” all Baseline widely available

Run it

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.

See inside โ€” the words that trip the alarm

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.

Why it matters

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.

Use cases

Basics

Type an email, get PHISHING / LEGITIMATE + confidence, updating live as you type.

Practical

Paste a reported-phish queue and watch it auto-triage into Threat and Clear columns.

Wild

Adversarial lab: obfuscate a lure with leetspeak and zero-width characters and watch how far you can fool the detector.

Multi-model

Phish-gate a mailbox, then summarize only the legitimate messages with DistilBART.

How the API works

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.

References