A final year engineering project that continuously verifies user identity every second using three behavioral biometric signals — silently, in the background, without interrupting normal workflow.
Built by **Divya Powar
Traditional authentication (passwords, fingerprint) verifies identity only once at login. After that, anyone can use the active session undetected. This system re-verifies the user every second throughout the entire session.
Three ML models run simultaneously in the background:
| Modality | Model | Features | Weight |
|---|---|---|---|
| 👤 Face Recognition | FaceNet (InceptionResnetV1) | 512-d cosine similarity | 50% |
| ⌨️ Keystroke Dynamics | LSTM Autoencoder | Dwell, flight, digraph time | 30% |
| 🖱️ Mouse Dynamics | GRU Autoencoder | Speed, angle, curvature, acceleration | 20% |
All three scores are fused into one confidence score: fusion = 0.5 × face + 0.3 × keystroke + 0.2 × mouse
- Score ≥ 0.55 → ✅ Authenticated
- Score 0.40–0.55 →
⚠️ Warning - Score < 0.40 → 🚨 Alert triggered
Chrome Extension (content.js) Desktop Agent (agent.py) User Portal keystrokes + mouse capture webcam @ 1fps registration wizard ↓ ↓ ↓ background.js (WebSocket) JPEG base64 POST REST API calls ↓ ↓ ↓ ╔══════════════════════════════════════════════════════════════╗ ║ FastAPI Backend (localhost:8000) ║ ║ Auth Router │ Register Router │ Admin Router │ WebSocket Hub ║ ║ SessionService │ AlertService │ DataStore │ FusionEngine ║ ╚══════════════════════════════════════════════════════════════╝ ↓ ↓ ↓ FaceNet LSTM model GRU model (face_model.py) (keystroke_model.py) (mouse_model.py) ↓ ↓ ↓ SQLite DB Per-user model files Admin Portal (auth.db) (.h5, .npy, .pkl) (React, port 5173)
Backend
- Python 3.10.11
- FastAPI + Uvicorn (REST + WebSocket)
- SQLAlchemy + SQLite
Machine Learning
- facenet-pytorch (FaceNet + MTCNN)
- TensorFlow / Keras (LSTM + GRU Autoencoders)
- PyTorch, OpenCV, scikit-learn, NumPy
Frontend
- React 18 + Vite
- React Router DOM v6
- Axios, Lucide React
Browser Extension
- Chrome Manifest V3
- Service Worker + Content Script
continuous-auth/ ├── backend/ │ ├── app/ │ │ ├── main.py ← FastAPI app entry │ │ ├── models.py ← DB table definitions │ │ ├── schemas.py ← Pydantic validators │ │ ├── websocket.py ← WebSocket hub │ │ ├── routers/ │ │ │ ├── auth.py ← Live auth endpoints │ │ │ ├── register.py ← Registration endpoints │ │ │ └── admin.py ← Admin endpoints │ │ ├── ml/ │ │ │ ├── face_model.py ← FaceNet pipeline │ │ │ ├── keystroke_model.py ← LSTM autoencoder │ │ │ ├── mouse_model.py ← GRU autoencoder │ │ │ └── fusion.py ← Score fusion engine │ │ └── services/ │ │ ├── data_store.py ← File I/O │ │ ├── session.py ← Session management │ │ └── alerts.py ← Alert management │ ├── data/users/{username}/ ← Per-user models + data │ ├── db/auth.db ← SQLite database │ ├── register_face.py ← Face capture script │ ├── collect_keystrokes.py ← Keystroke capture script │ ├── collect_mouse.py ← Mouse capture script │ └── run.py ← Start backend server ├── desktop-agent/ │ └── agent.py ← Webcam monitoring agent ├── extension/ │ ├── manifest.json ← Chrome MV3 config │ ├── popup/ ← Extension UI │ ├── content/content.js ← Behavioral capture │ └── background/background.js ← Service worker ├── admin-portal/ │ └── src/ │ ├── user/ ← Registration + guide │ └── admin/ ← Dashboard + management └── START_ALL.bat ← One-click startup
- Python 3.10.11
- Node.js 20.x
- Google Chrome browser
git clone https://github.com/yourusername/continuous-auth.git
cd continuous-authcd backend
python -m venv venv
venv\Scripts\activate # Windows
pip install -r requirements.txt
python run.pyVisit http://localhost:8000/docs to verify ✅
cd admin-portal
npm install
npm run devVisit http://localhost:5173 ✅
- Open Chrome →
chrome://extensions/ - Enable Developer mode
- Click Load unpacked
- Select the
extension/folder
http://localhost:5173/register → Step 1: Create username → Step 2: Capture 30 face images → Step 3: Type for 5-10 minutes (200+ sequences) → Step 4: Use mouse for 3-5 minutes (200+ sequences) → Step 5: Train all 3 models (2-3 minutes)
# Terminal 1 — Backend (already running)
# Terminal 2 — Start webcam agent
cd desktop-agent
..\backend\venv\Scripts\activate
python agent.py --username your_username
# Browser — Click CA extension icon → Start Session| Metric | Value |
|---|---|
| Face images collected | 30 |
| FaceNet embeddings | 30 × 512-d |
| Keystroke sequences | 590 |
| Mouse sequences | 1590 |
| Live face score | 0.82 – 0.87 |
| Live fusion score | 0.66 – 0.76 |
| Alert response time | ~1 second |
| System latency | < 300ms per cycle |
| Scenario | Detection | Alert Type |
|---|---|---|
| User covers webcam | ✅ Yes | NO_FACE |
| Unknown person only | ✅ Yes | UNKNOWN_FACE |
| User + stranger together | ✅ No alert | — |
| Impostor typing | ✅ Yes | LOW_FUSION_SCORE |
- Liveness detection (blink, depth analysis)
- System-wide capture (not just browser)
- Cloud deployment with HTTPS + PostgreSQL
- Adaptive fusion weights
- Mobile behavioral authentication
This project is built for academic purposes. PES Modern College of Engineering, Pune — 2024–25
- facenet-pytorch by Tim Esler
- FaceNet paper by Schroff, Kalenichenko, Philbin (Google, 2015)
- MTCNN paper by Zhang et al. (2016)