<<

3D Tracking of Anti-Predator Behaviour in Guppies

by

Ani Vanesyan

A thesis submitted in conformity with the requirements for the degree of Master of Science Graduate Department of Ecology and Evolutionary Biology University of Toronto

© Copyright by Ani Vanesyan (2012)

3D TRACKING OF ANTI-PREDATOR BEHAVIOURS IN GUPPIES

Ani Vanesyan

Masters of Science

Department of Ecology and Evolutionary Biology University of Toronto

2012

Abstract

Guppies from high- and low-predation habitats are well known for the differences in their anti- predator behaviours. However, little has been reported on the differences between social versus asocial stimulus responses. In this study, we conducted a detailed analysis of shoaling and other anti-predator behaviours of guppies from two populations, in pairs and as single , in three dimensions. Using custom programs in MATLAB, we quantify the behavioral responses before shoaling and during its dissipation. Our 3D reconstruction allowed us to track the inter-fish distance, velocity and orientation of both fish. Our results demonstrate a positive correlation between the relative orientation of the fish and the interfish distance, for pairs from the high- predation population. We also report that the anti-predator behaviour of guppies is comprised of the following sequence: freezing, darting/skittering, and recovery to pre-stimulus swimming behaviour. Upon repeated encounters with the stimulus, a reduced shoaling and anti-predator response was observed.

ii

Acknowledgements

Firstly, I would like to sincerely thank my supervisors Dr. Helen Rodd and Dr. William Ryu, for their guidance and support throughout my academic journey. Helen, thank you for your invaluable mentorship throughout my university career, for introducing me to the world of research, for coaching me every step of the way and for inspiring me to pursue graduate studies in EEB. Will, I owe you my interest and my understanding of the world of biophysics. Thank you for continuously pushing me to extend my knowledge in this field, to acquire new skills and to think critically and independently. I feel very fortunate to have had two coordinators from different backgrounds to learn from and to be guided by, from the point of decision making to the point of thesis completion.

In addition, I thank my supervisory committee members Dr. Marla Sokolowski and Dr. Debra

McLennan and my examining committee, Ben Gilbert and Shannon McCauley, for their comments and suggestions. I would like to also thank my lab members from both Ryu lab and

Rodd lab, for being there on all of my presentations and for always being ready to provide useful suggestions and advice.

I thank the Luys Foundation, for their support and their shared vision and faith in Armenian students worldwide.

Finally, I would like to thank my family and friends for their continuous support. Thank you for always encouraging me and for knowing that I will get where I am now, before I even did. You always told me that everything will be worth it at the end, and you were right. Vardges

Avetisyan, thank you for always showing such an enthusiasm about my work: you have motivated me more than you know.

iii

Table of Contents

Acknowledgements ...... iii

List of Tables ...... vi

List of Figures ...... vii

List of Appendices ...... viii

3D Tracking of Anti-Predator Behaviours in Guppies ...... 1

INTRODUCTION ...... 1

MATERIALS AND METHODS ...... 3

Experimental Fish ...... 3

Analysis of Schooling Behaviour ...... 4

Statistical Analyses ...... 7

RESULTS ...... 8

Interfish Distance ...... 8

Freezing Duration ...... 10

Velocity Recovery ...... 11

Variance of Speed ...... 11

DISCUSSION ...... 12

Initial Shoaling Response ...... 12

Anti-Predator Behaviours ...... 14

Decline in Responsivenes to the Stimulus ...... 15

CONCLUSIONS...... 17

References ...... 19

iv

Tables ...... 24

Figures...... 27

Appendices ...... 33

APPENDIX A ...... 33

APPENDIX B ...... 37

v

List of Tables

 Table 1. Separate repeated-measures ANOVAs, by Trial, on the transformed (square root) ratio of the interfish distance after the stimulus to the distance before the stimulus, for all three days.

 Table 2. Repeated-measures ANOVA on the average time spent frozen (in seconds) after the stimulus, for the first trials of the three days.

 Table 3. Results of a repeated-measures ANOVA on variance of speed before and after the stimulus.

vi

List of Figures

 Figure 1. Repeated-measures ANOVA, by Trial, on the ratios of (Da/Db) (interfish distance after the stimulus to the distance before stimulus), for the first, second and third trials, across the three days, for high- and low-predation population fish.

 Figure 2. Correlation of interfish distance with orientation of the fish during the first second after the stimulus for high-predation population and low-predation population guppies.

 Figure 3. Results of a repeated-measures ANOVA on the transformed (sqrt+1) freezing time of fish in the first tests on days 1,2 and 3 for the high- and low-predation population guppies.

 Figure 4. Repeated-measures ANOVA on the transformed (sqrt+1) freezing time of the fish in the first trials on Days 1, 2 and 3 for guppies in pairs and as singletons.

 Figure 5. Repeated-measures ANOVA by Population type, on the transformed (ln) velocity recovery time of fish in the first trials on Days 1, 2 and 3 for pairs of fish from high- and low-predation populations.

 Figure 6. Repeated-measures ANOVA by Population type on the Speed Variance data for Day1 of the high- and low- predation population guppies.

 Figure 7. Locating and tracking fish within frames, in 3D.

 Figure 8. 3D plots of the trajectories of a pair of fish, from high predation populations, before and after the stimulus.

vii

List of Appendices

 Appendix A. Image acquisition. Image Analysis. Future Directions.

 Appendix B. MATLAB Algorithms

viii

3D Tracking of Anti-Predator Behaviours in Guppies

INTRODUCTION

Group formation, which occurs in many animal taxa, can enhance the fitness of the members in a number of ways including increased foraging success (e.g., Breder, 1959; Foster et al., 2001; Krause & Ruxton, 2002), enhanced predator evasion and, in some cases, reduced hydro- or aerodynamic costs (e.g., Svedsen et al., 2003; Viscido & Wethey, 2002). Social grouping in fish is termed shoaling, of which schooling is a subset. Schooling is the synchronized swimming of all members in the group, characterized by a uniform separation among individuals, a specific velocity and matching orientation of all the members in the group

(Pitcher, 1983). Both the lateral system and vision can be employed during the formation and maintenance of fish schools (Faucher, 2010).

Until recently, most studies observed collective dynamics of fish in two dimensions, limiting the estimates of interfish distance and orientation to just those two dimensions. Not only do these calculations have reduced accuracy (the third dimension is needed when the fish are occluded and for the calculation of the relative polarization of the fish in three dimensions) but, more importantly, these calculations miss the complexity of the real world structure and interactions of the fish. In the models proposed thus far, schools are composed of varying spherical “zones” (Couzin et al., 2002; Miller et al., 2012). These zones are concentric spheres, with the innermost sphere being the zone of repulsion, the middle sphere the zone of orientation and the outermost sphere being the zone of attraction (Couzin et al. 2002). If the fish is in the zone of attraction, attraction forces are at work and the fish moves to the zone of orientation.

1

Here, the fish orients itself to the mean direction of the school. If the fish then moves too close to its neighbours, the fish is acted upon by forces of repulsion, which is a social force (Miller et al., 2012). The visualization of these spherical “zones” and the localization of fish within them require a three dimensional view.

Our understanding of schooling has improved with improved quantification of the attributes of shoals. For example, Viscido (2004) was able to track in three dimensions, and he reported a positive correlation between velocity and alignment. This finding lends support to Mikhailov and Calenbuhr’s (2002) proposal that fish in strongly aligned schools are more mobile and are, therefore, faster at locating food patches.

