[Paper Review] Predicting the long-term collective behaviour of fish pairs with deep learning
This paper introduces a deep learning model using a long short-term memory (LSTM) neural network to predict the long-term collective behavior of fish pairs (Hemigrammus rhodostomus) in a circular tank, outperforming a state-of-the-art analytical model by capturing both short- and long-term dynamics through end-to-end training on experimental trajectories. The model achieves high fidelity in replicating spontaneous turning, coordinated motion, and wall interactions by incorporating temporal context and behavioral variability via learned noise.
Modern computing has enhanced our understanding of how social interactions shape collective behaviour in animal societies. Although analytical models dominate in studying collective behaviour, this study introduces a deep learning model to assess social interactions in the fish species Hemigrammus rhodostomus. We compare the results of our deep learning approach to experiments and to the results of a state-of-the-art analytical model. To that end, we propose a systematic methodology to assess the faithfulness of a collective motion model, exploiting a set of stringent individual and collective spatio-temporal observables. We demonstrate that machine learning models of social interactions can directly compete with their analytical counterparts in reproducing subtle experimental observables. Moreover, this work emphasises the need for consistent validation across different timescales, and identifies key design aspects that enable our deep learning approach to capture both short- and long-term dynamics. We also show that our approach can be extended to larger groups without any retraining, and to other fish species, while retaining the same architecture of the deep learning network. Finally, we discuss the added value of machine learning in the context of the study of collective motion in animal groups and its potential as a complementary approach to analytical models.
Motivation & Objective
- To develop a machine learning model that accurately predicts long-term collective behavior in fish pairs, extending beyond short-term motion patterns.
- To benchmark a deep learning approach against a state-of-the-art analytical model for social interaction inference in animal groups.
- To identify critical design elements—such as temporal context and output variability—that enable deep learning to capture both short- and long-term dynamics in collective motion.
- To validate the model’s generalizability across fish species with similar burst-and-coast swimming patterns, such as zebrafish (Danio rerio).
- To establish a systematic methodology for assessing model faithfulness across multiple timescales using stringent observables.
Proposed method
- A deep neural network with long short-term memory (LSTM) units is trained end-to-end on experimental trajectories of fish pairs to predict the next-step acceleration vector (μx^{n+1}, μy^{n+1}) based on current state and neighbor interactions.
- The model inputs include position, velocity, distance to neighbor, and distance to the tank wall over a temporal window of 4–5 timesteps (0.48–0.6 s), capturing the typical duration of fish kicks.
- The network is probabilistic and includes learned noise to reflect behavioral uncertainty, avoiding artificial or phenomenological noise injection.
- An automated hyperparameter search over 82 network architectures was conducted, varying depth, width, and activation functions, with the final model selected for optimal performance on both short- and long-term observables.
- The model is evaluated using a set of stringent observables, including velocity correlation, turning rate, and collective alignment, across multiple timescales.
- The approach is extended to zebrafish (D. rerio), demonstrating scalability to other fish species with similar locomotion patterns.

Experimental results
Research questions
- RQ1Can a deep learning model trained on experimental trajectories accurately predict both short- and long-term collective dynamics in fish pairs?
- RQ2What architectural and design choices—such as memory, temporal context, and output variability—are essential for capturing long-term behavioral patterns?
- RQ3How does the performance of a deep learning model compare to a state-of-the-art analytical model in replicating experimental collective motion?
- RQ4To what extent can the trained model generalize to other fish species with similar burst-and-coast swimming behavior?
- RQ5What observables are most effective for validating model fidelity across different timescales?
Key findings
- The deep learning model with LSTM layers outperformed the analytical model in predicting long-term collective dynamics, including coordinated turning and alignment, as measured by multiple observables.
- The model achieved high accuracy in replicating the spontaneous turning behavior of fish, which is critical for group coordination and predator evasion.
- The inclusion of temporal context (4–5 timesteps) was essential for capturing the timing of fish kicks and gliding phases, with longer windows offering no significant improvement.
- The model’s output diversity, learned during training, successfully captured behavioral variability without requiring artificial noise injection, outperforming models with fixed or phenomenological noise.
- The model generalized to zebrafish (D. rerio), demonstrating scalability across species with similar locomotion patterns.
- The automated hyperparameter search identified that probabilistic networks with memory (LSTM) consistently outperformed non-probabilistic and non-memory variants, especially in long-term prediction.

Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.