JUNIORCamera AssistantAICHAPTER 06

AI in the camera: autofocus, subject tracking and computational modes

What the detector, the tracker and the burst merge do before you see a file, who they work for, and how to test them on the faces you actually shoot

50 MINCAMERA, LENS AND LIGHTUPDATED 2026-11-08
PREDICT

A phone in full auto frames a deep-skinned face (MST 9) against a bright sky. Its face detector fails to find the face. What does auto exposure do next?

Every camera you will use in this course has machine-learned software between the sensor and the file. On a phone it decides where to focus, how bright the face should be, what colour white is, and how many frames go into the picture you think you took. On a mirrorless camera it finds eyes, bodies, birds and cars and holds focus on them. This chapter is about what those systems do, how to use them well on a job, and how to find out, before the client does, who they fail.

How the models themselves work (detectors, training data, evaluation) belongs to the AI Engineering course: its chapter on multimodal input covers how a model reads an image, and building an eval set covers how to test one honestly. Here you treat the model as a black box with inputs you control (light, distance, the people in front of the lens) and outputs you can measure (lost locks, exposure, frame count).

Three jobs the software does

AI in the camera does three different jobs, and they fail in different ways.

Job What it does What it feeds How it fails
Find A detector marks faces, eyes, heads and bodies (and animals, birds, vehicles on mirrorless bodies) in the live preview, many times a second The AF point, the exposure metering weight, the white-balance sample, sometimes the tone curve for the face Misses a face, finds a face that is not there (a poster, a pattern), picks the wrong person
Follow A tracker keeps the same subject marked from frame to frame as it moves, turns or is briefly blocked Continuous autofocus Loses the subject, jumps to a nearby face or a high-contrast object, holds onto the wrong one
Make Computational modes capture several frames and merge them, or segment the picture and process parts differently The pixels in the file Ghosts and smears moving things, invents texture, renders skin differently from what was in front of the lens

The first two are about where the camera looks. The third is about what the camera writes. A camera assistant needs both: the first to get focus and exposure on the right face, the second to know whether the file is a record of one moment or a composite of many.

Find and follow: autofocus with a detector

Autofocus measures sharpness somewhere in the frame and drives the lens until it peaks. Phase-detection pixels on the sensor tell the lens which way to move and roughly how far; contrast detection confirms by looking for maximum local contrast. Both answer “is it sharp here?”. Neither answers “where is here?”. For decades the answer was a point you chose or the nearest object in the centre.

A subject detector replaces that point with a box around a face or an eye, and the tracker moves the box as the person moves. That is a large gain for a camera assistant: on a gimbal, in a crowd, on a walk-and-talk, the camera can hold a face that no human focus puller could follow at f/1.8. It is also why the detector’s misses matter so much: the box is the input to focus, and on most systems to exposure and white balance as well.

Read what one maker says its own system needs. Sony’s help guide for its current bodies lists the conditions where subject recognition may fail: “low-light or back-lit conditions”, “when the subject is in the shade”, “when the subject is moving too much”, and for eyes, closed eyes, hair over the eyes and sunglasses (vendor documentation, ILME-FX2 help guide)as of 2026-11. Two things stand out. Shade and backlight are the normal conditions of a Lagos street shoot from late afternoon, and of any interview where you put the subject’s back to a window. And the list says nothing about skin tone. A maker’s documentation is a list of what the maker chose to tell you; the absence of a line is not evidence that the case works.

WATCH 0:00–5:31 · 6 MIN
A Sony Alpha ambassador sets up real-time tracking and shows the tracking box following a subject. Watch where the box sits and when it lets go; treat it as a vendor-affiliated demonstration, not a test. Open on YouTube checked 2026-11 · segment not yet checked by a person

Why the detector fails where it fails

There are three reasons a face detector misses a deep-skinned face in backlight, and only one of them is about training data.

Signal. A detector finds a face from patterns of light and dark: the eye sockets darker than the cheekbones, the whites of the eyes, the edge of the face against the background. Darker skin reflects less light, so those patterns are smaller in code values and closer to the noise. The lab’s skin chart puts numbers on it. In linear light, the lightest Monk Skin Tone swatch (MST 1) has a luminance of about 0.86, 18% grey is 0.18, and the deepest swatch (MST 10) is about 0.018. MST 10 sits about 3.3 stops below grey and about 5.5 stops below MST 1. Those are the lab’s display sRGB swatches, not measured skin reflectances, but the size of the gap is the point. Put that face in shade and the scene in sun, and the face can be five or six stops under the sky.