In this study, guppies (Poecilia reticulata) were filmed from two perpendicular views to investigate the fine-scale dynamics of shoal formation in three dimensions. We selected this species because it shows considerable inter-population variation in shoaling behavior: from strong shoalers in populations exposed to high levels of predation, to those that rarely shoal, from populations exposed to lower predation risk (Magurran et al., 1993, Huizinga et al., 2009;

Song et al., 2011). The former co-occur with a community of large, dangerous predators (high- predation sites), the latter with minor predators (low-predation sites) (reviewed in Magurran,

2005). To elucidate the intricacies of how shoals are formed, we wanted to contrast guppies from these two types of populations. We extend previous studies, where the strength of shoaling has been characterized by the distance between the members of the shoal (Breden et al., 1987;

Kelley and Magurran, 2003b), degree of polarization (Huth & Wissel, 1994), and the time spent in a cohesive shoal (Magurran & Pitcher, 1987). In this study we assess the interfish distance, the velocity and orientation of fish in dyads, the time each fish spent in a frozen state, as well as the change in the variance of speed.

2

For this study, we selected two populations from one river drainage: one from a high- predation community and the other from a low-predation community. These two populations represent the range of shoaling behaviour seen in guppies from natural populations. Overall, shoaling has been studied in more than twenty guppy populations (Magurran et al., 1993). We looked at pairs of fish, from both populations, to study the social dynamics of guppies following a startling stimulus (lights on/off/on), as well as the differences in the anti-predator behaviours of guppies from different habitats. To help distinguish between predator avoidance behaviours versus group behaviours, single fish from each population were also observed. In addition, we compared the short-term and long-term reductions in response of the fish to the startling stimulus by testing all fish three times a day, over the course of three days. As the stimulus used was harmless, we expected the fish to show a reduced response over the course of the repeated test trials, thus filtering the irrelevant information from their sensory stream (Hemmi and Merkle,

2009).

MATERIALS AND METHODS

EXPERIMENTAL FISH

The experimental guppies were laboratory-reared descendents of guppies collected from two populations in Trinidad: Aripo River upstream (low-predation) and Aripo River downstream

(high-predation). These low-predation guppies co-occur with Rivulus hartii. This is a sit-and- wait predator, and guppies form a minor part of its diet (Seghers, 1973). The high-predation guppies co-occur with several species of fish, but Crenicichla alta is the major predator—it is an

3

active hunter that preys intensively on guppies (Haskins et al., 1961; Reznick et al. 1996). Avian predators, such as kingfishers, are occasionally seen at guppy sites (Ffrench, 1992). Only adult females were used in the experiment because they are stronger shoalers than males and because males switch between shoals more often than females during fusion and fission events (Croft et al., 2003). Each dyad of females was selected to be approximately the same body size, as it has been previously observed that guppy schools are assorted by body length (Brown & Laland,

2002). Before the experiment, the fish were held in large stock tanks with 20+ fish. Ten days before the start of testing and until they were used in a trial, the fish were moved to a 19 litre tank with filtered water and gravel on the bottom, and held in groups of 10 or 19 fish. The fish were fed flake food twice daily and held at a constant temperature of 25°C. Thirty individuals from each population were studied, 20 of them in pairs and 10 as single fish.

ANALYSIS OF SCHOOLING BEHAVIOUR

After being fed, one or two females were transferred to the observation tank (a cube with

33cm sides); the bottom and two adjacent sides were made of black plexiglass, to minimize glare in the images, and the other sides were made of clear acrylic. The temperature in the tank was held at 25°C. Two LED lights (Radionic LEDs ZX513) were mounted directly above the tank to provide the only light source for the fish; the tank was shielded from external sources of light by black blinds in the observation room. Imaging was done using two Allied Vision Technology

Cameras (Stingray F125B,Germany) with Nikon lenses (AF-S 18-55mm, Japan), positioned at

900 to each other and filming adjacent sides of the tank. All filming was done between 10:00am and 6:00pm.

4

The acclimatization period for the fish, after transfer to the observation tank, was 30 minutes. Then, to encourage shoaling, the light source was turned off for 5 seconds and turned back on. Rather than using startling stimuli that have been used in previous studies, such as a confined predator in the tank (Weetman et al., 1998), a model of a predator inside the tank

(Kelley and Magurran, 2003a), or being chased with a net (Reader et al., 2003), we chose light as a startling stimulus because we wanted to use a non-directional cue. We note that in previous studies, the silhouette of a bird passing overhead caused anti-predator responses (Templeton and

Shriner, 2004). It is not clear whether the guppies in our study interpreted our stimulus as a shadow of a potential predator.

LabVIEW software (National Instruments, USA) was used to simultaneously capture images from both cameras as well as controlling the stimulus lighting. A signal from a digital control module (National Instruments, ni-9401) was sent to a custom built AC relay control to turn the LED lighting on and off. A signal generator (Agilent, 33220a, USA) was used to simultaneously trigger image capture from both cameras. Image acquisition, at a rate of 20 frames/second, was done for 45 seconds before the stimulus, 5 seconds during the dark phase, and 60 sec after the light was turned back on. The 20 pairs and the 20 individual guppies were tested three times a day at intervals of 30 minutes between trials, and over the course of three consecutive days. At the end of each day, the pairs of fish were housed together in a separate tank. The individual fish were also housed separately after each observation day.

The subsequent image analysis and trajectory reconstruction were performed via a custom program written in MATLAB (Mathworks, USA). To track the fish, a label was assigned to each fish in the frame and a circular searching radius was defined around each object.

In the subsequent frame, if the fish was found within the specified circular area, it kept its label.

5

If not, a new label was assigned. This tracking was performed separately on the images acquired from each camera, and the positions of the centroids of the fish were output as excel files along with the frame numbers. Problems in image analysis arose during occlusions of the fish. If occlusions occurred in both views, a zero was assigned as the inter-fish distance. For the frames with occlusions in only one view, the program automatically stopped to allow us to manually label the fish, by using the data from the second camera to distinguish the fish. In the few cases of ambiguous occlusions, the frames were omitted from analysis; there were approximately 1-2 cases per data set, but overall, fewer than 2 seconds were omitted for each trial.

Using the 3D positions of the centroids for each fish, the inter-fish distances and orientations were computed for each of the 20 pairs of fish. The inter-fish distance was defined as the distance between the centroids of the fish in a pair. It was computed for all frames before the stimulus and after the stimulus. The relative orientation of the fish in 3D was computed using ImageJ (Schneider et al. 2012), for the first 20 frames after the stimulus. This was achieved using the 3D angle measurement function in ImageJ for both views. The three point selection for the angle computation corresponded to the heads of the fish and the vertex point, which was defined as the point of intersection of the vectors running from the heads to the tails of the fish.

Three additional variables were measured for all fish: freezing duration, velocity recovery time after the stimulus, and speed variance. For all 4 treatment groups, we observed that after the stimulus, the fish showed a temporary freezing behaviour. For this study, we defined freezing as no change in the spatial position of the centroid of the fish; however, in some cases, the fish slowly changed in orientation, but this was still classified as being ‘frozen’. The fish was defined as “freezing” if, in the frames directly after the dark phase, the velocity of the fish

6

was less than the variance of velocity across the post-stimulus values. The velocity recovery time was measured as the time it took for the post-stimulus velocity of the fish to reach one half of the maximum recorded pre-stimulus value. This measure was used to determine how quickly the fish resumed their pre-stimulus behaviours, after the initial freezing response. In the case of pairs of fish, the average velocity value of both was computed, and the maximum of the average was used. This was because it was not possible to recognize fish in a pair as individuals at all times during the experiment.

STATISTICAL ANALYSES

To evaluate the effects of predation community (i.e. population) and trial on the behaviours we measured, we used ANOVA. Where data for more than one trial was assessed, we used repeated-measures (RM) ANOVA. For interfish distance on the first trial of Day 1, we used a repeated-measures ANOVA with values Before and After the stimulus as the repeated- measures; the data were transformed using natural log to render the variances homogeneous.

To evaluate the change in interfish distance in response to the stimulus, we analysed the ratio of the interfish distance after the stimulus to the distance before the stimulus; the ratio also allowed us to observe the pattern in response to repeated encounters with the stimulus. To render the interfish distance ratios normally distributed, they were transformed (square root). In a preliminary analysis, we used a compound MANOVA with Day and Trial (1, 2, 3) as the repeated-measures; subsequent analyses were RM ANOVAs by Trial. The freezing time data were analysed for the first trials of all three days; they were transformed (sqrt+1). By analyzing

