Contemporary facial-recognition algorithms were first properly researched in the early 1990s. To conduct that research, computer scientists and software engineers need large collections of faces to experiment with and to use as performance benchmarks. Before the advent of social media, a common source of faces for this research and development came from mugshots of accused criminals and prisoners. Photos of prisoners are supplied by the American National Institute of Standards (the agency responsible for weights and measures) to researchers across the world developing facial recognition technologies. In a very real sense, facial recognition software is built upon the faces of the accused and the dead.
A large wall piece of training images is included in the exhibition ‘Uncanny Valley: Being Human in the Age of AI‘, which was commissioned by the de Young Museum in San Francisco.
There is also a publication about the exhibition, if you want to learn more.