Skip to main content
  • Loading metrics

Dominating lengthscales of zebrafish collective behaviour

  • Yushi Yang ,

    Roles Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Software, Visualization, Writing – original draft, Writing – review & editing

    Affiliations Bristol Centre for Functional Nanomaterials, University of Bristol, Bristol, United Kingdom, H.H. Wills Physics Laboratory, University of Bristol, Bristol, United Kingdom

  • Francesco Turci,

    Roles Conceptualization, Formal analysis, Methodology, Software, Writing – original draft, Writing – review & editing

    Affiliation H.H. Wills Physics Laboratory, University of Bristol, Bristol, United Kingdom

  • Erika Kague,

    Roles Conceptualization, Methodology, Validation, Writing – original draft

    Affiliation Department of Physiology, Pharmacology, and Neuroscience, Medical Sciences, University of Bristol, Bristol, United Kingdom

  • Chrissy L. Hammond,

    Roles Conceptualization, Methodology, Resources, Writing – original draft

    Affiliation Department of Physiology, Pharmacology, and Neuroscience, Medical Sciences, University of Bristol, Bristol, United Kingdom

  • John Russo,

    Roles Conceptualization, Supervision, Writing – original draft

    Affiliation Department of Physics, Sapienza Università di Roma, Rome, Italy

  • C. Patrick Royall

    Roles Conceptualization, Formal analysis, Supervision, Writing – original draft, Writing – review & editing

    Affiliations H.H. Wills Physics Laboratory, University of Bristol, Bristol, United Kingdom, Gulliver UMR CNRS 7083, ESPCI Paris, Università PSL, Paris, France, School of Chemistry, University of Bristol, Bristol, United Kingdom


Collective behaviour in living systems is observed across many scales, from bacteria to insects, to fish shoals. Zebrafish have emerged as a model system amenable to laboratory study. Here we report a three-dimensional study of the collective dynamics of fifty zebrafish. We observed the emergence of collective behaviour changing between ordered to randomised, upon adaptation to new environmental conditions. We quantify the spatial and temporal correlation functions of the fish and identify two length scales, the persistence length and the nearest neighbour distance, that capture the essence of the behavioural changes. The ratio of the two length scales correlates robustly with the polarisation of collective motion that we explain with a reductionist model of self–propelled particles with alignment interactions.

Author summary

Groups of animals can display complex collective motion, which emerges from physical and social interactions amongst the individuals. A quantitative analysis of emergent collective behaviour in animals is often challenging, as it requires describing the movement of many individual animals. With an innovative 3D tracking system, we comprehensively characterized the motion of large groups of zebrafish (Danio rerio), a freshwater fish commonly used as a vertebrate model organism. We find that the different collective behaviours are captured by two physical scales: the length of persistent motion in a given direction and the typical nearest neighbour distance. Their ratio allows us to interpret the experimental results, in the light of a statistical mechanics model for swarming with persistent motion and local neighbourhood alignment.


In living systems aggregation occurs at different scales, ranging from bacteria (microns) to insects (centimetres) to fish shoals (tens of kilometres) and with emerging complex patterns [13]. These manifestations of collective behaviour originate from the interactions among the individual agents and between the agents and the environment [4]. Such interactions are often modelled by a combination of deterministic and stochastic contributions, capturing the individual’s variability observed in nature and unknown or uncontrollable variables. The emergence of collective behaviour has been shown to be advantageous for communities [57], and the identification of universal patterns across scales and species reveals the physics behind these phenomena [8, 9]. Understanding the relationship between the collective behaviour and animal interactions has potential technological applications, for example to reverse engineer algorithms for the design of intelligent swarming systems [10]. Successful examples include the global optimisation algorithm for the travelling salesman problem inspired by the behaviour of ants, and implementation of the Boids flocking model in schooling of robotic fish [11, 12].

In a reductionist approach, collective behaviour can be modelled with interacting agents representing individuals in living systems. For example, groups of animals may be treated as if they were self-propelled particles with different interacting rules [13, 14]. Examples of using simple agent–based models applied to complex behaviour include describing the curvature of the fish trajectories as a Ornstein–Uhlenbeck process [15], modelling the ordered movement of bird flocks by an Ising spin model [2, 16], mapping of midge swarms onto particulate systems to explain the scale-free velocity correlations [13, 17, 18] and swarming in active colloids [19, 20]. One of the simplest approaches is the Vicsek model [21], in which the agents only interact via velocity alignment. Despite its simplicity, a dynamical phase transition from ordered flocking to randomised swarming can be identified, providing a basis to describe collective motion in biological systems [22, 23].

The study of collective behaviour in living systems typically has focused on two-dimensional cases for reason of simplicity, making the quantitative characterisation of three-dimensional systems such as flocks of birds or shoal of fish rare. To bridge this gap, zebrafish (Danio rerio) present a wealth of possibilities [24]: zebrafish manifest shoaling behaviour, i.e. they form groups and aggregates, both in nature and in the laboratory; also, it is easy to constrain the fish in controlled environments for long–time observations. Typically, the response of fish to different perturbations, such as food and illumination, can be pursued [2426]. Furthermore, genetic modification has been very extensively developed for zebrafish, giving them altered cognitive or physical conditions, and yielding different collective behaviour [27, 28].

