Back to blog

Published September 19, 2025

A masked ViT for person re-identification

Computer VisionViTRe-Identification

Re-ID in one line

Given a photo of a person, the task is to find the same person in a gallery of other images.

The mask trick

The background adds identity features that generalize poorly. For that reason the ViT receives a segmentation mask together with the image, which focuses the model's attention on the silhouette. This has two effects:

  • fewer false matches caused by similar backgrounds;
  • better robustness to changes in viewpoint and lighting.

The demo on this site runs on synthetic data, and no real biometric images are processed.