7

the first trials of the three days, we are able to assess whether the response of the fish changed from one day to the next, with repeated stimulus encounters.

For the speed variance data, a RM ANOVA was done on the Before and After measurements for just the first trial on the first day because we were interested in the initial disturbance in behaviour caused by the stimulus. The data were ln transformed. Velocity recovery was measured in the three trials on Day 1 and was transformed (ln) to meet the assumptions of ANOVA. We analysed all three trials of the first day to see how the recovery time changed with frequent stimulus encounters. Unless stated otherwise, all analyses were done with JMP 9.0.

To determine whether the fish were more aligned when they were closer together, for each population separately, a re-sampling method was used to compute the correlation coefficients of interfish distance with fish orientation for the first second after the stimulus.

Using the built-in bootstrapping function in MATLAB, the data were systematically and randomly re-sampled a 1000 times. From the data generated, the shape of the sampling distribution was approximated and estimates of data correlation and confidence intervals were derived.

RESULTS

INTERFISH DISTANCE

First, we asked whether the fish responded to our light cue by reducing inter-individual distances. Fish from both populations reduced interfish distance after the stimulus, but the high-

8

predation population showed a steeper, marginally significant decline (Time*Population effect:

F1,18=4.3, P=.051). The population effect (Between Subjects effect) was not significant

(F1,18=1.66, P=.21). We also note that, for the interfish distance for trial 1 on day 1, the variance for the low-predation fish’s untransformed ‘After the cue’ responses (SD=208.1) was significantly higher than the high-predation fish variance (108.5) (Levene’s test F1,18=7.08,

P=0.016). Therefore, not only did the fish from the low-predation habitat show weaker shoaling behaviour, there was more variation among individuals in whether they showed shoaling behaviour.

For the analysis of interfish distances we measured the interfish distances before (Db) and after (Da) the stimulus and computed an interfish distance ratio (Da/ Db) for all trials. In the analysis, two of the interactions with Population were not significant (Population*Day P=0.10;

Population*Day*Trial P=0.21), but there was a significant Population*Trial interaction (P=.001).

To examine this interaction in more detail, we ran separate analyses by Trial. In the first trial on each of the three days, there was a significant population effect with the low-predation population expressing a higher ratio than the high-predation one (see Table 1); in other words, the high-predation fish showed stronger shoaling behaviour (Fig. 1a). By the third trials of each day, that pattern had switched such that the high-predation fish had a higher ratio than the low- predation ones (Fig 1c). For the second trials, there was not a significant Population effect (Fig.

1b). Across all three analyses by trials, there was also a significant effect of Day such that the ratios increased to values near 1 on the third day, regardless of Trial number.

Since relative polarization of the fish in a group is an important characteristic of shoaling behaviour, we looked at the orientation of the fish immediately after the stimulus. Cohesive shoaling is characterized by a specific near neighbour distance and similar orientation of the fish.

9

We discovered that orientation was positively correlated with the interfish distance, for the high- predation population guppies: the closer the fish were post-stimulus, the more aligned they were

(corr. coefficient=0.81, confidence interval = [0.178; 0.961]) (Fig. 2a). In contrast, there was not a significant correlation between relative orientation and interfish distance for low-predation guppies (corr. coefficient=0.34, confidence interval = [-0.7240; 0.8119]) (Fig. 2b).

FREEZING DURATION

Next, we asked whether there were differences across treatments in the amount of time that the fish were ‘frozen’ after the stimulus by looking at the freezing durations for the first tests on all three days for all treatments. Within subjects, there were significant interactions between day and population type and between day and single/pair (Table 2, Figures 3 and 4). Guppies from the high-predation habitat stayed frozen for significantly longer post-stimulus, as compared to the low-predation guppies. Both populations showed a significant decline in the freezing time over the course of the three days, but the rate of decline was higher for the high-predation fish

(Fig. 3). In the comparison of fish in pairs vs. singletons, a significantly longer freezing time post-stimulus was observed for the fish in pairs for days 1 and 2 (Fig. 4). Upon repeated encounters with the stimulus, a decrease in response was observed for both treatments, as both pairs and singletons spent significantly less time frozen on Day 3; the rate of decline was steeper in the pairs of fish. The three way interaction between day*population*single was not significant.

10

VELOCITY RECOVERY

Velocity recovery, which estimates how quickly the fish regained normal swimming behaviour, was computed immediately after the freezing phase, to avoid the possible confounding of the two variables. The velocity recovery time decreased within the three trials of

Day1, as well as, across the three days, within all four treatment groups. Comparing the two populations, the fish from low-predation habitats had lower recovery times. For both the Within and Between Subjects effects, there were significant interactions between the population and single/pair treatments (including with Trial for Between Subjects: F2,35=8.32, P=.0011; for

Between Subjects: F1,36=13.00, P=.0009). To simplify the interpretation of the data, we then ran two separate analyses for pairs and single fish. For the single fish, neither the main effect

(population: F1,18 =1.03, P=0.32) nor Trial*Population (F2,17=0.35, P=0.71) were significant. For the pairs of fish, the fish from the two populations differed in how their responses changed over the three trials (Trial*Population: F2,17=9.35, P=0.0018, Population: F1,18=17.62, P=0.0005) (Fig.

5).

VARIANCE OF SPEED

We found that following the startling stimulus, the fish showed rapid starting and stopping in their swimming pattern. To provide a measure for this disturbance in normal swimming behaviour, the variance in velocity was computed. Fish from all four treatment groups showed significantly higher speed variances after the stimulus than before it (Table 3).

There were not significant differences among individuals from the different treatment groups in their relative responses before and after the stimulus. However, there were significant

11

differences in the overall speed variances such that the low-predation population had greater mean variances in speed than the high-predation one (Fig. 6). In addition, the pairs had significantly greater variances than the singletons both before (least square means for pairs (SE):

1.49 (0.19); for singles: 0.75 (0.19)) and after (pairs: 3.81 (0.23); singles: 3.38 (0.23)) the stimulus. There was not a significant interaction between the treatments.

DISCUSSION

We were able to elicit shoaling behaviour in the pairs of fish in this experiment by exposing them to a startling stimulus: they reduced their interfish distance and many individuals were aligned such that they were parallel or close to being parallel. Moreover, as in previous studies, the fish from a population that co-occurs with dangerous predators showed more cohesive group formation than those from a population that experiences less intense predation pressure. Across all fish, a strong anti-predator response was observed after the stimulus, in the form of temporary freezing of the fish, followed a darting/skittering behaviour and a gradual velocity recovery. Over the course of the trials, the responses of the fish to the stimulus declined rapidly.

INITIAL SHOALING RESPONSE

First, we were able to demonstrate that the fish responded, in early trials, to our startling

(on-off light) stimulus by reducing inter-fish distances. As expected from previous studies the

12

reduction was more dramatic in the high-predation population pairs of fish than in the low- predation population pairs (Huizinga et al., 2009; Song et al., 2011). Interestingly, the variation in behaviour following the encounter with the stimulus was lower for the high-predation population guppies than the low-predation ones; this finding suggests a more cohesive behavioural pattern for the high-predation population guppies in the presence of a threatening stimulus. Because these high-predation guppies naturally coexist with large, dangerous predators, cohesive group formation once a threat is perceived, could be advantageous

(Rubenstein, 1978). Guppies from these populations have been found to exhibit a stronger shoaling tendency (Seghers, 1974, Breden et al., 1987) and form larger shoals (Magurran and

Seghers, 1994). It has been previously reported that fish with unusual behaviour, differing from that of this shoal, suffer much greater risk of predation (Landeau and Terborgh, 1986). For the low-predation population guppies, the benefits associated with shoaling may be reduced, given that shoaling may actually attract their major predator (Rivulus hartii) (Farr, 1975, Ioannou

&Kruase, 2008, Li and Rodd unpub. data).

