Memuat
Memuat
Watch every step above performed live, with English narration.
0 plays
Class book
Page 1 / 5
Cover: Face Recognition with Occlusion Tolerance #5: Face Verification: Cosine Similarity, Threshold, ROC Curve & EER
Click a page or use ◀ ▶ to turn · swipe on mobile · to enlarge
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Face Recognition with Occlusion Tolerance #5: Face Verification: Cosine Similarity, Threshold, ROC Curve & EER”.
Other ways we can help with Python.
Learn with a mentor
Scheduled AI & Machine Learning courses with live guidance and a certificate.

Multi-Objective Optimization Course: NSGA-II, MOPSO & Hybrid Algorithms (Python)

ECG Arrhythmia Classification Course with Wavelet & Deep Learning (PyTorch)

ANFIS + PSO/GA Course for Non-Linear Time Series Forecasting (Python)
Have it built for you
No time to learn Python? Our team can do the project for you.

Python Machine Learning — Prediction Models, Customer Segmentation, Fraud Detection & AI Apps

AI Image Creation with Stable Diffusion — Unlimited Custom Visual Production
★ 4.9

AI Image & Video Creation with Leonardo AI — All-in-One Visuals for Business
★ 4.9
Get notified about new Python classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
This is the final result, more than 100,000 face pairs compared, and the score of the same person is clearly separated from the score of different people. From the ROC curve, we get an equal error rate around 1% and this helps make a decision for the verification system. Let's start. Hello, welcome to episode five of the facial recognition series with occlusion resistance. There are two main tasks in facial recognition. Identification answers who this person is, and verification answers whether these two photos are of the same person, like unlocking a phone with facial recognition. Verification requires a threshold, above that value is accepted, below it is rejected. Today we measure it using the standard biometric research method, the ROC curve and equal error rate.
Create verification.py file We load the best multi-scale fusion model from episode 4 and calculate the embedding for all test face data. Since the embedding is already normalized, matrix multiplication E times E transpose directly produces cosine similarity for every pair. We take the upper triangle of the matrix so that each pair is calculated once, then we mark pairs of the same person and different people. Run There are more than 102,000 pairs, around 5,000 same people and almost 98,000 different people. The average cosine of the same person is almost 0.9, while different people is around 0, meaning embeddings of different people are almost perpendicular.
Now the ROC curve. For each threshold, the false accept rate is the percentage of different person pairs that are incorrectly accepted, and the true accept rate is the percentage of same person pairs that are correctly accepted. Equal error rate is the point when false acceptance equals false rejection, one concise number often reported in papers. Run AUC is around 0.999 and IIR is around 1%. Security systems usually use a stricter FAR, for example 0.1%, with a higher threshold. Threshold.IIR we save to threshold.json. Let's draw it.
The left graph is the score distribution, blue for different people around 0, orange for same people clustered near 1, and the dashed line is the threshold. Very little overlap. The right ROC curve graph has a logarithmic FAR axis so that the small FAR region is clearly visible, and the red dot is IIR. Remember, the people in this test data are also in the training data, only their photos are different. For completely new people, the performance will be lower, and this will be addressed in the next episode.
Done We have distinguished between identification and verification, calculated cosine similarity for 100,000 pairs, created a ROC curve, calculated AUC and equal error rate, and selected the decision threshold. In the final episode, we tested the model's resistance to occlusion and built a facial attendance application. Currently working on a thesis, dissertation, or AI research in the field of facial recognition and biometrics? Cerdas Inovasi Digital helps implement deep learning, from synthetic occlusion, face alignment, feature pyramid, art face, verification and ROC, up to facial attendance applications, and also opens deep learning courses with PyTorch. Want to master the entire series, from face datasets to attendance applications? All 6 episodes, complete with PDF step-by-step guides and source code, are available for premium tutorial subscribers. Subscribe starting at Rp69.000 per month, save 28% with the 12-month package, or pay once Rp999.000 for lifetime access. Want just one class? Buy a single class with lifetime access. Subscribe now at the premium page cerdasinovasidigital.com Contact us via WhatsApp, or visit cerdasinovasidigital.com Thank you for watching, see you in the next episode.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →