Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

39 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


BLUEPRINT 2026 Status Tests Python License


"The first fraud detection system in the world that speaks Kannada."

Protecting β‚Ή4,000 Crore of small business dreams. One alert at a time.


πŸš€ Quick Start Β β€’Β  πŸ—οΈ Architecture Β β€’Β  🧠 ML Engine Β β€’Β  πŸ“‚ Project Structure Β β€’Β  πŸ§ͺ Testing Β β€’Β  πŸŽ₯ Demo Video


πŸ›‘οΈ Why We Built This

India is witnessing the world's most successful digital payment revolution via UPI. However, this success has a dark side. Small merchants β€” the backbone of Bharat β€” are being targeted by sophisticated fraud syndicates.

Important

The Problem:

  • Language Barrier: 100% of existing fraud tools are in English. Rural merchants are left in the dark.
  • Latency Gap: Bank-side fraud detection takes minutes. Fraudsters vanish in seconds.
  • Cost Barrier: Enterprise security costs thousands of dollars. Small merchants have zero budget.

PaySentinel was born to bridge this gap. We built a system that doesn't just block transactions β€” it explains them to the merchant in their native tongue, for free, in under 100 milliseconds.


πŸ₯‡ Competitive Analysis

"Why this over existing fraud tools?" This section answers that directly.

Capability Traditional Bank Fraud Stack Generic SME Fraud SaaS PaySentinel
Primary user focus Large institutions Online businesses Indian small merchants (UPI-first)
Language accessibility Mostly English Mostly English Kannada + Hindi + Tamil + Telugu + English
Explainability for non-technical users Low Medium High (plain-language explanation + SHAP reasons)
Voice-based actionability Rare Rare Built-in multilingual voice alerts
Offline fallback for alerts Rare Rare Available (pyttsx3 fallback)
Forensic evidence output Internal systems only Limited exports PDF fraud certificates + QR proof
Real-time simulation + stream pipeline Internal only Often add-on Native Kafka + SSE support
Cost profile for small shops High Medium Open-source and low-cost deployable

Strategic Differentiators

  • Bharat-first design: Built for the exact UPI merchant segment that is underserved by English-only fraud tools.
  • Trust + action, not just score: Detection, explanation, voice warning, and forensic report in one flow.
  • Deployability: Works as local Flask app, containerized production stack, and stream-enabled architecture.
  • Enterprise controls: API key protection, rate limiting, signed model cache, security headers, and rotating logs.

πŸ—οΈ System Architecture

PaySentinel is built as a high-performance, forensic-grade application with a clear separation of concerns.

graph TD
    subgraph "External Sources"
        A[UPI CSV Logs] --> D[Forensic Gateway]
        B[Kafka Live Stream] --> D
    end

    subgraph "PaySentinel Core (Python/Flask)"
        D --> E[Feature Engineering Engine]
        E --> F{Triple ML Ensemble}
        F --> G[Isolation Forest]
        F --> H[One-Class SVM]
        F --> I[Local Outlier Factor]
        
        F --> J[Inference Merger]
        J --> K[SHAP Explainer]
    end

    subgraph "Output Layer"
        K --> L[Regional Voice Engine]
        K --> M[Forensic PDF Generator]
        K --> N[Stark-Tech Dashboard]
        
        L --> O[Kannada/Hindi/Tamil Alerts]
        M --> P[QR-Signed Certificates]
    end

    style D fill:#0d1117,stroke:#00f5d4,stroke-width:2px
    style F fill:#0d1117,stroke:#ff7043,stroke-width:2px
    style K fill:#0d1117,stroke:#ffc107,stroke-width:2px
Loading

πŸ“‚ Project Structure

We follow a clean, modular Frontend-Backend Separation designed for high-speed delivery and auditability.

