Most discussions of face swapping start with the model: which architecture, how many landmarks, how good the identity embedding is. That is the wrong end of the pipeline. By the time a swapped face is pasted back, detection is already solved well enough for almost any frontal photo. What decides whether the result looks real is the four compositing passes that come after it, and each one has a cheap, checkable failure mode.
1. Geometry: the mask, not the face
The mask has to follow the source face's contour, including the parts that are not face: the jaw shadow, the hairline, the ear. A mask cut to an oval produces an oval of new skin inside an old head, and the seam sits where the skin tone changes. If the mask is drawn on landmarks only, it will cut through hair strands and leave the neck untouched, which is exactly where the eye checks first.
2. Colour: match the light, not the average
Average skin colour matching gets you a face that is the right tone and the wrong temperature. The two things that give it away are the white balance of the light hitting the face and the gradient across it. A face lit from the left and composited flat will look pasted even if the mean colour is perfect. Match a few patches (forehead, cheek, neck) rather than the whole region, and match them per channel.
3. Shadow: the contact area
The single most useful check is the shadow under the jaw and where the face meets the neck. A new face carries its own implied light direction. If the source photo has a hard shadow under the chin and the swapped face has none, the head looks like it is floating. This is also why swapping in a group photo is harder than swapping a portrait: two faces share a contact shadow that neither crop knows about.
4. Grain and sharpness
A swap is rendered clean, then placed on an image that has sensor noise, JPEG artefacts and a depth-of-field falloff. A face that is sharper and smoother than the rest of the frame is the most common tell at 100%. Add grain to match, and blur to match the local sharpness, or apply the depth-of-field pass after compositing rather than before.
The order matters
Do geometry, then colour, then shadow, then grain. Each pass assumes the previous one is right; running them out of order means redoing the earlier ones. And check the result at three sizes: thumbnail (does it read as a face), 50% (does the seam sit), 100% (does the texture match). Most swaps pass the first and fail the third.
If you want a reference implementation to compare against, faceswapai.com handles photos, video and GIF, up to ten faces in a group photo, ten minutes of video, HD and no watermark.
Top comments (0)