AI-Based Proctoring System for Secure Assessments πAn open-source initiative to transform remote assessment integrity using cutting-edge AI technology.
π Features βοΈ Installation ποΈ Architecture π Usage π€ Contributing π₯ Community
Please refer to our CONTRIBUTING.md for contribution guidelines.
Provide Your Feedback or ParticipateWe value your feedback! Please take a moment to fill out the Google Form and contribute to improving our project.
π Google Form - Participate Now!
| π Stars | π΄ Forks | π Issues | π Open PRs | π Close PRs | </tr>
</div>
OverviewThis project introduces a cutting-edge AI-powered proctoring system designed to maintain fairness, security, and integrity in remote assessments. By leveraging advanced machine learning techniques, this system redefines how online tests are monitored.
Featured In![]() |
Social Winter Of Code | Social Winter of Code is an initiative to introduce students to the open-source world, fostering collaboration and development. |
| Delta Winter Of Code | Delta Winter of Code empowers students by providing opportunities to contribute to meaningful open-source projects and grow their skills. | |
| JWOC Winter of Code | JWoC provides a fully immersive learning experience for students and first-time contributors by promoting the wonders of open-source software and crafting a community of new and experienced technical developers. The best projects are selected for this program. Students get acquainted with the projects from the mentors during the Community Bonding Period. Students work on these projects during the coding phase. At the end of the coding period, the winners of the programs are announced on the basis of their contribution in terms of quantity as well as quality. |
Project DemoWatch our community demo:
π FeaturesFor teachers / proctors
For students
Server-side AI proctoring β the browser only uploads a compressed frame every ~1.5 s; all analysis runs on the API server:
| Signal | Model / method |
|---|---|
| Face count, no face, multiple people | YuNet face detector (OpenCV, MIT) + YOLOX person class |
| Prolonged looking away, frequent head movement | MediaPipe Face Landmarker head pose vs. the candidateβs calibrated neutral pose (port of the original anomaly_detection.py rules) |
| Eyes off screen, talking | Face Landmarker gaze & jaw blendshapes + browser audio level |
| Phone, book/notes, extra laptop | YOLOX-Tiny object detector (ONNX, Apache-2.0) |
| Identity verification & mid-exam swap | SFace face embeddings (OpenCV, Apache-2.0), cosine match against the teacher-uploaded photo |
| Camera covered | Frame brightness |
| Tab switch, window blur, fullscreen exit, copy/paste, extra monitor | Browser events |
All models are permissively licensed (no AGPL), CPU-only, ~65 MB total, ~100β130 ms per frame. Object detection runs on every 2nd frame and identity on every 8th, so a single vCPU handles roughly 8β12 concurrent candidates; the server tells browsers to slow down automatically when frames queue up.
ποΈ Architecture & Design Student browser ββ JPEG frame + audio level every ~1.5 s βββ βββ Teacher browser (live grid polls 3 s)
βΌ βΌ
Next.js 14 on Vercel (Clerk auth, UI only)
β Bearer <Clerk session JWT>
βΌ
FastAPI on Render β verifies JWT (Clerk JWKS), Clerk Backend API for student accounts
ββ AI runtime: YuNet Β· Face Landmarker Β· SFace Β· YOLOX-Tiny (bounded worker pool, back-pressure)
ββ Per-attempt anomaly tracker + in-memory live cache (thumbnails never hit the DB)
ββ Alembic-migrated schema
β β
βΌ βΌ
Supabase Postgres (RLS on) Supabase Storage (private bucket: evidence + reference photos,
served via short-lived signed URLs)
Design notes:
π§ Technology Stack| Layer | Tech | Free hosting |
|---|---|---|
| Frontend | Next.js 14 (App Router), Tailwind, shadcn/ui, Recharts | Vercel Hobby |
| Auth | Clerk (sessions + Backend API for student accounts) | Clerk free tier |
| Backend | FastAPI, SQLAlchemy 2 (async), Alembic, PyJWT, httpx | Render |
| AI | OpenCV (YuNet, SFace), MediaPipe Tasks, ONNX Runtime (YOLOX) | Render (CPU) |
| Database | PostgreSQL | Supabase free tier |
| Storage | Supabase Storage | Supabase free tier (1 GB) |
| CI | GitHub Actions β ruff, pytest, Docker smoke test, Next.js lint/typecheck/build | free for public repos |
βοΈ Development SetupPrerequisites: Node 18+ with pnpm, Python 3.12+, a free Clerk application with Email address + Password sign-in enabled.
1. Backend
cd backend
python -m venv .venv
.venv/Scripts/activate # macOS/Linux: source .venv/bin/activate
pip install -r requirements-dev.txt
pip install --no-deps -r requirements-mediapipe.txt
python scripts/download_models.py # ~65 MB of model weights into backend/models/
cp .env.example .env # set CLERK_ISSUER and CLERK_SECRET_KEY
uvicorn app.main:app --reload --port 8000 --env-file .env
Migrations run automatically on startup (SQLite file guardai_dev.db locally). Tests: pytest -q.
2. Frontend
cd main-web-vecel
pnpm install
cp .env.example .env.local # Clerk keys + NEXT_PUBLIC_API_URL=http://localhost:8000
pnpm dev # http://localhost:3000
Sign up, choose βI conduct examsβ, add a student under Students (copy the generated password), upload their photo, create a batch, build an exam assigned to it and publish. Sign in as the student in a private window.
βοΈ Free Deployment Guide| Piece | Free service | Holds |
|---|---|---|
| Database | Neon Postgres | users, exams, attempts, violations |
| Files | Backblaze B2 (or any S3-compatible store, e.g. Cloudflare R2) | evidence snapshots, reference photos |
| API + AI models | Render free web service (Docker) | FastAPI, vision models, live state |
| Web app | Vercel | Next.js frontend |
| Auth | Clerk | sign-in, student accounts, invites |
| Assistant | Groq | teacher chat assistant (optional) |
1. Neon (database). Create a project. Connect β copy the pooled
connection string (host contains -pooler) β DATABASE_URL. Pick AWS ap-southeast-1 (Singapore) to sit next to the Render service. The ?sslmode=require suffix is handled; migrations run
automatically when the API starts.
2. Backblaze B2 (files, 10 GB free, no card). Buckets β Create a Bucket guardai-evidence, Private; note
its Endpoint (e.g. s3.us-west-004.backblazeb2.com, region us-west-004). Application Keys β Add a New Application
Key with Read and Write on that bucket β S3_ACCESS_KEY_ID (keyID) and S3_SECRET_ACCESS_KEY (applicationKey).
Evidence is served to proctors through short-lived signed links; the bucket never needs to be public. Any
S3-compatible store works the same way (Cloudflare R2: endpoint https://<account>.r2.cloudflarestorage.com, region
auto).
3. Clerk (auth). Enable Email address and Password sign-in. Copy the publishable and secret keys;
API keys β Frontend API URL β CLERK_ISSUER. A development instance works on *.vercel.app; a production instance
needs your own domain.
4. Render (API + AI). New β Blueprint β this repo. Render reads render.yaml: a free Docker
web service built from backend/Dockerfile (models baked in, health check /health, region Singapore). It asks for
the secrets: DATABASE_URL, S3_ENDPOINT, S3_REGION, S3_BUCKET, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, CLERK_ISSUER,
CLERK_SECRET_KEY, GROQ_API_KEY, and CORS_ORIGINS / FRONTEND_URL = your Vercel URL. Keep one instance
(the AI runtime and live view are in-process). Free services sleep after 15 minutes idle and take about a minute to
wake, so open the app a few minutes before an exam starts.
5. Vercel (web). Import the repo with Root Directory main-web-vecel; set the variables from
main-web-vecel/.env.example, with NEXT_PUBLIC_API_URL=https://<your-api>.onrender.com (no trailing slash).
Optional: TURN relay for live video. Live video connects peer to peer using public STUN servers, which works
on most networks. Very strict networks (some campus/office Wi-Fi, some mobile carriers) need a relay: create a free
TURN key in Cloudflareβs dashboard (Realtime β TURN) and set CLOUDFLARE_TURN_KEY_ID + CLOUDFLARE_TURN_API_TOKEN
on Render.
Optional: branded invitation emails. Brevo is free for 300 emails/day and needs no
domain: add and verify your own address under Senders, create an API key, then set BREVO_API_KEY and
EMAIL_FROM="Guard AI <you@gmail.com>" on Render. (Resend also works with RESEND_API_KEY if you own a domain.)
Without either, Clerk sends its plain invitation email. Renderβs free plan blocks SMTP, so Gmail SMTP isnβt an option.
Capacity on free tiers. All models together use ~185 MB RAM, well inside 512 MB. CPU is the limit: Renderβs free instance has 0.1 CPU, so a frame takes ~1.5β2 s and the server automatically thins out object detection (every 3rdβ4th frame plus any frame with a suspicious cue such as eyes or head down) and asks browsers to send frames less often. Expect phones flagged in ~3β6 s with 1β3 simultaneous candidates: right for a demo or a small class. On 1 full vCPU (e.g. Render Starter) the same code flags phones in ~1β1.5 s with ~5 candidates, ~8β11 under load.
π Project Structureβββ backend/ FastAPI service (Render)
β βββ app/
β β βββ main.py app factory, lifespan (migrations, bucket, model loading), middleware
β β βββ api/ routers: me, exams, monitor, students, candidate
β β βββ ml/ detector.py (YuNet, Face Landmarker, SFace, YOLOX), tracker.py (rules),
β β β runtime.py (worker pool, back-pressure, live cache)
β β βββ services/ exams (grading, timing, serializers), analytics, storage
β β βββ core/ config, db, security (Clerk JWT), clerk (Backend API client)
β β βββ models.py Β· schemas.py
β βββ alembic/ migrations (0001 schema, 0002 RLS)
β βββ scripts/download_models.py
β βββ tests/ API flow, frame pipeline, anomaly rules
β βββ Dockerfile (render.yaml at the repo root)
βββ main-web-vecel/ Next.js frontend (Vercel)
β βββ app/
β β βββ page.tsx landing page
β β βββ (root)/proctor/ overview, exams (builder, live monitor, analytics), students & batches, attempt review
β β βββ (root)/candidate/ home (assigned exams, access code), results
β β βββ exam/[attemptId]/ system check β identity β calibration β proctored exam
β βββ components/app/ design-system kit, app shell, charts
β βββ lib/ API client, types
βββ .github/workflows/ci.yml
π Usageπ€ ContributingWe warmly welcome contributions from developers of all skill levels! Hereβs how you can help:
graph TD
A[Fork Repository] --> B[Create Branch]
B --> C[Make Changes]
C --> D[Commit Changes]
D --> E[Push to Branch]
E --> F[Create Pull Request]
π― Good First Issuesgood-first-issueπ₯ Communityπ ContributorsThanks to these wonderful people:
π LicenseThis project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments