Related Experiment Video
Updated: May 14, 2026

Noninvasive, In-pen Approach Test for Laboratory-housed Pigs
Published on: June 5, 2019
Computer Vision Applied to the Analysis of Pig Behavior Patterns in an Air-Conditioned Environment
Maria de Fatima Araújo Alves1, Héliton Pandorfi2, Rodrigo Gabriel Ferreira Soares2
1Department of Agricultural Engineering, Federal Rural University of Pernambuco, Dom Manoel de Medeiros Avenue, SN, Dois Irmãos, Recife 52171-900, Pernambuco, Brazil.
None:
Observing pig behavior, such as feed intake, water intake, and resting behavior, is essential for improving the well-being of these animals. However, monitoring such behaviors by traditional methods can be exhausting for both humans and animals, interfering with their development. The research aimed to identify behavioral patterns of pigs in an air-conditioned environment through computer vision. Microcameras were installed in the animals' stalls to generate videos over an experimental period of 92 days and the temperature and humidity of the air were simultaneously recorded. The physiological variables of the animals were collected to identify whether they were under heat stress. To recognize the drinking, eating, standing and lying behavior of pigs, YOLOv5 was trained and then the model was used to detect the animals. Regions in the images corresponding to the feeders and drinkers were established. To identify feeding behavior and water intake, criteria based on the occupation of the feeding zone by pigs detected in the standing position were established. The results showed that the trained model achieved an average accuracy rate of 97.3% and an average recall of 96.1% in animal detection. The model exhibited 97.5% accuracy and 97.0% recall rates in recognizing the feeding behavior and water consumption of pigs. The proposed method can be used in videos or images and minimizes the need for manual intervention, offering an efficient means of monitoring pig behavior in agricultural environments and contributing to the productivity of pig farming operations.

