DIU ExamGuard is a cutting-edge, real-time, AI-powered examination monitoring and local invigilation suite custom-built for Daffodil International University (DIU). Engineered to enhance academic integrity, this application acts as an intelligent digital assistant for human proctors, combining client-side real-time Computer Vision (TensorFlow.js COCO-SSD) with state-of-the-art server-proxied AI reasoning via Gemini 3.5 Flash.
Developed by team DIU MISSION IMPOSSIBLE, this setup runs as a highly performant full-stack Node.js server, empowering exam halls with immediate phone detection, gaze-tracking telemetric telemetry, and automatic evidence snapshot archiving.
1. Unified Computer Vision Pipeline (Edge Execution)
Object Detection (TF.js & COCO-SSD): Local neural execution checks current webcam frames at up to 30 FPS. Deeply identifies mobile phones (representing YOLOv8 class 63).
Pose & Gaze Analytics: Nose-to-eyes skin cluster tracking calculates horizontally smoothed head yaw rotation (θ=[r−0.5]×180∘).
Glances Left: Threshold warning triggers when θ<−45∘.
Glances Right: Threshold warning triggers when θ>+45∘.
Looking Back: Highly critical flag triggers if horizontal head deflection reaches ±70∘.
Frequent Head Movements Monitor: Automatically tracks frequency of glances within a rolling 10-second sliding time-frame. Alerts if head oscillations exceed 4 cycles to detect suspicious search maneuvers.
Prolonged Side-View Lock: Tracks sustained glancing left or right for more than 3 consecutive seconds, isolating peer-collaboration activity.
2. High-Fidelity Proctor Interface & Console
Active Overlays Canvas: Highlights face bounding regions, real-time horizontal calibration lasers, gaze vectors, and status labels directly mapped to the video viewport.
Adaptive Integrity Rating Meter: Starts at a default of 100% and drops dynamically upon verified infractions (Phones drops rating by -35 index, Look warnings drop by -10).
Evidence Snapshots Gallery: Automatically captures and catalogues high-definition webcam frames representing the violation. Pre-computes yaw angles and confidence ratings, allowing proctors to download reports or inspect snapshot details.
Chronological Security Logs: Review ongoing infractions, search logs by category description, or manual dismiss/resolve statuses to control false positives.
3. Integrated Gemini Co-Pilot
Interactive Compliance Bot: Dedicated server-side Gemini 3.5 Assistant that answers university exam regulations, rules explanations, or troubleshooting directions.
Brief Generator: Autonomously translates logged visual telemetry into a professionally structures university disciplinary brief (PDF generation via jsPDF with markdown notes).
/
├── server.ts # Full-stack Node.js server (serves Express endpoints & hosts Vite middleware)
├── package.json # Application scripts, build commands & dependencies metadata
├── tsconfig.json # Strict TypeScript compiler options Configuration
├── vite.config.ts # Vite bundler options, plugins & absolute path aliases
├── alerts_db.json # High-speed file-based SQLite emulation DB (snapshots, confidence, angles)
├── .env.example # Secure template environment declarations (ex: GEMINI_API_KEY)
└── src/
├── main.tsx # React virtual tree bootstrap
├── App.tsx # Central layout orchestrator (brings components together)
├── index.css # Global Tailwind CSS variables & custom color themes
├── types.ts # Unified TypeScript definitions (DIUStudent, AlertEvent, SessionStats)
└── components/
├── TeamBox.tsx # Meet team "DIU MISSION IMPOSSIBLE" developer profiles panel
├── WebcamFeed.tsx # Handles video capture (webcam / local upload), skin vectors & TF.js
├── StatsCards.tsx # Renders real-time integrity progress bars, timers & telemetry indicators
├── EventLog.tsx # High-Fidelity Chronological table of captured academic infractions
├── EvidenceGallery.tsx # Image snapshot card desk with full scale interactive inspectors
└── AIProctorBot.tsx # Dedicated Gemini chatbot interface & pdf brief compiler
📐 Architecture & Design Flow:
┌────────────────────────────────┐
│ Examiner's Live Video │
│ (Webcam or MP4 Upload) │
└───────────────┬────────────────┘
│
▼
┌──────────────────────────────────────────┐
│ Client browser (React + HTML5) │
│ │
│ Skin region segmenter & Face centroid │
│ Calculates Head Yaw Orientation Vector │
│ │
│ TensorFlow.js COCO-SSD local executor │
│ Object Classifier seeks phone / book │
└─────────────────────┬────────────────────┘
│
│ Log events & base64 Snapshots
▼
┌────────────────────────────────────────────┐
│ Full-stack Express.js Backend │
│ │
│ Writes metrics into high-speed SQLite │
│ emulation (JSON persistence engine) │
│ │
│ API routes serve security log queries │
└──────────────────────┬─────────────────────┘
│
▼
┌────────────────────────────────────────────┐
│ Google Gemini 3.5 Flash API │
│ │
│ Analyzes transaction records and head- │
│ tracking anomalies to draft official │
│ DIU investigation reports & answers Qs │
└────────────────────────────────────────────┘
Pull requests and suggestions for improvement are welcome! Please fork this repository or share feedback to help extend this basic hotel management tool.
This project is open-source and available under the MIT License.