Table of Contents
Fetching ...

Dissecting Larval Zebrafish Hunting using Deep Reinforcement Learning Trained RNN Agents

Raaghav Malik, Satpreet H. Singh, Sonja Johnson-Yu, Nathan Wu, Roy Harpaz, Florian Engert, Kanaka Rajan

TL;DR

This work presents a minimal, biologically inspired DRL framework where recurrent agents learn bout-based hunting in a zebrafish-like arena. By incorporating binocular sensing, coupled bout kinematics, and modest energetic costs, the agents spontaneously develop naturalistic hunting motifs, vergence dynamics, and pursuit–abort patterns without imitation from real fish. Through systematic parameter sweeps, the study identifies a compact set of constraints sufficient to reproduce zebrafish-like hunting and offers falsifiable predictions for neural coding and behavior under ecological variations. The virtual lab provides a normative account of why stereotyped hunting strategies emerge and demonstrates how simple inductive biases can shape robust, adaptive sensorimotor behavior in both biology and AI.

Abstract

Larval zebrafish hunting provides a tractable setting to study how ecological and energetic constraints shape adaptive behavior in both biological brains and artificial agents. Here we develop a minimal agent-based model, training recurrent policies with deep reinforcement learning in a bout-based zebrafish simulator. Despite its simplicity, the model reproduces hallmark hunting behaviors -- including eye vergence-linked pursuit, speed modulation, and stereotyped approach trajectories -- that closely match real larval zebrafish. Quantitative trajectory analyses show that pursuit bouts systematically reduce prey angle by roughly half before strike, consistent with measurements. Virtual experiments and parameter sweeps vary ecological and energetic constraints, bout kinematics (coupled vs. uncoupled turns and forward motion), and environmental factors such as food density, food speed, and vergence limits. These manipulations reveal how constraints and environments shape pursuit dynamics, strike success, and abort rates, yielding falsifiable predictions for neuroscience experiments. These sweeps identify a compact set of constraints -- binocular sensing, the coupling of forward speed and turning in bout kinematics, and modest energetic costs on locomotion and vergence -- that are sufficient for zebrafish-like hunting to emerge. Strikingly, these behaviors arise in minimal agents without detailed biomechanics, fluid dynamics, circuit realism, or imitation learning from real zebrafish data. Taken together, this work provides a normative account of zebrafish hunting as the optimal balance between energetic cost and sensory benefit, highlighting the trade-offs that structure vergence and trajectory dynamics. We establish a virtual lab that narrows the experimental search space and generates falsifiable predictions about behavior and neural coding.

Dissecting Larval Zebrafish Hunting using Deep Reinforcement Learning Trained RNN Agents

TL;DR

This work presents a minimal, biologically inspired DRL framework where recurrent agents learn bout-based hunting in a zebrafish-like arena. By incorporating binocular sensing, coupled bout kinematics, and modest energetic costs, the agents spontaneously develop naturalistic hunting motifs, vergence dynamics, and pursuit–abort patterns without imitation from real fish. Through systematic parameter sweeps, the study identifies a compact set of constraints sufficient to reproduce zebrafish-like hunting and offers falsifiable predictions for neural coding and behavior under ecological variations. The virtual lab provides a normative account of why stereotyped hunting strategies emerge and demonstrates how simple inductive biases can shape robust, adaptive sensorimotor behavior in both biology and AI.

Abstract

Larval zebrafish hunting provides a tractable setting to study how ecological and energetic constraints shape adaptive behavior in both biological brains and artificial agents. Here we develop a minimal agent-based model, training recurrent policies with deep reinforcement learning in a bout-based zebrafish simulator. Despite its simplicity, the model reproduces hallmark hunting behaviors -- including eye vergence-linked pursuit, speed modulation, and stereotyped approach trajectories -- that closely match real larval zebrafish. Quantitative trajectory analyses show that pursuit bouts systematically reduce prey angle by roughly half before strike, consistent with measurements. Virtual experiments and parameter sweeps vary ecological and energetic constraints, bout kinematics (coupled vs. uncoupled turns and forward motion), and environmental factors such as food density, food speed, and vergence limits. These manipulations reveal how constraints and environments shape pursuit dynamics, strike success, and abort rates, yielding falsifiable predictions for neuroscience experiments. These sweeps identify a compact set of constraints -- binocular sensing, the coupling of forward speed and turning in bout kinematics, and modest energetic costs on locomotion and vergence -- that are sufficient for zebrafish-like hunting to emerge. Strikingly, these behaviors arise in minimal agents without detailed biomechanics, fluid dynamics, circuit realism, or imitation learning from real zebrafish data. Taken together, this work provides a normative account of zebrafish hunting as the optimal balance between energetic cost and sensory benefit, highlighting the trade-offs that structure vergence and trajectory dynamics. We establish a virtual lab that narrows the experimental search space and generates falsifiable predictions about behavior and neural coding.