Exposure. An auto-exposure system that meters the whole frame puts the average near grey. With a bright sky in frame, the average is high, so exposure drops, and a face already 3 stops under grey falls further. On an 8-bit phone preview, two stops down shrinks a face’s span of code values to about half or less: on the sRGB curve, detail spread over codes 0 to 41 is squeezed into 0 to 17. The detector receives less face than the person in front of it has.

Training data. A detector learns faces from labelled examples. If the examples under-represent dark skin, shade and backlight, the detector is less sure of those faces, and a tracker that lets go below a confidence threshold lets go of them first. The vendors themselves have said so. Google wrote in 2021 that it had “radically diversified the images that train our face detector” and “significantly increased the number of portraits of people of color in the image datasets that train our camera models” (vendor claim, Google, “Real Tone”, 19 October 2021)as of 2026-11, and that stray light “had a tendency to disproportionately wash out darker skin tones”. That is an admission of the problem and a claim about a fix. It is not a published test: there is no test set, method or error rate you can check. Treat every vendor’s fairness claim, Google’s included, as a hypothesis you test on your own people.

Independent evidence shows the problem is real across the industry, though on neighbouring tasks rather than in-camera autofocus. Buolamwini and Gebru’s Gender Shades (2018) tested three commercial face-analysis services and found error rates of up to 34.7% for darker-skinned women against at most 0.8% for lighter-skinned menas of 2026-11 on gender classification. NIST’s 2019 test of 189 face-recognition algorithms found false-positive rates that varied by factors of 10 to beyond 100 across demographic groups, highest in West and East African and East Asian faces for many algorithms, and that the size of the gap depended on the algorithm. Neither study tested a camera’s autofocus. What they establish is that face models do not perform equally across skin tones by default, that the gap varies a great deal from one model to the next, and that the only way to know about the one in your hand is to measure it.

The three causes compound. Less signal makes detection harder; a missed detection makes the camera meter the sky; the darker face is harder to detect on the next frame. That loop is the vox-pop in the Why, and it is why the fix starts with light and exposure, not with a better phone.

Make: computational modes write a composite

The third job changes the file. A modern phone rarely writes one exposure. In bright light and dim light alike it captures a burst and merges it.

Burst merge (HDR). Google’s HDR+ pipeline, described by Hasinoff and colleagues at SIGGRAPH Asia 2016, captures a burst of frames at the same short exposure, works on the raw Bayer data, aligns the frames tile by tile, and merges them to cut noise and extend dynamic range. Short exposures protect the sky; averaging several of them lifts the shadows out of the noise. Most phone makers now do something similar under their own names. The cost is motion: a tile that moved between frames cannot be averaged, so the merge either rejects it (that area keeps the noise of one frame) or blends it (a ghost or smear). A hand waving, a rider passing, a head turning mid-answer: these are where a merged frame stops being a record of one moment.

Night modes. Liba and colleagues (ACM Transactions on Graphics, 2019) describe Google’s Night Sight: down to about 0.3 lux, it picks the number of frames and their exposure times from how much the phone and the scene are moving, merges them, uses a learned auto white balance, and tone-maps the result so night still looks like night. Each of those choices is a model’s decision. The learned white balance is trained on images someone labelled as correct, which is the same training-data question as the detector, now applied to skin colour.

Semantic processing. Phones segment the picture into regions (sky, face, skin, hair, background) and process each differently: lift the faces, deepen the sky, smooth the skin, blur the background in portrait mode. The portrait-mode depth fake is the subject of the lenses chapter. The face lift matters here: a face the segmenter did not find gets the scene’s tone curve, not the face’s, so a missed detection now costs you rendering as well as focus and exposure.

Video. In video, phones change frame rate by themselves when light falls, so a clip you set to 30 fps can drop to 24 fps in shade and come back. That is variable frame rate (VFR). The frame-rates chapter covers why it matters for motion; the Editing course owns conforming it. In this chapter you detect it with ffprobe, because it is one more decision the phone made without telling you.

