Mouse Pellet Detection

We developed a comprehensive video analysis solution to track mouse movement, count pellets, and classify them by color in a controlled research environment. The system leverages advanced object detection, motion tracking, and color segmentation techniques to provide accurate, timestamped behavioral data for scientific analysis.

What We Built

A fully automated video analysis pipeline using:

  • YOLO for object detection of mice and pellets
  • ByteTrack for continuous multi-object tracking of mouse movements
  • SAM 2 (Segment Anything Model) for pixel-level pellet segmentation, even when partially occluded
  • Custom color detection algorithm for red vs. non-red pellet classification
  • Make Sense for video frame annotation
  • Roboflow for dataset preparation, labeling, and augmentation
  • Google Colab Pro for GPU-enabled model training and video processing

The system acts as a precision behavioral analysis engine, dynamically processing video footage to extract quantitative data on mouse behavior and pellet interactions.

Key Features​

Data Annotation

  • 10,000 diverse frames annotated across 20 videos
  • Robust training set for accurate detection

Mouse Detection & Tracking

  • Real-time identification of mice in video frames
  • Continuous tracking using ByteTrack for movement analysis
  • Motion pattern detection and distance calculations

Pellet Segmentation

  • Pixel-level segmentation using SAM 2 for occluded pellets
  • Accurate counting of pellets dropped after video start

Color Detection

  • Custom algorithm classifying pellets as red or non-red
  • Threshold-based classification for consistent results

Timestamp Detection

  • Precise logging of when pellets fall
  • Essential for behavioral timing analysis

Motion Analysis

  • Pattern detection of pellet drops and mouse movements
  • Comprehensive behavioral insights

How It Works

Video footage is ingested and frames are extracted

YOLO detects mice and pellets within each frame

SAM 2 performs pixel-level segmentation for occluded pellets

ByteTrack tracks mouse movement continuously across frames

Color detection algorithm classifies pellets by color

Timestamped data is compiled into comprehensive CSV reports

Results

96%

detection accuracy for pellet identification

Completed

within 5-week timeline with consistent milestone delivery

18%

reduction in false negatives

Accurate

differentiation between red and non-red pellets

Detailed

timestamped data for behavioral analysis

Value Dilevered

This project transformed manual video analysis into an automated, high-precision behavioral tracking system. By combining object detection, motion tracking, and color segmentation, the solution provides researchers with accurate, timestamped data essential for understanding mouse behavior streamlining research processes and enabling more robust scientific conclusions.

Want to build AI-powered Problem solutions?

View Our Work

#Computer Vision #Object Detection #YOLO #ByteTrack #SAM 2 #Behavioral Analysis #Video Processing #Research Automation