For the high-predation fish, the closer the fish were after the stimulus, the more aligned they were. Previous studies have suggested that parallel orientation of fish in a shoal allows for faster movement of the school as a whole, should it need to escape from the predator (e.g.

Mikhailov and Calenbuhr, 2002, Viscido et al., 2004). This is because when the fish are not aligned, their velocity vectors cancel each other out (the fish are facing and moving in different directions), which leads to an overall decrease in the net movement of the whole school.

Moreover, motion of a group with constant polarization allows for the optimal utilization of the lateral line for threat , as synchronous movement reduces the generated noise, which could mask other auditory signals (Larsson 2009). Thus, being aligned in parallel may allow

13

for a more precise localization of the predator. In contrast, no significant association between alignment and interfish distance was found for the low-predation guppies.

ANTI-PREDATOR BEHAVIOURS

Freezing behaviour post-stimulus was observed for all pairs and single fish, although pairs from the high-predation population habitats froze for a longer time. Previous studies show that stationary prey are less easily detected by predators (e.g. Lima and Dill, 1990; Kramer and

McLaughlin, 2001; Seghers, 1974; Templeton and Shriner, 2004; Fraser et al. submitted ms), suggesting that the freezing behaviour we observed is adaptive. Moreover, a study by Neill and

Cullen (1974) demonstrated that success rate per attack by predator was higher when they attacked solitary individuals, rather than groups of prey. This could explain why the fish from the high predation site stayed frozen and in close proximity to each other for a longer period of time, as for these fish, in their natural population, there may be a high risk associated with being isolated from the shoal. To measure how soon the fish resumed their normal swimming behaviours after the stimulus, we computed the velocity recovery time. No significant difference was observed in velocity recovery time for single fish from the two populations. For the comparison of pairs with the single fish, the single fish regained their pre-stimulus velocity significantly faster than the pairs of fish. As the single fish tested cannot benefit from group behaviour, they do not have costs associated with isolating themselves from a formed shoal.

This could explain why the darting/skittering behaviour in tested single fish resumes significantly faster post-stimulus, as compared to the pairs of fish.

14

We observed that, after the stimulus, when the fish began to move again, their swimming pattern consisted of frequent starting and stopping movements. According to Bassett et al.

(2007), this frequent stopping of the fish allows them to maximally utilize the mechanoceptors of their lateral line for threat perception. The lateral line receptors allow for the perception of movements of the water, which are also caused by the fish themselves. Therefore, when not in motion, the fish eliminates self-generated noise making it easier to detect potential threats

(Coombs and Conley, 1997). Likewise for a group of fish, if all the fish stop simultaneously, the noise due to all the members of the group will be eliminated (Larsson, 2009). Visual searching for potential threats is also more efficient when stopped than when in motion. Radakov (1983) has termed the groups of fish that freeze under a threat of predation the “look around shoals”.

Thus, the initial freezing phase of our pairs of fish could be to reduce the self-generated noise so that they can locate the threat visually and via their lateral line cells; however, it is also possible that their starting and stopping was exaggerated because, during the dark phase of our stimulus, they had to rely entirely on lateral line perception. Other species also show this darting/skittering behaviour after being frightened (e.g. zebrafish (Gerlai, 1980), mice (Kafkafi et al., 2003)). In our study, the final recovery of the pre-stimulus swimming behaviour was observed after the initial freezing stage (on the order of seconds), followed by the starting and stopping behaviour.

DECLINE IN RESPONSIVENESS TO STIMULUS

The characteristics of the reduction in the responses to the stimulus across trials that we observed are similar to the common characteristics of habituation defined and reviewed in

15

Rankin et al. (2009). Firstly, over the first day, where the fish continuously encountered a harmless stimulus, there was a steady decrease in the magnitude of the change in interfish distance, freezing duration and the velocity recovery time. The spontaneous and partial recovery of the responses after the withdrawal of the stimulus was observed during the first tests of Days 2 and 3. Moreover, during Days 2 and 3, the decrease in the response was more rapid over the course of the three test trials than it was on Day 1, a process referred to as “potentiation of habituation” (Thompson and Spencer, 1966). The anti-predator behaviours also declined with repeated encounters with the stimulus, both across the trials in the first day and across the three days. Fish from all treatments stayed frozen significantly less by the third day, as compared to the first trial of Day1. Their post-freezing recovery of velocity was significantly faster by the last trial of Day 3, as compared to the initial stimulus encounter. However, we are unable to claim that the decline in responsiveness was due to habituation because we have not tested the alternate explanation; it is possible that the sensory learning that we observed was caused by a different form of sensory adaptation. To determine whether the patterns in sensory learning that we observed qualify as habituation, it is also important to demonstrate dishabituation (the recovery of the habituated response when a different stimulus is presented), stimulus specificity

(the response still occurs to other stimuli) or frequency dependent spontaneous recovery (more rapid recovery following stimulation delivered at a high frequency than to stimulation delivered at a lower frequency) (Rankin, 2009).

Despite our general observation that the ’ responsiveness to the stimulus declined, we did notice some interesting differences between populations in this decline. For the first trials across the three days, the high-predation fish showed a greater decrease in interfish distance, compared to the low-predation fish. However, for the third trials across the three days, the high-

16

predation fish were essentially not responding to the stimulus. As previous studies have suggested, predator avoidance is costly to the fish, in terms of time and energy (Welton et al.,

2003; Lima and Steury, 2005). Therefore, the fish from high-predation populations may choose to maintain regular activities such as courtship and foraging by quickly reducing their response to a threatening stimulus (Croft et al., 2004). According to Sih et al. (2000), if prey species continuously respond to a perceived threat with high intensity, an overall decrease in fitness could occur as they forgo courtship and foraging. As the low-predation fish experience a lower risk of predation, their fitness is less likely to be affected by exhibiting a high intensity response every time a serious threat is perceived (Brown et al., 2001).

CONCLUSIONS

Our study identifies, in fine detail, anti-predator behaviours in guppies from two populations, and differentiates between social and asocial responses to a perceived threat. Guppies from both populations showed shoaling behaviour but it was stronger in fish from the high-predation population. One interesting aspect of this was that the alignment between guppies from a high- predation population was stronger, the closer together the fish were; low-predation fish did not show that pattern. This suggests a more cohesive social behaviour in high-predation population guppies. Across all four treatments, the fish exhibited similar asocial predator evasion behaviour, comprised of freezing right after the encounter with the stimulus, followed by a starting/stopping swimming pattern until they regained their pre-stimulus velocity of swimming.

The assessment of the relative importance of these different phases in avoiding real predators

17

would be useful in future studies. A decrease in the stimulus response was observed, in the form of a decline in both the shoaling and predator avoidance behaviours, within a day, as well as across all three days, for all tested pairs and singletons. However, high-predation population fish showed a quicker decrease in social response, as they were essentially not responding to the stimulus by the third trial of the day. Future investigations of larger groups of fish are needed to determine how the stated parameters are affected by shoal size. To determine whether the observed changes in stimulus responses are indeed due to habituation, future studies are needed to test this learning for stimulus specificity and dishabituation.

18

References

