In order to promote the welfare of farm animals, there is a need to be able to recognize, register and monitor their affective states. Numerous studies show that just like humans, non-human animals are able to feel pain, fear and joy amongst other emotions, too. While behaviorally testing individual animals to identify positive or negative states is a time and labor consuming task to complete, artificial intelligence and machine learning open up a whole new field of science to automatize emotion recognition in production animals. By using sensors and monitoring indirect measures of changes in affective states, self-learning computational mechanisms will allow an effective categorization of emotions and consequently can help farmers to respond accordingly. Not only will this possibility be an efficient method to improve animal welfare, but early detection of stress and fear can also improve productivity and reduce the need for veterinary assistance on the farm. Whereas affective computing in human research has received increasing attention, the knowledge gained on human emotions is yet to be applied to non-human animals. Therefore, a multidisciplinary approach should be taken to combine fields such as affective computing, bioengineering and applied ethology in order to address the current theoretical and practical obstacles that are yet to be overcome.