Threshold-Free Neural Network Models for Swim Bout Detection of Larval Zebrafish
Journal:
bioRxiv
Published Date:
Jan 24, 2026
Abstract
Accurate identification of swim bouts is essential for decoding motor responses in larval zebrafish, yet conventional threshold-based methods rely on subjective cutoffs and per-experiment tuning. To overcome these limitations, we developed threshold-free deep learning models for post-hoc data processing (offline model) and an online model optimized for real-time detection. Both models showed superior precision over threshold-based methods, especially for low-amplitude bouts. Using the offline model, we validated that our head-fixing protocol with closed-loop visual feedback largely preserves naturalistic swimming kinematics. We further showed that repeated trials of moving grating stimulus led to lower bout frequency and longer interbout intervals (IBI). By contrast, transparent pigmentation mutants (nacre and casper) showed similar bout frequencies and IBIs but shorter duration compared to wildtype (AB) larvae. Together, these findings highlight the versatility of our models, enabling reproducible, high-throughput, and biologically relevant analysis of zebrafish behavior across a wide range of experimental paradigms.