Novel automated training platform for studying flexible switching among natural motivated behaviors in mice

based on reviews by Ede Attila Rancz and Ewelina Knapska
A recommendation of:

The Switchmaze: an open-design device for measuring motivation and drive switching in mice

Data used for results
Codes used in this study
Scripts used to obtain or analyze results


Submission: posted 13 February 2024, validated 18 February 2024
Recommendation: posted 09 April 2024, validated 18 April 2024
Cite this recommendation as:
Hangya, B. (2024) Novel automated training platform for studying flexible switching among natural motivated behaviors in mice. Peer Community in Neuroscience, 100180. 10.24072/pci.neuro.100180


As our understanding of the building blocks of mammalian behavior improves, there is a shifting focus towards addressing the brain mechanisms of behavioral flexibility, strategy learning and behavioral switching (Banerjee et al., 2020; López-Yépez et al., 2021; Manzur et al., 2023). This requires novel behavioral paradigms and new tools: Hartmann and colleagues started filling this gap by presenting an open-source automated training system for studying motivational switching, which they coined the ‘Switchmaze’ (Hartmann et al., 2024).

Instead of training mice on specific tasks, Hartmann et al. chose to quantify switching between spontaneous motivated behaviors like feeding, drinking, and engaging in social interactions in a type of foraging task. These behaviors were spatially separated by a smart design using distinct compartments with unidirectional doors, allowing the counting of discrete cycles of food and water intake in unitary quantities.

Switching behavior was quantified by the ratio of shifting from one behavioral chamber to another (single probe entries) versus exploitation of a single chamber through multiple consecutive entries (continuous exploitation runs), termed ‘motivation switching rate’ (MSR). Interestingly, the measured MSR values were well within the distribution of randomized data in which the trial sequence was shuffled. The Authors suggest that this may be an adaptive strategy to decrease behavioral predictability and thus fool competitors and predators; however, determining the significance of this finding will require further testing. For instance, is a ‘more random mouse’ indeed more successful in a competitive setting where the total amounts of food and water are limited? Food deprivation increased, while re-feeding decreased switch rate, strengthening the arguments for the MSR being a strategically controlled parameter.

Hartmann et al. further demonstrated the utility of the Switchmaze by performing chemogenetic inhibition of prefrontal cortical neurons projecting to the hypothalamus, a pathway thought to be involved in controlling feeding behavior (Petrovich et al., 2005; Cole et al., 2020; Padilla-Coreano et al., 2022). Mice showed an increased MSR upon inhibition, now significantly different from randomized distributions. Further analysis revealed that the difference was driven by a selective reduction of food-to-food transitions, that is, a decreased tendency for repetitive feeding. Moreover, this was due to a decrease in the number but not the duration of food runs, suggesting a specific behavioral role of the prefrontal-hypothalamic pathway in promoting repetitive feeding.

In summary, Hartmann and colleagues showcased an affordable, open-source behavioral design and demonstrated its usefulness for quantifying flexible switching of natural behaviors. It is ideal for testing the effect of pharmacological and chemogenetic manipulations, but it can likely be combined with electrophysiology, fiber photometry or miniscope imaging, greatly broadening its potential. Therefore, the Switchmaze is a valuable member of the growing family of open source, automated rodent training tools (Puścian et al., 2016; Erskine et al., 2019; Qiao et al., 2019; Birtalan et al., 2020; Cano-Ferrer et al., 2024) that represent the logical next step for high-throughput, stress- and bias-free behavioral experimentation.



Banerjee A, Parente G, Teutsch J, Lewis C, Voigt FF, Helmchen F (2020) Value-guided remapping of sensory cortex by lateral orbitofrontal cortex. Nature 585:245–250 Available at:

Birtalan E, Bánhidi A, Sanders JI, Balázsfi D, Hangya B (2020) Efficient training of mice on the 5-choice serial reaction time task in an automated rodent training system. Sci Rep 10:22362 Available at:

Cano-Ferrer X, Tran-Van-Minh A, Rancz E (2024) RPM: An open-source Rotation Platform for open- and closed-loop vestibular stimulation in head-fixed Mice. J Neurosci Methods 401:110002 Available at:

Cole S, Keefer SE, Anderson LC, Petrovich GD (2020) Medial Prefrontal Cortex Neural Plasticity, Orexin Receptor 1 Signaling, and Connectivity with the Lateral Hypothalamus Are Necessary in Cue-Potentiated Feeding. J Neurosci 40:1744–1755 Available at:

Erskine A, Bus T, Herb JT, Schaefer AT (2019) AutonoMouse: High throughput operant conditioning reveals progressive impairment with graded olfactory bulb lesions Reisert J, ed. PLoS One 14:e0211571 Available at:

