Active Electrosensing in Artificial Fish Collectives
Weakly electric fish like Gnathonemus petersii sense and communicate using self-generated electric fields, supporting rich but understudied social behaviors such as spacing, chasing, and freeloading. However, technical limitations in multi-animal neural recordings make it difficult to study how these behaviors emerge from distributed sensing and computation. We present a biologically grounded computational framework to model electrosensory fish collectives using recurrent neural network (RNN)–based agents trained with multi-agent reinforcement learning (MARL). Each agent modulates electric organ discharges (EODs) and motor actions in response to local sensory inputs from realistic, biologically inspired electroreceptors. The agents operate in customizable environments that simulate key physical features of electric fields and social interactions. Trained agents reproduce known behaviors from real fish: in a virtual “homing” task, they align to electric field lines; in free-foraging conditions, they exhibit realistic pulse statistics, self-spacing, and social dynamics such as “freeloading,” where agents reduce their own EOD rate while benefiting from neighbors’ emissions. These behaviors emerge solely from individual rewards for food and avoidance, without explicit incentives for cooperation. Ablating long-range social sensors reduces foraging performance and increases aggression, suggesting a computational role for social sensing. Decoding internal RNN states and analyzing sensor attention reveals how agents prioritize cues like field orientation, food direction, and nearby conspecifics—yielding interpretable hypotheses about sensorimotor strategies. Our virtual ethological platform bridges behavior, sensing, and neural dynamics in a fully controlled setting, offering new tools for understanding distributed intelligence in biological collectives.