Step 1: finding the face
Before anything can be estimated, a face detector scans the image for regions that look like faces and draws a box around each one with a detection score. The detector used here is a deliberately small network, which keeps the download light and fast enough to run on a phone. Small detectors miss faces that are tiny, turned away, heavily shadowed or partly covered.
The Age & Gender Detector handles that with up to three passes. A strict pass runs first, keeping only confident detections. If it finds nothing, a relaxed pass accepts weaker detections and the result is marked rough, because a weak box may be a partial face or not a face at all. If that misses too, a close-up pass puts the photo on a larger canvas, because small detectors often miss a face that fills the whole frame. Faces are then sorted largest first and numbered, so Face 1 is usually the person the photo is about.
Step 2: preparing the crop
Each face box is cut out and resized to the fixed square size the age network expects. This is where resolution matters: a face that was only a few dozen pixels wide in the original photo gets stretched, and the fine texture the network uses is simply not there. Landmark points around the eyes, nose, mouth and jaw are also found at this stage; this tool uses them to measure head tilt for the photo quality meter, and the other analyses use them to measure proportions.
Step 3: the age and gender network
The crop goes through a convolutional neural network, a model built from layers that each respond to visual patterns: edges and gradients in the early layers, textures and shapes in the middle, and combinations like the shape of an eye socket or the depth of a fold near the mouth in the deeper layers. At the end, one output predicts a number for age and another predicts a probability for male or female.
The network learned those outputs from many photos that people had labelled with an age and a gender. It does not know what ageing is. It knows which patterns tended to come with which labels in its training data, and it reports the label that fits your crop best. That is why it is more accurate to call the result apparent age: the age that photos like yours were usually labelled with.
Step 4: the stability check
A single forward pass gives a single number, and a single number looks more certain than it is. So the detector runs the age network four times on slightly different versions of the same face: the original crop, a mirror image and two crops shifted a little. A face is roughly symmetrical and those shifts are small, so in an ideal world all four answers would match.
They rarely match exactly. The tool shows the middle value and the lowest-to-highest spread. A tight spread tells you the model is consistent on this photo. A wide spread tells you the photo is hard for the model, perhaps because of blur, shadow or angle. Neither tells you whether the model is right: a model can be consistently wrong. Consistency and accuracy are different things, and the tool labels the check accordingly.
Step 5: quality and context
Alongside the estimate, a photo quality meter checks four things that are known to throw age models off: how large the face is in pixels, how bright and evenly lit it is, how sharp it is, and how far the head is tilted. When one of them is poor, the tool tells you what to change. In a group photo, a summary adds the number of faces found and the average, youngest and oldest estimate.
- Face size: small faces lose the texture the network reads.
- Light: shadows read as lines and hollows.
- Sharpness: blur removes fine detail and pulls estimates towards the middle.
- Tilt: rotated faces look less like the upright training photos.
Why everything happens in your browser
Many online age detectors send your photo to a server for analysis. This one downloads the small models once, keeps them in your browser cache, and runs them with TensorFlow.js on your own device. The photo never leaves the page. That design choice limits how large the models can be, which is one reason the tool is careful to describe its output as an estimate with a range rather than a precise answer.