What the file admits. Some of these decisions leave traces in metadata, and many do not. ExifTool decodes Apple’s maker notes with tags such as HDRImageType and ImageCaptureType, and Google’s HDR+ maker note with a FrameCount, but it documents many of these fields as reverse-engineered and partly unknown, and other makers write less. A file with no merge tag may still be a merge. You cannot prove from a JPEG or HEIC that it is one exposure; you can only find evidence that it is not.

Using it well on a job

None of this means turn the AI off. On a moving subject at a wide aperture, detection and tracking hold focus better than you can by hand, and a burst merge gives a phone a dynamic range its sensor does not have. The skill is knowing when to trust it and when to take the decision back.

  • Fix the light before you fix the camera. Turn the subject so the sun is behind the camera or to the side, or move them into open shade with the bright background out of frame. Add a white bounce card or a reflector under a deep-skinned face. More light on the face helps the detector, the metering and the picture at once.
  • Lock what the software would change. On a phone, press and hold on the face to lock focus and exposure (AE/AF lock), then drag exposure compensation until the face, not the sky, sits where you want it. On a mirrorless body, set the recognition target to the subject type you are shooting (Human, not Auto) so it does not jump to a car or a bird. Recheck the lock each time the person moves.
  • Expose for the deepest face in frame. In a group, the camera will expose for the face it found or for the average. Find the deepest-skinned person, place them first, and protect the highlights with light, not by cutting exposure for everyone.
  • Turn merges off for motion. For anything moving fast, or anything that must be one moment (a product being poured, a handshake, evidence), turn off night and HDR modes or use the camera’s manual or pro mode, and accept the noise. A manual video app that locks frame rate also stops VFR.
  • Test the people, not the phone. Before a vox-pop day, film the range of people you expect, in the light you will have, and count. That test is the lab.

For Lumora’s vox-pop day, that last point is the whole job. Anouk, Lumora’s brand manager, has asked for “real people from every part of Lagos”. The camera team’s duty is that every one of those people comes out sharp and exposed for their own face. A test on the morning of the shoot costs 20 minutes; a reshoot of the people the phone failed costs a day and an apology to them.

Testing it: a protocol you can repeat

A useful test is small, fixed and reported by person.

  1. People across the scale. At least three people, chosen across the Monk Skin Tone Scale (for example one from MST 1–3, one from 4–6, one from 8–10), each with their written consent to be filmed for a test. The Monk scale is Google’s 10-shade scale developed with sociologist Ellis Monk and released openly in 2022 for exactly this kind of evaluation. It has ten shades, against the six types of the Fitzpatrick scale, which dermatology built to describe how skin reacts to sun.
  2. Light that matches the job. At minimum open shade and backlight (sun or a bright window behind the person). Add low light if the shoot runs into evening.
  3. Fixed everything else. Same phone, same lens, same distance (2 m is a vox-pop distance), same mode, same duration (60 seconds), the person talking and turning their head as an interviewee does.
  4. Count, do not judge. A lost lock is any moment the face box disappears or focus visibly leaves the face. A wrong target is any moment the box moves to something else. Count both per person per light.
  5. Report the worst case. “Lost lock 6 times a minute on the MST 9 subject in backlight, 0 in shade” is a finding. “Tracking was mostly fine” is not.

Three people is a check, not a study. It cannot prove a phone is fair; it can show you that this phone, in this light, fails this person today, which is what you need to know before the shoot. The eval-set chapter in AI Engineering explains why small sets catch large failures and miss small ones.

LAB Test your phone's tracking and find what it merged ~45 MIN
YOU NEEDPython 3.9+ and ffmpeg/ffprobe on the PATH (labs/media/README.md)exiftool (`brew install exiftool`, `apt install libimage-exiftool-perl`, or the Windows build from exiftool.org)your own phone, and three people across the Monk Skin Tone range who have agreed in writing to be filmed for a testa sunny spot with open shade nearby, or a bright window

1. Generate the lab files and read a known VFR clip first.

Before you trust ffprobe on your own phone, read a clip whose answer you know. The generator’s video/vfr_phone.mp4 imitates a phone that drops from 30 to 24 fps in low light.

cd labs/media
python3 generate.py
ffprobe -v error -select_streams v:0 \
  -show_entries stream=r_frame_rate,avg_frame_rate,nb_frames \
  -of default=nw=1 out/video/vfr_phone.mp4
