Skip to content

Sagar-S-R/anomaly-detection-TriFusion

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

31 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ TriFusion Family Care AI

Samsung PRISM GenAI Hackathon 2025

๐Ÿค– Vishvabodh : GenAI-Powered Real-Time MultiModal Anomaly Detection System for Family Safety & Elder Care with Neurosymbolic reasoning

๐Ÿ  Smart Home Integration


๐Ÿ“‹ Project Information

  • Hackathon: Samsung PRISM GenAI Hackathon 2025
  • Team Name: TriFusion
  • Theme: AI-Powered Family Safety & Elder Care
  • Technology: Multimodal AI Fusion (Vision + Audio + Pose Detection)

System Architecture

graph TB
    subgraph "Input Layer"
        CAM[Camera/Video Feed]
        MIC[Microphone/Audio]
        UP[Video Upload]
    end
    
    subgraph "Capture & Preprocessing"
        VC[Video Capture Thread<br/>OpenCV]
        AS[Audio Stream Thread<br/>PyAudio Buffer]
        FQ[Frame Queue<br/>Thread-Safe]
        
        CAM --> VC
        UP --> VC
        MIC --> AS
        VC --> FQ
    end
    
    subgraph "Tier 1: Fast Detection <100ms"
        T1[Tier 1 Pipeline]
        
        subgraph "Multimodal Analysis"
            CLIP[CLIP Vision<br/>Scene Understanding]
            MP[MediaPipe Pose<br/>Human Detection]
            AFFT[Audio FFT<br/>Sound Analysis]
        end
        
        FQ --> T1
        AS --> T1
        T1 --> CLIP
        T1 --> MP
        T1 --> AFFT
    end
    
    subgraph "Fusion Logic"
        FL[Fusion Engine<br/>Threshold Detection]
        DEC{Anomaly<br/>Suspected?}
        
        CLIP --> FL
        MP --> FL
        AFFT --> FL
        FL --> DEC
    end
    
    subgraph "Tier 2: Deep AI Reasoning 1-3s"
        T2[Tier 2 Pipeline]
        
        subgraph "Advanced AI Models"
            BLIP[BLIP-2<br/>Image Captioning]
            WHIS[Whisper<br/>Speech Recognition]
            LLM[Groq LLM<br/>Contextual Analysis]
        end
        
        DEC -->|Yes| T2
        T2 --> BLIP
        T2 --> WHIS
        BLIP --> LLM
        WHIS --> LLM
    end
    
    subgraph "Backend Processing"
        SM[Session Manager<br/>AsyncIO + Threading]
        LOCK[Thread Lock<br/>Resource Sync]
        RES[Resource Manager<br/>Video/Audio/Files]
        
        SM --> LOCK
        SM --> RES
    end
    
    subgraph "Real-Time Communication"
        WS[WebSocket<br/>FastAPI]
        HTTP[REST API<br/>Status/Control]
    end
    
    subgraph "Output Layer"
        DASH[Dashboard UI<br/>Live Updates]
        RPT[Reports<br/>JSON + HTML]
        ALERT[Alert System<br/>Real-time Notifications]
        ST[Samsung SmartThings<br/>IoT Integration]
    end
    
    DEC -->|No| DASH
    LLM --> SM
    SM --> WS
    SM --> HTTP
    WS --> DASH
    HTTP --> DASH
    SM --> RPT
    SM --> ALERT
    ALERT --> ST
    
    style T1 fill:#e3f2fd
    style T2 fill:#fff3e0
    style SM fill:#f3e5f5
    style WS fill:#e8f5e9
    style DASH fill:#fce4ec
    style ST fill:#1428a0,color:#fff
Loading

Submissions

The demo video

The demo video

Idea presentation ppt

Access pptx here

๐Ÿ“ Project Resources

๐Ÿ”— Google Drive - Project Assets & Documentation
Access TriFusion Project Resources

This folder contains additional project assets, demo videos, presentation materials, and supplementary documentation. *Use demo videos to test *


๐ŸŽฏ Project Overview

TriFusion is a revolutionary multimodal AI platform that transforms Samsung's SmartThings Family Care ecosystem into the world's most advanced family safety monitoring solution. This hackathon project demonstrates production-ready AI technology that combines real-time video analysis, audio processing, pose detection, and advanced LLM reasoning to deliver unprecedented safety insights for elderly care and family protection.

๐ŸŽฏ Samsung PRISM GenAI 2025 - Ultra Simple Evaluation:

๐Ÿš€ For Samsung Judges (2 Commands Only)

cd inference
python batch_processor.py

That's it! Results will be in output/ and reports/ folders

  • No videos required: Demo mode works instantly
  • Professional reports: JSON and HTML outputs ready for Samsung integration
  • Real-time performance: Demonstrates production capability
  • Samsung optimized: 5-10x performance improvements included

or

Deatiled pipeline experience

  • Follow docs to setup environment and

  • open dashboard and upload or live monitoring available too


๐Ÿš€ Quick Start

For Samsung Judges (Ultra Simple)

# Clone and setup
git clone https://github.com/Samrudhp/anomaly-2.git
cd anomaly-2

# Install dependencies  
pip install -r backend/requirements.txt

# Samsung evaluation (2 commands total)
cd inference
python batch_processor.py
# Done! Check output/ and reports/ folders

For Full System Experience

# Clone repository
git clone https://github.com/Samrudhp/anomaly-2.git
cd anomaly-2/backend

# Setup virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure API key
echo "GROQ_API_KEY=your_groq_api_key_here" > .env

# Start the application
uvicorn app:app --host 0.0.0.0 --port 8000

Access Application


Quick Samsung Evaluation Workflow:

# 1. Navigate to inference folder
cd inference

# 2. Place test videos in input folder
cp your_test_video.mp4 input/

# 3. Run Samsung demo (choose one):

python batch_processor.py           # Automated processing

# 4. Review professional reports
open reports/samsung_dashboard_*.html
  • Dedicated Inference Pipeline: Professional evaluation tools for Samsung judges
  • 10x Performance Optimizations: Real-time processing capability demonstrated
  • SmartThings Integration Ready: Native ecosystem compatibility examples
  • Interactive Jupyter Demos: Live demonstrations for stakeholders

๐Ÿš€ Key Innovation

  • Two-Tier AI Architecture: Real-time detection (Tier 1) + AI reasoning (Tier 2)
  • Multimodal Fusion: CLIP vision + Whisper audio + MediaPipe pose + Scene analysis
  • Privacy-First Design: Local processing with user-controlled data sharing
  • Production-Ready Code: Enterprise-grade error handling and scalability
  • ๐Ÿ†• Samsung Evaluation Suite: Dedicated tools for professional assessment

๐Ÿ“ˆ Market Impact

  • $50B+ Elder Care Market opportunity growing at 15% annually
  • Competitive Differentiation: Years ahead of Apple, Google, Amazon
  • Revenue Potential: $1.2B annually from premium subscriptions

๐Ÿ—๏ธ Architecture

Two-Tier AI System

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   TIER 1        โ”‚    โ”‚   TIER 2        โ”‚
โ”‚ Fast Detection  โ”‚    โ”‚ AI Reasoning    โ”‚
โ”‚ (<100ms)        โ”‚    โ”‚ (1-3 seconds)   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค    โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ€ข Pose Analysis โ”‚    โ”‚ โ€ข Multimodal    โ”‚
โ”‚ โ€ข Scene Prob.   โ”‚    โ”‚   Fusion        โ”‚
โ”‚ โ€ข Audio Keywordsโ”‚    โ”‚ โ€ข LLM Analysis  โ”‚
โ”‚ โ€ข Threshold     โ”‚    โ”‚ โ€ข Context       โ”‚
โ”‚   Detection     โ”‚    โ”‚   Reasoning     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Multimodal Fusion Engine

  • ๐Ÿ‘๏ธ Vision: CLIP + BLIP for scene understanding
  • ๐ŸŽค Audio: Whisper for speech recognition
  • ๐Ÿƒ Pose: MediaPipe for human movement analysis
  • ๐Ÿง  Reasoning: Groq LLM for contextual analysis

๐Ÿ› ๏ธ Technology Stack

AI/ML Frameworks

  • Computer Vision: OpenCV, PyTorch, Transformers
  • Audio Processing: Whisper, PyAudio
  • Pose Detection: MediaPipe
  • LLM Integration: Groq API

Backend & Infrastructure

  • Web Framework: FastAPI
  • Real-time Communication: WebSocket
  • Video Processing: OpenCV
  • Deployment: Uvicorn ASGI

Frontend

  • UI Framework: HTML5, CSS3, JavaScript
  • Real-time Updates: WebSocket integration
  • Responsive Design: Mobile-first approach

๐ŸŽฏ Samsung Evaluation Tools - Ultra Simple

๐Ÿ“ Batch Processing for Samsung Judges

We've created ultra-simple evaluation tools specifically for Samsung PRISM GenAI Hackathon 2025! No complex setup required.

๐Ÿš€ Simple Command-Line Processing

# That's literally it - one command does everything
cd inference
python batch_processor.py

What happens:

  • Auto-detects videos in input folder (or runs demo mode)
  • Processes with Samsung optimizations (5-10x faster)
  • Generates professional reports in output/ and reports/
  • Works immediately - no configuration needed
๐Ÿ“ inference/
โ”œโ”€โ”€ ๐Ÿ“‚ input/           # Drop test videos here (.mp4, .avi, .mov, .mkv)
โ”œโ”€โ”€ ๐Ÿ“‚ output/          # Processed frames and anomaly detections  
โ”œโ”€โ”€ ๐Ÿ“‚ reports/         # Professional JSON + HTML reports
โ”œโ”€โ”€ ๐Ÿ”ง batch_processor.py   # One-command evaluation tool
โ””โ”€โ”€ ๐Ÿ“– README.md        # Simple usage instructions

โšก Samsung Performance Optimizations

Our batch processor features Samsung-specific optimizations:

Optimization Improvement Benefit
Smart Thresholds 80% fewer false positives Higher precision, faster processing
Frame Sampling 2x faster processing Real-time capability demonstrated
Combined Effect 5-10x overall speed Professional demo performance

