TL;DR
This paper introduces a novel two-stream deep learning approach for automatically detecting pain in dogs from video. By combining body keypoint information with RGB video frames, their method achieves good classification results, addressing a significant gap in automated animal welfare monitoring.
What Problem Does This Paper Address?
Recognizing pain in animals, particularly dogs, is crucial for their well-being. While human owners can often intuitively detect pain through behavioral cues, automating this process is challenging. Dogs exhibit diverse breeds, appearances, and coping strategies, making it difficult for computer vision systems to generalize. Existing research on automated pain estimation in animals is limited, especially for dogs, and often relies on specific clinical scales or focuses solely on facial expressions. This paper aims to bridge this gap by developing a robust video-based system for dog pain estimation.
Methods
The proposed approach utilizes a two-stream deep neural network architecture.
- Pose Estimation: The system first detects dogs in video frames using a YOLOv5 object detection model. Subsequently, a pre-trained HRNet-W32 model is employed to extract 17 keypoints representing the dog's body (head, spine, legs). To handle self-occlusions and missing keypoints, they implement a strategy involving interpolation from neighboring frames, discarding frames with excessive missing data, and inferring leg keypoints based on symmetry and other available points. The extracted keypoints are then normalized to account for variations in dog size and distance from the camera.
- Two-Stream Network:
- Keypoint Stream: A basic LSTM network processes the sequence of normalized body keypoints to capture temporal pose information.
- RGB Stream: A Convolutional LSTM (C-LSTM) network processes the raw RGB video frames to extract visual features over time. C-LSTM is chosen for its ability to handle spatio-temporal data effectively.
- Attention Mechanism: An attention mechanism is applied to the LSTM outputs to allow the model to focus on the most relevant time steps for pain detection.
- Fusion: The features from both streams are concatenated and fed into a fully connected layer for final binary classification (pain vs. no pain).
Datasets
The authors introduce a new dataset called the Anonymous University Dog Behavior Dataset (AUDBD). This dataset consists of 61 videos of individual dogs, totaling over 6 hours of footage. It is annotated by veterinary experts based on medical records, categorizing videos into "pain condition" (orthopedic and neurological pain) and "non-pain condition." To evaluate their pose estimation method, they also used:
- StanfordExtra: An image-based dataset with annotated 2D keypoints, derived from the Stanford Dog Dataset.
- TigDog: A video dataset without annotated keypoints, sourced from the Youtube-Objects dataset.
Key Insights and Ideas
- Leveraging Both Pose and Appearance: The paper highlights the importance of combining both body pose (keypoints) and visual appearance (RGB frames) for accurate pain detection. Relying on just one modality proved insufficient.
- Handling Missing Data is Crucial: The proposed method for dealing with self-occlusions and missing keypoints is essential for robust pose estimation in real-world scenarios.
- Temporal Information is Key: The use of LSTM and C-LSTM networks underscores the significance of temporal dynamics in behavioral analysis for pain detection.
- Veterinary Expertise is Invaluable: The creation of the AUDBD dataset, annotated by veterinary professionals, is a critical step towards building reliable models for animal welfare.
Key Results
- Pose Estimation: The pre-trained HRNet achieved good performance on the pose estimation task, with PCK scores generally above 80% across datasets, performing best on the visually similar StanfordExtra dataset.
- Pain Estimation: The best performing model, a C-LSTM combined with an LSTM network (C-LSTM+LSTM128), achieved an average F1 score of 76.3% ± 4.4 and an average accuracy of 77.0% ± 4.6 on the AUDBD test set. This outperforms single-stream models and other two-stream configurations.
- Qualitative Analysis: Grad-CAM visualizations showed that the model focuses on relevant body parts (e.g., legs, head) for orthopedic pain, indicating it learns meaningful cues. However, it also identified cases where the model struggled, particularly when key body parts were not clearly visible.
Limitations and Future Work
- Limited Pain Categories: The current study focuses only on orthopedic and neuropathic pain, excluding other categories like organic pain.
- Data Imbalance: While efforts were made to balance the dataset, the F1-score is reported in addition to accuracy, suggesting potential class imbalance.
- Generalization to Other Breeds/Conditions: The paper acknowledges the challenge of generalizing across different breeds and the need for further validation.
- Facial Region Neglect: The authors explicitly state that they did not focus on facial regions, which are known to contain pain indicators. Future work could incorporate validated grimace scales for labeling and analysis of facial expressions.
- Clinical Validation: The proposed approach is not yet a clinical assessment tool and requires further testing and validation.
- Real-time Performance: While not explicitly detailed, the complexity of the two-stream model might pose challenges for real-time applications.
Summary updated