However, tracking zebrafish in three dimensions (3D) has proven difficult [29]. To the best of our knowledge, previous studies on the 3D locomotion of zebrafish focussed either on the development of the methodology [30, 31], or were limited to very small group sizes (N ≤ 5) [29, 32, 33], while ideally one would like to study the 3D behaviour of a statistically significant number of individuals, representative of a typical community. In the field, zebrafish swim in 3D with group sizes ranging from tens to thousands [34].

Here we report on the collective behaviour of a large group (N = 50) of wild-type zebrafish, captured by a custom 3D tracking system. The observed fish shoals present different behaviours, showing different levels of local density and velocity synchronisation. We identify two well-separated time scales (re-orientation time and state-changing time) and two important length scales (persistence length and nearest neighbour distance) for the zebrafish movement. The time scales indicate the fish group change their collective state gradually and continuously. The spatial scales change significantly as collective behaviour evolves over time, with strong correlations between spatial correlations and shoaling. Finally, we reveal a simple and universal relationship between the global velocity alignment of the shoals (the polarisation) and the the ratio between the two length scales (the reduced persistence length). We rationalise this finding through the simulation of simple agent-based models, in which an extra inertia term is added to the Vicsek model. Our findings illustrate complex behaviour in zebrafish shoaling, with couplings between spatial and orientational correlations that could only be revealed through a full three-dimensional analysis.

Materials and methods

Ethics statement

The experiments were approved by the local ethics committee (University of Bristol Animal Welfare and Ethical Review Body, AWERB) and given a UIN (university ethical approval identifier).

Zebrafish husbandry

Wildtype zebrafish were kept in aquarium tanks with a fish density of about 5 fish / L. The fish were fed with commercial flake fish food (Tetra Min). The temperature of the water was maintained at 25°C and the pH ≈ 7. They were fed three times a day and experience natural day to night circles, with a natural environment where the bottom of the tank is covered with soil, water plant, and decorations as standard conditions [35]. Our young group (Y) were adults between 4–6 months post-fertilisation, while our old group (O) were aged between 1–1.5 year. The standard body lengths of these fish were are available in section II in S1 Text. All the fish were bred at the fish facility of the University of Bristol.


The movement of the zebrafish were filmed in a separate bowl-shaped tank, which is immersed in a larger water tank of 1.4 m diameter. The radius r increasing with the height z following z = 0.734r2. The 3D geometry of the tank is measured experimentally by drawing markers on the surface of the tank, and 3D re-construct the positions of the markers. Outside the tank but inside the outer tank, heaters and filters were used to maintain the temperature and quality of the water. The videos of zebrafish were recorded with three synchronised cameras (Basler acA2040 um), pointing towards the tank. Detailed information is available in subsection I.A in S1 Text.

Measurement and analysis

Fifty zebrafish were randomly collected from their living tank, moved to a temporary container, then transferred to the film tank. The filming started about 10 minutes after fish were transferred. The individual fish in each 2D images were located by our custom script and we calculated the 3D positions of each fish following conventional computer vision method [36, 37]. The 3D positions of the fish were linked into trajectories [38, 39]. Such linking process yielded the positions and velocities of different fish in different frames. We segmented the experimental data into different sections of 120 seconds, and treat each section as a steady state, where the time averaged behavioural quantities were calculated. More details on the tracking are available in subsections I.B-I.D in S1 Text, and more descriptions on the analysis are in section III in S1 Text.


Experimental observation

We tracked the movement of zebrafish from multiple angles using three synchronised cameras. We collected data for fish groups with different ages, with young fish (labelled as Y1–Y4) and old fish (labelled as O1–O4). Fig 1A schematically illustrates the overall setup of the experiment, where the cameras were mounted above the water to observe the fish in a white tank in the shape of a parabolic dish, enabling 3D tracking [2, 4042]. With this apparatus, we extract the 3D positions of the centre of each fish at different time points, with the frequency of 15 Hz. We then link these positions into 3D trajectories. Fig 1B presents typical 3D trajectories from 50 young zebrafish during a period of 10 seconds, where the fish group changed its moving direction at the wall of the tank. The zebrafish always formed a single coherent group, without splitting into separate subgroups during our observations. Supplementary videos (S1, S2 and S3 Videos) are examples of the their movements. Fig 1C shows the cumulative spatial distribution of the zebrafish in the tank, during a one-hour observation. It is clear from this figure that the fish tend to swim near the central and bottom part of the tank. The propensity of zebrafish to swim near the wall was our motivation to use a bowl-shaped fish tank shown in Fig 1C, so that there are no corners for the fish to aggregate in, compared to a square-shaped container like conventional aquaria.

Fig 1. Experimental setup and overall spatial distributions.

A: Schematic illustration of the experimental setup. Zebrafish were transferred into a bowl-shaped tank and three cameras were mounted above the air-water interface to record the trajectories of the fish. B: 3D trajectories obtained from the synchronised videos of different cameras. These trajectories belong to 50 young zebrafish (group Y1) in 10 seconds. C: The spatial distribution of 50 young fish (Y1) during a one-hour observation. Brighter colour indicates higher density. The top panel shows the result in XY plane, obtained from a max-projection of the full 3D distribution. The bottom panel shows a max-projection in the XZ plane. The outline of the tank and water-air interface, obtained from 3D measurement, are labelled.

