Skip to content

A real-time intelligent surveillance system designed to detect human falls and anomalous behaviors using deep learning techniques. Includes automated alerting, a monitoring dashboard, and scalable deployment via Docker and Kubernetes.

License

Notifications You must be signed in to change notification settings

muhkartal/sentinelAI-safetyMonitoring

Repository files navigation

sentinelAI-safetyMonitoring

screenshot

Real-Time Fall Detection & Anomaly Alert Platform

Code Size Last Commit Status Demo License Python 3.11+ Docker

Overview

EdgeVision-Guard is a monitoring system using computer vision and deep learning to detect human falls and anomalies in real-time. The platform uses a privacy-preserving approach based on skeleton keypoints, making it suitable for healthcare facilities, workplace safety monitoring, and smart living environments.

Contents

Performance & Optimization

  • Model Optimization Techniques

    • INT8 quantization reduces model size by 75% without significant accuracy loss
    • TensorRT acceleration for NVIDIA platforms increases throughput by 3x
    • ARM-optimized inference for Raspberry Pi and Jetson Nano devices
    • Support for hardware acceleration (CUDA, OpenVINO, CoreML)
  • Production Performance Metrics

    Deployment Target Latency Throughput Power Consumption
    Cloud (GPU) 12ms 83 FPS N/A
    Cloud (CPU) 45ms 22 FPS N/A
    Jetson Nano 78ms 12 FPS 5W
    Raspberry Pi 4 126ms 8 FPS 3.2W
  • Model Accuracy Benchmarks

    Metric UP-Fall Dataset URFall Dataset Real-World Validation
    Precision 0.94 0.92 0.91
    Recall 0.91 0.89 0.88
    F1 Score 0.92 0.90 0.89
    ROC-AUC 0.97 0.95 0.94
    False Positive Rate 0.04 0.05 0.06
    False Negative Rate 0.09 0.11 0.12

Deployment Guide

1. Docker Deployment

# Clone the repository
git clone https://github.com/muhkartal/EdgeVision-Guard.git
cd EdgeVision-Guard

# Configure environment variables
cp .env.example .env
# Edit .env with your configuration

# Deploy with Docker Compose
docker-compose up -d

2. Kubernetes Deployment

# Install Helm chart
helm repo add edgevision-guard https://charts.yourdomain.com/
helm repo update

# Deploy EdgeVision-Guard
helm install edgevision-guard edgevision-guard/edgevision-guard \
  --namespace monitoring \
  --create-namespace \
  --set ingress.enabled=true \
  --set persistence.enabled=true \
  --values custom-values.yaml

3. Edge Device Deployment

# Deploy to edge device
./scripts/deploy-edge.sh --target <device-ip> --username <user> --key <ssh-key>

# Or use the edge-specific Docker Compose
docker-compose -f docker-compose.edge.yml up -d

# Install as systemd service
sudo cp deployment/edgevision-guard.service /etc/systemd/system/
sudo systemctl enable edgevision-guard.service
sudo systemctl start edgevision-guard.service

Model Training & Customization

# Download and preprocess datasets
python src/data_ingest.py --dataset up-fall --output data/up-fall
python src/data_ingest.py --dataset ur-fall --output data/ur-fall
python src/data_ingest.py --generate-keypoints --dataset up-fall --dataset ur-fall

# Train with dataset
python src/train.py --epochs 100 --batch-size 64 --device cuda --output-dir models/

# Fine-tune on custom data
python src/train.py --transfer-learning --base-model models/fall_detector.pth \
  --custom-data path/to/custom/data --epochs 20

# Export to production-ready ONNX format
python src/onnx_export.py --model-path models/fall_detector.pth \
  --output models/fall_detector.onnx --quantize --benchmark

Architecture Deep Dive

Fallback image description

Integration Examples

Security System Integration

# Configure webhook notifications to your security system
WEBHOOK_URL = "https://your-security-system.com/api/events"
WEBHOOK_AUTH = {"Authorization": "Bearer your-api-token"}

