Using Machine-Vision to Quantify Mouse Behavior


Joseph DuPree

Document Type


Publication Date

Summer 2022



JAX Location

In: Student Reports, Summer 2022, The Jackson Laboratory


The study aimed to develop a machine vision-based approach to quantify spontaneous mouse behavior in a home cage and investigate changes in the sleep-wake cycle of a 5XFAD mouse model of Alzheimer’s disease. I used OpenCV (Open-Source Computer Vision Library) and Python programming language to analyze the mouse video data collected from our custom- made home cages. My analysis approach was to first convert the RGB videos to grayscale and then use image segmentation and morphological operations to identify the mouse and track it. I used this approach not only to quantify the home-cage activity but also during contextual fear conditioning (CFC). I found that the best approach for mouse segmentation in the home-cage videos was based on global thresholding. However, for videos from the CFC task, background subtraction method was more effective because of the presence of dark walls in the fear conditioning chamber. Further, I also tested optical flow approaches to quantify mouse activity. A visual inspection of CFC data revealed freezing behavior during fear conditioning (a total of four shocks), further when the animals were placed in the same chamber after 24 hours, they exhibited freezing behavior and less activity even in the absence of shocks.

Please contact the Joan Staats Library for information regarding this document.