Bassett, D. K., Carton, A.G., and Montgomery, J.C. 2007. Saltatory Search in a Lateral Line Predator. Journal of Fish Biology, 70, 1148-160. Breden, F., Scott, M., and Ellinor, M. 1987. Genetic Differentiation for Anti-predator Behaviour in the Trinidad Guppy, Poecilia reticulata. Animal Behaviour, 35, 618-20. Breder, C. M. 1959. Studies on Social Groupings in Fishes. Bulletin of the American Museum of Natural History, 117, 393-482. Brown, C. & Laland, K. 2001. Social Learning and Life Skills Training for Hatchery Reared Fish. Journal of Fish Biology, 59, 471-93. Brown, C., & Laland, K. 2002. Social Learning of a Novel Avoidance Task in the Guppy: Conformity and Social Release. Animal Behaviour, 64, 41-47. Brown, G. E., Adrian, J.C., and Shih, M.L. 2001. Behavioural Responses of Fathead Minnows to Hypoxanthine-3-N-oxide at Varying Concentrations. Journal of Fish Biology, 58, 1465-470. Brown, G. E., Macnaughton, C. J., Elvidge C.K., Ramnarine, I., and Godin, J. 2009. Provenance and Threat-sensitive Predator Avoidance Patterns in Wild-caught Trinidadian Guppies. Behav Ecol Sociobiol, 63, 699-706. Coombs, S., & Conley, R.A. 1997. Dipole Source Localization by the Mottled Sculpin II. The Role of Lateral Line Excitation Patterns. Journal of Comparative Physiology A: Sensory, Neural, and Behavioral Physiology, 180, 401-15. Couzin, I. D., Krause, J., James, R., Ruxton, G.D., and Franks, N.R. 2002. Collective Memory and Spatial Sorting in Animal Groups. Journal of Theoretical Biology, 218.1, 1- 11. Croft, D. P., Arrowsmith, B. J., Bielby, J., Skinner, K., White, E., Couzin, I.D., Magurran, A.E., Ramnarine, I., and Krause, J. 2003. Mechanisms Underlying Shoal Composition in the Trinidadian Guppy, Poecilia reticulata. Oikos, 100.3, 429-38. Croft, D.P., Botham, M.S., and Krause, J. 2004. Is Sexual Segregation in the Guppy, Poecilia reticulata, Consistent with the Predation Risk Hypothesis? Environmental Biology Of Fishes, 71.2, 127-33. Farr, J.A., 1975. The role of predation in the evolution of social behavior of natural

19

populations of the guppy. Evolution, 29, 151-158. Faucher, K., Parmentier, E., Becco, C., Vandewalle, N., and Vandewalle, P. 2010. Fish Lateral System Is Required for Accurate Control of Shoaling Behaviour. Animal Behaviour, 79, 679-87. Ffrench, R. 1992. Birds of Trinidad and Tobago. London: Christopher Helm. Foster, E.G., Ritz, D.A., Osborn, J.E., and Swadling, K.M. 2001. Schooling Affects the Feeding Success of Australian ( trutta) When Preying on Mysid Swarms (Paramesopodopsis rufa). Journal of Experimental Marine Biology and Ecology, 261, 93-106. Gautrais J., Ginelli F., Fournier R., Blanco S., Soria M. 2012. Deciphering Interactions in Moving Animal Groups. PLoS Comput Biol,. 8 (9), 1-11. Godin, J.J., Alfieri, M.S., Hoare, D.J., and Sadowski, J.A. 2003. Conspecific Familiarity and Shoaling Preferences in a Wild Guppy Population. Canadian Journal of Zoology, 81, 1899-904. Haskins, C.P., Haskins, E.F., McLaughlin, J.J.A., and Hewitt, R.E. 1961. Polimorphism and Population Structure in Lebistes reticulates, an Ecological Study. In Vertebrate Speciation, pp. 320-395. Ausin: University of Texas Press. Hemmi, J. M., and Merkle, T.. 2009. High Stimulus Specificity Characterizes Anti- predator Habituation under Natural Conditions. Proceedings of the Royal Society of Biological Sciences, 276, 4381-388. Huizinga, M., Ghalambor, C.K., and Reznick, D.N. 2009. The Genetic and Environmental Basis of Adaptive Differences in Shoaling Behaviour among Populations of Trinidadian Guppies. Journal of Evolutionary Biology, 22, 1860- 866. Huth, A., & Wissel, C. 1994. The Simulation of Fish Schools in Comparison with Experimental Data. Ecological Modelling, 75-76, 135-46. Huth, A., & Wissel, C. 1992. The Simulation of the Movement of Fish Schools. Journal of Theoretical Biology, 156, 365-85. Ioannou, C.C., & Kruase, J. 2008. Searching for prey: the effects of group size and number. Animal Behaviour, 75, 1383-1388. Kafkafi, N., M. Pagis, D. Lipkind, C. L. Mayo, Y. Bemjamini, I. Golani, and C. L. Elmer.

20

2003. Darting Behavior: A Quantitative Movement Pattern Designed for Discrimination and Replicability in Mouse Locomotor Behavior. Behavioural Brain Research, 142.1-2, 193-205. Kelley, J.L., & Magurran, A.E. 2003a. Effects of Relaxed Predation Pressure on Visual Predator Recognition in the Guppy. Behavioral Ecology and Sociobiology, 54, 225-32. Kelley, J.L., & Magurran, A.E. 2003b. Learned Predator Recognition and Antipredator Responses in Fishes. Fish and , 4.3, 216-26. Kramer, D. L., & McLaughlin, R.L. 2001. The Behavioral Ecology of Intermittent Locomotion. American Zoologist, 41.2, 137-53. Krause, J., & Ruxton, G.D. 2002. Living in Groups. Oxford: Oxford UP. Print. Landeau, L., & Terborgh, J. 1986. Oddity and the ‘confusion Effect’ in Predation. Animal Behaviour, 34.5, 1372-380. Larsson, M. 2009. Possible Functions of the Octavolateralis System in Fish Schooling. Fish and Fisheries, 10.3, 344-53. Lima, S.L., & Dill, L.M. 1990. Behavioral Decisions Made under the Risk of Predation: A Review and Prospectus. Canadian Journal of Zoology, 68.4, 619-40. Lima, S.L., & Steury, T.D. 2005. Perception of Predation Risk: The Foundation of Nonlethal Predator-prey Interactions." Ecology of Predator-prey Interactions. By Pedro Barbosa and Ignacio Castellanos. Oxford: Oxford UP. 166-88. Print. Magurran, A.E., & Pitcher, T.J. 1987. Provenance, Shoal Size and the Sociobiology of Predator-Evasion Behaviour in Minnow Shoals. Proceedings of the Royal Society B: Biological Sciences, 229.1257, 439-65. Magurran, A.E., Seghers, B.H., Carvalho, G.R., and Shaw, P.W. 1993. Evolution of Adaptive Variation in Antipredator Behaviour. Marine Behaviour and Physiology, 23.1- 4, 29-44. Magurran, A.E. 2005. Evolutionary Ecology: The Trinidadian Guppy. Oxford: Oxford UP, 2005. Print. Mikhailov, A.S., and Calenbuhr, V. 2002. From Cells to Societies: Models of Complex Coherent Action. Berlin: Springer. Print.

21

