Skip to content

OnDevice Multimodal agent for anomaly-detection

Notifications You must be signed in to change notification settings

Samrudhp/OnDevice-Multimodal-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OnDevide MultiModal multi-agent System

Multi-Modal Behavioral Fraud Detection System

License Python React Native Expo

Real-time fraud detection using behavioral biometrics and AI-powered multi-agent analysis

Features β€’ Architecture β€’ Getting Started β€’ Demo β€’ Documentation


🎯 Overview

QuadFusion is an advanced multi-modal behavioral fraud detection system that leverages AI and machine learning to identify fraudulent activities through behavioral biometrics. Unlike traditional authentication methods, QuadFusion continuously monitors user behavior patterns across multiple dimensions:

  • Touch Patterns - Swipe dynamics, tap pressure, gesture recognition
  • Typing Behavior - Keystroke dynamics, rhythm analysis, timing patterns
  • Voice Authentication - Speaker identification, voice pattern analysis
  • Visual Biometrics - Face recognition, scene analysis
  • Motion Analysis - Accelerometer, gyroscope, magnetometer data
  • App Usage Patterns - Usage frequency, navigation patterns, temporal analysis

The system uses a multi-agent architecture where specialized AI agents analyze different behavioral aspects and a coordinator agent fuses their decisions for robust fraud detection.


✨ Features

πŸ”’ Multi-Modal Authentication

  • Continuous behavioral biometric monitoring
  • Real-time anomaly detection
  • Risk scoring with confidence levels
  • Session-based fraud analysis

πŸ€– AI-Powered Multi-Agent System

  • 6 Specialized Agents:
    • Touch Pattern Agent
    • Typing Behavior Agent
    • Voice Command Agent
    • Visual Agent
    • Movement Agent
    • App Usage Agent
  • Coordinator Agent for intelligent decision fusion
  • Lightweight models optimized for mobile deployment

πŸ“± Mobile-First Design

  • React Native + Expo for cross-platform support
  • Real-time sensor data collection
  • Live monitoring dashboard
  • Beautiful, responsive UI with animations
  • Offline-capable with local processing

πŸ›‘οΈ Privacy & Security

  • End-to-end encryption for biometric data
  • On-device processing where possible
  • Secure data storage and transmission
  • GDPR-compliant data handling

πŸ“Š Developer Experience

  • RESTful API with comprehensive documentation
  • Easy integration with existing apps
  • Detailed logging and monitoring
  • Performance metrics and analytics

πŸ—οΈ Architecture

System Components

QuadFusion/
β”œβ”€β”€ Backend (Python)          # AI/ML Processing Server
β”‚   β”œβ”€β”€ API Server           # FastAPI REST endpoints
β”‚   β”œβ”€β”€ Multi-Agent System   # 6 specialized + 1 coordinator
β”‚   β”œβ”€β”€ Models               # ML models (LSTM, CNN, etc.)
β”‚   β”œβ”€β”€ Data Pipeline        # Collection, preprocessing, encryption
β”‚   └── Mobile Deployment    # ONNX/TFLite conversion
β”‚
└── Frontend (React Native)   # Mobile Application
    β”œβ”€β”€ Sensor Managers      # Data collection
    β”œβ”€β”€ Live Monitoring      # Real-time dashboard
    β”œβ”€β”€ UI Components        # Responsive, animated UI
    └── API Client           # Backend communication

Multi-Agent Architecture

User Interaction Data
        ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Specialized Agent Layer         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ TouchPatternAgent    (20%)      β”‚
β”‚ β€’ TypingBehaviorAgent  (15%)      β”‚
β”‚ β€’ VoiceCommandAgent    (20%)      β”‚
β”‚ β€’ VisualAgent          (25%)      β”‚
β”‚ β€’ MovementAgent        (10%)      β”‚
β”‚ β€’ AppUsageAgent        (10%)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Coordinator Agent               β”‚
β”‚   β€’ Weighted fusion               β”‚
β”‚   β€’ Confidence aggregation        β”‚
β”‚   β€’ Risk level determination      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        ↓
   Fraud Decision

Technology Stack

Backend:

  • Python 3.10+
  • FastAPI (REST API)
  • TensorFlow & PyTorch (Deep Learning)
  • Scikit-learn (ML algorithms)
  • ONNX/TFLite (Mobile optimization)
  • Librosa (Audio processing)
  • OpenCV & MediaPipe (Computer Vision)

Frontend:

  • React Native 0.79
  • Expo 53.0
  • TypeScript
  • Expo Sensors, Camera, Audio
  • Victory Native (Charts)
  • React Navigation

πŸš€ Getting Started

Prerequisites

  • Backend: Python 3.10+, pip
  • Frontend: Node.js 18+, npm/yarn
  • Mobile: Expo Go app (for testing) or Expo CLI