Evolving collective behaviour

The 3D tracking yields the positions of the fish, whose discrete time derivative gives the velocities. From these two quantities, we calculate three global descriptors to characterise the behaviour of the fish: the average speed, the polarisation, and the nearest neighbour distance. The average speed is defined as v0 = 1/N∑|vi| where i runs over all the tracked individuals. The polarisation Φ characterises the alignment of the velocities. It is defined as the modulus of the average orientation, written as [13], Φ = 1/N|∑(vi/|vi|)| where i runs over all the individuals. Large polarisation (Φ ∼ 1) signifies synchronised and ordered movement, while low polarisation indicates decorrelated, random movement. The nearest neighbour distance between the fish centres is defined according to the Euclidean metric, and we focus on is arithmetic mean lnn. These quantities were selected, because v0 and Φ describe the dynamic of the fish, and lnn captures structural information on the group of fish.

We start from the analysis of temporal correlations of these three scalar quantities. Notably, all three exhibit two distinct time scales. Fig 2A shows the auto–correlation functions (ACF) of v0, Φ and lnn averaged over the group of 50 young fish, calculated from a one hour observation. The ACFs present two decays and one intermediate plateau. We identify the first decay (∼1s) corresponding to the reorientation time of the zebrafish. This can be shown through the analysis of the autocorrelation of the orientations Fig 2B, which are characterised by an exponential decay with relaxation time 〈τ〉 close to ∼1s. This value is compatible with the previously reported turning rate timescale (∼0.7s) [43].

Fig 2. The behavioural quantities of 50 young zebrafish (group Y1).

A: The auto–correlation function of the polarisation and average speed of the fish group. B: The auto–correlation function of the orientations of fish. C: Sequence of radial distribution functions with increasing time: at early times (top curves) the fish are clustered together so that the peak is large; at later times (bottom curves) the local density decreases and so does the peak height. D: The time evolution of the averaged behavioural quantities for 50 young fish. Each point corresponds to the average value in 2 minutes. The error bars illustrate the standard error values.

The plateau and subsequent decay of the ACF of the scalar quantities v0, Φ and lnn, with the time scale of ∼120 seconds, represent complete decorrelation from the initial state, indicating that the shoal properties change significantly on this much longer timescale. Therefore, we employ time-windows of 120 seconds to average the time evolution of of v0, Φ and lnn, to characterise the states of the fish groups with moving averages 〈v0〉(t), 〈Φ〉(t) and 〈lnn〉(t).

To characterise the degree of spatial correlation of the fish, we calculate their radial distribution function (RDF), see Fig 2C, which quantifies the amount of pair (fish-fish) correlations and it is commonly employed in the characterisation of disordered systems ranging from gas to liquids, from plasma to planetary nebulae [44]. Details on the RDF can be found in subsection III.C in S1 Text. All the RDFs exhibit one peak at a short separation, indicating the most likely short-distance separation between fish. The peak height is a measure of the cohesion of the fish group. Inspired by liquid state theory [44], we take the negative logarithm of the peak height to characterise what we call as the “effective attraction” among the fish, noted as 〈ϵ〉. While lnn quantifies a characteristic lengthscale in the macroscopic collective state, ϵ quantifies the fish propensity to remain neighbours. In Fig 2D we see that 〈lnn〉 and 〈ϵ〉 are strongly correlated, confirming that lnn is also a measure of the cohesion of the collective states. We term 〈v0〉, 〈Φ〉, 〈τ〉, 〈lnn〉, and 〈ϵ〉 “behavioural quantities”, and the brackets indicate the moving average. These variables are summarised in Table 1.

Table 1. A summary of the variables used to describe the fish behaviour.

Fig 2D illustrates the time-evolution of all the behavioural quantities, calculated from the movement of 50 young fish (group Y1) ten minutes after they were extracted from a husbandry aquarium and introduced into the observation tank. Over time, the behavioural quantities drift, indicating that a steady state cannot be defined over the timescale of 1 hour. This result is generic, as the separated time scales and changing states were obtained from repeated experiments on the fish group (Y2–Y4), and also from different groups of older zebrafish (O1–O4).

Shoaling state described by two length scales

To describe the space of possible collective macroscopic states we employ two dimensioned lengths, the nearest neighbour distance 〈lnn〉 defined above and a second scale characterising the typical distance that a single fish covers without reorientation, the persistence length 〈lp〉. This is defined as the product of the speed and the orientational relaxation time 〈lp〉 = 〈v0〉〈τ〉.