Miller, J.M., Kolpas, A., Neto, J.P.J., and Rossi, L.F. 2012. A Continuum Three-Zone Model for Swarms. Bull Math Biol, 74, 536-61. Print. Morrell, L.J., Hunt, K.L., Croft, D.P., and Krause, J. 2007. Diet, Familiarity and Shoaling Decisions in Guppies. Animal Behaviour, 74.2, 311-19. Print. Neill, S.R.S. and Cullen, J.M. 1974. Experiments on Whether Schooling by their Prey Affects the Hunting Behaviour of Cephalopod and Fish Predators. Journal of Zoology, 172, 549- 569. Paxton, C. G. M. 1996. Isolation and the Development of Shoaling in Two Populations of the Guppy. Journal of Fish Biology, 49.3, 514-20. Pitcher, T.J. 1983. Heuristic Definitions of Fish Shoaling Behaviour. Animal Behaviour, 31.2, 611-13. Radakov, D.V. 1983. Schooling in the Ecology of Fish. New York [etc.: J. Wiley. Print. Rankin, C.H., Abrams, T., Barry, R.J., Bhatnagar, S., Clayton, D.F., Colombo, J., Coppola, G., Geyer, M.A., Glanzman, D.I., and Marsland, S. 2009. Habituation Revisited: An Updated and Revised Description of the Behavioral Characteristics of Habituation. Neurobiology of Learning and Memory, 92.2, 135-38. Reader, S.M., Kendal, J.R., and Laland, K.N. 2003. Social Learning of Foraging Sites and Escape Routes in Wild Trinidadian Guppies. Animal Behaviour, 66.4, 729-39. Reznick, D.N., M.J. Butler IV, F.H. Rodd, and P.N. Ross. Life history evolution in guppies (Poecilia reticulata): 6. Differential mortality as a mechanism for natural selection. Evolution, 50, 1651-1660. Rubenstein, D.I. 1978. On Predation, Competition, and the Advantages of Group Living. Perspect. Ethol., 3, 205-31. Schneider, C.A., Rasband, W.S., Eliceiri, K.W. 2012. NIH Image to ImageJ: 25 years of image analysis. Nature Methods, 9, 671-675. Seghers, B.H. 1973. An Analysis Geographic Variation in the Antipredator Adaptation of the Guppy, Poecilia reticulata. Ph.D. thesis: University of British Columbia. Seghers, B.H. 1974. Schooling Behavior in the Guppy (Poecilia reticulata): An Evolutionary Response to Predation. Evolution, 28, 486-89. Sih, A., Ziemba, R., and Harding, K.C. 2000. New Insights on How Temporal

22

Variation in Predation Risk Shapes Prey Behaviour. Trends Ecol Evol, 15, 3-4. Song, Z., Boenke, M.C., and Rodd, F.H. 2011. Interpopulation Differences in Shoaling Behaviour in Guppies (Poecilia reticulata): Roles of Social Environment and Population Origin. Ethology, 117, 1009-018. Svendsen, J. C., Skov, J., Bildsoe, M., and Steffensen, J.F. 2003. Intra-school Positional Preference and Reduced Tail Beat Frequency in Trailing Positions in Schooling Roach under Experimental Conditions. Journal of Fish Biology, 62.4, 834-46. Templeton, C.N., & Shriner, W.M. 2004. Multiple Selection Pressures Influence Trinidadian Guppy (Poecilia reticulata) Antipredator Behavior. Behavioral Ecology, 15.4, 673-78. Thompson, R.F., & Spencer, W.A. 1966. Habituation: A Model Phenomenon for the Study of Neuronal Substrates of Behavior. Psychological Review, 73.1, 16-43. Tien, J.H., Levin, S.A., and Rubenstein, D.I. 2004. Dynamics of Fish Shoals: Identifying Key Decision Rules. Evolutionary Ecology Research, 6, 555-65. Viscido, S.V., and Wethey, D.S. 2002. Quantitative Analysis of Fiddler Crab Flock Movement: Evidence for ‘selfish Herd’ Behaviour. Animal Behaviour, 63.4, 735- 41. Viscido, S.V., Parrish, J.K., and Grünbaum, D. 2004. Individual Behavior and Emergent Properties of Fish Schools: A Comparison of Observation and Theory. Marine Ecology Progress Series, 273, 239-49. Weetman, D., Atkinson, D., and Chubb, J.C. 1998. Effects of Temperature on Anti-predator Behaviour in the Guppy, Poecilia reticulata. Animal Behaviour, 55, 1361-372. Welton, N.J., McNamara, J.M., and Houston, A.I. 2003. Assessing Predation Risk: Optimal Behaviour and Rules of Thumb. Theoretical Population Biology, 64.4, 417-30.

23

Tables

Table 1: Results of separate repeated-measures ANOVAs, by Trial, on the transformed (square root) ratio

of (Da/Db) (where Db and Da are the interfish distances before and after the stimulus, respectively) measures of interfish distance for all three days. For the first trials of all three days, there was a significant population effect with the low-predation population expressing a higher ratio than the high-predation one. By the third trials of each day, that pattern had switched such that the high- predation fish had a higher ratio than the low-predation ones. For the second trials, there was not a significant Population effect.

Factor F value NumDF DenDF Prob>F Trial 1 Between Subjects Population 37.1219 1 18 <.0001*

Within Subjects Day 8.5342 2 17 0.0027* Day*population 3.7047 2 17 0.0462*

Trial 2 Between Subjects Population 0.3348 1 18 0.5700

Within Subjects Day 49.5803 2 17 <.0001* Day*population 0.3512 2 17 0.7089

Trial 3 Between Subjects

Population 12.8745 1 18 0.0021*

Within Subjects Day 20.1287 2 17 <.0001* Day*population 0.8653 2 17 0.4387

24

Table 2: Results of a repeated-measures ANOVA on the average time spent frozen (in seconds) after the stimulus, for the first runs of the three days. The fish was defined to be in the freezing state if no spatial change of its centroid was observed. Significant interactions were observed between day and treatment for both population type and for single/pair.

Factor F value NumDF DenDF Prob>F Trial 1 Between Subjects Population 9.1722 1 36 0.0045 Pair/alone 16.3810 1 36 0.0003 Population*pair/alone 4.1675 1 36 0.0486

Within Subjects Day 116.7417 2 35 <.0001 Day*population 6.4871 2 35 0.0040 Day*pair/alone 8.0746 2 35 0.0013 Day*population*pair/alone 1.5508 2 35 0.2263

25

Table 3: Results of a repeated-measures ANOVA on variance of speed where Time (measures of the behaviour before and after the stimulus) is the repeated-measure. The variance of speed was computed for all speed values before and after the stimulus. For the pairs of fish, the variance was the average of the two fish. Populations from low-predation habitats had significantly higher speed variances after the stimulus compared to the high-predation population fish. A significant difference was also observed between pairs and singletons where the pairs exhibited greater speed variances both before and after the stimulus.

Factor F value NumDF DenDF Prob>F

Between Subjects

Population 12.3202 1 36 0.0012*

Single/Pair 6.7447 1 36 0.0135*

Population*Single/Pair 1.2008 1 36 0.2804

Within Subjects

Time 297.7732 1 36 <.0001*

Time*Population 1.8460 1 36 0.1827

Time*Single/Pair 1.1800 1 36 0.2846

Time*Population*Single/Pair 3.2672 1 36 0.0790

26

Figures

Fig. 1: Results of Repeated-measures ANOVAs, by Trial, on the ratios of (Da/Db) (interfish distance after the stimulus to the distance before stimulus), for the first trials (a), second trials (b) and third trials (c) across the three days. A population from a high-predation habitat (red) and from a low-predation habitat (blue) are presented. For the first trial across the 3 days, a stronger shoaling behaviour was observed for the high-predation pairs (smaller Da/Db ratio). There was not a significant difference between populations for the second trials. By the third trial each day, the pattern had reversed, such that the high-predation population pairs showed a larger (D- a/Db) ratio, as compared to the low-predation population pairs.

(a)

(b)

mulus, for the high predation fish (corr. Coef.=0.81, confidence interval (c)= [0.1785; 0.9607])

27

Fig. 2: Associations of interfish distance with orientation of the fish during the first second after the stimulus for guppies from a) a high-predation population, b) a low-predation population. A positive correlation was observed for the high-predation pairs (a, corr. coefficient=0.81, confidence interval = [0.178; 0.961]), whereas a reduced level of association was found for the low-predation guppies (b, corr.

coefficient=0.34, confidence interval = [-0.7240; 0.8119]).

250

200

150

(a) 100

(a) 50

0 -0.2 0 0.2 0.4 0.6 0.8 1

250

200

150

100 (b)

mulus,50 for the high predation fish (corr. Coef.=0.81, confidence interval = [0.1785; 0.9607])

0 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1

28

Fig. 3: Results of a repeated-measures ANOVA on the transformed (sqrt+1) freezing time of fish in the first tests on days 1,2 and 3 for the high- (red) and low-predation (blue) population guppies. The guppies were defined to be in the frozen stage if no spatial change of their centroid was observed. The high-predation population guppies froze for a significantly longer time, post-stimulus, as compared to the low-predation guppies for days 1 and 2. Both populations showed a decrease in the freezing duration over the course of the three days.