Paper Structure

This paper contains 27 sections, 9 figures, 2 tables.

Figures (9)

  • Figure 1: A biologically inspired DRL framework grounds recurrent agent perception, actions, and rewards in zebrafish hunting.(a) Closed-loop setup: an actor–critic RNN policy selects actions (forward speed, turn speed, vergence angle) that update the environment, which in turn provides new observations and rewards. (b) Zebrafish visual model: each eye has a 163$^{\circ}$ monocular field of view, subdivided into 10 angular sectors that report the nearest object type and distance. (c) Eye vergence: eyes rotate between empirically observed divergence and convergence limits, defining the binocular overlap region. (d) Triangular action space: linear (forward) and angular (turn) speeds are coupled; larger forward speeds permit only smaller turns. A linear energy cost is imposed upon movements surpassing a fixed turn or forward speed. (e) Strike model: when prey are within strike radius, capture probability decays with alignment error $|\theta|$ according to a modified Laplace distribution fit to empirical strike angle data.
  • Figure 2: Agent movement statistics reveal distinct bout types resembling real zebrafish strikes and adjustments.(a) Agent action selection: density plot and histograms of forward and turn speeds chosen across evaluation (left) along with spatial displacement after one bout (right). (b) Forward and turn speeds as a function of distance to prey: two distinct clusters appear when prey are nearby—fast, straight bouts (strikes) and slower, variable-turn bouts (fine adjustments). (c) Behavioral motifs across timesteps: Principal component analysis (PCA) of movement trajectories (8 timesteps, 1 s) clustered into five groups with K-means (PC1: 17% variance, PC2: 17%); see Appendix \ref{['appendix:clustering']}. (d) Transition probabilities between clusters: the transition matrix is characterized by a dominant outgoing probability at each state, suggesting that bout sequences are stereotyped. (e) Example trajectories: 20 example trajectories (1 s each) from the five clusters. Together these analyses show that the agent’s bout repertoire is structured into discrete modes that align with known zebrafish hunting motifs.
  • Figure 3: Successful and failed hunts diverge in bout sequences, durations, and pursuit corrections.(a) Example trajectory ending in a successful strike. (b) Example trajectory ending in an abort. (c) Distribution of forward and turn speeds during hunting versus exploration, showing larger turn speeds and more precise forward bouts during hunts. (d) Hunt durations separated by successful versus failed hunts: successful hunts are typically shorter, with aborts occurring after extended tracking durations without successful capture. (e) 200 sample trajectories in the 0.75 s (6 bouts) preceding prey capture, colored by initial turn direction. (f–g) Bout-wise changes in prey azimuth and distance across the final 0.75 s of successful hunts: each bout reduces angle to prey by about half and prey distance by about 15%, closely matching empirical zebrafish hunting data Bolton2019. Together, these demonstrate that successful hunts are characterized by pursuit with systematic angle reduction.
  • Figure 4: Vergence dynamics reveal costly but advantageous binocular sensing during hunts.(a) Distribution of vergence angles during successful hunts versus non-hunting periods: hunts show consistently higher vergence. (b) Distribution of vergence angles as a function of distance to food: agents exhibit high eye vergence angles when food is within their detection range and low vergence when it is not. (c) Time course of average vergence angle over all episodes aligned to prey detection and strike/abort: vergence rises sharply at hunt onset, peaks before strike, and relaxes afterward. Error bars represent 1 standard error. Time corresponds to 1 s before detection and after outcome, and all tracking sequences in between normalized to equal duration. $n=$1366 successful hunts; $n=$1554 misses. (d) Rate of vergence change within 1 s after prey detection and successful eating events: Vergence increases at an average rate of 14.5$^\circ$/s in the 1 s after detection (Student’s $t$-test, $n=\,$1159 detection events) and decreases at an average rate of -12.7$^\circ$/s following eating ($n=\,$1350 eating events). Together these results show that although convergence incurs a metabolic cost, agents adopt and sustain it during hunts because binocular sensing improves prey localization, paralleling empirical zebrafish data Bianco2011Johnson2020.
  • Figure 5: Virtual experiments reveal how ecological and sensory constraints shape hunting performance.(a) Increasing prey speed reduces the number of successful strikes and increases abort rates, demonstrating sensitivity to prey motion statistics. (b) Increasing prey density leads to more eating events and shorter hunt durations, consistent with expectations from in vivo assays. (c-d) Limiting max/min vergence angle reduces binocular coverage and modestly decreases hunt success in the current model. Error bars denote SEM across $n=$ 50 evaluation arenas $\times$ 200 trials each. Together these sweeps illustrate how the framework can systematically vary ecological and energetic parameters to test hypotheses about zebrafish hunting, generating falsifiable predictions for future experiments.
  • ...and 4 more figures