WAF Detection (Transformer-Based)
Deep Learning Web Application Firewall for Attack Payload Detection
Transformer-based machine learning firewall detecting SQLi, XSS, and path traversal attack payloads with ~4.2ms latency and ~95%+ accuracy.
AI & Machine Learning, Backend Systems
2024 Development
FastAPI • PyTorch
Cross-Platform
Problem, Solution & Engineering Scope
Operational Challenges & Cloud Fragility
Traditional regex-based web application firewalls frequently miss zero-day payload mutations or generate high false positive rates that block legitimate users.
Offline-First Zero Latency Local Engine
Trained a character-level transformer neural network that learns semantic syntax patterns of injection payloads regardless of encoding obfuscations.
- 1Ultra-low latency inference: ~4.2ms per request suitable for reverse proxy inline checks
- 2~95%+ detection accuracy across 5 payload classes (SQLi, XSS, Path Traversal, Command Injection, Benign)
- 3Compact 1.2M parameter Transformer architecture optimized for edge CPU execution
- 4FastAPI middleware wrapper allowing plug-and-play gateway deployment
- Automotive Service Centers & Independent Garages
- Spare Parts Retailers & Inventory Managers
- Offline POS Operators needing Zero-Cloud Dependability
Key System Capabilities
Engineered features and deep architectural implementations.
Multi-Class Threat Classification
Differentiates between SQL Injection, XSS, Directory Traversal, Command Injection, and Benign traffic.
Low-Latency FastAPI Gateway
Asynchronous endpoint design ensuring inline HTTP request inspection under 5ms.
Obfuscation Resilience
Handles URL encoding, hex escapes, and nested string concatenations without rule breakage.
System Architecture & Engineering Design
The system receives incoming raw URI query parameters and request bodies, tokenizes character and byte sequences, and executes forward inference on a lightweight PyTorch transformer classifier to emit malicious probability scores.
Presentation Layer
User interface, client-side state handling, input sanitization, and responsive views.
Application Core
Core domain logic, transaction coordinator, validation pipeline, and IPC/API endpoints.
Persistence Layer
Normalized persistence layer with indexing, foreign key constraints, and transactional ACID safety.
External Services
Third-party APIs, asynchronous cloud synchronization, document generators, and external webhooks.
User interface, client-side state handling, input sanitization, and responsive views.
Core domain logic, transaction coordinator, validation pipeline, and IPC/API endpoints.
Normalized persistence layer with indexing, foreign key constraints, and transactional ACID safety.
Third-party APIs, asynchronous cloud synchronization, document generators, and external webhooks.
Technology Stack & Core Tooling
Selected languages, frameworks, runtime environments, and engines.
FastAPI
Modern, high-performance Python ASGI web framework with automatic OpenAPI documentation and Pydantic validation.
PyTorch
Engineered architecture using PyTorch
Transformers
Engineered architecture using Transformers
Python
Dynamic programming language utilized for data modeling, statistical ARIMA forecasting, and machine learning pipelines.
Tokenizers
Engineered architecture using Tokenizers
Docker
OS-level containerization ensuring parity across local desktop development and production cloud deployment.
NumPy
Engineered architecture using NumPy
Engineering Challenges & Technical Solutions
Complex bottlenecks, concurrency hurdles, and architectural decisions resolved during development.
Pruned model layers to a compact 1.2M parameter architecture and quantized weights for rapid CPU inference.
Individual Contributions & Architectural Ownership
Core development, system architecture, database schema, and delivery milestones.
Prepared and sanitized synthetic and public attack payload datasets
Designed and trained the PyTorch transformer classification architecture
Built the production-ready FastAPI inferencing server with Docker containerization
Project Outcomes & Benchmarks
Created an intelligent, proactive firewall layer capable of blocking obfuscated injection payloads at web-scale speeds.
Explore Other Architectures
AutoBillDrive
Offline-first desktop billing application for Windows with SQLite persistence, automated PDF generation, Google Drive sync, and WhatsApp delivery.
EventApp
Production-ready event registration platform with Spring Boot 3.2, React 18, JWT RBAC, QR-code ticket generation, and async email confirmations.