The resulting 〈lp〉 and 〈lnn〉 diagram is illustrated in Fig 3A. As we move across the diagram, the degree of alignment of the fish motion—the polarisation—also changes, indicating that changes in the local density (as measured by 〈lnn〉) and in the pattern and velocity of motion (as measured by 〈lp〉) are reflected in the polarisation of the shoals. For high 〈lp〉 and low 〈lnn〉, the movements of the fish are cohesive and ordered (S1 Video). For the fish states with a low 〈lnn〉 and low 〈lp〉, the movements are cohesive but disordered (S3 Video). For fish states with high 〈lnn〉 and low 〈lp〉, the fish are spatially separated with disordered movements (S2 Video). Separated and ordered states are never observed. We also note that there is a systematic difference between young (Y) and old (O) fish groups, with the former characterised by longer persistence lengths, shorter neighbour distances and larger polarisations, while the latter are clustered in a narrower range of persistence lengths with more disorder.

Fig 3. The states of Zebrafish characterised by two length scales.

A: The states of the fish represented by the nearest neighbour distance and the persistence length. The brightness of the markers corresponds to the value of the polarisation. Each scatter–point corresponds to a time-average of 2 minutes. Different shapes indicate different fish groups from different experiments. B: A multilinear regression model fitting the relationship between the polarisation and the two length scales, indicating the polarisation increase with the increase of persistence length, and the decrease of the nearest neighbour distance. The model is rendered as a 2D plane, whose darkness indicates the value of polarisation.

The simplest model to capture the relationship between polarisation and the two lengthscales is a multilinear regression. This yields 〈Φ〉 = 0.039 〈lp〉 − 0.05 〈lnn〉 + 0.147, with a goodness of fit value R2 = 0.73. This strong simplification suggests that most of the fish macroscopic states reside on a planar manifold in the Φ–lnnlp space, illustrated in Fig 3B. The value of 〈Φ〉 increases with the increase of 〈lp〉, and the decrease of 〈lnn〉. Such relationship is reminiscent of results from the agent-based Vicsek model, where the polarisation of self–propelled particles is determined by the density () and orientational noise () [21, 45]. In addition, the relationship between the polarisation and the local density suggests a metric based interaction rule, rather than the topological one [46]. In other words, the fish tend to align with nearby neighbours, rather than a fixed number of neighbours. For instance, if the fish always align with their closest neighbours regardless of the distance, then the polarisation of the system will not be affected by lnn. A similar relationship between polarisation and density was also found for jackdaw flocks while responding to predators [47].

Interestingly, the ratio between the persistence length and the nearest neighbour distance exhibits a simple and robust correlation with the polarisation. Here we introduce the reduced persistence length κ = 〈lp〉/〈lnn〉. The value of κ exhibits a consistent relationship with the polarisation for all the fish groups, as shown in Fig 4A. All the experimental data points collapse onto a single curve, especially for the younger fish groups (Y1–Y4) which have a much wider dynamic range than the older groups. Notably, the young fish always transform from ordered states with high κ value to disordered states with low κ value, possibly because they adapt to the observation tank. Other possible ways to collapse the data is discussed in section VII in S1 Text.

Fig 4. Single–parameter description of the Zebrafish system.

A: The average polarisation 〈Φ〉 as a function of the reduced persistence length κ, where most data points collapse, and agree with the simulation result of the inertial Vicsek model. The dashed line and grayscale zone represent the expected average value and standard deviation of 〈Φ〉 for the uniform random sampling of vectors on the unit sphere. B: The velocity correlation function of the fish and the model in the low κ states, highlighted in A with a × symbol. C: The velocity correlation function of the fish and the model in the high κ states, highlighted in A with a + symbol.

To understand this relationship, we consider the fish motion as a sequence of persistent paths interrupted by reorientations. In a simplified picture, the new swimming direction at a reorientation event is determined by an effective local alignment interaction that depends on the neighbourhood, and notably on the nearest neighbour distance lnn. The fish states with larger value of κ correspond to situations where each individual fish interacts with more neighbours on average, between successive reorientations. The increased neighbour number leads to a more ordered collective behaviour, so that the values of κ and Φ are positively correlated as shown in Fig 4A.

The time-averaged spatial correlation of the velocity fluctuation supports our picture of the local alignment interaction between the fish. Such a correlation function is defined as, (1) where vi is the velocity of fish i, is the average velocity in one frame, rij is the distance between two fish, and δ is the Dirac delta function. This function is widely used to characterise the average alignment of velocity fluctuations of moving animals, at different distances [2, 48, 49]. Fig 4B and 4C show the correlation functions for different fish groups with low and high κ values, respectively. The distances are rescaled by the different 〈lnn〉 values of each fish group. For both conditions, the correlation curve collapses beyond one 〈lnn〉, and peaks around the value of 〈lnn〉, supporting our assumption that 〈lnn〉 is the length scale for the fish–fish interactions.

Vicsek model rationalisation of the experiments

The relationship between κ and Φ, presented in Fig 4A, can be easily compared with simulations. Here we explore this through simulations proposing a new modification of the original Vicsek model [21]. The Vicsek model treats the fish as point-like agents with an associated velocity vector of constant speed v0. During the movement, the fish adjust their orientations to align with the neighbours’ average moving direction. In order to take into account of memory effects in a simple fashion, we add an inertia term into the Vicsek model, so that each agent partially retain their velocities after the update, with the following rule (2) where is the velocity or the ith fish, and the updated velocity of fish i is a linear mixture of its previous velocity and a Vicsek term. The parameter α characterises the proportion of the non-updated velocity, i.e. the inertia. This model is reduced to the Vicsek model by setting α to 0. If α = 1, these agents will perform straight motion with constant speed without any interaction. For the Vicsek term, Si is the set of the neighbours of fish i, and the Θ is a normalising function. The operator randomly rotates the vector r into a new direction, which is drawn uniformly from a cap on the unit sphere. The cap is centred around r with an area of 4πη. The value of η determines the degree of stochasticity of the system. Our model is thus an inertial Vicsek model in three dimensions with scalar noise.

