Abstract
Mankind directly controls the environment and lifestyles of several domestic species for purposes ranging from production and research to conservation and companionship. These environments and lifestyles may not offer these animals the best quality of life. Behaviour is a direct reflection of how the animal is coping with its environment. Behavioural indicators are thus among the preferred parameters to assess welfare. However, behavioural recording (usually from video) can be very time consuming and the accuracy and reliability of the output rely on the experience and background of the observers. The outburst of new video technology and computer image processing gives the basis for promising solutions. In this pilot study, we present a new prototype software able to automatically infer the behaviour of dogs housed in kennels from 3D visual data and through structured machine learning frameworks. Depth information acquired through 3D features, body part detection and training are the key elements that allow the machine to recognise postures, trajectories inside the kennel and patterns of movement that can be later labelled at convenience. The main innovation of the software is its ability to automatically cluster frequently observed temporal patterns of movement without any pre-set ethogram. Conversely, when common patterns are defined through training, a deviation from normal behaviour in time or between individuals could be assessed. The software accuracy in correctly detecting the dogs' behaviour was checked through a validation process. An automatic behaviour recognition system, independent from human subjectivity, could add scientific knowledge on animals' quality of life in confinement as well as saving time and resources. This 3D framework was designed to be invariant to the dog's shape and size and could be extended to farm, laboratory and zoo quadrupeds in artificial housing. The computer vision technique applied to this software is innovative in non-human animal behaviour science. Further improvements and validation are needed, and future applications and limitations are discussed.
Introduction
Assessing the welfare of confined animals—whether in shelters, laboratories, or farms—relies heavily on observing their behavior. However, traditional behavioral monitoring is a significant bottleneck. Manual "live scoring" or reviewing hours of video is incredibly time-consuming, expensive, and prone to human subjectivity. Furthermore, standard 2D video analysis struggles with "occlusion" (e.g., a dog’s legs disappearing under its body from a top-down view) and fails to capture vertical movement accurately. While wearable sensors like accelerometers can help, they are invasive and can induce stress in the subjects.
This study introduces B.A.R.K. (Behavioural Automatic Recording in Kennels), a prototype designed to provide a non-invasive, automated, and objective 3D behavioral analysis. By leveraging depth sensors and machine learning, the system aims to overcome the limitations of traditional 2D monitoring and manual observation.
Methodology
3D Data Acquisition
The researchers utilized a Microsoft Kinect depth camera to capture 3D spatial data. Unlike standard cameras, depth sensors create a "cloud of points" defining the distance of every pixel from the lens. This allows the software to isolate the animal from its environment (segmentation) with high precision, regardless of lighting conditions or background complexity.
Technical Framework
The core technical framework consists of three primary components:
- Structural Support Vector Machines (SSVM): This classifier was trained to fit a seven-part skeleton (head, torso, tail, and four legs) to the dog’s 3D "blob." This allows the system to recognize specific postures like standing, sitting, or lying down.
- Needleman-Wunsch (NW) Algorithm: Borrowing a technique from bioinformatics (originally used for aligning DNA sequences), the authors used NW to align behavioral time-series data. This allows the system to recognize that two dogs are performing the same action (like circling) even if they move at different speeds.
- Unsupervised Clustering: Using K-medoids, the system can group similar temporal patterns of movement into clusters. This allows the software to "discover" behaviors without a human needing to define an ethogram (a catalog of behaviors) beforehand.
Experimental Setup
The study used a mix of controlled and real-world data:
- Laboratory Setting: A trained Bearded collie mix was recorded in a controlled room to test basic commands (sit, stay, walk).
- Shelter Setting: Four dogs of varying breeds (mongrels with different coat lengths and colors) were recorded in their residence pens at a rescue shelter in Italy.
- Validation: The system was trained on 400 randomly selected frames. Validation was performed against a "Ground Truth" (GT) dataset of 13 video clips (approx. 25,000 frames) manually annotated by a blind experimenter.
Results
The B.A.R.K. system demonstrated high accuracy and strong correlation with human observers:
- Posture Accuracy: The system achieved a Percentage of Correctly estimated body Parts (PCP) of up to 83% in controlled settings and 74-80% in shelter environments.
- Classification Success: "Stand" and "Walk" behaviors were identified with >95% accuracy.
- Human-Machine Agreement: Correlation (Spearman’s rho) between the software and human observers was very high for locomotion (0.95) and standing (0.92).
- Benchmarking: The system outperformed previous state-of-the-art 2D and 3D models specifically designed for human pose estimation or earlier dog-tracking iterations.
Discussion and Limitations
One of the most striking features is the system’s ability to cluster behaviors without pre-set labels, identifying recurring geometric patterns in space and time. Because the system builds a skeleton based on the animal's barycenter and anatomical constraints, it is designed to be invariant to the dog's specific size or shape, theoretically making it applicable to other quadrupeds like pigs or cows.
However, several hurdles remain:
- Environmental Sensitivity: The Kinect’s infrared sensor is sensitive to high light exposure. Direct sunlight in outdoor pens can "blind" the sensor, leading to poor segmentation.
- Morphological Extremes: Dogs with very long hair (which obscures the "blob" shape) or very short legs (like Dachshunds) can still cause skeletal fitting errors.
- Ambiguous Postures: The system occasionally struggled to distinguish between "sitting" and "lying down" when the depth difference became negligible.
- Social Complexity: The current prototype tracks individually housed animals; future work is needed to handle multiple interacting animals.
Conclusion
The B.A.R.K. system represents a significant step toward automated, objective animal welfare monitoring. By integrating 3D computer vision with advanced machine learning, researchers can gain scientific knowledge on animals' quality of life in confinement while saving considerable time and resources.
Summary updated