CoolFace
Modelpublic

Aadi210/BERT_phishing_classifier

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes8downloads
Model Card

Model Card for Model ID

This model is a fine-tuned version of google-bert/bert-base-uncased trained to classify website text as Safe or Not Safe (Phishing). It is designed to detect malicious or deceptive website content commonly used in phishing attacks.

The model was trained using a feature-based fine-tuning approach where BERT’s base layers were frozen and only the pooling layer and classification head were trained. This ensures stable learning and reduces overfitting on smaller datasets.

Model Sources

Base model: Google BERT

This project was developed as a hands-on fine-tuning and evaluation exercise.

  • Dataset: shawhin/phishing-site-classification
  • Model: google-bert/bert-base-uncased

Uses

Binary Text Classification

The model predicts whether a given piece of website text belongs to:

Safe (legitimate site)

Not Safe (phishing or malicious site)

Bias, Risks, and Limitations

Trained on a relatively small dataset

Performance may degrade on unseen phishing styles

Should be combined with rule-based or RAG-based systems for production use

How to Get Started with the Model

from transformers import AutoTokenizer, AutoModelForSequenceClassification import torch

model = AutoModelForSequenceClassification.frompretrained("Aadi210/BERTphishingclassifier") tokenizer = AutoTokenizer.frompretrained("Aadi210/BERTphishingclassifier")

text = "Verify your account immediately to avoid suspension."

inputs = tokenizer(text, return_tensors="pt") outputs = model(**inputs)

probs = torch.softmax(outputs.logits, dim=1) prediction = probs.argmax().item()

print("Prediction:", "Not Safe" if prediction == 1 else "Safe")

Training Details

Training Data

The model was trained and evaluated on the HuggingFace dataset:

shawhin/phishing-site-classification

This dataset contains labeled website text samples categorized as phishing or legitimate.

Training Hyperparameters

Base model: google-bert/bert-base-uncased

Fine-tuning strategy: Feature-based fine-tuning (BERT frozen, classifier trained)

Optimizer: AdamW (HuggingFace Trainer)

Learning rate: 2e-4 with scheduler

Batch size: 8

Epochs: 10

Evaluation

Evaluated on the test split:

Metric Value Accuracy ~0.86 ROC-AUC ~0.95

ROC-AUC indicates strong class separation between phishing and legitimate websites.