We set the units of the interaction range ξ and time dt and fix the number density to ρ = 1ξ−3 and speed v = 0.1ξ/dt. We then proceed with varying the two parameters α and η to match the data. In particular we measure the average persistence length 〈k〉 and polarisation 〈Φ〉 and find that for α = 0.63 we can fit the data only through the variation of the noise strength η (more details of the simulation are available in the section IV in S1 Text). For η ∼ 1, the movement of each agent is completely disordered, reproducing the low κ (or Φ) states of the fish. For the case of η ∼ 0.65 the movements of the agents are ordered (Φ ∼ 0.64) and mimic the states of fish with high κ. This is consistent with the fact that in the ordinary Vicsek model the persistence length scales as v0/η2 (section V in S1 Text) [45]. The good fit of the simulation result suggests the fish–fish alignment interaction dominates their behaviour, and the fish can change their states by changing the rotational noise (η).

We emphasise that the inertial Vicsek model is a crude approximation, as the only interaction of the model is velocity alignment. Without the attractive/repulsive interactions and other details, the inertial Vicsek model does not reproduce the velocity correlation function of the fish, as illustrated in Fig 4B and 4C, suggesting that more sophisticated models with effective pairwise and higher order interactions may be developed in the future. Nevertheless, the model qualitatively reproduces the fact that the velocity correlation is stronger in the high κ states.

Discussion and conclusion

Our results confirm some previous observations and open novel research directions. The young fish appear to adapt to a new environment with the reduction of the effective attraction and speed (Fig 2). Such behaviour is consistent with previous observations of dense groups of fish dispersing over 2–3 hours [50], and it might be related to the fact that the fish perceived less danger as they adapted to the new environment [51, 52]. At the same time, it was reported by Miller and Gerlai that the habituation time has no influence on the Zebrafish group density [53]. We speculate that this difference emerges from the way the statistics were performed. Typically, Miller and Gerlai’s results were averaged over 8 different small fish groups (N = 16), and it is possible that the noise among different groups obfuscates the time dependence features here highlighted. Despite the different claims, our result matched Miller and Gerlai’s result quantitatively (section VI in S1 Text).

The strong correlation between the speed and polarisation (Fig 4D) is consistent with previous studies on zebrafish [54, 55]. Such correlation had also been observed for different fish species [15, 28, 56]. The polarisation of the young fish was found to decrease (Fig 2D), during the adaptation process. This “schooling to shoaling” phenomenon had also been observed previously in a quasi 2 dimensional environment [51]. Our results, being quantitatively consistent with previous reports (section VI in S1 Text), suggest that this behaviour is present also in a fully three-dimensional context and that the change from schooling (ordered motion) to shoaling (disordered motion) is related to an increasingly disordered or uncorrelated behaviour, corresponding to the increase in the noise term η in the Vicsek model.

It is been speculated that all the biological systems were poised near the critical state, enjoying the maximum response to the environmental stimuli [57]. Here the inertial Vicsek model offers a supporting evidence to this claim. The fluctuation of the polarisation, the susceptibility, took a maximum value at moderate reduced persistence value κ ∼ 2, as illustrated Fig 4A. Also, the fish states were clustered around such region, where the fish can switch between the disordered behaviour and ordered behaviour swiftly. Such disordered but critical behaviour was also observed for the midges in the urban parks of Rome [18].

In conclusion, our work presents a quantitative study of the spatial and temporal correlations manifested by a large group of zebrafish. In our fully 3D characterisation, we have shown that there is a timescale separation between rapid reorientations at short times and the formation of a dynamical state with characteristic spatial correlations at longer times. Such spatial correlations evolve continuously and no steady state is observed in the time window of one hour. Our analysis shows that the continuously changing collective macroscopic states of the fish can be described quantitatively by the persistence length and nearest neighbour distance. The ratio of these length scales presents a characteristic correlation with the polarisation of the fish group. This simple relation is supported by an elementary agent based model in the class of the Vicsek models for collective behaviour.

Our analysis also opens multiple questions: the true nature of the interactions and how these are linked to the sensory and vision capabilities of the fish is open to debate; also, the reason for the change of the fish states remained unexplored, with the possibility of the fish learning over time about the experimental conditions. Our work shows that zebrafish provides a viable model system for the study of animal collective behaviour where such questions can be investigated in a quantitative manner.

A further intriguing possibility is to link the methodology that we develop here, with genetic modifications to zebrafish, for example with behavioural phenomena such as autism [27] or physical alterations such as the stiffened bone and cartilage [58].

Supporting information

S1 Text. The details on the experiments, the analysis, and simulations. And the comparison between our results and previous studies.

