Animal faces convey important information such as individual health status1 or identity2,3. Human and nonhuman primates rely on highly heritable facial traits4,5 to recognize their kin6–8. However, whether these facial traits have evolved for this specific function of kin recognition remains unknown. We present the first unambiguous evidence that inter-individual facial similarity has been selected to signal kinship using a state-of-the-art artificial intelligence approach based on deep neural networks and long-term data on a natural population of nonhuman primates. The typical matrilineal society of mandrills, is characterized by an extreme male’s reproductive skew with one male generally siring the large majority of offspring born into the different matrilines each year9. Philopatric females are raised and live throughout their lives with familiar maternal half-sisters (MHS) but because of male’s reproductive monopolization, they also live with unfamiliar paternal half-sisters (PHS). Because kin selection predicts differentiated interactions with kin rather than nonkin10 and that PHS largely outnumber MHS in a mandrills’ social group, natural selection should favour mechanisms to recognize PHS. Here, we first show that PHS socially interact with each other as much as MHS do, both more than nonkin. Second, using artificial intelligence trained to recognize individual mandrills from a database of 16k portrait pictures, we demonstrate that facial similarity increases with genetic relatedness. However, PHS resemble more to each other than MHS do, despite both kin categories sharing similar degrees of genetic relatedness. We propose genomic imprinting as a plausible genetic mechanism to explain paternally-derived facial similarity among PHS selected to improve kin recognition. This study further highlights the potential of artificial intelligence to study evolutionary mechanisms driving variation between phenotypes.