'Creating a unique hash per face leveraging face recognition techniques

Using face recognition and related techniques I would like to create a unique hash for each face. The idea is that same person's face always returns the same hash, irrespective of lighting conditions, make-up, angle and rotation and similar. Obviously, identical twins might potentially result in the same hash, but that's okay. Also, I am not aiming at perfection, this is not security relevant, other factors such as ability to execute on a client device are more relevant.

Also, I don't need to actually determine to whom the face belongs, it is sufficient to just distinguish it uniquely from every other face and deterministically re-create the same hash each time I see the same face again.

Ideally, I'd like to use some JavaScript library that can run in a browser like face-api.js, pico.js or similar.

However, I am a bit confused how to approach this from a conceptual perspective. For example, if I determine the landmarks of a face, are these landmarks staying the same for each face, so I could use them to create the hash? Also, how should I handle the situation when the landmarks are just slightly different (e.g. due to lighting conditions) so this would result in a different hash due to small deviations? Is there any approach that is robust to such deviations?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source