ffprobe -v error -select_streams v:0 -show_entries frame=pts_time -of csv=p=0 \
  out/video/vfr_phone.mp4 | awk 'NR>1{d=$1-p; if(min==""||d<min)min=d; if(d>max)max=d} {p=$1} END{printf "frames %d, shortest gap %.1f ms, longest gap %.1f ms\n", NR, min*1000, max*1000}'
At scale 0.1 and seed 1: r_frame_rate=30/1, avg_frame_rate=1350000/48997 (about 27.55 fps), nb_frames=90, and gaps from 30.2 ms to 44.8 ms. A constant 30 fps clip would have both rates equal and every gap at 33.3 ms. The two rates disagree because the clip claims 30 fps but spends frames 31 to 62 at 24 fps (41.7 ms) with 1.6 ms of jitter; answers.json lists every timestamp under video/vfr_phone.mp4. This is a generated clip, not a phone recording.

2. Read your own phone’s video the same way.

Record 20 seconds on your phone in auto, walking from sun into deep shade or a dim room. Copy the file over (AirDrop, USB or a cable, not a messaging app, which re-encodes it) and run the same two commands on it.

ffprobe -v error -select_streams v:0 \
  -show_entries stream=r_frame_rate,avg_frame_rate,nb_frames \
  -of default=nw=1 ~/Desktop/phone_clip.mov
ffprobe -v error -select_streams v:0 -show_entries frame=pts_time -of csv=p=0 \
  ~/Desktop/phone_clip.mov | awk 'NR>1{d=$1-p; if(min==""||d<min)min=d; if(d>max)max=d} {p=$1} END{printf "frames %d, shortest gap %.1f ms, longest gap %.1f ms\n", NR, min*1000, max*1000}'
If the two rates match and the gaps stay within a millisecond of 1/fps, your phone held a constant rate. If the longest gap grows in the shade (41.7 ms is 24 fps, 50 ms is 20 fps), the phone lowered the frame rate to get more light per frame. Write down which it did: the project chapter asks for a constant-rate file.

3. Run the tracking test and log every lost lock.

Set the phone to video, auto mode, face or subject tracking on (the default on most phones). For each of your three people, film 60 seconds in open shade and 60 seconds with the sun or a bright window behind them, at 2 m, while they talk and turn their head. Watch the face box and the focus. Count lost locks (box gone, or focus leaves the face) and wrong targets (box jumps to something else). Record them in a file called tracking_log.csv:

person,mst,light,mode,seconds,lost_locks,wrong_target,notes
A,3,shade,face-eye,60,0,0,
A,3,backlight,face-eye,60,1,0,hunted once when she turned
B,6,shade,face-eye,60,0,0,
B,6,backlight,face-eye,60,2,1,box jumped to a poster
C,9,shade,face-eye,60,1,0,
C,9,backlight,face-eye,60,6,2,no face box for 12 s; exposure dropped

The rows above are an example of the format, not results; replace them with your counts. Pick each person’s mst by comparing their cheek in daylight with the chart: open out/charts/skin_tones.png (patches MST 1 to MST 10, lightest to deepest) and choose the nearest.

Six rows, one per person per light, with your own counts. Keep the clips: they are the evidence if anyone asks how you reached the result.

4. Summarise by person and light.

Save this as summary.py beside the log and run it.

import csv, sys
rows = list(csv.DictReader(open(sys.argv[1])))
print(f"{'MST':>3} {'light':<10} {'lost/min':>8} {'wrong/min':>9}")
for r in sorted(rows, key=lambda r: (r["light"], int(r["mst"]))):
    m = float(r["seconds"]) / 60
    print(f"{r['mst']:>3} {r['light']:<10} {int(r['lost_locks'])/m:8.1f} {int(r['wrong_target'])/m:9.1f}")
python3 summary.py tracking_log.csv
A table sorted by light, then by MST. With the example rows it prints backlight at 1.0, 2.0 and 6.0 lost locks a minute for MST 3, 6 and 9, and shade at 0.0, 0.0 and 1.0. Look down each light’s column: if the deepest person’s numbers are the highest, the phone is failing the person this chapter warned about. Then reshoot person C in backlight with a white card bouncing sun into the face and AE/AF locked on the face, and add that as a seventh row with mode locked+bounce.

5. Find what the phone merged.

