Back to Projects
CodeB: Phishing URL Detection System
CompletedPythonScikit-learnFastAPI+4 more

CodeB: Phishing URL Detection System

End-to-end ML solution for identifying malicious URLs with explainable AI

Timeline

Completed

Role

ML Engineer

Status
Completed

Technology Stack

Python
Scikit-learn
FastAPI
Streamlit
Docker
SHAP
LIME

CodeB: Phishing URL Detection System

An end-to-end Machine Learning solution designed to identify and classify malicious URLs. This project bridges the gap between high-accuracy classification and model transparency in cybersecurity.

Project Overview

CodeB is a production-ready system that detects phishing URLs with 93-95% accuracy while providing explainable predictions through SHAP and LIME analysis. The system features a modular architecture with a FastAPI backend and interactive Streamlit dashboard.

Performance: 93-95% accuracy Key Feature: Explainable AI (XAI) for transparency Deployment: Fully containerized with Docker

Key Highlights

  • High Performance: Achieved 93-95% accuracy using optimized classification algorithms
  • Explainable AI (XAI): Integrated SHAP and LIME to provide "why" behind every prediction, making the model trustworthy for non-technical stakeholders
  • Production Ready: Features a modular FastAPI backend and an interactive Streamlit dashboard
  • Full Containerization: Dockerized for 100% environment consistency

System Architecture

The system follows a modern ML-Ops pipeline:

  1. Data Preprocessing: Feature extraction from raw URLs (checking for length, special characters, domain age, etc.)
  2. ML Engine: Classification model trained on curated phishing datasets
  3. Explainability Layer: SHAP/LIME analysis to highlight specific URL features that triggered the "Phishing" alert
  4. Interface: Real-time inference via a web-based UI

Tech Stack

Tech Stack
  • Machine Learning: Scikit-learn, SHAP, LIME, Pandas, NumPy
  • API Framework: FastAPI (Python)
  • Frontend: Streamlit
  • DevOps: Docker, Git

Getting Started

Using Docker (Recommended)

Ensure you have Docker installed, then run:

docker-compose up --build
  • API Documentation: http://localhost:8000/docs
  • Web UI: http://localhost:8501

Local Setup

  1. Clone the Repository:
git clone https://github.com/SHREY275/codeb.git
cd codeb
  1. Install Dependencies:
pip install -r requirements.txt
  1. Run the Backend:
uvicorn backend.app:app --reload
  1. Run the Frontend:
streamlit run frontend/ui.py

Evaluation and Explainability

The project doesn't just provide a label (Safe/Phishing); it provides a Feature Importance Map. By using SHAP, we can see which part of the URL (e.g., a suspicious subdomain or an IP-based host) contributed most to the risk score.

Key Metrics

  • Accuracy: 93-95%
  • Precision: High confidence in phishing predictions
  • Recall: Effective at catching malicious URLs
  • Explainability: SHAP/LIME feature importance analysis

Features

  • Real-time URL classification
  • Feature importance visualization
  • SHAP and LIME explainability analysis
  • RESTful API with comprehensive documentation
  • Interactive web dashboard
  • Batch processing capability
  • Docker containerization for easy deployment

Internship Contributions

  • Engineered a robust feature extraction pipeline to reduce overfitting
  • Automated the deployment workflow using Docker
  • Collaborated on improving model interpretability for end-users
  • Implemented SHAP/LIME integration for explainable predictions

API Endpoints

  • POST /predict - Classify a single URL
  • POST /predict-batch - Classify multiple URLs
  • GET /explain/{url_id} - Get SHAP/LIME explanation for a prediction
  • GET /docs - Interactive API documentation

Model Performance

The model achieves consistent performance across different URL types:

  • Legitimate URLs: High true negative rate
  • Phishing URLs: High true positive rate with clear feature attribution
  • Suspicious URLs: Detailed risk scoring with explainability

Repository: github.com/SHREY275/codeb

Design & Developed by Shrey Mishra
© 2026. All rights reserved.