model-insights · RetinaFace · MobileNet-0.25 · WIDER FACE

Inside a face detector

Before a face can be recognised, it has to be found. RetinaFace answers two questions for every small patch of an image: is there a face centred here, and if so, where exactly are its box, its eyes, its nose and its mouth corners? This version is tiny: 423,264 parameters, about 1.7 MB, fast enough for a webcam. It learned what a face is from WIDER FACE, a collection of crowded photos full of small, tilted and half-hidden faces. That shows in what it accepts, and in what it mistakes for a face.

Loading model weights…

1 12,600 guesses per image

The image is resized to 640×480. A MobileNet backbone at a quarter of its usual width shrinks it in three stages, to grids of 80×60, 40×30 and 20×15 cells (one cell per 8, 16 and 32 pixels). A feature pyramid passes the coarse, semantic grids back down to the fine ones. Then SSH context modules widen what each cell sees with 3×3, 5×5 and 7×7 receptive branches. Each cell of each grid carries two anchors, square template boxes: 16 and 32 pixels on the finest grid, 64 and 128 on the middle one, 256 and 512 on the coarsest. That makes 12,600 anchors. For each one the network outputs a face score, four numbers that nudge the anchor into the face's box, and ten numbers for the five landmarks. A face is whatever survives a score threshold and non-maximum suppression.

The weights' file name matches mobilenet0.25_Final from the open-source Pytorch_Retinaface project, which trains on WIDER FACE: 32,203 photos with 393,703 labelled faces in 61 event categories (parades, riots, concerts, sports). The five landmarks come from extra annotations made for the RetinaFace paper. This page runs the same model the embedder page uses to crop faces.

Layer by layer

2 Watch it look

Pick an image, or start the webcam and press Live. Boxes are coloured by the grid that found them (stride 8 stride 16 stride 32). The three maps on the right show the face score of every cell, the better of its two anchors: where on each grid the network thinks a face is centred.

drop / paste an image · click to grow a face

Face score per cell

Feature maps the heads read

3 What a crowd photo teaches

To measure what it accepts, we took the astronaut's face, changed one thing at a time and recorded the best face score anywhere in the image.

4 Faces where there are none

A detector tuned to find a face in fifteen pixels of a crowd will also find faces in things that only partly look like one. We ran it over every non-face image on this site: the sample photos, and the class visualisations of VGG16, ResNet-50, YOLOv8 and CLIP. Here are the strongest hits. Some are pareidolia. Others are real residues: faces that the other networks drew because their training photos had people in them.

5 What it thinks a face is

Start from noise and change the pixels until one anchor in the middle of the image is certain it sees a face, once for each anchor size. Nothing but "face score up" was asked for.

You can do the same on any image in §2: click a spot and the page will grow a face there, sized for the anchor you choose, by gradient ascent on that anchor's score. On a photo, what grows is mostly a dense, colourful pattern with a darker centre. The score reaches 1.0 long before a person would see a face, and the re-run usually finds a few extra small "faces" around it. On the brick wall sample, 60 steps for a 64 px face gave the target anchor 1.000, and detection then kept 4 faces.

Click on the image in §2 to start.