For the object recognition used in Facebook's image search, the AI system was trained with tens of millions of photos, each annotated by a human in advance so the system could learn which pixel patterns correspond to which subjects.