CheatGuard is a lightweight Python-based exam proctoring system designed for offline schools that don’t have access to expensive AI infrastructure or online proctoring tools. It uses OpenCV + MediaPipe to monitor students through a camera and detect suspicious behaviour like:
- Looking away/down repeatedly
- Hands appearing in frame
- Absence of face during the exam
- Detection of prohibited items during the exam
- Live video monitoring via webcam
- Face detection to ensure student presence
- Hand detection for questions during the exam
- Automatic photographic and videographic evidence capture when suspicious activity is detected
- Logs alerts to a Flask-SQLAlchemy database with timestamps and photographic evidence
- Saves videographic evidence with timestamps locally
- Built fully using classical CV + MediaPipe (no ML training required)
- Python 3
- OpenCV
- MediaPipe
- NumPy
- Ensure that Python 3.12 is installed. Note: The program will NOT work on a later version of Python.
- Clone the repository by running the command below in your terminal:
git clone https://github.com/muditgoel135/CheatGuard.git cd CheatGuard - Create a venv and activate it in your terminal.
- Download all the dependencies from requirements.txt using the command below.
pip install -r requirements.txt - Create a
.envfile with your secret key with the nameSECRET_KEY. Save it as the text below and replace "your_secret_key" with your secret key.SECRET_KEY = your_secret_key - Run the app with the following command:
python app.py
- Webcam feed is captured using OpenCV
- MediaPipe processes each frame in real-time
- CheatGuard checks for:
- Face presence
- Hand visibility
- The program draws MediaPipe's given face and hand landmarks
- If a rule is violated:
- An alert is logged.
- It is reported to the invigilator.
- A frame is saved as evidence
- Teacher-centric: Final decisions are made by the invigilator
- Academic-focused: Built for real exam environments
- Transparent logic: Rule-based detection ensures alerts are interpretable, not black-box
- Affordable: Works with cheap webcams to support budget-constrained schools
- Offline-first: Designed for schools without online infrastructure
- Multi-camera support is not tested
- FPS depends on webcam + system performance
- Lack of simplicity in UI and UX for non-techy invigilators
- Not intended to replace human invigilators (yet 👀)
- Multi-camera classroom support
- Student ID verification
- Gaze estimation
- GUI for invigilators
- Performance optimisations for low-end systems
- Object detection
This project was built fast and intentionally simple. If you have ideas, optimisations, or improvements, PRs are welcome.
This project is licensed under the MIT License.