Royal Society Research Grant

Closing the Loop in Running Mice

An experimental platform to dissect the neural circuits underlying legged locomotion.

Source code and documentation for the outcome of this project can be found here.

In March 2011 the Royal Society (London, UK) funded the Spence Lab with a Research Grant to build a machine vision feedback controlled treadmill system for mice. Called "Closing the Loop in Running Mice," the goal of the proposal was to develop the capability to sense and perturb freely moving mice in real-time. Studying legged systems, I have long been jealous of flight neuroscientists, with their ability to glue flies to torque sensing rods, and then use the exertions of the fly to apply visual stimuli in real-time, as done in the famous LED flight arena developed by Michael Reiser and Michael Dickinson at Caltech. Wouldn't it be great to have similar, closed loop capability, in a legged system? To be able to sense the speed and phase of a running animal in real-time, to automate data collection, and to precisely apply neural and mechanical perturbations? Given the exquisite phase dependence of the nervous system, we need this level of automation to tease apart how the nervous system controls locomotion. Even better, to have this capability in a legged system where exceptional new tools such as optogenetics make possible causal, fast, reversible neural perturbations.

To this end, the objective of this grant was to build a machine vision feedback controlled treadmill for small animals including mice. The version of ths system currently running achieves this objective using a modified Panlab Rodent Treadmill controlled over the serial port by a computer. The computer tracks the animal using a Point Grey Research Grasshopper high speed Firewire Camera. The computer runs the open-source Ubuntu Linux operating system, making it freely available to researchers, and the animal tracking algorithm is written in the free Python programming language, and utilises the also freely available OpenCV computer vision library. This means the apparatus does not rely on any expensive software licenses. The tracking algorithm (image below; click for movie) works by thresholding the image to find dark regions, finding which of these dark regions has area closest to that of the animal, and then fitting an oval to the contour with the closest area. The position and speed of this oval are used to control the treadmill speed in real-time, accelerating and decelerating it to keep the animal near the centre of the belt.

Currently we are using the system to quantify the gaits of running mice, and ask questions about how insects adapt their gait. In the near future, we will be adding a small mechanical perturbation. Small bumps will be applied to the treadmill belt from underneath with an actuator, and we will study how insects recover from these perturbations.

We thank the Royal Society for their generous support.

Structure & Motion Laboratory
Royal Veterinary College
Hawkshead Lane
Hatfield, Hertfordshire AL9 7TA
phone: +44 (0) 1707 666988