BehaviorCloud Protocols - Barnes maze

Oct 13 2017

The Barnes maze is a test used for measuring spatial learning and memory in laboratory rodents. The maze is a brightly lit elevated circular platform with holes equally spaced around the edges. One hole leads to an escape box below the maze. Rodents are motivated by an innate aversion to open spaces to find the escape box; spatial cues around the maze help subjects learn the location. After several training trials, rodents typically learn to run straight to the escape hole. Training consists of several trials per day over a period of approximately 4-5 days. Investigators can measure latency to escape, distance taken to reach the escape hole, number of visits to incorrect holes, and velocity to measure how well a subject has learned the task. Optionally, a probe trial can be performed after training is complete where the escape hole is relocated or removed altogether and time spent searching the correct quadrant of the maze is measured.

rodent path through barnes maze


  1. Barnes maze
  2. Mobile device (iOS or Android) with the BehaviorCloud Camera app installed
  3. Tripod or mobile device mount
  4. WiFi
  5. Laptop or second mobile device
  6. Calibration pattern from


Setting up the testing room

Environment: The testing room should be a quiet space with WiFi access. The room should be illuminated and spatial cues should be placed around the maze. For example, different shapes cut out of colored paper can be taped to the walls of the room. The maze should be set up several feet from where the experimenter sits.

Streaming: Log in to the BehaviorCloud Camera app and begin streaming. Mount the mobile device running the BehaviorCloud Camera app above the maze so the entire area is in full view. It is important for the mobile device and the maze to remain in the same positions throughout testing.

Controls: A laptop or a second mobile device should be set up where the experimenter plans to sit during trials. Log in to to reach the experiment dashboard and create a new experiment.

creating an experiment

Running a trial

Preparation: Animals should be brought into the testing room approximately 30 minutes before testing to acclimate to the environment.

Calibration: To get an accurate measure of distance traveled by each rodent, it is important to calibrate the system at the beginning of an experiment. From the laptop or second mobile device, click calibration and place the checkerboard calibration pattern onto the maze in full view. A preview window will show the system automatically recognize the pattern and calculate a distance measurement. Click the arrow to continue to the next step.

Starting a trial: Click Experiment Video and then the plus icon to add a new subject. Select the mobile device that is being used for streaming, enter the subject ID, and enter the duration of the test in seconds. On the next screen, you will be prompted to clear the arena, which means to remove any animals, people, or other moving objects from the view. Then you will be prompted to insert the subject and begin the trial.

Tip: Each animal should be started in the center of the maze. Move the animal in an opaque container from its cage to the maze so it does not get any spatial information before the trial begins.

Finishing a trial: When the scheduled duration has elapsed, the test will automatically end and you will be prompted to enter the next subject ID. Repeat running subjects until you are finished, cleaning the maze thoroughly between subjects. Odor cues from a previous animal could confound the results.

Analyzing data

BehaviorCloud makes your raw video data and analysis tools accessible from anywhere using your online account. At your desk in the lab (or at your favorite coffee shop), log in to your account and run your analysis.

Setting the boundary: Set a tracking boundary to specify the area to be analyzed. Click save.

Generate position data: Next generate XY position data for all of the subjects.

Set zones: Draw and label zones to specify the escape hole, as wells as incorrect holes. Click save.

Generate data files: Generate zoned activity data for all of the subjects and download the .csv file.

tracked activity in barnes maze

Interpreting data

Calculate latency to escape, distance taken to reach the escape hole, number of visits to incorrect holes, and velocity for each subject. These measures reflect the subject’s spatial memory of the escape hole. Analyzing how these values change over the course of training can describe how quickly a subject is learning the location. Interestingly, some rodents opt to use alternative strategies to find the escape box instead of using spatial cues. Some rodents might check different holes randomly or sequentially go from one hole to the next until they find the escape box. If a subject cannot find the correct hole within several minutes, it is usually acceptable to help guide the animal to the correct hole during training trials to facilitate their learning.

BehaviorCloud automatically tracks movement in the Barnes maze so you can easily generate all the relevant variables you need to analyze spatial learning and memory. While you’re working on Barnes maze, don’t forget that BehaviorCloud also makes it easy to upload and analyze videos you’ve already recorded and even invite collaborators to contribute. Happy testing!

Join over 500 labs doing behavior more efficiently and collaboratively.

No credit card required.