π‘οΈ An end-to-end AI surveillance pipeline that processes surveillance footage, detects threats using YOLOv8, scores behavioural anomalies, prioritises operational alerts, and surfaces everything in a Streamlit command dashboard β with optional Azure cloud integration throughout.
Custom YOLOv8 Model (v2 Balanced): 7 classes Β· mAP50 47.8% Β· mAP50-95 28.5% Β· 114.7ms/frame CPU inference
Click to expand full contents
- π― Overview
- π¨ Problem Statement
- π§ Key Features
- ποΈ System Architecture
- π How It Works
- βοΈ Tech Stack
- π Project Structure
βΆοΈ Quick Start β Evaluator Guide- βοΈ Azure Integration
- π§ Alert System
- π Dashboard
- π§© Key Modules
- π§ͺ Sample Output & Results
- π§Ύ Testing
- π Future Improvements
- π Academic Context
- π¨βπ» Author
- π License
Border surveillance environments generate large volumes of visual data that are difficult to monitor continuously by hand. This project automates that entire workflow end-to-end.
Traditional Monitoring Border Surveillance AI
ββββββββββββββββββββββ ββββββββββββββββββββββ
ποΈ 1 operator, many cameras π€ AI processes all feeds 24/7
β³ Slow, delayed human reaction β‘ Sub-second anomaly detection
β Alert fatigue from false alarms β
Priority-filtered notifications
π Isolated logs, manual reports βοΈ Centralised Azure cloud storage
π No trend or pattern insights π Streamlit operational dashboard
The system accepts a video file or live camera feed, extracts and analyses every frame, assigns anomaly scores, generates prioritised alerts, logs everything locally and optionally to Azure, and makes it all readable through an auto-refreshing dashboard.
Domain: Border Defence and Surveillance β GTU Internship 2026
| Challenge | Real-World Impact |
|---|---|
| Large-scale monitoring | Vast border areas exceed human monitoring capacity |
| Delayed threat detection | Manual analysis causes late identification of intrusions |
| High false-alarm rates | Animals, weather, and noise trigger unnecessary responses |
| Resource constraints | Limited manpower must cover extensive remote regions |
| Siloed data | Sensor, camera, and historical data never integrated |
This system addresses all five through automated AI detection, cloud integration, and confidence-filtered smart alerting.
|
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β INPUT LAYER β
β πΉ Video File OR π₯ Live Camera Index β OpenCV frame reader β
ββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PREPROCESSING β
β Resize (640Γ640) β Normalize β Optional Optical Flow (motion score) β
β β structured frame_item dicts passed downstream β
ββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OBJECT DETECTION [src/detector.py] β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Custom YOLOv8n (border_v2_balanced) β 30 epochs, 7 classes β β
β β Detects β person β vehicle β crowd β military_vehicle β aircraft β β
β β ship β suspicious_object β β
β β Output β class Β· confidence Β· bbox Β· threat_tag Β· flags β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββ
β β β
βββββββββββββββββββββββ ββββββββββββββββββββββββ ββββββββββββββββββββββββββ
β πΊοΈ ZONE ANALYSIS β β β±οΈ TEMPORAL ANALYSIS β β π§ ANOMALY DETECTION β
β [zone_analyzer.py] β β[temporal_analyzer.py] β β [anomaly.py] β
β β β β β β
β β’ 3 border zones β β β’ IoU object tracker β β β’ Isolation Forest β
β β’ Intrusion detect β β β’ Approach trajectoryβ β β’ Random Forest β
β β’ Night boost β β β’ Crowd buildup β β β’ Rule-based fallback β
β β’ Risk scoring β β β’ Loitering detect β β β’ 10-dim features β
β β β β’ Coordinated move β β β
ββββββββββ¬βββββββββββββ ββββββββββββ¬ββββββββββββ βββββββββββββ¬βββββββββββββ
ββββββββββββββββ¬βββββββββββ β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ALERT MANAGEMENT [src/alert_manager.py] β
β β
β Zone + Temporal + Anomaly β π΄ CRITICAL β π HIGH β π‘ MED β π’ LOW β
β Rolling JSON log β Cooldown dedup β SendGrid email notifications β
β Azure Cosmos DB write (if configured) β
ββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OUTPUT LAYER + AZURE + DASHBOARD β
β β
β π data/alerts/alert_log.json ποΈ Azure Cosmos DB (alerts) β
β π data/results/session_*.json π¦ Azure Blob Storage (sessions) β
β πΌοΈ data/detections/frame_*.jpg π enhanced_analysis.json β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β π Streamlit Dashboard (dashboard/app.py) β β
β β Alert feed β Priority chart β Session summaries β Trend lines β β
β β Anomaly overview β Manual notify β Auto-refresh β Threat Map β β
β β πΊοΈ Enhanced Analysis: Zone map β Temporal alerts β Tracking β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The pipeline accepts either a video file path or a live camera index. Frames are loaded through OpenCV, resized to 640Γ640, and optionally passed through an optical flow computation that estimates per-frame motion intensity. Each frame becomes a structured frame_item dictionary passed to downstream modules.
BorderDetector loads the YOLOv8 model once and reuses it across all frames. Each frame produces a list of structured detections with class name, confidence score, bounding box coordinates, normalised spatial features, per-class threat tags, and has_high / has_critical flags for fast downstream filtering.
AnomalyDetector operates in two phases. The first 30 frames (default) build a normal baseline. Every subsequent frame is scored using Isolation Forest against these behavioural features:
| Feature | Description |
|---|---|
detection_count |
Total objects detected in the frame |
class_diversity |
Number of unique detected classes |
confidence_stats |
Mean and max detection confidence |
critical_class_count |
Count of high-threat class detections |
location_distribution |
Spatial spread of detected objects |
object_size |
Average bounding box area |
motion_score |
Optical-flow estimated motion intensity |
suspicious_presence |
Binary flag for suspicious class in frame |
Frames are classified as normal, high, or critical with human-readable anomaly reasons attached. A Random Forest Classifier trained from anomaly labels provides supervised threat classification alongside the unsupervised Isolation Forest.
ZoneAnalyzer divides the camera field of view into three configurable zones β Border (RESTRICTED), Buffer (HIGH), and Observation (MEDIUM). Every detection's normalised centre coordinate is tested against zone polygons using ray-casting. Detections of high-threat classes (person, military_vehicle, suspicious_object) in the RESTRICTED zone trigger immediate CRITICAL alerts. A night activity boost multiplies zone risk during 21:00β05:00 hours.
TemporalAnalyzer maintains a sliding window of the last 30 frames and analyses detection patterns across time. It tracks objects across frames using lightweight IoU matching and runs five temporal detectors:
| Detector | What It Catches | Severity |
|---|---|---|
| β‘ Sudden Appearance | Empty scene β 5+ new detections | HIGH |
| π₯ Crowd Buildup | Gradual increase in person count | HIGH |
| πΆ Loitering | Object stationary in one spot for 10+ frames | MEDIUM |
| Objects moving toward the border zone | CRITICAL | |
| π Coordinated Movement | 3+ objects moving in the same direction | HIGH |
AlertManager merges anomaly scores, zone violations, and temporal alerts into unified priority levels. Zone intrusions and approach trajectories can upgrade alert severity beyond what anomaly scoring alone would assign. HIGH and CRITICAL alerts trigger email notifications subject to a configurable cooldown window. Every non-normal alert is appended to the rolling JSON log. Alert records are optionally written to Azure Cosmos DB.
Session summaries are saved as timestamped JSON files. The enhanced pipeline additionally writes enhanced_analysis.json with per-frame zone risk, temporal risk, and object tracking data for the dashboard. When Azure credentials are present, session results are uploaded to Blob Storage and alerts are written to Cosmos DB. The Streamlit dashboard reads local output files directly and auto-refreshes to show the latest operational state.
| Layer | Technology | Role |
|---|---|---|
| Language | Python 3.9+ | Core runtime |
| Object Detection | YOLOv8 (Ultralytics) | Real-time frame inference |
| Deep Learning | PyTorch 2.x | Model backend |
| Computer Vision | OpenCV 4.x | Video I/O, frame processing, optical flow |
| Anomaly Detection | scikit-learn (Isolation Forest + Random Forest) | Unsupervised anomaly scoring + supervised threat classification |
| Zone Analysis | NumPy (ray-casting PIP) | Spatial intrusion detection across border zones |
| Temporal Analysis | NumPy + IoU tracker | Multi-frame pattern detection and object tracking |
| Data | NumPy, Pandas | Feature arrays and session analytics |
| Dashboard | Streamlit + Plotly | Operational monitoring UI |
| Alerting | SendGrid | Email notifications |
| Cloud Storage | Azure Blob Storage SDK | Session result uploads |
| Cloud Database | Azure Cosmos DB SDK | Alert persistence |
| Testing | pytest + pytest-cov | Automated validation |
| Environment | python-dotenv | Credential management |
Border Surveillance Project/
β
βββ π src/ # Core application modules
β βββ pipeline.py # Main pipeline with zone + temporal intelligence
β βββ detector.py # YOLOv8 wrapper + structured detections
β βββ anomaly.py # Dual ML: Isolation Forest + Random Forest scoring
β βββ zone_analyzer.py # Zone-based intrusion detection (3 border zones)
β βββ temporal_analyzer.py # Multi-frame temporal video analysis + IoU tracker
β βββ alert_manager.py # Priority assignment, logging, email, cooldown
β βββ azure_client.py # Blob Storage + Cosmos DB integration
β
βββ π dashboard/
β βββ app.py # Streamlit command-centre dashboard (main page)
β βββ pages/
β β βββ 1_πΊοΈ_Enhanced_Analysis.py # Zone + temporal analysis dashboard page
β βββ Border Defence AI logo.png # Project branding asset
β
βββ π scripts/ # Utility and dataset preparation scripts
β βββ pilot.py # Manual integration checker across all modules
β βββ smoke_test.py # Quick pipeline smoke test
β βββ preprocess_all_datasets.py # Full dataset preprocessing
β βββ preprocess_balanced_v2.py # Local dataset preprocessing
β βββ xview_geojson_to_yolo.py # xView GeoJSON β YOLO labels
β βββ smart_extract.py # Intelligent frame extractor
β
βββ π data/ # Runtime data (gitignored β not in repo)
β βββ alerts/ # alert_log.json β rolling alert output
β βββ results/ # session_*.json + enhanced_analysis.json
β βββ test_videos/ # Sample videos for local runs
β βββ processed/ # Preprocessed training-ready data (7 classes)
β βββ annotations/ # Dataset annotation files
β βββ raw/ # Source datasets (DOTA, xView, Visdrone)
β βββ logs/ # Pipeline runtime logs
β
βββ π tests/ # Automated test suite (285 tests)
β βββ test_detector.py
β βββ test_anomaly_and_alert.py
β βββ test_pipeline.py
β βββ test_zone_analyzer.py # 23 tests β zone intrusion detection
β βββ test_temporal_analyzer.py # 28 tests β temporal pattern detection
β
βββ π models/ # YOLO weights + anomaly model artefacts
βββ π notebooks/ # ppt and Report
βββ π docs/ # Architecture diagrams + presentations
βββ π overview/ # Implementation guide and references
β
βββ π models/ # Trained model artefacts (committed to repo)
β βββ border_yolo.pt # Custom-trained YOLOv8 border detection model (~6 MB)
β βββ anomaly_model.pkl # Trained Isolation Forest anomaly detector (751 KB)
β
βββ yolov8n.pt # YOLOv8 nano base weights (fallback)
βββ yolov8s.pt # YOLOv8 small base weights (fallback)
βββ requirements.txt # All Python dependencies
βββ pyproject.toml # Project metadata
βββ pytest.ini # Test runner configuration
βββ makefile # Common task shortcuts
βββ .env # Local credentials (never committed)
βββ .gitignore # Excludes data/, venv/, .env
βββ README.md # This file
β±οΈ Estimated setup time: ~5 minutes. Follow these six steps in order and the system will run end-to-end from video input to a live dashboard.
git clone https://github.com/jainilgupta02/Border-Surveillance-Project.git
cd "Border-Surveillance-Project"python -m venv venv
# Linux / macOS
source venv/bin/activate
# Windows PowerShell
venv\Scripts\Activate.ps1
# Windows CMD
venv\Scripts\activate.batpip install --upgrade pip
pip install -r requirements.txtπ‘ Dependencies installed. Now verify your trained models are present before running.
After cloning, confirm the models/ folder contains both trained artefacts:
models/
βββ border_yolo.pt β Custom-trained YOLOv8 border detection model (~22 MB)
βββ anomaly_model.pkl β Trained Isolation Forest anomaly detector (99 KB)
β Both files are committed directly to the repository β no separate download needed. The pipeline loads
models/border_yolo.ptfor detection andmodels/anomaly_model.pklfor anomaly scoring automatically. Ifborder_yolo.ptis missing, the pipeline falls back gracefully toyolov8n.pt(base YOLO weights in repo root).
Create a .env file in the project root. Azure and SendGrid fields are optional β leave them blank to run the system in fully local mode.
# ββ Azure Storage ββββββββββββββββββββββββββββββββββ
AZURE_STORAGE_CONNECTION_STRING=
AZURE_STORAGE_CONTAINER_ALERTS=alert-frames
AZURE_STORAGE_CONTAINER_RESULTS=session-results
# ββ Azure Cosmos DB ββββββββββββββββββββββββββββββββ
AZURE_COSMOS_ENDPOINT=
AZURE_COSMOS_KEY=
AZURE_COSMOS_DATABASE=SurveillanceDB
AZURE_COSMOS_CONTAINER=Alerts
# ββ Email Alerts (SendGrid) ββββββββββββββββββββββββ
SENDGRID_API_KEY=
ALERT_FROM_EMAIL=
ALERT_TO_EMAIL=
# ββ Email Alerts (SMTP fallback) βββββββββββββββββββ
SMTP_USER=
SMTP_APP_PASSWORD=
# ββ Dashboard (only if running outside project root)
DATA_ROOT=β The full pipeline β detection, anomaly scoring, alerts, dashboard β works entirely without cloud credentials. All outputs are saved locally.
Recommended evaluation command:
python src/pipeline.py --video data/test_videos/dota_aerial_test.mp4 --save-framesWith additional controls:
python src/pipeline.py \
--video data/test_videos/dota_aerial_test.mp4 \
--frame-skip 3 \
--save-frames \
--temporal-window 30 \
--results-dir data/results \
--annotated-dir data/detectionsLive camera mode:
python src/pipeline.py --camera 0Expected terminal output (enhanced pipeline):
β
Preprocessing complete β frames extracted and resized to 640Γ640
β
Detection complete β structured detections logged per frame
β
Zone analysis complete β intrusion detection across 3 border zones
β
Temporal analysis done β object tracking + 5 temporal detectors
β
Anomaly scoring complete β Isolation Forest + Random Forest scored all frames
β
Alerts generated β zone + temporal + anomaly priority levels assigned
β
Session saved β data/results/enhanced_session_<source>_<timestamp>.json
β
Alert log written β data/alerts/alert_log.json
β
Enhanced log written β data/results/enhanced_analysis.json
streamlit run dashboard/app.pyOpen your browser at http://localhost:8501 to see the live operational command-centre view.
# All tests with verbose output
pytest tests -v
# With HTML coverage report
pytest tests --cov=src --cov-report=html
# Report opens at: htmlcov/index.html| Command | Purpose |
|---|---|
python src/pipeline.py --video <path> |
Full pipeline with zone + temporal intelligence |
python scripts/main.py |
Minimal single-video detector demo |
python scripts/pilot.py data/test_videos/dota_aerial_test.mp4 |
Manual integration check across all modules |
python scripts/smoke_test.py |
Fast pipeline smoke test |
python scripts/generate_test_video.py |
Generate a synthetic test video if none is present |
When credentials are present in .env, two cloud paths activate automatically β no code changes required.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Azure Services Used β
β β
β π¦ Blob Storage β session result JSON files uploaded per run β
β Container: session-results β
β β
β ποΈ Cosmos DB β individual alert documents written per event β
β Database: SurveillanceDB β
β Container: Alerts β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
If Azure credentials are missing or invalid, the system falls back silently to local-only mode. No errors are raised and the pipeline continues normally.
Data stored in Azure per run:
- Session result summary (
session_<source>_<timestamp>.json) β Blob Storage - Per-alert records with priority, anomaly score, detection count, motion score, and reasons β Cosmos DB
The alerting layer is designed for operational triage, not raw event dumping.
| Priority | Trigger Condition | Notification Behaviour |
|---|---|---|
| π΄ CRITICAL | Highest-severity anomaly + critical class detection | Email sent immediately |
| π HIGH | Significant anomaly score or critical class flag | Email sent (cooldown applies) |
| π‘ MEDIUM | Lower anomaly score or motion-based escalation | Written to log only |
| π’ LOW | Normal or near-normal activity | Written to log only |
- All non-normal alerts are appended to
data/alerts/alert_log.json - HIGH and CRITICAL alerts trigger SendGrid email when
SENDGRID_API_KEYis configured - A cooldown window suppresses repeated notifications for the same ongoing threat pattern
- Manual notification can be triggered at any time directly from the Streamlit dashboard
The dashboard uses Streamlit's multi-page layout. Run streamlit run dashboard/app.py β all pages appear in the sidebar automatically.
| Panel | What You See |
|---|---|
| π Recent Alerts | Sortable feed of latest alerts with colour-coded priority badges |
| π₯§ Priority Distribution | Pie and bar chart breakdown of CRITICAL / HIGH / MEDIUM / LOW |
| π Anomaly Trend | Score-over-time chart for the most recent session |
| π¦ Session Summaries | Per-run statistics read from data/results/session_*.json |
| π Detection Activity | Detection count and class distribution trends |
| π Threat Heatmap | Geographic threat map of Indian border zones (Plotly Mapbox) |
| π Notification Status | SendGrid readiness indicator + manual email trigger button |
| Panel | What You See |
|---|---|
| π Risk Score Timeline | Zone risk + temporal risk over time (dual chart) |
| πΊοΈ Zone Violations | Bar chart of intrusions per zone (border / buffer / observation) |
| β±οΈ Temporal Alert Types | Donut chart of 5 temporal detector categories |
| πΊοΈ Zone Severity Heatmap | Frame-by-frame zone severity scatter plot |
| π― Object Tracking | Active tracked objects over time |
| π Detection Trend | Rolling detection count slope (positive = increasing activity) |
Primary data inputs:
data/alerts/alert_log.json
data/results/session_*.json
data/results/enhanced_analysis.json β zone + temporal data from enhanced pipeline
data/detections/anomaly_summary.json β optional
If no live pipeline output is present, both dashboard pages automatically fall back to demo data so the interface always remains fully functional and reviewable.
Main orchestration layer with zone + temporal intelligence. Connects preprocessing β detection β zone analysis β temporal analysis β anomaly scoring β alert management in a single runtime session. Adds zone intrusion detection and temporal video analysis as parallel processing stages alongside anomaly scoring. Accepts CLI arguments including --temporal-window, --no-zones, and --no-temporal flags. Saves session summaries and optionally annotated frames, then uploads to Azure when configured.
YOLOv8 wrapper. Loads the custom-trained border_yolo.pt model once per session and reuses it across all frames. Converts raw model output into structured Detection objects carrying class, confidence, bbox, threat tags, and frame-level has_high / has_critical flags.
Dual ML pipeline: Isolation Forest for unsupervised anomaly scoring and Random Forest Classifier for supervised threat classification. Baseline collected from the first 30 frames, then live scoring on 10-dimensional behavioural features. Produces interpretable anomaly reasons and severity classifications attached to each scored frame result.
Spatial intelligence layer. Defines three configurable border surveillance zones (RESTRICTED, BUFFER, OBSERVATION) as normalised polygons. Every detection is tested against zone boundaries using ray-casting point-in-polygon. High-threat classes in restricted zones trigger immediate CRITICAL alerts. Supports night activity boosting and composite risk scoring.
Multi-frame video analysis engine. Maintains a sliding window of recent frames and runs five temporal detectors: sudden appearance, crowd buildup, loitering, approach trajectory, and coordinated movement. Includes a lightweight IoU-based object tracker that associates detections across frames without GPU dependency.
Priority assignment from anomaly level, zone violations, and temporal alerts. Maintains the rolling JSON alert log with append-only writes. Sends SendGrid notifications for HIGH+ events within cooldown constraints. Writes alert records to Cosmos DB via azure_client.
Lazy initialisation β Azure clients are created only when valid credentials are present. Uploads session JSON files to Blob Storage. Writes alert documents to Cosmos DB. Falls back gracefully to a no-op if Azure is unavailable, with no pipeline interruption.
Main dashboard page. Reads alert_log.json and session_*.json from local data/ directories. Auto-refreshes on a configurable interval. Renders alert feed, priority charts, session summaries, anomaly trend, geographic threat heatmap, and manual notification control.
Enhanced analysis dashboard page (auto-detected by Streamlit multi-page system). Visualises zone intrusion data, temporal alert breakdowns, risk score timelines, object tracking counts, and detection trends. Falls back to demo data when no enhanced pipeline output is present.
| Class | Images | Instances | Precision | Recall | mAP50 | mAP50-95 |
|---|---|---|---|---|---|---|
| All | 1685 | 30195 | 0.701 | 0.457 | 0.478 | 0.285 |
| person | 603 | 10387 | 0.463 | 0.283 | 0.293 | 0.096 |
| vehicle | 999 | 8170 | 0.327 | 0.398 | 0.270 | 0.155 |
| crowd | 24 | 149 | 0.713 | 0.367 | 0.483 | 0.197 |
| military_vehicle | 4 | 8 | 1.000 | 0.000 | 0.000 | 0.000 |
| aircraft | 425 | 2353 | 0.831 | 0.622 | 0.668 | 0.479 |
| ship | 527 | 8169 | 0.780 | 0.821 | 0.870 | 0.561 |
| suspicious_object | 116 | 959 | 0.791 | 0.706 | 0.763 | 0.505 |
Training config: YOLOv8n Β· 30 epochs Β· 640Γ640 Β· CPU (12th Gen Intel i5-12350U) Β· Balanced v2 dataset (DOTA + xView + Visdrone) Inference speed: 1.4ms preprocess Β· 114.7ms inference Β· 1.4ms postprocess per image
Example alert record written to data/alerts/alert_log.json:
{
"alert_id": "alert_1712312345678",
"frame_id": 42,
"priority": "CRITICAL",
"alert_level": "critical",
"anomaly_score": -0.1042,
"detection_count": 7,
"motion_score": 10.4,
"reasons": [
"person (85%) detected in Border Zone (Restricted) [HIGH THREAT]",
"Border approach detected: 2 object(s) moving toward border zone",
"crowd gathering detected"
],
"notified": true
}Example enhanced session summary:
{
"source": "dota_aerial_test.mp4",
"pipeline_type": "enhanced",
"total_frames": 124,
"frames_scored": 94,
"total_detections": 2351,
"alerts_raised": 38,
"zone_analysis_enabled": true,
"total_zone_violations": 34,
"zone_critical_count": 8,
"temporal_analysis_enabled": true,
"total_temporal_alerts": 12,
"temporal_approach_count": 2,
"avg_inference_ms": 114.7,
"avg_zone_ms": 0.8,
"avg_temporal_ms": 1.2
}Typical output file set after an enhanced pipeline run:
data/alerts/alert_log.json
data/results/enhanced_session_<source>_<timestamp>.json
data/results/enhanced_analysis.json β zone + temporal data for dashboard
data/detections/frame_000042.jpg β if --save-frames enabled
data/logs/pipeline.log
runs/detect/ β YOLO inference artefacts
The project includes an automated test suite covering all major runtime modules.
# Run full suite with verbose output
pytest tests -v
# Run with HTML coverage report
pytest tests --cov=src --cov-report=html
# Open: htmlcov/index.html in your browser
# Run individual test files
pytest tests/test_detector.py -v
pytest tests/test_anomaly_and_alert.py -v
pytest tests/test_pipeline.py -v
pytest tests/test_zone_analyzer.py -v
pytest tests/test_temporal_analyzer.py -v| Test File | Tests | Coverage Area |
|---|---|---|
test_detector.py |
β | YOLOv8 model loading, inference execution, structured detection output format |
test_anomaly_and_alert.py |
β | Baseline learning, Isolation Forest scoring, priority assignment logic, alert log writes |
test_pipeline.py |
β | End-to-end orchestration, output file creation, inter-module integration |
test_zone_analyzer.py |
23 | Point-in-polygon, zone violation detection, risk scoring, custom zone configs |
test_temporal_analyzer.py |
28 | IoU tracking, sudden appearance, crowd buildup, loitering, approach trajectory |
Custom YOLOv8 fine-tuning on annotated border-specific datasetsβ Completed β custom model trained on balanced v2 dataset (DOTA + xView + Visdrone)Zone-based intrusion detectionβ Completed β 3-zone spatial intelligence with night boostMulti-frame temporal analysisβ Completed β 5 temporal detectors + IoU object trackingRandom Forest threat classifierβ Completed β dual ML pipeline alongside Isolation ForestGeographic threat heatmapβ Completed β Plotly Mapbox Indian border zone visualisation- Stronger model and version tracking for reproducible production deployments
- REST API layer to expose pipeline controls programmatically
- Alert frame thumbnails with direct Azure Blob links embedded in dashboard views
- Automated CI/CD deployment profiles for staging and production environments
- Multi-camera ingestion with centralised alert aggregation across feeds
- Real-time streaming support via RTSP or WebRTC camera feeds
- DeepSORT or ByteTrack integration for production-grade multi-object tracking
| Field | Detail |
|---|---|
| Program | Microsoft Elevate β GTU Internship 2026 |
| Powered By | Edunet Foundation & FICE Education |
| College | SAL Institute of Technology and Engineering Research |
| Department | Information & Communication Technology (ICT) |
| Semester | 8th Semester |
| Duration | January 2026 β April 2026 (12 weeks Β· 420 hours) |
| Problem Domain | Border Defence and Surveillance (GTU) |
GTU domain requirements fulfilled by this project:
- β EDA on surveillance and sensor datasets
- β Anomaly detection model to identify unusual activity patterns (Isolation Forest + Random Forest dual pipeline)
- β ML/DL object classification of movement patterns using custom-trained YOLOv8 (7 border-specific classes)
- β Alert prioritisation system with zone intrusion, temporal analysis, and anomaly scoring
- β Cloud-based data integration using Microsoft Azure (Blob Storage + Cosmos DB)
- β Spatial intelligence β zone-based intrusion detection with configurable border zones
- β Video-level temporal intelligence β multi-frame tracking, loitering detection, approach trajectory analysis
| Field | Detail |
|---|---|
| Name | Jainil Gupta (Jay Gupta) |
| Role | Solo Developer β ML Engineer Β· Cloud Architect Β· System Designer |
| Enrollment | 220670132018 |
| @jainilgupta | |
| Internal Guide | Prof. Chintan Rana |
| External Guide | Adarsh Gupta |
This project is distributed under the MIT License β see LICENSE for full details.