Advanced Real-Time AI Surveillance Dashboard for Defense
Jal-Drishti is a cutting-edge real-time surveillance system designed for underwater and high-stakes defense environments. It combines state-of-the-art computer vision models with a robust, low-latency dashboard to provide actionable intelligence.
The system features a Dual-Mode Architecture separating the core application logic (Backend) from the heavy AI computation (ML Engine), ensuring stability and responsiveness even under heavy load.
- 🔴 Safe Mode Monitoring: Real-time threat assessment with visual "Safe Mode" / "Threat" indicators.
- 📷 Information Enhancement: Uses FUnIE-GAN to clear up underwater/low-visibility footage in real-time.
- 🎯 Precise Detection: YOLOv8 integration for high-accuracy object detection.
- 📱 Multi-Source Support:
- Live Webcam
- Video Files (Simulation)
- RTSP Streams
- Phone Camera Streaming (continuously integrated)
- ⚡ High Performance:
- Decoupled ML Engine (GPU-optimized).
- WebSockets for real-time telemetry (<80ms latency targets).
- Graceful frame dropping and error recovery.
- 🖥️ Defense-Grade Dashboard: Dark-themed, high-contrast UI designed for long-duration monitoring with System Uptime, FPS, and Latency trackers.
- Framework: React 19 (Vite)
- Styling: Custom Defense-Grade CSS
- Communication: WebSocket (Native)
- Framework: FastAPI (Python)
- Role: WebSocket broadcaster, Frame Scheduler, System State Manager.
- Concurrency: AsyncIO
- Framework: FastAPI (Python)
- ML Libraries: PyTorch, OpenCV, NumPy
- Models: YOLOv8 (Detection), FUnIE-GAN (Enhancement)
- Hardware: GPU (CUDA) preferred, CPU fallback available.
jal-drishti/
├── backend/ # Application Logic & WebSocket Server
├── frontend/ # React-based Dashboard
├── ml-engine/ # Independent AI Service (YOLO + GAN)
├── data/ # Datasets and logs
├── config.yaml # Centralized System Configuration
└── README.md # This file
- Python 3.9+
- Node.js 18+
- [Optional] NVidia GPU with CUDA for ML acceleration.
The ML Engine handles all heavy AI inference.
cd ml-engine
# Create and activate virtual environment (optional but recommended)
python -m venv venv
# Windows:
venv\Scripts\activate
# Linux/Mac:
# source venv/bin/activate
pip install -r requirements.txt
python service.pyPort: 8001
The Backend coordinates streams and connects to the Frontend.
cd backend
# Create and activate virtual environment
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python -m uvicorn app.main:app --reload --port 9000Port: 9000
The Dashboard UI.
cd frontend
npm install
npm run devAccess at: http://localhost:5173
The system is highly configurable via config.yaml in the root directory. Key settings include:
device: Toggleuse_gpuandfp16_enabled.video: Switchsource_type(file/webcam/rtsp).performance: Adjusttarget_fpsandlatency_target_ms.confidence: Tune YOLO and Safe Mode thresholds.
The core of Jal-Drishti is a sophisticated Machine Learning pipeline designed to overcome the optical challenges of underwater vision (color absorption, haze, and low contrast).
Instead of relying on a single data source, the system processes two parallel streams for every frame:
- Stream A (Raw Sensor): Direct feed from the camera. Best for detecting Divers and objects in clear water where texture preservation is key.
- Stream B (AI-Enhanced): Processed through a Generative Adversarial Network (GAN) to restore color and remove haze. Best for detecting Mines and camouflaged threats.
Both streams are batched together for inference, ensuring real-time performance (Batch Inference) without doubling the latency.
The enhancement module transforms degraded underwater frames into clear, detector-friendly images:
- FUnIE-GAN: A Fast Underwater Image Enhancement GAN that corrects color balance (restoring red channels) and removes haze.
- CLAHE: Contrast Limited Adaptive Histogram Equalization is applied post-GAN to recover local texture details that might be smoothed out by the generator.
We use a custom-trained YOLOv8-Nano model for high-speed detection.
- Classes:
0: Mine (Naval Mines)1: Diver (Human presence)2: Drone (ROVs/AUVs)3: Submarine (Manned submersibles)
- Performance: Optimized with FP16 (Half-Precision) inference on CUDA devices.
The system doesn't just trust the model blindly. It employs "Gatekeeper" logic to minimize false positives:
Different threats carry different risks. We apply strict confidence cutoffs:
- Diver (> 55%): High threshold to prevent "Ghost Divers" (fish misclassified as humans).
- Mine / Submarine (> 40%): Balanced sensitivity.
- Drone (> 15%): Lower threshold to catch small, faint signatures of distant ROVs.
Standard Non-Maximum Suppression (NMS) creates conflicts. Our Smart NMS resolves them semantically:
- The Rule: If a Diver and a Submarine are detected in the same location (High IoU), the system prioritizes the Diver and removes the Submarine detection.
- Reasoning: Large ROVs or background noise often look like subs, but detecting a human is critical safety info.
The engine determines the overall threat level based on detection confidence:
- 🔴 CONFIRMED THREAT: High confidence detection.
- 🟡 POTENTIAL ANOMALY: Moderate confidence detection.
- 🟢 SAFE MODE: No significant anomalies detected.
To use your phone as a camera source:
- Ensure your phone and PC are on the same network.
- Navigate to the Mobile Stream page (URL displayed in dashboard or
http://<YOUR_PC_IP>:9000/mobile). - Update
config.yamlor environment variables to accept external streams.
- Fork the repository
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Jal-Drishti: Seeing the unseen.