Example Performance: 1.3-minute video processed in 2-4 minutes (was 18 minutes)

๐Ÿ“Š Generated Reports for Samsung Evaluation

The batch processor produces professional Samsung-branded reports:

  1. ๐Ÿ“„ JSON Report - Machine-readable analysis data

    • Frame-by-frame anomaly detection results
    • Performance metrics and processing statistics
    • SmartThings integration metadata
    • Enterprise deployment recommendations
  2. ๐ŸŒ HTML Dashboard - Executive-friendly visual report

    • Professional Samsung PRISM GenAI 2025 branding
    • Interactive anomaly timeline and visualizations
    • Performance benchmarks and speed comparisons
    • SmartThings ecosystem integration examples

๐Ÿข Samsung SmartThings Integration Examples

The inference pipeline demonstrates ready-to-deploy Samsung ecosystem integration:

  • SmartThings Cam direct video feed processing
  • Galaxy device notifications and mobile alerts
  • Smart Home automation responses to anomalies
  • Enterprise multi-location monitoring scenarios

๐ŸŽฏ Why This Matters for Samsung Judges

  1. ๐Ÿš€ Production-Ready: Demonstrates enterprise deployment capability
  2. โšก Performance: Shows real-time processing suitable for Samsung devices
  3. ๐Ÿข Integration: Proves seamless SmartThings ecosystem compatibility
  4. ๐Ÿ“Š Professional: Provides comprehensive evaluation tools for stakeholders
  5. ๐Ÿ”’ Privacy-First: Validates local processing without cloud dependencies

๐Ÿ† Ready for Samsung PRISM GenAI Hackathon 2025 evaluation!


๐Ÿ“š Documentation

Comprehensive documentation is available in the docs/ directory:

Complete project overview, architecture, and navigation guide.

๐Ÿ—๏ธ Architecture

๐Ÿค– AI Components

โš™๏ธ Technical Details

๐Ÿ’ผ Business Value


๐ŸŽฏ Key Features

๐Ÿ†• Samsung Evaluation Suite

  • Professional Inference Pipeline: Dedicated tools for Samsung judge evaluation
  • Batch Processing Engine: Automated video analysis with professional reports
  • 10x Performance Optimizations: Real-time capability with Samsung-tuned settings

๐Ÿ”ด Real-Time Anomaly Detection

  • Instant Alerts: <100ms response time for critical events
  • Multi-Modal Analysis: Vision, audio, and pose detection
  • Contextual Reasoning: AI-powered threat assessment

๐Ÿ“น Video Upload & Analysis

  • Offline Processing: Analyze recorded videos
  • Frame-by-Frame Analysis: Detailed anomaly detection
  • Comprehensive Reports: Threat assessment and recommendations

๐Ÿ›ก๏ธ Privacy-First Design

  • Local Processing: No cloud upload of sensitive data
  • User Control: Configurable privacy settings
  • Secure Architecture: Enterprise-grade security

๐Ÿ“Š Advanced Analytics

  • Performance Metrics: Real-time FPS and accuracy tracking
  • Historical Data: Event timeline and analysis history
  • Export Capabilities: Generate reports and summaries

๐Ÿ† Samsung Integration Potential

SmartThings Family Care Enhancement

  • Seamless Integration: Native SmartThings app integration
  • Galaxy Watch Connectivity: Wearable device alerts
  • Smart Home Automation: Automated response systems

Competitive Advantages

  • AI Superiority: Most advanced multimodal AI in family safety
  • Privacy Leadership: Local processing vs. cloud competitors
  • Scalability: Enterprise-ready architecture

Business Impact

  • Market Leadership: First-mover advantage in AI family safety
  • Revenue Streams: Premium subscription and enterprise licensing
  • Brand Differentiation: Samsung as AI safety innovator

๐Ÿ“Š Performance Metrics

System Performance

  • Response Time: <100ms for Tier 1, <3s for Tier 2
  • Real-Time Processing: 25-30 FPS video analysis
  • Memory Usage: <2GB RAM under normal load

Reliability

  • Uptime: 99.9% availability
  • Error Handling: Graceful fallbacks and recovery
  • Scalability: Handles multiple concurrent sessions

๐Ÿ”ง Development Setup

Environment Setup

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Setup environment variables
cp .env.example .env
# Edit .env with your API keys

Development Server

# Start development server with auto-reload
uvicorn app:app --reload --host 0.0.0.0 --port 8000

# Access logs
tail -f logs/application.log

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

๐Ÿ“„ License

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


Support


๐Ÿ™ Acknowledgments

  • Samsung PRISM GenAI Hackathon 2025 for the opportunity
  • Groq for providing fast LLM inference
  • Hugging Face for open-source AI models
  • Google MediaPipe for pose detection technology

Made with โค๏ธ by Team TriFusion

Samsung PRISM GenAI Hackathon 2025


Transforming family safety through the power of multimodal AI

About

Samsung PRISM GenAI Hackathon 2025

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 59.5%
  • HTML 40.5%