PracticeVideosBlogFlashcards

3.2 Azure AI Face Service

Key Takeaways

  • Azure AI Face provides detection, verification (1:1), identification (1:N against a PersonGroup), grouping, find-similar, and liveness detection.

  • Pair detection_03 with recognition_04 for the highest accuracy; detection_03 also returns blur, mask, and head-pose attributes.

  • Verification and identification are Limited Access features requiring an approved Microsoft intake form before they are enabled on a resource.

  • A PersonGroup must be retrained after any face add/update/delete, and a detected faceId is valid for only 24 hours before it expires.

  • Microsoft retired the emotion and gender attributes and limits age, smile, facial hair, hair, and makeup to approved use cases; the exam tests that emotion and gender are no longer returned.

Last updated: October 2026

Quick Answer: Azure AI Face does detection (find faces + attributes), verification (1:1 — are these two faces the same person?), identification (1:N — who is this against a PersonGroup?), find-similar, grouping, and liveness (live person vs. spoof). Verification and identification are Limited Access and need Microsoft approval; emotion and gender attributes are retired, and age is limited.

Face Detection

Detection returns a face rectangle, up to 27 facial landmarks, an optional faceId, and selected attributes. The detection and recognition models you choose drive accuracy.

Detection models

ModelStrengthNotes
detection_01Legacy; supports the broadest set of attributesWeaker on small/rotated faces
detection_02Better on small, side, and blurry facesNo attributes
detection_03Highest accuracy; returns blur, mask, head-poseRecommended for production

Recognition models

ModelUse
recognition_03Good general recognition
recognition_04Highest accuracy; better with masks — use for verification/identification
from azure.ai.vision.face import FaceClient
from azure.ai.vision.face.models import (FaceDetectionModel,
    FaceRecognitionModel, FaceAttributeTypeDetection03)
from azure.core.credentials import AzureKeyCredential

client = FaceClient(endpoint, AzureKeyCredential(key))
faces = client.detect(image_content=img_bytes,
    detection_model=FaceDetectionModel.DETECTION03,
    recognition_model=FaceRecognitionModel.RECOGNITION04,
    return_face_id=True, return_face_landmarks=True,
    return_face_attributes=[FaceAttributeTypeDetection03.HEAD_POSE,
        FaceAttributeTypeDetection03.BLUR,
        FaceAttributeTypeDetection03.MASK])

On the Exam: The "highest accuracy" answer is almost always detection_03 + recognition_04. A returned faceId is usable for only 24 hours, then it expires — code that caches faceIds for later identification is a classic bug the exam plants.

Verification (1:1) vs. Identification (1:N)

  • Verification compares exactly two inputs and returns is_identical plus a confidence. Default decision threshold is roughly 0.5; KYC and access-control flows often raise it.
  • Identification searches one face against a trained PersonGroup (or PersonDirectory / LargeFaceList) and returns ranked candidates.
res = client.verify_face_to_face(face_id1=a, face_id2=b)
print(res.is_identical, res.confidence)

PersonGroup Identification Lifecycle

The order of operations is a guaranteed exam item.

StepCallNote
1. Create groupcreate_person_group(id, recognition_model=...)Recognition model is fixed at creation
2. Add personcreate_person_group_person(group, name)Returns a personId
3. Add facesadd_person_group_person_face(...)Several images per person raise accuracy
4. Traintrain_person_group(group)Required after any add/update/delete
5. Identifyidentify(face_ids=[...], person_group_id=group)Returns ranked candidates
results = client.identify(face_ids=[unknown_id], person_group_id="employees")
for r in results:
    if r.candidates:
        print(r.candidates[0].person_id, r.candidates[0].confidence)

If you skip step 4 after adding faces, identification returns stale or empty results — the symptom many exam scenarios describe.

Liveness Detection (anti-spoofing)

Liveness proves the input is a live human, not a photo, screen replay, or deepfake. It runs from a mobile/web SDK that produces a short session token the backend validates.

ModeWhat it doesBest for
Passive livenessAnalyzes one capture for spoof artifacts; no user actionFrictionless onboarding
Active livenessUser performs a prompted motion (blink, turn)Highest assurance
Liveness with verificationLiveness check + matches the live face to a reference photoRemote identity proofing

On the Exam: A scenario where someone holds up a printed photo to fool sign-in is solved by adding liveness detection — not by raising the verification threshold or adding emotion detection.

Limited Access and Retired Attributes

FeatureAccessStatus
Face detection / landmarksOpenAvailable
Verification & identificationLimited AccessSubmit Microsoft intake form first
LivenessLimited AccessApproval required
Emotion, gendern/aRetired (Responsible AI)
Age, smile, facial hair, hair, makeupLimitedMicrosoft approval required

Limited Access means a new resource cannot call verify/identify until the registration form is approved; SDK calls fail with an authorization error until then. The retired emotion and gender attributes are simply no longer returned by any detection model — if an option lists "emotion" as a current Face attribute, it is wrong.

Worked Example

A bank onboards customers remotely. Use liveness with verification: the mobile SDK captures a liveness session, the backend confirms the session is genuine, then verifies the live face against the photographed ID using recognition_04. Because verification and liveness are Limited Access, the bank must complete the intake form before the resource will process these calls.

Find Similar and Grouping

Beyond the headline operations, two utility calls show up in exam distractors. Find Similar takes one face and returns the most visually similar faces from a candidate list or LargeFaceList, ranked by similarity — useful for de-duplication or "have we seen this person before" without a labeled PersonGroup. Group takes a set of unknown faces and clusters them into groups that likely belong to the same person, returning a messyGroup for faces it cannot confidently cluster. Neither identifies who a person is; they only measure similarity.

If a scenario says "organize a photo library so each person's shots are grouped, but we have no labels," the answer is Group, not Identify, because Identify requires a trained PersonGroup of known people.

Confidence Thresholds and False Matches

Verification and identification both return a confidence between 0 and 1, and your application — not the service — decides the cutoff. Microsoft's guidance ties the threshold to risk tolerance: a low-security photo-tagging feature can accept around 0.5, while access control or financial KYC should demand a higher confidence (often 0.8 or above) to suppress false accepts, accepting that more legitimate users will be asked to retry.

A frequent trap pairs a complaint about impostors getting in with the wrong fix ("add more training faces"); the correct response to false accepts is to raise the confidence threshold, whereas false rejects of genuine users point to adding varied enrollment images or improving capture quality.

Test Your Knowledge

What is the difference between Face verification and Face identification?

A

Verification detects faces; identification recognizes emotions

B

Verification is free; identification requires a paid tier

C

Verification uses photos; identification uses video

D

Verification is 1:1 matching (are these the same person?); identification is 1:N matching against a PersonGroup (who is this?)

Test Your Knowledge

You add several new face images to a PersonGroup, then identification calls return no matches. What step was most likely skipped?

A

Calling train on the PersonGroup after the changes

B

Restarting the Face resource

C

Switching to detection_02

D

Deleting and recreating the PersonGroup

Test Your Knowledge

Which Face API features did Microsoft retire as part of its Responsible AI commitments?

A

Face detection and face rectangles

B

Face landmarks and head pose

C

Face verification and face identification

D

Emotion and gender attributes

Test Your Knowledge

For the highest face recognition accuracy on a production identity-verification system, which model combination should you choose?

A

detection_01 with recognition_03

B

detection_02 with recognition_03

C

detection_03 with recognition_04

D

detection_01 with recognition_04

Sections you finish are checked off in the contents.