# In your .env file
ALERT_WEBHOOK_URL=https://your-security-system.com/api/events
ALERT_WEBHOOK_AUTH_HEADER=Bearer your-api-token

Healthcare System Integration

# Configure HL7 FHIR integration
FHIR_SERVER = "https://fhir.hospital.org/api/fhir/r4"
FHIR_AUTH = {"Authorization": "Bearer your-fhir-token"}

# In your .env file
FHIR_ENABLED=true
FHIR_SERVER_URL=https://fhir.hospital.org/api/fhir/r4
FHIR_AUTH_HEADER=Bearer your-fhir-token

Monitoring Integration

# Prometheus metrics configuration
METRICS_ENABLED=true
METRICS_PORT=9090

# Grafana dashboard provisioning
GRAFANA_API_KEY=your-grafana-api-key
GRAFANA_URL=https://grafana.yourdomain.com

Administration & Maintenance

System Monitoring

EdgeVision-Guard exposes Prometheus metrics at /metrics for monitoring:

Metric Description
edgevision_inference_requests_total Total number of inference requests
edgevision_inference_latency_seconds Histogram of inference latencies
edgevision_anomaly_detections_total Total number of anomalies detected
edgevision_false_positive_rate Estimated false positive rate
edgevision_model_version Current model version in use

Backup & Disaster Recovery

# Backup configuration and models
./scripts/backup.sh --output backup.tar.gz

# Restore from backup
./scripts/restore.sh --input backup.tar.gz

Model Management

# List available models
./scripts/model-manager.sh list

# Register new model
./scripts/model-manager.sh register --model-path models/new_model.onnx --version 1.2.0

# Switch active model
./scripts/model-manager.sh activate --version 1.2.0

Development & Customization

Environment Setup

# Create development environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -r requirements-dev.txt

# Install pre-commit hooks
pre-commit install

Code Quality & Testing

# Run linting
ruff check .

# Run tests with coverage
pytest tests/ --cov=src/ --cov-report=html

# Format code
black .

Custom Model Development

# Create custom model architecture
python src/model.py --custom-architecture config/custom_model.yaml

# Hyperparameter tuning
python src/hyperopt.py --config config/hyperparameter_space.yaml

Project Structure

EdgeVision-Guard/
├─ README.md                      # This file
├─ requirements.txt               # Production dependencies
├─ requirements-dev.txt           # Development dependencies
├─ data/                          # Data directory
│  └─ (download script populates)
├─ src/                           # Source code
│  ├─ __init__.py                 # Package initialization
│  ├─ data_ingest.py              # Dataset download and preprocessing
│  ├─ model.py                    # ML model architecture
│  ├─ train.py                    # Training pipeline
│  ├─ onnx_export.py              # Model export and optimization
│  ├─ inference_service/          # API service
│  │  ├─ __init__.py
│  │  ├─ app.py                   # FastAPI application
│  │  └─ utils.py                 # Utility functions
│  └─ dashboard/                  # User interface
│     ├─ __init__.py
│     ├─ app.py                   # Streamlit dashboard
│     └─ explainer.py             # Explainability visualizations
├─ docker/                        # Dockerfiles
│  ├─ Dockerfile                  # Cloud deployment (x86_64)
│  └─ Dockerfile.edge             # Edge deployment (arm64)
├─ deployment/                    # Deployment configurations
│  ├─ kubernetes/                 # K8s manifests
│  └─ edge/                       # Edge deployment scripts
├─ scripts/                       # Administration scripts
├─ .github/                       # CI/CD configuration
│  └─ workflows/
│     ├─ ci.yml                   # Continuous Integration
│     └─ cd.yml                   # Continuous Deployment
└─ tests/                         # Test suite
   └─ test_inference.py           # Inference tests

License

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

Acknowledgements


Developed by Muhammed Ibrahim Kartal | https://kartal.dev

About

A real-time intelligent surveillance system designed to detect human falls and anomalous behaviors using deep learning techniques. Includes automated alerting, a monitoring dashboard, and scalable deployment via Docker and Kubernetes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages