RpiBeh offers a versatile open source solution for rodent behavior tracking and closed loop interventions

Abstract High-precision behavior tracking and closed-loop intervention are essential for studying the neural basis of cognition and behavior. Existing commercial systems are costly and inflexible for customization, while current open-source tools are often lack of real-time functionality and suffer...

Full description

Saved in:
Bibliographic Details
Main Authors: Yiqi Sun, Jie Zhang, Qianyun Wang, Jianguang Ni
Format: Article
Language:English
Published: Nature Portfolio 2025-08-01
Series:Scientific Reports
Subjects:
Online Access:https://doi.org/10.1038/s41598-025-14693-7
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:Abstract High-precision behavior tracking and closed-loop intervention are essential for studying the neural basis of cognition and behavior. Existing commercial systems are costly and inflexible for customization, while current open-source tools are often lack of real-time functionality and suffer from steep learning curve. To address these issues, we developed RpiBeh, an open-source, cost-effective, and versatile software tailored for rodent neuroethological research. The software features an intuitive interface with extensive customization options. RpiBeh leverages a Raspberry Pi and camera for video streaming, enabling behavior-driven closed-loop control. Additionally, it provides frame-by-frame video timestamp output for precise synchronization with external devices. For real-time tracking and locomotion pattern analysis, RpiBeh utilizes several novel algorithms and integrated newly developed deep-learning method. Specifically, we introduced two algorithms: a Background Subtraction Method (BSM) for real-time position tracking and a Frame Difference (FD) algorithm for freezing behavior detection. RpiBeh was validated in single animal real-time tracking and locomotion pattern detection, demonstrating flexibility and effectiveness in configurating behavior-triggered closed-loop reinforcement experiments including passive place avoidance task and social fear conditioning tasks. It achieved the same level of performance in tracking and locomotion pattern detection comparing to benchmark software including ANY-maze and DeepLabCut, with superior customization and expandability. Consequently, RpiBeh offers an efficient, affordable, and open-source solution for video tracking and behavior-driven closed-loop experiments.
ISSN:2045-2322