Pay_Sentinel/
β”œβ”€β”€ src/                           # πŸ”§ Core Engine
β”‚   β”œβ”€β”€ app.py                     #    Flask API Gateway & Controller
β”‚   β”œβ”€β”€ model.py                   #    Triple ML Ensemble Core
β”‚   β”œβ”€β”€ generate_data.py           #    Forensic Synthetic Data Generator
β”‚   β”œβ”€β”€ pdf_report.py              #    Bilingual QR-Signed Certificates
β”‚   β”œβ”€β”€ voice_alerts.py            #    Regional NLP Voice Engine
β”‚   β”‚
β”‚   └── frontend/                  # 🎨 Modern UI Layer
β”‚       β”œβ”€β”€ templates/             #    Index & Dashboard (Glassmorphism)
β”‚       └── static/                #    Frontend Assets
β”‚           β”œβ”€β”€ images/            #    HUD, Backgrounds, Section Visuals
β”‚           └── css/               #    Global Styles & Animations
β”‚
β”œβ”€β”€ tests/                         # πŸ§ͺ Quality Assurance (99 Tests)
β”œβ”€β”€ models/                        # πŸ’Ύ Serialized ML Models
β”œβ”€β”€ docs/                          # πŸ“– Enterprise Documentation
β”œβ”€β”€ Dockerfile                     # 🐳 Production Containerization
└── requirements.txt               # πŸ“¦ Pinned Dependencies

πŸ› οΈ Tech Stack

Component Technology Role
Backend Python Flask API Orchestration & Security
ML Engine Scikit-Learn Pandas Triple Ensemble Anomaly Detection
Forensics SHAP OpenCV AI Interpretability & Vision
Frontend HTML5 CSS3 Glassmorphism & WebGL HUD
Real-time Kafka High-throughput Event Streaming
Linguistic gTTS Regional Multi-language Alerting

πŸ“Š Data Flow Pipeline

The journey of a transaction from a raw log to a regional voice alert follows a strict, high-speed pipeline.

1. Ingestion & Sanitization

  • Raw Data: CSV upload or Kafka stream.
  • Validation: Deep check for SQLi, XSS, and mathematical anomalies (negative amounts, extreme outliers).
  • Sanitization: Bleach-based HTML stripping for merchant names.

2. Feature Engineering (~15ms)

We transform raw timestamps and amounts into 11 forensic features including velocity engines and merchant fingerprinting.

3. Neural Inference (~30ms)

The heart of PaySentinel is a weighted ensemble of three unsupervised models:

  • Isolation Forest (35%)
  • One-Class SVM (35%)
  • LOF (20%)
  • Heuristics (10%)

4. Forensic Output (~50ms)

  • Explainability: SHAP identifies the top 4 reasons for the flag.
  • Vocalize: Regional voice alerts in Kannada, Hindi, or Tamil.

🧠 How It Works

Stage Process Technology Latency
Ingest Stream / Upload Flask + Kafka 5ms
Engine 11-Feature Vector Pandas + NumPy 15ms
Neural Triple Ensemble Scikit-Learn 30ms
Explain SHAP Values SHAP Library 35ms
Alert Regional Voice gTTS / pyttsx3 <100ms

⚑ Quick Start

πŸš€ Local Development

# Clone the vault
git clone https://github.com/Yashaswini-V21/Pay_Sentinel.git
cd Pay_Sentinel

# Install dependencies
pip install -r requirements.txt

# Ignite the engine
python src/app.py

Tip

Visit http://localhost:5000/dashboard to experience the Stark-Tech command center.


πŸ§ͺ Testing & Audit

We maintain a 99% test pass rate across three specialized suites.

pytest tests/ -v --cov=.

πŸ‘¨β€πŸ’» Solo Developer

PaySentinel is a passion project built single-handedly for the BLUEPRINT 2026 Hackathon. It represents a journey of learning Forensic ML, Regional NLP, and High-Performance Flask.

#SoloHacker #BharatTech #OpenSource #FintechSecurity #MLOps


"Protecting the backbone of Bharat's economy."

Made with ❀️ by a Solo Learner

GitHub Stars GitHub Forks

About

PaySentinel is a bilingual fraud shield for UPI merchants with real-time detection, Kannada/Hindi voice alerts, and explainable AI.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages