Dissecting Zebrafish Hunting Behavior using Deep Reinforcement Learning trained RNNs
Abstract
Understanding the neural basis of natural behaviors is a fundamental challenge in neuroscience. Larval zebrafish, with their compact and transparent brains, are a powerful model for studying sensorimotor transformations, particularly for their distinctly stereotyped prey hunting behavior. While experiments have revealed key sensorimotor motifs, such as stereotyped eye-convergence preceding hunting sequences, the computational principles underlying these behaviors remain poorly understood. Here, we use deep reinforcement learning (DRL) to train a recurrent neural network (RNN) agent to perform naturalistic hunting in a biologically-inspired simulation. Our DRL-trained agent's emergent behavior recapitulates known ethological hallmarks such as eye convergence when hunting, speed modulation, and stereotyped approach trajectories. By systematically varying both the agent's biologically grounded reward-function and its kinematics model, we provide a normative explanation for why these stereotyped behaviors emerge as an optimal strategy. The RNN dynamics underlying the behaviors robustly encode the hunting state and predicted prey locations even when prey are momentarily out of sight. In summary, our work demonstrates how task-optimized RNN agents can be a powerful computational framework for uncovering the principles of sensorimotor control and generating experimentally testable predictions about the neural basis of natural behavior.