mulus, for the high predation fish (corr. Coef.=0.81, confidence interval = [0.1785; 0.9607])

29

Fig. 4: Repeated-measures ANOVA on the transformed (sqrt+1) freezing time of the fish in the first trials on Days 1, 2 and 3 for guppies in pairs (blue) and as singletons (red). For the first two days, the time spent frozen post-stimulus was significantly greater for the fish in pairs, as compared to the single fish. Over the course of the three days, both treatments showed a significant decline in the freezing time.

mulus, for the high predation fish (corr. Coef.=0.81, confidence interval = [0.1785; 0.9607])

30

Fig. 5: Repeated-measures ANOVA by Population type, on the transformed (ln) velocity recovery time of fish in the first trials on Days 1, 2 and 3 for pairs of fish from high- (red) and low-predation (blue) populations. The velocity recovery time was measured as the time it took for the post-stimulus velocity of the fish to reach one half of the maximum recorded pre- stimulus value. Both populations showed a decline over time, but the overall decline was most pronounced between Days 2 and 3 for the high-predation fish.

31

Fig. 6: Repeated-measures ANOVA by Population type (low-predation in blue, high- predation in red) on the Speed Variance data for Day1. The variance of speed was computed and compared for all the values before and after the stimulus. In cases of a pair of fish, the variance was the average of the two fish. A significant difference in the overall speed variances were observed, such that the low-predation population had greater mean variances in speed than the high- predation one.

32

Appendices

APPENDIX A

IMAGE ACQUISITION

To capture guppies as white objects on a black background, a custom tank was constructed (a cube with 33cm sides) with two adjacent sides of black plexiglass and other sides made of clear acrylic. The initial use of gravel in the tank arose difficulties in image analysis, as the gravel particles were also white and it was impossible to identify the fish when it was in close proximity to the bottom of the tank. Gravel was then substituted for black sand, which had the downfalls of often floating on the water, causing difficulties in tank cleaning and maintenance, and of uneven distribution on the bottom of the tank which often shielded the fish from camera view. The final solution was to construct the bottom of the tank of black plexiglass as well, to achieve a uniform dark background. As guppies are attracted to any particles (e.g. dust) stuck on the bottom of the tank, a frequent cleaning is needed after each set of trials.

The tank was shielded from external sources of light by black blinds in the observation room and two LED lights (Radionic LEDs ZX513) were mounted directly above the tank to provide the only light source for the fish. The two lights positioned on the lid of the tank (at 15-

18cm from the water level) were chosen to minimize the glare of the sides and corners of the tank, yet provide enough light for accurate fish recognition in the frames during analysis.

Imaging was done using 2 Allied Vision Technology Cameras (Stingray F125B,Germany) with

33

Nikon lenses (AF-S 18-55mm, Japan), positioned at 900 to each other and filming adjacent sides of the tank. Black posters positioned directly behind the cameras minimized the reflection of the camera lenses in the water.

IMAGE ANALYSIS

A custom written Matlab program was written to locate and track moving fish in 3D.

Original acquired images were first calibrated in reference to a custom built grid of known size and transformed to black and white images (a matrix with 0s for the background and 1s for the white objects). Subsequently, all objects within a given frame were identified and given a label, and a circular area with a particular radius was specified around each object. If in the next frame, the object was within the specified radius, it kept its label (Fig. i). If not, a new label was assigned. Problems with image analysis and object recognition arose during the occlusions of the fish. If the fish were occluded in both camera views, a “0” was assigned as interfish distance.

If the fish was occluded in 1 view only, the information from the 2nd camera was used to manually analyze the frame.

Fig. 7. The square in the figure represents the boundaries of the frame. Within each frame, each identified object (represented by the arrow in the figure) was given a label. A circular area with a specified radius was identified around each of the objects (the shaded circle in the figure). If in the subsequent frame (fig. i(b)), the object was found within the specified circle, it kept its label, and a new circular area was assigned (the non-shaded circle in fig. i(b) and i(c)).

34

The analysis was carried out independently for images from both cameras, with the outputs of xy coordinates from camera 1 and yz coordinates from camera 2. The matrices with the 2 sets of coordinates were then concatenated to produce a matrix with xyz coordinates for each fish. The trajectory obtained from the analysis of one complete data set is shown in fig. ii.

(a)

(b)

Fig. 8. 3D plots of the trajectories of a pair of fish, from high predation populations, before the stimulus (a) and after the stimulus (b). The plots are the initial outputs of Matlab frame analysis.

35

FUTURE DIRECTIONS

The data on shoaling behaviour analyzed and presented thus far, includes the frames before the startling stimulus and after the startling stimulus. The data during the 5 seconds of stimulus encounter, on the other hand, cannot be visualized and analyzed due to the dark phase.

While the ability of the fish to locate each other in the dark is worth noting, it would be useful to revise the startling cue, in order to be able to collect and analyze the data during the initial seconds of stimulus occurrence. Some possibilities include the use of speakers located on the top of the tank, as the 5 second stimulus. Additional research is needed to assess the ability of the fish to respond to sounds of certain frequency, as well as, to account for the directionality of this stimulus. Another possibility is that of dimming the lights, instead of completely turning them off, while at the same time adjusting the camera shutter speed to increase the quality of the images in the dim phase.

Future studies on groups of guppies comprised of 3 or more fish should be carried out to assess the relationship between the number of fish in a group and interfish distance, velocity, freezing time and the rapidity in the decrease of stimulus response with repeated stimulus encounters. These studies will help reveal whether the anti-predator behaviours reported in this study comprise the building blocks of more complex behaviours. To circumvent the problem of fish occlusions in the frames and, as a result the 3D trajectory reconstruction, a 2D tracking method can be employed by the use of a single camera positioned directly above the tank.

36

APPENDIX B

MATLAB ALGORITHMS

%%%%%%%Relabelling using the radius parameter,tracking%%%%%%%%%%%% clear all clc %%%%%COMPUTER 1 (VIEW 1) labelling and tracking%%%%%%%%% PM = 46.678/10000; %%PM = pixels per micron %%%%Varargument frames%%%%%%% p=2; %% this is the ftrack number for 1st fish k=1; %% this is the ftrack number for the 2nd fish startframe=267; endframe=290; n_frames=endframe - startframe; savestats=fishlocate1('LP pair3 day1 test3_cam2_1.tif',0.1725,startframe:endframe); ftrack=trackbeads1(savestats,30,1, 'plot'); % imwrite(nk,'pic.jpg') %%%%%COMPUTER 2 (VIEW 2) labelling and tracking%%%%%%%%% PM2 = 60.800/10000; savestatscomp2=fishlocatecomp2('test4-COMP2-1300-2500frames-LIGHTS OFF.tif',0.1725,startframe:endframe); ftrackcomp2=trackbeadscomp2(savestatscomp2,25,1, ['plot']); save('ftrackJUNE10thCOMP2test3-frames500-1000', 'ftrackcomp2')

%%Plotting the position in 3D %%%%%%%%% a=plot3(ftrack(1,p).x,ftrackcomp2(1,k).x,ftrack(1,p).y, ftrack(1,k).x,ftrackcomp2(1,p).x,ftrack(1,k).y,'DisplayName','ftrack(1,1).x vs. ftrack(1,1).y','XDataSource','ftrack(1,1).x','YDataSource','ftrack(1,1).y');figure(gcf) xlabel('time') ylabel('position')

%%%%********for interfish distance distx=ftrack(1,p).x-ftrack(1,k).x; disty=ftrack(1,p).y-ftrack(1,k).y; distz=ftrackcomp2(1,1).x-ftrackcomp2(1,3).x; interfish=(distx.*distx+disty.*disty+distz.*distz); plot(abs(interfish)); *** when fish are obstracted on both views xafter=zeros(1,numel(distx)); yafter=zeros(1,numel(disty)); cat(2,distx,xafter)

