Phishing Detection ModernBERT-base

This model is a fine-tuned answerdotai/ModernBERT-base for detecting phishing emails, developed as part of the llm-phishing-detection research project.

Model Performance

Evaluated on the benchmark test_llm test split:

  • Recall @ 1% FPR: 82.0% (95% CI: 74.5%โ€“89.1%)
  • PR-AUC: 0.9893
  • Inference Latency (p50): 199.5 ms

Usage

import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

model_id = "iceninja3/phishing-modernbert-base"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
model.eval()

subject = "Action Required: Update your bank details"
body = "Please visit http://update-secure-auth.net to avoid suspension of your account."
text = f"Subject: {subject}\n\n{body}"

inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
    logits = model(**inputs).logits
    probs = torch.softmax(logits, dim=-1)

# Probability of phishing (index 1)
phishing_prob = probs[0, 1].item()
print(f"Phishing probability: {phishing_prob:.4f}")

Classes

  • 0: legitimate
  • 1: phishing
Downloads last month
23
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for iceninja3/phishing-modernbert-base

Finetuned
(1,624)
this model