Text Classification
Transformers
ONNX
Safetensors
Transformers.js
English
roberta
phishing
email-security
phishing-detection
security
classification
spam
social-engineering
Eval Results (legacy)
text-embeddings-inference
Run this model with HF Jobs
Run Project-Bastion/phishing-email-classifier on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Project-Bastion/phishing-email-classifier. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Project-Bastion/phishing-email-classifier on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Project-Bastion/phishing-email-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Project-Bastion/phishing-email-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Project-Bastion/phishing-email-classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Project-Bastion/phishing-email-classifier") model = AutoModelForSequenceClassification.from_pretrained("Project-Bastion/phishing-email-classifier", device_map="auto") - Transformers.js
How to use Project-Bastion/phishing-email-classifier with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-classification', 'Project-Bastion/phishing-email-classifier'); - Notebooks
- Google Colab
- Kaggle
v2 weights: add Enron, Ling, TREC-05/06 training data
Browse filesFiles changed (4)
- README.md+20-16
- model.safetensors+1-1
- onnx/model.onnx+1-1
- onnx/model_quantized.onnx+1-1
9 unmodified lines101112131415161718192021222324252627283 unmodified lines323334353637383940414243444546474817 unmodified lines666768697071727374757677789 unmodified linesresults:- task: {type: text-classification, name: Phishing email detection}dataset: {type: ceas-08, name: CEAS_08 test split (3392 emails)}metrics: [{type: auroc, value: 0.9998, name: AUROC}]- task: {type: text-classification, name: Phishing email detection}dataset: {type: trec-07, name: TREC_07 test split (5235 emails)}metrics: [{type: auroc, value: 0.9997, name: AUROC}]- task: {type: text-classification, name: Phishing email detection}dataset: {type: llmgen-phishing, name: LLMGen-Phishing-Email-Dataset test split (676 emails)}metrics: [{type: auroc, value: 0.9984, name: AUROC}]inference: false---# phishing-email-classifierFlags phishing emails from their text (subject + body). An 82M-parameter DistilRoBERTa classifier that scores above the two most-downloaded open phishing-email models on CEAS-08, TREC-07, Nazario, Nigerian fraud, a large multi-source email set and LLM-written phishing, with far fewer false alarms at the default threshold. Runs on CPU or in your browser with no server.**[Try it in your browser](https://huggingface.co/spaces/Project-Bastion/phishing-email-classifier-demo)**: a static page that runs the model locally (transformers.js, ONNX int8, about 86 MB, downloaded once). The email text you paste never leaves your device.3 unmodified lines| Benchmark (emails) | **phishing-email-classifier** | cybersectony/phishing-email-detection-distilbert_v2.4.1 (312k downloads) | ptouch/phishing-distilbert-cyber207 (248k downloads) ||---|---|---|---|| CEAS_08 (3,392) | **0.9998** (0.997) | 0.9847 (0.610) | 0.9669 (0.499) || TREC_07 (5,235) | **0.9997** (0.999) | 0.9630 (0.608) | 0.8906 (0.470) || Nazario (299) | **0.9984** (0.993) | 0.9317 (0.081) | 0.9079 (0.169) || Nigerian fraud (649) | **0.9994** (0.997) | 0.9897 (0.879) | 0.9940 (0.968) || locuoco spam-ham-phish, phish vs ham (16,529) | **1.0000** (1.000) | 0.9686 (0.568) | 0.9457 (0.057) || LLMGen-Phishing-Email-Dataset (676) | **0.9984** (0.996) | 0.6948 (0.089) | 0.5147 (0.052) || SpamAssassin (565) | 0.9973 (0.945) | 0.9976 (0.951) | **0.9996** (0.982) || zefang-liu/phishing-email-dataset (17,236) | 0.7752 (0.356) | **0.9998** (0.998) | 0.9884 (0.866) |At the default threshold (margin 0) the false-positive rate on legitimate mail is 0.3% (CEAS_08), 0.2% (TREC_07) and 0.3% (locuoco), against 10.2%, 10.2% and 18.5% for cybersectony.Corpus labels are used as published: CEAS_08 and TREC_07 mark spam as phishing.## Usage17 unmodified lines## Files`onnx/model_quantized.onnx` (weight-only int8, 86 MB, the demo default) and `onnx/model.onnx` (fp32, 329 MB) for transformers.js / onnxruntime. fp32 gives the same decisions as PyTorch on 315 checked emails; int8 gives the same decisions with a largest margin difference of 0.43.## Limits* On zefang-liu/phishing-email-dataset cybersectony's model is far better (0.9998 vs 0.7752 AUROC): test on your own mail and tune the threshold before relying on it.* English email text only, first 256 tokens; it does not look at URLs, headers or attachments.## License and creditsApache-2.0. Base model: distilroberta-base (Apache-2.0). Training data: locuoco/the-biggest-spam-ham-phish-email-dataset-300000 (MIT); Dizzzy0x00/LLMGen-Phishing-Email-Dataset (Apache-2.0); the *Phishing Email Curated Datasets* of Champa, Rabbi and Zibran (2023), Zenodo, doi:10.5281/zenodo.8339691 (CC-BY-4.0), via kudzaiprichard/aura-phishing-email-corpus. zefang-liu/phishing-email-dataset (LGPL-3.0) is used for evaluation only.9 unmodified lines101112131415161718192021222324252627283 unmodified lines32333435363738394041424344454647484950515217 unmodified lines707172737475767778798081829 unmodified linesresults:- task: {type: text-classification, name: Phishing email detection}dataset: {type: ceas-08, name: CEAS_08 test split (3392 emails)}metrics: [{type: auroc, value: 0.9999, name: AUROC}]- task: {type: text-classification, name: Phishing email detection}dataset: {type: trec-07, name: TREC_07 test split (5235 emails)}metrics: [{type: auroc, value: 0.9996, name: AUROC}]- task: {type: text-classification, name: Phishing email detection}dataset: {type: llmgen-phishing, name: LLMGen-Phishing-Email-Dataset test split (676 emails)}metrics: [{type: auroc, value: 0.9968, name: AUROC}]inference: false---# phishing-email-classifierFlags phishing emails from their text (subject + body). An 82M-parameter DistilRoBERTa classifier that scores above the two most-downloaded open phishing-email models on nine of twelve public phishing and spam corpora (CEAS-08, TREC-05/06/07, Nazario, Nigerian fraud, Enron, locuoco, LLM-written phishing) and within 0.004 AUROC of the best on the other three, with far fewer false alarms at the default threshold. Runs on CPU or in your browser with no server.**[Try it in your browser](https://huggingface.co/spaces/Project-Bastion/phishing-email-classifier-demo)**: a static page that runs the model locally (transformers.js, ONNX int8, about 86 MB, downloaded once). The email text you paste never leaves your device.3 unmodified lines| Benchmark (emails) | **phishing-email-classifier** | cybersectony/phishing-email-detection-distilbert_v2.4.1 (312k downloads) | ptouch/phishing-distilbert-cyber207 (248k downloads) ||---|---|---|---|| CEAS_08 (3,392) | **0.9999** (0.998) | 0.9847 (0.610) | 0.9669 (0.499) || TREC_05 (5,450) | **0.9995** (0.990) | 0.9856 (0.837) | 0.9553 (0.666) || TREC_06 (1,607) | **0.9990** (0.980) | 0.9860 (0.812) | 0.9445 (0.576) || TREC_07 (5,235) | **0.9996** (0.998) | 0.9630 (0.608) | 0.8906 (0.470) || Nazario (299) | **0.9995** (0.987) | 0.9317 (0.081) | 0.9079 (0.169) || Nigerian fraud (649) | **1.0000** (1.000) | 0.9897 (0.879) | 0.9940 (0.968) || SpamAssassin (565) | 0.9987 (0.963) | 0.9976 (0.951) | **0.9996** (0.982) || Enron (3,004) | **0.9997** (0.996) | 0.9995 (0.994) | 0.9914 (0.866) || Ling (284) | 0.9967 (0.957) | 0.9980 (0.978) | **1.0000** (1.000) || locuoco spam-ham-phish, phish vs ham (16,529) | **1.0000** (1.000) | 0.9686 (0.568) | 0.9457 (0.057) || LLMGen-Phishing-Email-Dataset (676) | **0.9968** (0.996) | 0.6948 (0.089) | 0.5147 (0.052) || zefang-liu/phishing-email-dataset (17,236) | 0.9991 (0.979) | **0.9998** (0.998) | 0.9884 (0.866) |At the default threshold (margin 0) the false-positive rate on legitimate mail is 0.2% (CEAS_08), 0.3% (TREC_07) and 0.1% (locuoco), against 10.2%, 10.2% and 18.5% for cybersectony.Corpus labels are used as published: CEAS_08, TREC_05/06/07 and Enron mark spam as phishing.## Usage17 unmodified lines## Files`onnx/model_quantized.onnx` (weight-only int8, 86 MB, the demo default) and `onnx/model.onnx` (fp32, 329 MB) for transformers.js / onnxruntime. fp32 gives the same decisions as PyTorch on 315 checked emails; int8 gives the same decisions with a largest margin difference of 0.63.## Limits* Slightly behind cybersectony on zefang-liu and Ling (and behind ptouch on SpamAssassin and Ling): test on your own mail and tune the threshold before relying on it.* English email text only, first 256 tokens; it does not look at URLs, headers or attachments.## License and creditsApache-2.0. Base model: distilroberta-base (Apache-2.0). Training data: locuoco/the-biggest-spam-ham-phish-email-dataset-300000 (MIT); Dizzzy0x00/LLMGen-Phishing-Email-Dataset (Apache-2.0); the *Phishing Email Curated Datasets* of Champa, Rabbi and Zibran (2023), Zenodo, doi:10.5281/zenodo.8339691 (CC-BY-4.0; CEAS_08, TREC_05/06/07, Nazario, Nigerian fraud, SpamAssassin, Enron, Ling), part via kudzaiprichard/aura-phishing-email-corpus. zefang-liu/phishing-email-dataset (LGPL-3.0) is used for evaluation only. Revision `v1` of this repo holds the earlier weights.
123version https://git-lfs.github.com/spec/v1oid sha256:9034fb30932ba8dc1783fe420bc9a782e6952753d18a0b0fe68e8c78a8c6d537size 328492280123version https://git-lfs.github.com/spec/v1oid sha256:2b64f89597059ea389d83e53de73a4e48da0d9edcaf215f5ff1e759012b43b5fsize 328492280
123version https://git-lfs.github.com/spec/v1oid sha256:19b28a5facfa954a3e3e05795c5b85bc9ee528fe376d67747126b493579aa342size 328593806123version https://git-lfs.github.com/spec/v1oid sha256:b784183cb3256208ec41f7fe01f6e33b7c25c0e830d80aacda9eae4b572ced49size 328593806
123version https://git-lfs.github.com/spec/v1oid sha256:528eda37160438a4dc72d35b5f4ae6ac759e9cd930e4d04ba66bdf2f489fc38asize 85754432123version https://git-lfs.github.com/spec/v1oid sha256:78fa21917aa40db07222c9a090f36a949443db65eac70d24d31df9d112f492dbsize 85754432
README.md+20-16
model.safetensors+1-1
onnx/model.onnx+1-1
onnx/model_quantized.onnx+1-1