The most popular and well-known machine learning algorithm for face recognition is the Viola-Jones algorithm. It detects photos in several stages: feature definition, feature assessment, feature classifier definition, and classifier cascade check. For example, the OpenCV library works exactly like that.