Quick Start

1️⃣ Clone the Repository

git clone https://github.com/Samrudhp/OnDevice-Multimodal-Agent.git
cd QuadFusion

2️⃣ Backend Setup

cd src/backend/src

# Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Start API server
cd ..
python api_server.py

The backend server will start at `http://127.0.0.1:8000\`

API Documentation: Visit `http://127.0.0.1:8000/docs\` for interactive API docs

3️⃣ Frontend Setup

cd src/qf

# Install dependencies
npm install

# Start development server
npm run dev

Scan the QR code with Expo Go app to run on your device.

Configuration

Backend Configuration

Edit `src/backend/src/config.yaml`:

agents:
  coordinator:
    agent_weights:
      TouchPatternAgent: 0.2
      TypingBehaviorAgent: 0.15
      VoiceCommandAgent: 0.2
      VisualAgent: 0.25
      AppUsageAgent: 0.1
      MovementAgent: 0.1
    risk_thresholds:
      low: 0.3
      medium: 0.6
      high: 0.8

πŸ“– Usage

Running the Demo

# Terminal 1: Start backend
cd src/backend
python api_server.py

# Terminal 2: Start frontend
cd src/qf
npm run dev

API Examples

Real-time Fraud Detection

curl -X POST http://127.0.0.1:8000/api/v1/process/realtime \\
  -H "Content-Type: application/json" \\
  -d '{
    "session_id": "session-123",
    "sensor_data": {
      "touch_events": [...],
      "keystroke_events": [...],
      "motion_data": {...},
      "audio_data": "base64...",
      "image_data": "base64..."
    }
  }'

Response:

{
  "anomaly_score": 0.23,
  "risk_level": "low",
  "confidence": 0.87,
  "agent_results": {
    "MovementAgent": {
      "anomaly_score": 0.15,
      "risk_level": "low",
      "confidence": 0.9
    },
    "TouchPatternAgent": {...},
    ...
  }
}

🎬 Demo

Live Monitoring Dashboard

The mobile app provides real-time visualization of:

  • Sensor data collection (touch, motion, audio, camera)
  • Agent analysis results with individual scores
  • Risk assessment with confidence levels
  • Processing metrics and performance stats

Screenshots

(Add screenshots of your mobile app here)


πŸ“š Documentation


πŸ”§ Development

Project Structure

QuadFusion/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ backend/
β”‚   β”‚   β”œβ”€β”€ api_server.py              # Main API server
β”‚   β”‚   β”œβ”€β”€ API_SPECIFICATION.md       # API docs
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ agents/                # Multi-agent system
β”‚   β”‚       β”‚   β”œβ”€β”€ coordinator_agent.py
β”‚   β”‚       β”‚   β”œβ”€β”€ touch_pattern_agent.py
β”‚   β”‚       β”‚   β”œβ”€β”€ typing_behavior_agent.py
β”‚   β”‚       β”‚   β”œβ”€β”€ voice_command_agent.py
β”‚   β”‚       β”‚   β”œβ”€β”€ visual_agent.py
β”‚   β”‚       β”‚   β”œβ”€β”€ movement_agent.py
β”‚   β”‚       β”‚   └── app_usage_agent.py
β”‚   β”‚       β”œβ”€β”€ models/                # ML models
β”‚   β”‚       β”œβ”€β”€ data/                  # Data pipeline
β”‚   β”‚       β”œβ”€β”€ mobile_deployment/     # Model conversion
β”‚   β”‚       β”œβ”€β”€ training/              # Model training
β”‚   β”‚       └── utils/                 # Utilities
β”‚   β”‚
β”‚   └── qf/                            # React Native app
β”‚       β”œβ”€β”€ app/                       # Expo Router pages
β”‚       β”œβ”€β”€ components/                # UI components
β”‚       β”œβ”€β”€ lib/                       # Utilities
β”‚       β”‚   β”œβ”€β”€ sensor-manager.ts      # Sensor data collection
β”‚       β”‚   β”œβ”€β”€ api.ts                 # API client
β”‚       β”‚   └── audio-recorder.ts      # Audio recording
β”‚       └── config/                    # Configuration
β”‚
β”œβ”€β”€ docs/                              # Documentation
└── README.md                          # This file

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
  3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
  4. Push to the branch (`git push origin feature/AmazingFeature`)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Built for Samsung EnnovateX 2025 AI Challenge
  • TensorFlow and PyTorch communities
  • Expo and React Native teams
  • Open-source ML model contributors

πŸ“§ Contact

Project Repository: https://github.com/Samrudhp/OnDevice-Multimodal-Agent


Built with ❀️ using AI and Multi-Agent Systems

Protecting users through behavioral intelligence

About

OnDevice Multimodal agent for anomaly-detection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •