Downloads · 30 days
4
14% of all-time downloads
4xrhd/sentinelxai-distilbert
sentinelxai-distilbert is a text classification model from 4xrhd. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
SentinelXAI is a fine-tuned transformer model for continual, explainable, and robust phishing detection across English, Bengali (bn), Banglish, and code-mixed mobile-financial-service (MFS) smishing lures (bKash, Naga…
Downloads · 30 days
4
14% of all-time downloads
All-time downloads
29
Public
Parameters
67M
536 MB on disk
Likes
0
Public
Click a slice to open those files.
.pt268 MB · 50%
From the Hugging Face model README
SentinelXAI is a fine-tuned transformer model for continual, explainable, and robust phishing detection across English, Bengali (bn), Banglish, and code-mixed mobile-financial-service (MFS) smishing lures (bKash, Nagad, DBBL Nexus).
This model repository contains the fine-tuned DistilBERT classifier trained across sequential temporal experience streams evaluated under the Replay Continual Learning strategy (Avalanche framework).
distilbert-base-uncased0: LEGITIMATE / HAM, 1: PHISHING / SPAM)en), Bengali (bn), Banglish, and Code-Mixed| Evaluation Metric | Score (%) | Notes |
|---|---|---|
| Replay Strategy Accuracy | 95.84% ± 0.28% | 5-step continual learning benchmark |
| Test Set Accuracy | 95.20% ± 0.31% | Held-out 1,122 chronological test records |
| Test F1-Score | 94.80% ± 0.29% | Macro F1 on test split |
| Backward Transfer (BWT) | -0.0125 | Minimal catastrophic forgetting |
| Evasion Robustness (Combined) | 88.60% | Homoglyph + Zero-width-space + Benign padding |
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_name = "4xrhd/sentinelxai-distilbert"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "URGENT: Your account access has been restricted. Verify at http://secure-login.com"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=-1)[0]
pred_class = torch.argmax(logits, dim=-1).item()
label = "PHISHING / SPAM" if pred_class == 1 else "LEGITIMATE / HAM"
print(f"Prediction: {label} (Confidence: {probs[pred_class]*100:.2f}%)")
from captum.attr import LayerIntegratedGradients
# Compute token-level attributions on embedding layer
def custom_forward(input_ids):
return model(input_ids=input_ids).logits
lig = LayerIntegratedGradients(custom_forward, model.distilbert.embeddings)
inputs = tokenizer(text, return_tensors="pt")
attributions, delta = lig.attribute(inputs["input_ids"], target=1, return_convergence_delta=True)
# Token risk scores
tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
scores = attributions.sum(dim=-1).squeeze(0).tolist()
for tok, score in zip(tokens, scores):
print(f"{tok:<15} : {score:+.4f}")
Trained on the SentinelXAI Unified Dataset (5,610 records chronologically split across 2021-01-01 to 2023-06-18) combining:
Available on Kaggle: azhar4xrhd/sentinelxai-dataset.
@article{sentinelxai2026,
title={SentinelXAI: A Continual & Explainable Approach to Phishing Detection},
author={Team Recursion},
journal={IEEE Conference Proceedings},
year={2026}
}