# Developing and Assessing the Performance of a Machine Learning Model for Analyzing Drinking Behaviors in Minipigs for Experimental Research

**Authors:** Frederik Deutch, Lars Schmidt Hansen, Firas Omar Saleh, Marc Gjern Weiss, Constanca Figueiredo, Cyril Moers, Anna Krarup Keller, Stefan Rahr Wagner

PMC · DOI: 10.3390/s26020402 · Sensors (Basel, Switzerland) · 2026-01-08

## TL;DR

A low-cost computer vision system was developed to automatically monitor and analyze drinking behavior in minipigs, showing high accuracy and potential for experimental research.

## Contribution

A novel, low-cost vision-based system using machine learning was developed and validated for detecting drinking behavior in minipigs.

## Key findings

- The YOLOv11n model achieved over 97% accuracy in detecting drinking behavior features.
- Manual validation showed 99.7% overall accuracy with high precision and recall.
- Drinking patterns revealed bimodal behavior and significant inter-pig variability.

## Abstract

Monitoring experimental animals is essential for ethical, scientific, and financial reasons. Conventional observation methods are limited by subjectivity and time constraints. Camera-based monitoring combined with machine learning offers a promising solution for automating the monitoring process. This study aimed to validate and assess the performance of a machine learning model for analyzing drinking behavior in minipigs. A novel, vision-based monitoring system was developed and tested to detect drinking behavior in minipigs. The system, based on low-cost Raspberry Pi units, enabled on-site video analysis. A dataset of 5297 images was used to train a YOLOv11n object detection model to identify key features such as pig heads and water faucets. Drinking events were defined by the spatial proximity of these features within video frames. The multi-class object detection model achieved an accuracy of above 97%. Manual validation using human-annotated ground truth on 72 h of video yielded an overall accuracy of 99.7%, with a precision of 99.7%, recall of 99.2%, and F1-score of 99.5%. Drinking patterns for three pigs were analyzed using 216 h of video. The results revealed a bimodal drinking pattern and substantial inter-pig variability. A limitation to the study was chosen methods missing distinguishment between multiple pigs and the absence of quantification of water intake. This study demonstrates the feasibility of a low-cost, computer vision-based system for monitoring drinking behavior in individually housed experimental pigs, supporting earlier detection of illness.

## Full-text entities

- **Chemicals:** water (MESH:D014867)
- **Species:** Homo sapiens (human, species) [taxon 9606], Sus scrofa (pig, species) [taxon 9823]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12845838/full.md

## Figures

12 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12845838/full.md

## References

34 references — full list in the complete paper: https://tomesphere.com/paper/PMC12845838/full.md

---
Source: https://tomesphere.com/paper/PMC12845838