Back to Work
G30

Brand protection capstone

NLP Phishing Detection

Safe or Caution, right in the inbox.

A capstone system that turns an open email into a security signal: clean the text, route it through fine-tuned classifiers or LLM adapters, and badge the verdict directly in Gmail.

Jan 2024 - Dec 2024Group 30 · g30.xyzDetector sourceExtension source
Gmail message with a phishing risk button and Safe result badge

Live verdict

Safe

Legitimate98.4%
Phishing1.6%

Model option

local · distilbert-base-uncased_fine_tuned · badge injected by the Chrome content script

Overview

The detector is a model bench and production path in one repo: DistilBERT and RoBERTa fine-tunes, OpenAI and Claude adapters, an Ollama route, W&B-backed evaluation, and a Flask API that preloads every model before serving requests.

The companion Chrome extension watches for the currently opened Gmail message, extracts the email body, sends it to the deployed detector, and renders the answer beside the message toolbar.

Gmail extensionFine-tuned RoBERTaLocal DistilBERTOpenAI adapterClaude adapterDocker deployment
Legitimate Gmail message marked Safe by the phishing detector
Legitimate messageSafe badge
Suspicious Gmail message marked Unsafe and Dangerous by the phishing detector
Phishing attemptUnsafe badge

5

01

Inference Backends

local · roberta · openai · claude · ollama

2

02

Fine-Tuned HF Models

DistilBERT and RoBERTa checkpoints

3.75M

03

Processed CSV Rows

train and test splits across four datasets

MV3

04

Chrome Extension Surface

the verdict badge lands beside the open Gmail message

01Classifier readout

Text preprocessing and classification.

Every path starts by simplifying the raw message: URLs and punctuation are stripped, casing is normalized, and the result is fed into a sequence classifier or model adapter with a strict phishing/safe output contract.

no-reply@robinhood.com

Important information about your application

Hi Tawfiq, thank you for taking the time to apply. We wanted to let you know that we are no longer accepting applications for the New Grad, Toronto position.

Preprocessed

hi tawfiq thank you for taking the time to apply we wanted to let you know that we are no longer accepting applications for the new grad toronto position

Verdict

Safe

98.4% confidence

Phishing1.6%
Safe98.4%
verified senderno credential requestno payment pressure
02System path

The architecture is intentionally direct: browser content script, text cleaning, model selection, preloaded Flask backend, JSON result, and a badge inserted back into Gmail.

01

Gmail DOM

Open message surface

02

Content script

Reads .a3s and selectedModel

03

HTTPS request

email_text + model_option

04

Flask API

Preloaded inference workers

05

Preprocess

URL strip + lowercase normalize

06

Model router

local · roberta · openai · claude · ollama

07

HF models

DistilBERT / RoBERTa logits

08

LLM adapters

OpenAI model, Claude, Ollama

09

Inbox badge

Safe or Caution JSON verdict

03Model backends

Inference options implemented in the detector.

Local DistilBERT

Default on-device-style classifier, loaded from the fine-tuned model folder.

RoBERTa

A second transformer path for sequence classification and comparison.

OpenAI model

Fine-tuned OpenAI adapter with the same phishing/safe response contract.

Claude

Prompted classifier path for Anthropic evaluation and fallback testing.

Ollama

Local LLM route that can run llama3 or another installed model from the CLI.

04Deployment

Containerized service and browser integration.

The final system ran as a containerized service on a Hetzner VPS, behind Nginx and SSL so the Chrome extension could call it from a normal browser session.

Flask API

Models are preloaded at startup, then served through GET /detect_phishing.

Nginx + SSL

g30.xyz sat in front of the detector with a Let's Encrypt certificate.

Chrome extension

The browser surface reads the open email, calls the API, and injects the result.

Built with
PythonLanguage
TransformersNLP models
PyTorchTraining
RoBERTaClassifier
DistilBERTClassifier
OpenAILLM adapter
AnthropicLLM adapter
OllamaLocal LLM
FlaskAPI
DockerContainer
NginxReverse proxy
Chrome MV3Extension
W&BEvaluation
G30NLP Phishing Detection
All Projects「مشروع」