Hartmann C, Mahajan A, Borges V, Razenberg L, Thönnes Y, Karnani MM (2024) The Switchmaze: an open-design device for measuring motivation and drive switching in mice. bioRxiv:1–17 Available at:

López-Yépez JS, Martin J, Hulme O, Kvitsiani D (2021) Choice history effects in mice and humans improve reward harvesting efficiency Palminteri S, ed. PLOS Comput Biol 17:e1009452 Available at:

Manzur HE, Vlasov K, Jhong Y-J, Chen H-Y, Lin S-C (2023) The behavioral signature of stepwise learning strategy in male rats and its neural correlate in the basal forebrain. Nat Commun 14:4415 Available at:

Padilla-Coreano N et al. (2022) Cortical ensembles orchestrate social competition through hypothalamic outputs. Nature 603:667–671 Available at:

Petrovich GD, Holland PC, Gallagher M (2005) Amygdalar and Prefrontal Pathways to the Lateral Hypothalamus Are Activated by a Learned Cue That Stimulates Eating. J Neurosci 25:8295–8302 Available at:

Puścian A, Łęski S, Kasprowicz G, Winiarski M, Borowska J, Nikolaev T, Boguszewski PM, Lipp H-P, Knapska E (2016) Eco-HAB as a fully automated and ecologically relevant assessment of social impairments in mouse models of autism. Elife 5:1–22 Available at:

Qiao M, Zhang T, Segalin C, Sam S, Perona P, Meister M (2019) Mouse Academy: high-throughput automated training and trial-by-trial behavioral analysis during learning. bioRxiv:467878 Available at:


Conflict of interest:
The recommender in charge of the evaluation of the article and the reviewers declared that they have no conflict of interest (as defined in the code of conduct of PCI) with the authors or with the content of the article. The authors declared that they comply with the PCI rule of having no financial conflicts of interest in relation to the content of the article.
Dutch Research Council Gravitation project BRAINSCAPES: A Road map from Neurogenetics to Neurobiology, Grant No. 024.004.012

Evaluation round #1

DOI or URL of the preprint:

Version of the preprint: 1

Author's Reply, 03 Apr 2024

Decision by , posted 19 Mar 2024, validated 19 Mar 2024

The Authors present an open-source system for testing flexible behvior in mice. The study has been seen by two Reviewers. The general opinions are positive, while the Reviewers suggested points of clarification and improvement. Based on these, I suggest clarifying definitions in the Abstract and Introduction, differences across behavioral groups (including number of mice tested) as well as  methodological details (including compatibility) highlighted by the Reviewers. Additionally, I suggest citing those publications pointed out by the Reviewers on similar applications. 

Reviewed by , 08 Mar 2024

Reviewed by ORCID_LOGO, 24 Feb 2024

Hartmann et al. present a new, open-source device to measure mouse foraging behaviour in a close-to-natural environment. 
The presentation of the design choices and the build instructions are exemplary, allowing pretty much any lab to build its device. The use of food deprivation, swapping of feeding areas and pharmacogenetic interference with specific neuronal pathways elegantly demonstrates the device's utility in investigating motivated behaviours, particularly motivational switching. 
I congratulate the authors on their approach and the work done and look forward to exciting experimental work using the device. I only have a few minor suggestions. 

In the current form of the supplementary material, the Bill of Materials points to tinkercad files. I suggest referencing the OSF repo files, which are likely more future-proof. In addition, a "version of record" depository should be produced upon publication. Further versions can then be used for future modifications and improvements to the design. 

I want to draw the authors' attention to two similar publications which use a similar approach to designing novel research equipment. These papers and repositories could guide readers willing to design their tools, and the authors may consider referencing them. (conflict of interest: this paper is from my lab)

"sleep mix" is a colloquial term and should be removed. 

In the methods section, I struggled to follow what viral constructs were injected for what purpose in which animals. While it is deducible, it requires unnecessary effort, and I suggest restructuring these few sentences. 

Relatedly, the histology figures referenced in the manuscript are missing from the supplementary material. They are present on the OSF data repository without legends, making it difficult to square with the methods section. 

I struggled to understand what epoch in Figure 2 could correspond to the "appetitive" epoch mentioned in the second line of the results.

In Figure 1C, please mark the position of the FED3, SWD, HSD and SEM devices.  

Please provide the weight of the individual mice during the whole experiment in Figure 2.

A further minor suggestion to ensure animal wellbeing is automatic monitoring of mouse weight and foraging with a warning system (i.e. automatic warning email if a mouse drops below 85% of initial weight or doesn't visit the maze for 12 hours). 

A sentence about the device's compatibility with tethered optical and electrophysiological measurement systems is warranted. 

User comments

No user comments yet