The detailed description of the tracking system was introduced in the first section, including the analysis on the overall tracking accuracy. The second section presented the details of the fish age. The third section discussed the details of the analysis, typically the calculation of the correlation functions. The fourth section showed the simulation parameters. The fifth section verified the scaling relationship between persistence length and noise in the Vicsek model. The sixth section presented the comparison between our result and previous results. The last section discussed different ways to collapse the experimental data.


S1 Dataset. The behavioural quantities, correlation functions, and simulation results to produce figures in the main text.

The results were organised in the json file format, and they can be parsed by common json libraries in different computer languages. The pedagogical code (S1 Code) was provided to aid the reader visualising the results.


S1 Code. The pedagogical code to explore the dataset and to generate the figures in the main text.

The code was written in Python language, and organised as a jupyter notebook.


S1 Video. Fifty young fish in the fast and ordered state.

The movie shows the 2D video and 3D trajectories of 50 young fish in real time. In the 3D plot, The dots represent the location of the fish, and the arrows represent the velocities of the fish. The length of the arrow indicates the value of the speed.


S2 Video. Fifty young fish in the slow and disordered state.

The movie shows the 2D video and 3D trajectories of 50 young fish in real time. In the 3D plot, The dots represent the location of the fish, and the arrows represent the velocities of the fish. The length of the arrow indicates the value of the speed.


S3 Video. Fifty old fish in the fast and disordered state.

The movie shows the 2D video and 3D trajectories of 50 old fish in real time. In the 3D plot, The dots represent the location of the fish, and the arrows represent the velocities of the fish. The length of the arrow indicates the value of the speed.


S4 Video. The reprojection error of the 3D tracking of 50 young fish.

The circles are 2D tracking results, and the cross markers are the reprojected 3D tracking results.


S5 Video. The reprojection error of the 3D tracking of 50 simulated fish.

The circles are 2D tracking results, and the cross markers are the reprojected 3D tracking results.



