TechPhantom AI Campus is a modern, full-stack Campus Management System (CMS) designed to automate university operations through Artificial Intelligence, Computer Vision, real-time attendance tracking, and centralized academic management.
The core of the platform is its AI-powered facial recognition attendance system, which combines face detection, 128-dimensional facial embeddings, identity recognition, and YOLO-based person tracking to provide an automated alternative to traditional manual attendance.
๐ From student registration to facial enrollment, classroom detection, identity verification, and attendance recording โ TechPhantom AI Campus brings the complete workflow into one intelligent platform.
Unlike a conventional CMS that only manages student records and attendance manually, TechPhantom AI Campus introduces an AI Computer Vision layer directly into the attendance workflow.
The attendance engine is built around a multi-stage computer vision pipeline:
๐ท Camera / Video Stream
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ YOLO Detection โ
โ Person Detection โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Face Detection โ
โ & Processing โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Face Encoding โ
โ 128D Vector โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Identity Match โ
โ Student Database โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Course / Session โ
โ Validation โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Attendance Saved โ
โโโโโโโโโโโโโโโโโโโ
- Real-time facial recognition
- 128D facial embeddings
- YOLO-based person detection and tracking
- Student identity verification
- Face enrollment through the student profile
- Multi-student detection
- Course-aware attendance validation
- Duplicate attendance prevention
- Active-class/course selection logic
- Real-time attendance events through WebSockets
- OpenCV-based image preprocessing
- Fallback encoding support for environments where native C++ dependencies are unavailable
The YOLO tracking layer is particularly useful for video-stream scenarios because object trackers can maintain tracked identities across frames.
The centerpiece of TechPhantom AI Campus.
Students can register their facial data once, after which the system can recognize them during attendance sessions.
- Student enrolls their face.
- The system generates a facial representation.
- Camera captures the classroom/session.
- YOLO detects people in the video stream.
- Face detection identifies visible faces.
- Facial embeddings are generated.
- Embeddings are compared with enrolled students.
- The system identifies the student.
- Active course/session rules are evaluated.
- Attendance is recorded.
- The result is pushed to connected dashboards in real time.
The system separates "Who is present in the camera?" from "Who is this person?"
YOLO
โ
Detect / Track Person
โ
Face Detection
โ
Face Encoding
โ
Face Matching
โ
Student Identity
โ
Attendance Validation
This architecture helps make the attendance kiosk suitable for real-time environments rather than relying on a simple single-face image upload.
Administrators get a centralized control panel for managing the entire campus system.
- ๐ Attendance analytics
- ๐จโ๐ Student statistics
- ๐ Course statistics
- ๐ Attendance percentages
- ๐ค Student management
- ๐ Course management
- ๐งโ๐ป User management
- ๐ค Face enrollment management
- ๐ก Live attendance monitoring
- ๐ Attendance history
- ๐ Role-based access control
Students have their own dedicated portal to interact with the academic system.
- View attendance history
- View attendance percentage
- Check course enrollment
- Enroll in available courses
- Update profile information
- Register facial data
- Review attendance records
Administrators can create and manage university courses.
- Create courses
- Update courses
- Delete courses
- Assign course information
- Manage active courses
- Associate students with courses
- Validate attendance against active courses
The system also includes multi-course logic, allowing the attendance workflow to handle students who are enrolled in multiple active classes.
TechPhantom AI Campus includes a global scanner/kiosk mode designed for high-traffic environments.
The kiosk can continuously process camera input while the backend communicates attendance events to connected clients through WebSockets.
Camera
โ
โผ
AI Processing
โ
โผ
FastAPI Backend
โ
โโโโโโโโโโโโโโโโบ Database
โ
โผ
WebSocket
โ
โผ
Live Dashboard
FastAPI supports WebSocket endpoints for persistent two-way communication between the application and connected clients.
The computer vision subsystem combines multiple technologies instead of relying on a single model.
Powered by:
face_recognitiondlib- 128-dimensional facial embeddings
The facial recognition component converts detected faces into numerical representations that can be compared against enrolled student data.
Powered by:
- Ultralytics YOLO
- OpenCV
YOLO provides real-time person detection/tracking while OpenCV handles camera and image-processing operations.
Ultralytics supports tracking on video and streaming sources and provides configurable tracking systems such as BoT-SORT and ByteTrack.
The project also includes a fallback approach for environments where native C++ dependencies required by dlib cannot be built easily.
Primary
dlib + face_recognition
โ
โผ
High-quality facial embeddings
Fallback
OpenCV-based processing
โ
โผ
Improved environment compatibility
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FRONTEND โ
โ โ
โ React.js + Vite + Vanilla CSS โ
โ โ
โ Admin Dashboard โ Student Portal โ Kiosk โ
โโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โ
REST / WebSocket
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BACKEND โ
โ โ
โ FastAPI โ
โ โ
โ Authentication โ Students โ Courses โ
โ Attendance โ Analytics โ WebSockets โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Database โ โ AI / Vision โ
โ โ โ โ
โ SQLAlchemy โ โ YOLO โ
โ SQLite/Postgresโ โ OpenCV โ
โ MySQL โ โ face_recognitionโ
โโโโโโโโโโโโโโโโโโ โ dlib โ
โโโโโโโโโโโโโโโโโโโ
| Technology | Purpose |
|---|---|
| Python | Core backend & AI processing |
| FastAPI | REST API framework |
| SQLAlchemy | Database ORM |
| Pydantic | Data validation |
| Uvicorn | ASGI server |
| JWT | Authentication |
| Bcrypt | Password hashing |
| Technology | Purpose |
|---|---|
| React.js | UI framework |
| Vite | Frontend tooling |
| Vanilla CSS | Custom UI design |
| Lucide Icons | Interface icons |
| WebSocket | Real-time communication |
| Technology | Purpose |
|---|---|
| face_recognition | Facial recognition |
| dlib | Facial embeddings |
| OpenCV | Image processing & camera handling |
| Ultralytics YOLO | Person detection & tracking |
- SQLite โ local development
- PostgreSQL โ production
- MySQL โ supported through SQLAlchemy
TechPhantom-AI-Campus/
โ
โโโ backend/
โ โโโ main.py
โ โโโ models/
โ โโโ schemas/
โ โโโ routes/
โ โโโ services/
โ โโโ ai/
โ โ โโโ face_recognition/
โ โ โโโ detection/
โ โ โโโ tracking/
โ โโโ database/
โ โโโ requirements.txt
โ
โโโ frontend/
โ โโโ src/
โ โ โโโ components/
โ โ โโโ pages/
โ โ โโโ services/
โ โ โโโ assets/
โ โโโ package.json
โ โโโ vite.config.js
โ
โโโ README.md
โโโ docker-compose.yml
Make sure you have:
- Python 3.9+
- Node.js 18+
- npm
- C++ Build Tools
- Git
- Webcam/camera for facial attendance
dlibandface_recognitionmay require native build dependencies depending on your operating system and Python environment.
cd backend
python -m venv venv.\venv\Scripts\activatesource venv/bin/activateInstall dependencies:
pip install -r requirements.txtStart the backend:
python main.pyOr with Uvicorn:
uvicorn main:app --reloadcd frontend
npm install
npm run devThe frontend will start using Vite's development server.
Create:
backend/.env
Example:
DATABASE_URL=sqlite:///./attendance.db
SECRET_KEY=your_very_secure_random_secret
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=1440For production, replace development secrets and SQLite with appropriate production configuration.
Want to test the facial recognition attendance system right away? Follow these steps:
- Open the application.
- Click the "Demo Admin" button on the login screen.
- You are now logged into the Administrative Dashboard.
- Navigate to Courses in the sidebar.
- Click "Add Course", enter a name (e.g., "AI 101"), and save.
- Navigate to Attendance Sessions.
- Click "New Session", select your newly created course, and start it. (The scanner only marks attendance for active sessions).
- Navigate to Students in the sidebar.
- You will see a pre-created "Demo Student". Click the Edit icon (pencil).
- Under Enrolled Courses, select the course you just created and click Save.
- Click the Face Registration icon (camera) next to the Demo Student.
- Upload a clear picture of your face. (This saves your facial embedding to the database).
- Navigate to the Live Kiosk from the sidebar.
- Allow camera permissions.
- Step in front of the camera.
- The system will detect your face, match it against the registered demo student, check the active session, and mark you as Present with a green success message!
Before using automated attendance in a real-world scenario:
Administrator creates a student profile.
The student registers their face through the system.
Student Profile
โ
Face Capture
โ
Face Detection
โ
Face Encoding
โ
Store Facial Representation
Launch the camera/kiosk.
Camera โ YOLO โ Face Detection โ Encoding โ Matching
The system compares the detected facial representation against enrolled students.
The system determines the appropriate active course/session.
A successful recognition results in an attendance record.
The platform is designed to provide more than a simple Present/Absent value.
Attendance data can be used to calculate:
- Individual attendance percentage
- Course attendance percentage
- Student attendance history
- Class/session attendance
- Overall campus attendance statistics
- Attendance trends
Example:
Student: Muhammad Ali
Course: Artificial Intelligence
Total Classes: 30
Present: 26
Absent: 4
Attendance: 86.67%
TechPhantom AI Campus implements multiple layers of application security.
- JWT-based authentication
- Secure password hashing
- Token expiration
Role-based access control separates administrative and student functionality.
- Protected API endpoints
- Configurable CORS
- Input validation through Pydantic
- Authentication middleware/dependencies
The system is designed to store facial representations/encodings rather than relying on raw student photographs for recognition.
โ ๏ธ Facial biometric data is sensitive. A production deployment should additionally implement appropriate consent, retention, access-control, encryption, and institutional privacy policies.
For production environments, the recommended architecture is:
Internet
โ
โผ
โโโโโโโโโ
โ Nginx โ
โโโโโฌโโโโ
โ
โโโโโโโโโโดโโโโโโโโโ
โผ โผ
React Frontend FastAPI API
โ
โโโโโโโโโโโโโผโโโโโโโโโโโโ
โผ โผ โผ
PostgreSQL AI Engine WebSocket
- 4 GB+ RAM
- 2+ vCPUs
- Linux server
- Nginx
- PostgreSQL
- HTTPS/SSL
- Gunicorn + Uvicorn workers
- GPU recommended for heavier computer-vision workloads
Example:
gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:appFor larger deployments, Docker Compose can be used to orchestrate:
- FastAPI
- React/Nginx
- PostgreSQL
- AI processing services
Automate classroom attendance without requiring manual roll calls.
Use a camera-based kiosk to recognize students entering or attending a session.
Deploy the system at designated campus scanning locations.
Use the live kiosk and tracking system for continuous attendance processing.
Potential extensions include:
- Liveness / anti-spoofing detection
- Mobile attendance notifications
- Advanced attendance analytics
- Email/SMS alerts for low attendance
- GPU-accelerated inference
- Cloud deployment
- Multi-campus support
- Advanced audit logs
- Facial recognition confidence thresholds
- Attendance anomaly detection
- Parent/guardian portal
- Automated timetable integration
- Containerized AI inference service
๐ค AI-Powered Facial Recognition
๐ฅ Real-Time Computer Vision
๐๏ธ YOLO Person Detection & Tracking
๐ง 128D Facial Embeddings
๐ก Real-Time WebSocket Attendance
๐ Automated Course Management
๐ Administrative Analytics
๐จโ๐ Student Portal
๐ JWT + RBAC Security
โก FastAPI Backend
โ๏ธ React + Vite Frontend
๐๏ธ SQLAlchemy Database Layer
๐ณ Production-Ready Architecture
Traditional campus management systems primarily focus on record keeping.
TechPhantom AI Campus focuses on automation.
Instead of:
Teacher โ Manual Roll Call โ Attendance Sheet โ Database
TechPhantom introduces:
Camera
โ
AI Detection
โ
Facial Recognition
โ
Student Identification
โ
Course Validation
โ
Automatic Attendance
โ
Real-Time Dashboard
This makes AI-powered facial attendance the central intelligence layer of the campus management platform.
TechPhantom AI Campus combines:
Full-Stack Development + Artificial Intelligence + Computer Vision + Real-Time Systems + Database Engineering
into a unified university management platform.
The project's primary innovation is its real-time facial recognition attendance pipeline, supported by YOLO-based person detection/tracking, dlib/face-recognition facial embeddings, OpenCV processing, FastAPI APIs, and WebSocket communication.
It demonstrates how modern AI technologies can be integrated into a practical university information system to automate repetitive administrative workflows while providing students and administrators with a centralized digital platform.
Built with Python, FastAPI, React, Computer Vision, and AI.
โญ If you find this project useful, consider giving the repository a star.
This project is intended for educational, research, and demonstration purposes. Add your preferred license here, such as MIT, if the repository is intended for open-source distribution.