Building a Secure Exam Proctoring System with Face Recognition
How to use face recognition and liveness detection to prevent cheating in online exams — identity verification, continuous monitoring, and anti-spoofing.
The Online Exam Problem
Remote exams are convenient but vulnerable to cheating. Students can have someone else take the test, use pre-recorded videos, or simply look away at notes. Face recognition solves these problems.
Three Layers of Proctoring Security
1. Identity Verification (Before the Exam)
Verify the student is who they claim to be by comparing their live selfie against their registered photo:
result = requests.post("https://faceapi.arsa.technology/api/v1/face_recognition/validate_faces",
headers={"x-key-secret": API_KEY},
files={
"image1": open("student_registration.jpg", "rb"),
"image2": open("live_selfie.jpg", "rb")
}
).json()
if result["match_result"] and result["face1_analysis"]["passive_liveness"]["is_real_face"]:
print("Identity confirmed — exam may begin")
2. Liveness Detection (Anti-Spoofing)
Passive liveness ensures the student isn't using a photo or video. For higher security, use active liveness with head movement challenges.3. Continuous Monitoring (During the Exam)
Periodically capture frames from the webcam and verify the same student is still present:
Every 30 seconds during the exam
result = requests.post(
"https://faceapi.arsa.technology/api/v1/face_recognition/recognize_face",
headers={"x-key-secret": API_KEY},
files={"face_image": open("periodic_capture.jpg", "rb")}
).json()
current_student = result["faces"][0]["recognition_uidresult"]
if current_student != expected_student_id:
flag_suspicious_activity()
What Face Recognition Detects
Integration Tips
Learn about face detection vs. recognition for choosing the right approach.
Start building with ARSA — free trial includes 100 API calls.