FraudShield

FraudShield — Real-Time Fraud Detection Platform FraudShield is a fully containerized, production-grade fraud detection platform combining machine learning, real-time business rules, and microservices. Built with FastAPI, Docker, Scikit-learn, and Gradio, it delivers ultra-fast inference (<100ms), 98%+ accuracy on extreme fraud cases, and includes a full analytics dashboard.

Year

2024

Service

Web Design

Category

ML

Tool

Framer

FraudShield AI – Real-time Fraud Detection System

Concept:
A production-ready, Dockerized fraud detection system that uses machine learning and business rules to detect fraudulent transactions with high accuracy and low-latency inference.

Problem Solved:
Enables real-time fraud detection using an ensemble ML model, risk scoring, contextual business rules, and analytics dashboards. Helps reduce fraud losses and improves decision-making for financial systems.

Scope:

  • Input:
    Transaction data (amount, balance, transaction count, location flags, card age, fraud history, etc.).

  • Process:
    A fully containerized microservice architecture:

    1. Frontend (Gradio UI):
      User-facing interface for live predictions, analytics, and dashboards.

    2. Backend (FastAPI Server):
      Handles prediction requests, business rules, analytics endpoints, and retraining.

    3. Machine Learning Engine:
      Ensemble model (Random Forest + Logistic Regression) performing real-time inference with <50ms model latency.

    4. Business Rules Layer:
      Additional fraud heuristics layered on top of model output.

    5. Health & Monitoring:
      Auto-recovery, service discovery, and logging through Docker.

  • Output:
    Real-time fraud predictions (<100ms), risk scores, classification levels (Low/Medium/High), dashboards, model analytics, and access to OpenAPI documentation.

Features:

  • 98% accuracy on extreme fraud cases

  • Risk scoring + confidence levels

  • Real-time predictions

  • Feature importance visualization

  • Dashboard with transaction statistics

  • REST API with documented endpoints

  • Retraining endpoint

  • Health checks

  • Microservices with Docker Compose

  • Persistent storage through volumes

Tech Stack:

  • Backend: FastAPI

  • Frontend: Gradio

  • Machine Learning: Scikit-learn (Random Forest, Logistic Regression)

  • Data: CSV, Pandas, NumPy

  • Infrastructure: Docker, Docker Compose

  • Logs & Monitoring: FastAPI logging + container logs

  • Output: JSON, UI dashboard

Project Structure:
(High-level)

  • backend/ — FastAPI app, ML models, database layer

  • frontend/ — Gradio UI

  • models/ — Saved ML models

  • data/ — Training + live data

  • docker-compose.yml — Orchestration layer

  • requirements.txt — Dependencies

API Endpoints:

  • /predict — Single prediction

  • /batch-predict — Batch predictions

  • /train — Retrains the model

  • /health — System health

  • /model-info — Metadata + performance

  • /feature-importance — Feature rankings

  • /stats — Dashboard stats

  • /transactions — Recent transactions

Performance Metrics:

  • <100ms API response

  • <50ms model inference

  • 98% extreme fraud detection

  • 2s UI load time

  • 30s container startup

Achievements:

  • Fully Dockerized ML system

  • Stage-ready fraud detection workflow

  • Accurate ensemble model

  • Real-time API + analytics

  • Extendable microservice architecture

GitHub Repository:
https://github.com/Shodexco/fraud-detector

API Documentation:
http://localhost:8000/docs (local development)

Web Interface (UI):
http://localhost:7860 (local development)

Health Check:
http://localhost:8000/health (local development)

© Jonathan Sodeke 2025

© Jonathan Sodeke 2025

© Jonathan Sodeke 2025

Create a free website with Framer, the website builder loved by startups, designers and agencies.