Back to Projects01

FLARE: Federated Learning Phishing Defense System

A federated learning system for phishing email detection, aggregating client model updates without transmitting raw data.

PythonPyTorchFastAPISQLAlchemyChrome Extension (MV3)View on GitHubRead the Paper
Why I Built This

This one started as my graduation project, built around a single constraint: catch phishing emails without anyone's inbox ever leaving their device. Most phishing filters I looked at wanted the opposite: pool everyone's data centrally, train one big model, and hope people trust you with their inboxes along the way.

I wanted to see if federated learning could actually pull off the alternative in practice, not just on paper. That meant building the whole loop myself: a local client that trains on-device, a central server that aggregates weight deltas instead of raw data, and a scheduling strategy that doesn't fall apart the moment a client goes offline mid-round.

The Chrome extension came last, but it's the part that made the whole thing feel real: watching a warning pop up on an actual phishing email, knowing the model behind it never once saw anyone's actual mail.

Process
How It Works

Training happens on-device; only weight deltas ever leave it.

01

Each client trains locally on-device, computing only weight deltas, raw emails never leave the browser.

02

A FastAPI aggregation server runs FedAvg across client updates, weighted by local sample count.

03

The updated global model ships back down, and the Chrome extension flags phishing emails in real time.

How It Works
Demo
In Action

The admin dashboard, watching the model work in real time.

In Action01 / 03

Total flags, false positives, and false negatives tracked live across every connected client.

Gallery01 / 02
By the Numbers
96.3%

Detection Accuracy

0.963

F1 Score

Under 15ms

Prediction Latency

Highlights
  1. 01

    Fine-tuned DistilBERT for phishing email detection, achieving 96.3% accuracy and 0.963 F1 on a held-out test set.

  2. 02

    Implemented FedAvg in a custom FastAPI aggregation server, weighting client updates by local sample count and handling non-IID data distributions across clients.

  3. 03

    Designed a hybrid threshold/timeout round-scheduling strategy to balance aggregation latency against client availability, with SQLAlchemy-backed persistence for round state and weight updates.

  4. 04

    Engineered the on-device training loop to compute and transmit weight deltas only, eliminating raw data transmission and validating correctness with a pytest integration suite.

  5. 05

    Built a Gmail-integrated Chrome MV3 extension with an admin dashboard, giving users live phishing warnings and letting them flag/correct predictions to feed local retraining.

What's Next
  • →Add a functional LLM fallback for low-confidence predictions.
  • →Build a central-server dashboard for monitoring every connected client.