Scientists as well as farmers are increasingly interested in the mental capacities of pigs. Recent research has revealed surprising cognitive abilities, such as episodic memory, intentional deception and even theory of mind. Still, our knowledge about perceptuo-cognitive abilities, especially in the visual domain, is lagging behind. In the few studies conducted so far pigs have failed to discriminate pictures of conspecifics, which contrasts with findings in other farm animals. From the perspective of human-animal relationship it would be especially interesting to know what and how pigs learn about humans, for instance, if they would learn to visually discriminate people. To address this question, we conducted an experiment with 33 free-ranging pigs that lived for almost two years in close relationship to humans. The task afforded to discriminate between two views of the heads (front and back) of 10 women presented on a computer screen. The computer-controlled training excluded the influence of human experimenters and any other cues than the visual ones. Altogether 31 subjects reached a high (> 80%) and stable learning criterion within approximately 400 trials, with some pigs having accomplished this in less than half of the trials. This discrimination performance, which could not be achieved by using simple features like size, color or brightness, challenges the one of a previous study in which pigs failed to discriminate between only two pictures of conspecifics. A generalization test, in which the pigs were asked to spontaneously discriminate the two head views from further 16 women, corroborated this astonishing achievement. The average score of 84% correct responses suggests that the pigs had not simply stored the training pictures together with the respective contingency in their memory but have learned the task by open-ended categorization. A final set of tests with inverted and scrambled pictures and ones with missing facial parts aimed at determining which features of the stimuli the pigs used as discriminatory cues. At least for some pigs these features were face specific or orientation-dependent, as changes of the facial parts (eyes or mouth) or of the orientation of the face were avoided. These findings revise some pessimistic conclusions drawn from previous studies and challenge the still dominant view about the poor visuo-cognitive abilities of pigs. The use and training of all senses and the fostering of their cognitive talents is likely a form of cognitive enrichment in conventional housing systems and a way of enhancing their welfare.