37

cat(2,disty,yafter)

%%%Updating the plot in a for loop%%%%% for i=2:106; for j=1:50; pause(.1) a=plot(ftrack(1,1).x(i),ftrack(1,1).y(i), 'o','color','r', 'MarkerSize',10) axis([100 400] ) end end

% x = t2; %%%%%%% fitting the data to gaussian sigma = 0.01; y = manorm(v); % test data: [p,s] = polyfit(x,log(y),2); % fit parabola to log yh = exp(polyval(p,x)); % data model norm(y-yh) % ans = 1.9230e-16 when sigma=0 plot(abs([y',yh']));

%%% 3 Dimensions %%%%%%%%%% %%VELOCITY FROM THE POSITION VECTOR DIVIDED BY TIME (time from 20 frames/sec) %%%%% for i=1:50, %%%%Velocity (from position vector) For fish 1 in view 1 %%% rx(i)=ftrack(1,1).x(i) ry(i)=ftrackcomp2(1,2).x(i) rz(i)=ftrack(1,1).y(i)

end

%%% 3 Dimensions %%%%%%%% for i=1:49, vx(i)=(rx(i+1)-rx(i))/(1/20) vy(i)=(ry(i+1)-ry(i))/(1/20) vz(i)=(rz(i+1)-rz(i))/(1/20) v(i)=sqrt((vx(i))^2 + (vy(i))^2 + (vz(i))^2) end

%%% 3 Dimensions %%%%%%%% for i=1:48, ax(i)=(vx(i+1)-vx(i))/(1/20) ay(i)=(vy(i+1)-vy(i))/(1/20) az(i)=(vz(i+1)-vz(i))/(1/20) a(i)=sqrt((ax(i))^2 + (ay(i))^2 + (az(i))^2) end

38

%%%PLOTTING VELOCITY%%%%% t=1:1/20:3.45 plot(t,v1) plot(t,v2)

%%%HISTOGRAMS OF VELOCITY AND ACCELERATION%%%%% hist(v), hold on, hist(v2), hold on, hist(a), hold on, hist(a2), hold off

%%%QUIVER PLOTS%%%%%%% % % Note that numel(vx) is always less than numel(ftrack(1,1).x)%%% quiver(vx,vy,ftrack(1,1).x,ftrackcomp2(1,2).x) quiver3(vx,vy,vz,ftrack(1,1).x,ftrackcomp2(1,2).x,ftrack(1,1).y)

39

1st FUNCTION OF LOCATING FISH IN FRAMES function savestats=fishlocate(filename,thresh,varargin); %%%%%%Computer 1 data %%%%%%% % extracts COM, area, and framenumber from a TIFF stack file. % framelist is an optional vector of the frames to be processed (e.g. 10:300) fileinfo = imfinfo(filename); % Find out about the image file. width = fileinfo(1).Width; height = fileinfo(1).Height; nFrames=length(fileinfo); clear fileinfo; if nargin==2, framelist=1:nFrames; % process all frames or else framelist=varargin{1}; % only process frames requested in 3rd argument. end;

% bwstack = logical(zeros(height,width,depth)); % in case of debugging savestats=[]; % the position, size and frame info will be deposited here % Load the frames one at a time. % Threshold and close objects immediately (in function threshold). % Label objects and retrieve their statistics (area, centroid) % Append this data to savestats, where it's stored for future tracking analysis for index=framelist, fprintf(1,'.'); bw=threshold(filename,index,thresh); % threshold function is below. %%%%%%%%%%%saving a string of images for a video%%%%%%%%%%%%% % imwrite(bw(index),'img.tif'); L=bwlabel(bw); % 'particle' assignment stats=regionprops(L,'area','centroid'); z = 1:numel(stats); for i=1:length(index),

if z<2, stats(i).Area=cat(1,stats.Area); stats(i).Centroid=cat(1,stats.Centroid); stats=cat(1, stats, stats); end [stats(1:length(stats)).Frame]=deal(index); end savestats=[savestats;stats];

% if z<2; % centroids= [cat(1,stats.Centroid);cat(1,stats.Centroid)]; % stats.Centroid=[cat(1,stats.Centroid);cat(1,stats.Centroid)]; % % end

40

2nd FUNCTION OF TRACKING LOCATED FISH function ftrack=fishtrack(savestats,micron_search_radius,pixels_per_micron,varargin); % function fishtrack(savestats,micron_search_radius,pixels_per_micron,['plot']); % savestats is the outputs from the thresholding / COM-finding routine fishlocate.m % searchradius is the cutoff and in pixels

plotresults=ismember('plot',varargin); pixel_search_radius=micron_search_radius*pixels_per_micron; finaldata=[]; xy=cat(1,savestats.Centroid); x=xy(:,1)'; y=xy(:,2)'; clear xy; % easier to address this way % finaldata=[finaldata;xy]; frame=[savestats.Frame]; area=[savestats.Area]; beadlabel=zeros(size(x)); % vector of bead labels. i=min(frame); spanA=find(frame==i);

% initialize w/ first frame. beadlabel(1:length(spanA))=1:length(spanA); % refers to absolute indexing of x,y,frame,etc. lastlabel=length(spanA); % start off with unique bead labels for all the beads in the first frame centroids=cat(1,savestats.Centroid); for i=min(frame):max(frame)-1, % loop over all frame(i),frame(i+1) pairs. spanA=find(frame==i); spanB=find(frame==i+1); dx = ones(length(spanA),1)*x(spanB) - x(spanA)'*ones(1,length(spanB)); dy = ones(length(spanA),1)*y(spanB) - y(spanA)'*ones(1,length(spanB)); dr2 = dx.^2 + dy.^2; % dr2(m,n) = distance^2 between r_A(m) (in frame i) and r_B(n) (in frame i+1) dr2test=(dr2

if length(orphan)>0, % there is at least one new (or ambiguous) bead beadlabel(orphan)=lastlabel+(1:length(orphan)); % assign new labels for new beads. lastlabel=lastlabel+length(orphan); % keep track of running total number of beads end; end

41

% From now on, ALL distance and area data will be in microns. emptybead.x=0; emptybead.y=0; emptybead.area=0; emptybead.frame=0; ftrack(1:lastlabel)=deal(emptybead); % initialize for purposes of speed and memory management. for i=1:lastlabel, % reassemble beadlabel into a structured array 'ftrack' containing all info beadi=find(beadlabel==i); ftrack(i).x=x(beadi)/pixels_per_micron ftrack(i).y=y(beadi)/pixels_per_micron; ftrack(i).area=area(beadi)'/pixels_per_micron^2; ftrack(i).frame=frame(beadi)';

% save('1to50','ftrack', '-v7.3') end;

% if plotresults, % figure; % colors=prism(lastlabel); clf; hold on; % plot the ftrack to check everything's OK. % for i=1:lastlabel, % plot(ftrack(i).x,ftrack(i).y,'Color',colors(i,1:3),'LineStyle','none','Marker','.','MarkerSize',5); % text(ftrack(i).x(length(ftrack(i).x))+0.25,ftrack(i).y(length(ftrack(i).y))+0.25,int2str(i),'Color',col ors(i,1:3)); % end; % end;

function [from,to,orphan]=beadsorter(connections); % All bead tracking is done here. Everything else is bookkeeping. NOT ROBUST. Look here first for problems! from=find(sum(connections,2)==1); % connected to only ONE bead in next frame: from(i) -> 1 bead to=find(sum(connections,1)==1)'; % connected from only ONE bead in previous frame: 1 bead - > to(i) [i,j]=find(connections(from,to)); % returns list of row,column indices of nonzero entries in good subset of correction from=from(i); to=to(j); % translate list indices to row,column numbers. orphan=setdiff(1:size(connections,2),to); % anyone not pointed to is an orphan

42