We thank James G. Puckett, Christos C. Ioannou, and James Herbert for stimulating conversations. This work was carried out using the computational facilities of the Advanced Computing Research Centre, University of Bristol—


  1. 1. Liu G, Patch A, Bahar F, Yllanes D, Welch RD, Marchetti MC, et al. Self-Driven Phase Transitions Drive Myxococcus Xanthus Fruiting Body Formation. Phys Rev Lett. 2019;122(24):248102. pmid:31322369
  2. 2. Cavagna A, Cimarelli A, Giardina I, Parisi G, Santagati R, Stefanini F, et al. Scale-Free Correlations in Starling Flocks. Proceedings of the National Academy of Sciences. 2010;107(26):11865–11870. pmid:20547832
  3. 3. Makris NC, Ratilal P, Symonds DT, Jagannathan S, Lee S, Nero RW. Fish Population and Behavior Revealed by Instantaneous Continental Shelf-Scale Imaging. Science. 2006;311(5761):660–663. pmid:16456080
  4. 4. Deneubourg JL, Goss S. Collective Patterns and Decision-Making. Ethology Ecology & Evolution. 1989;1(4):295–311.
  5. 5. Pitcher TJ, Magurran AE, Winfield IJ. Fish in Larger Shoals Find Food Faster. Behav Ecol Sociobiol. 1982;10(2):149–151.
  6. 6. Trenchard H, Perc M. Energy Saving Mechanisms, Collective Behavior and the Variation Range Hypothesis in Biological Systems: A Review. Biosystems. 2016;147:40–66. pmid:27288936
  7. 7. Hemelrijk C, Reid D, Hildenbrandt H, Padding J. The Increased Efficiency of Fish Swimming in a School. Fish Fish. 2015;16(3):511–521.
  8. 8. Cavagna A, Conti D, Creato C, Del Castello L, Giardina I, Grigera TS, et al. Dynamic Scaling in Natural Swarms. Nature Phys. 2017;13(9):914–918.
  9. 9. Méndez-Valderrama JF, Kinkhabwala YA, Silver J, Cohen I, Arias TA. Density-Functional Fluctuation Theory of Crowds. Nat Commun. 2018;9(1):3538. pmid:30166535
  10. 10. Grünbaum D, Viscido S, Parrish JK. Extracting Interactive Control Algorithms from Group Dynamics of Schooling FIsh. In: Cooperative Control; 2005. p. 103–117.
  11. 11. Dorigo M, Birattari M, Stutzle T. Ant Colony Optimization. IEEE Comput Intell Mag. 2006;1(4):28–39.
  12. 12. Jia Y, Wang L. Leader–Follower Flocking of Multiple Robotic Fish. IEEE/ASME Trans Mechatron. 2015;20(3):1372–1383.
  13. 13. Attanasi A, Cavagna A, Del Castello L, Giardina I, Melillo S, Parisi L, et al. Collective Behaviour without Collective Order in Wild Swarms of Midges. PLoS Comput Biol. 2014;10(7):e1003697. pmid:25057853
  14. 14. Ni R, Ouellette NT. On the Tensile Strength of Insect Swarms. Phys Biol. 2016;13(4):045002. pmid:27559838
  15. 15. Gautrais J, Ginelli F, Fournier R, Blanco S, Soria M, Chaté H, et al. Deciphering Interactions in Moving Animal Groups. PLoS Comput Biol. 2012;8(9):e1002678. pmid:23028277
  16. 16. Bialek W, Cavagna A, Giardina I, Mora T, Silvestri E, Viale M, et al. Statistical Mechanics for Natural Flocks of Birds. Proceedings of the National Academy of Sciences. 2012;109(13):4786–4791. pmid:22427355
  17. 17. Sinhuber M, Ouellette NT. Phase Coexistence in Insect Swarms. Phys Rev Lett. 2017;119(17):178003. pmid:29219441
  18. 18. Attanasi A, Cavagna A, Del Castello L, Giardina I, Melillo S, Parisi L, et al. Finite-Size Scaling as a Way to Probe Near-Criticality in Natural Swarms. Phys Rev Lett. 2014;113(23):238102. pmid:25526161
  19. 19. Bricard A, Caussin JB, Desreumaux N, Dauchot O, Bartolo D. Emergence of Macroscopic Directed Motion in Populations of Motile Colloids. Nature. 2013;503(7474):95–98. pmid:24201282
  20. 20. Yan J, Han M, Zhang J, Xu C, Luijten E, Granick S. Reconfiguring Active Particles by Electrostatic Imbalance. Nature Mater. 2016;15(10):1095–1099. pmid:27400388
  21. 21. Vicsek T, Czirók A, Ben-Jacob E, Cohen I, Shochet O. Novel Type of Phase Transition in a System of Self-Driven Particles. Phys Rev Lett. 1995;75(6):1226–1229. pmid:10060237
  22. 22. Couzin ID, Krause J, James R, Ruxton GD, Franks NR. Collective Memory and Spatial Sorting in Animal Groups. Journal of Theoretical Biology. 2002;218(1):1–11. pmid:12297066
  23. 23. van der Vaart K, Sinhuber M, Reynolds AM, Ouellette NT. Mechanical Spectroscopy of Insect Swarms. Sci Adv. 2019;5(7):eaaw9305. pmid:31501772
  24. 24. Giannini JA, Puckett JG. Testing a Thermodynamic Approach to Collective Animal Behavior in Laboratory Fish Schools. Phys Rev E. 2020;101(6):062605. pmid:32688602
  25. 25. Puckett JG, Pokhrel AR, Giannini JA. Collective Gradient Sensing in Fish Schools. Sci Rep. 2018;8(1):7587. pmid:29765115
  26. 26. Jolles JW, Boogert NJ, Sridhar VH, Couzin ID, Manica A. Consistent Individual Differences Drive Collective Behavior and Group Functioning of Schooling Fish. Curr Biol. 2017;27(18):2862–2868.e7. pmid:28889975
  27. 27. Kim OH, Cho HJ, Han E, Hong TI, Ariyasiri K, Choi JH, et al. Zebrafish Knockout of Down Syndrome Gene, DYRK1A, Shows Social Impairments Relevant to Autism. Molecular Autism. 2017;8(1):50. pmid:29021890
  28. 28. Tang W, Davidson JD, Zhang G, Conen KE, Fang J, Serluca F, et al. Genetic Control of Collective Behavior in Zebrafish. iScience. 2020;23(3):100942. pmid:32179471
  29. 29. Pedersen M, Haurum JB, Bengtson SH, Moeslund TB. 3D-ZeF—a 3D Zebrafish Tracking Benchmark Dataset. CVPR. 2020;.
  30. 30. Butail S, Paley DA. Three-Dimensional Reconstruction of the Fast-Start Swimming Kinematics of Densely Schooling Fish. J R Soc Interface. 2011;9(66):77–88. pmid:21642367
  31. 31. Wang SH, Liu X, Zhao J, Liu Y, Chen YQ. 3D Tracking Swimming Fish School Using a Master View Tracking First Strategy. 2016 IEEE International Conference on Bioinformatics and Biomedicine (BIBM). Proceedings—2016 IEEE International Conference on Bioinformatics and Biomedicine, BIBM 2016; 2017. p. 516–519.
  32. 32. Cachat J, Stewart A, Utterback E, Hart P, Gaikwad S, Wong K, et al. Three-Dimensional Neurophenotyping of Adult Zebrafish Behavior. PLoS ONE. 2011;6(3):e17597. pmid:21408171
  33. 33. Saberioon MM, Cisar P. Automated Multiple Fish Tracking in Three-Dimension Using a Structured Light Sensor. Comput Electron Agric. 2016;121(C):215–221.
  34. 34. Shelton DS, Shelton SG, Daniel DK, Raja M, Bhat A, Tanguay RL, et al. Collective Behavior in Wild Zebrafish. Zebrafish. 2020;17(4):243–252. pmid:32513074
  35. 35. Westerfield M. The Zebrafish Book: A Guide for the Laboratory Use of Zebrafish (Danio Rerio). University of Oregon Press. University of Oregon Press; 2000.
  36. 36. Hartley R, Zisserman A. Multiple View Geometry in Computer Vision. Cambridge Books Online. Cambridge University Press; 2003.
  37. 37. Cavagna A, Giardina I, Orlandi A, Parisi G, Procaccini A, Viale M, et al. The STARFLAG Handbook on Collective Animal Behaviour: 1. Empirical Methods. Animal Behaviour. 2008;76(1):217–236.
  38. 38. Ouellette NT, Xu H, Bodenschatz E. A Quantitative Study of Three-Dimensional Lagrangian Particle Tracking Algorithms. Exp Fluids. 2006;40(2):301–313.
  39. 39. Xu H. Tracking Lagrangian Trajectories in Position–Velocity Space. Meas Sci Technol. 2008;19(7):075105.
  40. 40. Kelley DH, Ouellette NT. Emergent Dynamics of Laboratory Insect Swarms. Sci Rep. 2013;3(1):1073. pmid:23323215
  41. 41. Stowers JR, Hofbauer M, Bastien R, Griessner J, Higgins P, Farooqui S, et al. Virtual Reality for Freely Moving Animals. Nat Methods. 2017;14(10):995–1002. pmid:28825703
  42. 42. Ling H, Mclvor GE, van der Vaart K, Vaughan RT, Thornton A, Ouellette NT. Costs and Benefits of Social Relationships in the Collective Motion of Bird Flocks. Nat Ecol Evol. 2019;3(6):943–948. pmid:31061474
  43. 43. Mwaffo V, Anderson RP, Butail S, Porfiri M. A Jump Persistent Turning Walker to Model Zebrafish Locomotion. J R Soc Interface. 2015;12(102):20140884. pmid:25392396
  44. 44. Hansen JP, McDonald IR. Chapter 3—Static Properties of Liquids: Thermodynamics and Structure. In: Hansen JP, McDonald IR, editors. Theory of Simple Liquids (Fourth Edition). fourth edition ed. Oxford: Academic Press; 2013. p. 61–104.
  45. 45. Ginelli F. The Physics of the Vicsek Model. Eur Phys J Spec Top. 2016;225(11-12):2099–2117.
  46. 46. Ballerini M, Cabibbo N, Candelier R, Cavagna A, Cisbani E, Giardina I, et al. Empirical Investigation of Starling Flocks: A Benchmark Study in Collective Animal Behaviour. Anim Behav. 2008;76(1):201–215.
  47. 47. Ling H, Mclvor GE, Westley J, Vaart K, Vaughan RT, Thornton A, et al. Behavioural Plasticity and the Transition to Order in Jackdaw Flocks. Nat Commun. 2019; p. 1–7. pmid:31729384
  48. 48. Silverberg JL, Bierbaum M, Sethna JP, Cohen I. Collective Motion of Humans in Mosh and Circle Pits at Heavy Metal Concerts. Phys Rev Lett. 2013;110(22):228701. pmid:23767754
  49. 49. van der Vaart K, Sinhuber M, Reynolds AM, Ouellette NT. Environmental Perturbations Induce Correlations in Midge Swarms. J R Soc Interface. 2020;17(164):20200018. pmid:32208820
  50. 50. Delaney M, Follet C, Ryan N, Hanney N, Lusk-Yablick J, Gerlach G. Social Interaction and Distribution of Female Zebrafish (Danio Rerio) in a Large Aquarium. The Biological Bulletin. 2002;203(2):240–241. pmid:12414599
  51. 51. Miller N, Gerlai R. From Schooling to Shoaling: Patterns of Collective Motion in Zebrafish (Danio Rerio). PLoS ONE. 2012;7(11):e48865. pmid:23166599
  52. 52. Pérez-Escudero A, de Polavieja GG. Adversity Magnifies the Importance of Social Information in Decision-Making. J R Soc Interface. 2017;14(136):20170748. pmid:29187633
  53. 53. Miller N, Gerlai R. Quantification of Shoaling Behaviour in Zebrafish (Danio Rerio). Behavioural Brain Research. 2007;184(2):157–166. pmid:17707522
  54. 54. Miller N, Greene K, Dydinski A, Gerlai R. Effects of Nicotine and Alcohol on Zebrafish (Danio Rerio) Shoaling. Behav Brain Res. 2013;240:192–196. pmid:23219966
  55. 55. Heras FJH, Romero-Ferrero F, Hinz RC, de Polavieja GG. Deep Attention Networks Reveal the Rules of Collective Motion in Zebrafish. PLoS Comput Biol. 2019;15(9):e1007354. pmid:31518357
  56. 56. Tunstrøm K, Katz Y, Ioannou CC, Huepe C, Lutz MJ, Couzin ID. Collective States, Multistability and Transitional Behavior in Schooling Fish. PLoS Comput Biol. 2013;9(2):e1002915. pmid:23468605
  57. 57. Mora T, Bialek W. Are Biological Systems Poised at Criticality? J Stat Phys. 2011;144(2):268–302.
  58. 58. Lawrence EA, Kague E, Aggleton JA, Harniman RL, Roddy KA, Hammond CL. The Mechanical Impact of Col11a2 Loss on Joints; Col11a2 Mutant Zebrafish Show Changes to Joint Development and Function, Which Leads to Early-Onset Osteoarthritis. Philos Trans R Soc B Biol Sci. 2018;373(1759):20170335. pmid:30249781