CoolFace
Modelpublic

mikaelnurminen/phishing-email-detector-v51

sourceHugging Facemitupdated 7mo agoView on Hugging Face
0likes24downloads
Model Card

Phishing Email Detector V5.1

Phishing Email Detector V5.1 is a multi-task DistilBERT model trained on merged phishing email corpora with auxiliary phishing-type supervision and calibrated probability outputs.

Developed by members of l3ak, a cybersecurity / CTF team

๐Ÿ‘‰ Demo: https://huggingface.co/spaces/mikaelnurminen/phishing-detector-app


Model Overview

  • โ€”Base model: distilbert-base-uncased
  • โ€”Task: phishing vs safe classification
  • โ€”Auxiliary task: phishing type classification (6 classes)
  • โ€”Input: preprocessed email text
  • โ€”Output: phishing probability (0โ€“1)
  • โ€”Loss: weighted CE + label smoothing
  • โ€”Calibration: temperature scaling
  • โ€”Threshold modes: balanced / high-recall / high-precision

Training Data

The model is trained on a merged and deduplicated dataset from two public phishing email sources:

DatasetSizeNotes
zefang-liu/phishing-email-dataset~18.6kPrimary dataset (used in V4/V5)
ealvaradob/phishing-dataset (emails config)~4.8kAdditional phishing/ham emails

After merge + deduplication: ~30k+ emails


Data Processing Pipeline

  • โ€”HTML โ†’ text stripping
  • โ€”URL + email masking
  • โ€”Cross-dataset deduplication
  • โ€”Stratified split
  • โ€”Feature extraction (URLs, domains, tokens, etc.)
  • โ€”Pseudo-labelling of phishing type

Phishing Type Auxiliary Labels

Phishing emails receive one of 6 heuristic types:

  1. 1.Credential harvesting
  2. 2.Financial / invoice
  3. 3.Account suspension
  4. 4.Malware / attachment
  5. 5.Brand impersonation
  6. 6.Generic spam

Safe emails โ†’ type = โˆ’1 (masked in loss)

This auxiliary supervision improves representation learning and recall.


Performance (Test Set)

MetricScore
Accuracy0.9855
F10.9806
ROC-AUC0.9989
PR-AUC0.9981
FP / 1k8.06
FN / 1k25.23

Decision Thresholds

ModeThresholdUse
balanced0.3635default filtering
high_recall0.9546SOC triage
high_precision0.0100auto-blocking

Training Configuration

  • โ€”Max length: MAX_LENGTH (DistilBERT input)
  • โ€”Effective batch: 64 (grad accumulation)
  • โ€”Scheduler: linear
  • โ€”Optimizer: AdamW
  • โ€”Epochs: V5.1 training regime
  • โ€”GPU: CUDA (mixed precision)