The Mouse Action Recognition System (MARS): a software pipeline for automated analysis of social behaviors in mice

Cristina Segalin, Jalani Williams, Tomomi Karigo, May Hui, Moriel Zelikowsky, Jennifer J. Sun, Pietro Perona, David J. Anderson, Ann KennedybioRxiv 2020

Abstract

The study of naturalistic social behavior requires precise quantification of animal interactions, a task traditionally performed through manual annotation. This process is labor-intensive, time-consuming, and prone to subjective bias. While computer vision has advanced pose estimation for individual animals, accurately classifying complex social behaviors remains a significant technical hurdle. We introduce the Mouse Action Recognition System (MARS), an automated pipeline for pose estimation and behavior quantification in pairs of freely interacting mice. MARS achieves human-level performance in behavior classification and is accompanied by the Behavior Ensemble and Neural Trajectory Observatory (BENTO), a graphical user interface for multimodal data analysis. Together, these tools provide an end-to-end, user-friendly pipeline for behavioral neuroscience.

Introduction: The Bottleneck of Manual Annotation

In behavioral neuroscience, the "gold standard" for measuring social interaction has long been manual annotation. This involves researchers watching hours of video and manually recording the onset and duration of specific behaviors, such as attacks or sniffing. This process is not only inefficient—often taking three to four times the length of the actual video—but also highly subjective. Even expert annotators within the same laboratory frequently disagree on the exact timing of behavioral boundaries.

While recent advancements in deep learning have improved "pose estimation" (tracking specific anatomical keypoints), moving from raw coordinates to "action recognition" (interpreting what the animal is doing) is difficult. This is particularly true in social contexts where mice may huddle, tumble, or wear bulky experimental hardware like microendoscopes or cannulas, which can obscure their bodies and confuse traditional tracking algorithms.

The MARS Pipeline

MARS addresses these challenges through a modular four-stage deep learning pipeline designed to transform raw video into interpretable behavioral data:

  1. Detection: The system utilizes a modified MSC-MultiBox detector with an Inception-ResNet v2 backbone to identify and draw bounding boxes around each mouse in the frame.
  2. Pose Estimation: A Stacked Hourglass Network identifies 7 to 11 anatomical keypoints (such as the nose, ears, and paws) for each animal, providing a digital skeleton of their posture.
  3. Feature Extraction: Rather than relying on raw pixels, MARS calculates 270 spatiotemporal features. These include metrics such as the velocity of each mouse, the distance between their noses, and their relative body orientations.
  4. Action Classification: These features are processed by an XGBoost (gradient boosting) classifier to predict behaviors frame-by-frame. To ensure biological plausibility, a Hidden Markov Model (HMM) smooths the output, preventing the detection of impossibly short behavioral "bouts."

To complement MARS, the authors developed Bento, a graphical user interface (GUI) that allows researchers to synchronize these automated behavioral labels with other data streams, such as calcium imaging, electrophysiology, or audio recordings.

Benchmarking and Robustness

To train and validate MARS, the authors produced a massive, high-quality dataset that serves as a benchmark for the community. This includes 30,000 frames of manual pose annotations (each verified by five different annotators to create a "consensus" ground truth) and over 14 hours of annotated social interactions, including attack, mounting, and close investigation.

A key strength of MARS is its robustness. The training data specifically included mice with head-mounted cables and sensors. Unlike simpler silhouette-based tracking systems that fail when the animal's outline is altered, MARS’s deep learning architecture successfully ignores experimental "clutter," making it compatible with modern optogenetic and imaging workflows.

Key Results and Biological Insights

MARS demonstrated performance levels indistinguishable from human experts. In top-view videos, 92% of MARS’s keypoint estimates were within 5mm of the human-defined ground truth. More importantly, the F1 scores for classifying complex behaviors like attacking and mounting were comparable to the level of agreement between two human experts.

The utility of the system was demonstrated through two primary applications:

  • Genetic Screening: MARS was used to screen three different genetic mouse models of autism, successfully identifying distinct behavioral "fingerprints" for each line.
  • Neural Correlation: Using Bento, researchers discovered specific neurons in the medial preoptic area (MPOA) of the hypothalamus that are precisely tuned to the onset of mounting behavior, showcasing the power of integrating automated behavior tracking with neural recordings.

Limitations and Future Directions

Despite its successes, MARS faces certain limitations. Pose estimation accuracy drops in front-view camera angles (67% accuracy) due to frequent occlusions when one mouse stands in front of the other. Additionally, as a supervised learning system, MARS can only recognize behaviors it has been explicitly trained to identify; studying new behaviors still requires an initial investment in manual labeling.

Future iterations of the software may incorporate unsupervised learning to discover novel behavioral categories that humans might overlook. While Bento is currently Matlab-based, a Python version is in development to increase accessibility for the broader scientific community. Ultimately, MARS and Bento represent a significant step toward making behavioral neuroscience more objective, reproducible, and scalable.

Summary updated

BibTeX
@misc{segalin2020mouse,
  author = {Cristina Segalin and Jalani Williams and Tomomi Karigo and May Hui and Moriel Zelikowsky and Jennifer J. Sun and Pietro Perona and David J. Anderson and Ann Kennedy},
  title = {{The Mouse Action Recognition System (MARS): a software pipeline for automated analysis of social behaviors in mice}},
  year = {2020},
  doi = {10.1101/2020.07.26.222299},
  howpublished = {bioRxiv},
}
Figure