Photograph a backlit scene (a person or an object against a bright window or sky) twice from the same spot: once with the phone’s HDR or night mode on (or set to auto), once with it off, or in the camera app’s pro or manual mode. Copy both originals over and compare their metadata.

exiftool -a -G1 -s on.heic  > on.txt
exiftool -a -G1 -s off.heic > off.txt
diff on.txt off.txt | grep -iE 'hdr|capture|scene|frame|night|software|exposuretime|iso|brightness'
exiftool -a -G1 -s -ExposureTime -ISO -HDRImageType -ImageCaptureType -FrameCount -Software on.heic off.heic
Use your real file names and extensions (.heic, .jpg or .dng). On an iPhone, look for Apple maker-note tags such as HDRImageType and ImageCaptureType; on a Pixel, a FrameCount from the HDR+ maker note; other makers write less. Often the exposure time differs and nothing else admits a merge. Note what you found and what you did not: the absence of a tag does not prove a single exposure. Look at both pictures at 100%: hair, fingers or anything that moved will show smearing or noise patches in the merged one.
Repeat step 3 for person C in backlight with exposure compensation pulled down two stops, as a camera does when it meters the sky. Count the lost locks: they rise, because the detector now sees a face with even fewer code values. Then pull compensation back up, add the bounce card, and watch the box hold. The fix was light and exposure; the phone did not change.
DECIDE

Kilnworth is shooting 40 vox-pop clips for Lumora Mobile on phones in one day across Lagos, from 9 am to 5 pm. Your morning test shows the lead phone's face tracking losing the MST 9 test subject six times a minute in backlight and never in shade, while the MST 3 subject loses lock once. The client wants people from every part of the city and is watching the budget. What do you set as the rule for the day?

READING
  1. PAPER
    Burst photography for high dynamic range and low-light imaging on mobile cameras Hasinoff, Sharlet, Geiss, Adams, Barron, Kainz, Chen and Levoy, 2016

    The paper behind HDR+: why a phone captures a burst of short frames and merges them, and what happens to things that move. Read it to know what a merged file is. Read: SIGGRAPH Asia 2016 (ACM Transactions on Graphics 35(6)); sections 1 and 3 to 5 for capture, alignment and merge; skip the Wiener-filter maths on first reading.

  2. PAPER
    Handheld Mobile Photography in Very Low Light Liba et al., 2019

    How Night Sight chooses frame count and exposure from motion, and the learned white balance that decides skin colour in the dark. Read: ACM Transactions on Graphics 38(6), 2019; sections on motion metering and learned white balance.

  3. POST
    Image equity: Making image tools more fair for everyone Florian Koenigsberger, Google, 2021

    Google's own account of where it says it had to improve for darker skin (face detection, white balance, exposure, stray light) and what it changed. A vendor claim with no test data: read it for the failure list, not as proof of a fix.

  4. POST
    Improving skin tone representation across Google Tulsee Doshi, Google, 2022

    The release of the 10-shade Monk Skin Tone Scale, developed with Ellis Monk, for evaluating models across skin tones. The scale this chapter's test uses; the swatches are at skintone.google.

  5. PAPER
    Gender Shades: Intersectional Accuracy Disparities in Commercial Gender Classification Joy Buolamwini and Timnit Gebru, 2018

    The study that showed commercial face analysis erring far more on darker-skinned women. A model for how to test by subgroup and report the worst case. Read: Proceedings of FAT* 2018, PMLR 81; the method and results sections.

  6. PAPER
    Face Recognition Vendor Test (FRVT) Part 3: Demographic Effects (NISTIR 8280) Grother, Ngan and Hanaoka, 2019

    189 algorithms tested across demographic groups: the gaps are real and vary widely by algorithm, which is why you test the one in your hand. Read: NIST, December 2019; the executive summary is enough for this chapter.

  7. DOC
    Focusing using subject recognition functions (Sony help guide) Sony

    A maker's own list of when its subject recognition fails: backlight, shade, low light, hair and sunglasses. Read what it says and notice what it leaves out.

  8. DOC
    ExifTool Apple and Google tag names Phil Harvey

    The maker-note tags the lab reads (HDRImageType, ImageCaptureType; the Google page has the HDR+ FrameCount). Note how many fields are marked unknown: metadata only partly admits what the phone did.

All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: Project: a 60-second product film on a phone, exposed and lit properly →