ABSTRACT
We analyzed the trajectories of freely foraging Gymnotus sp., a pulse-type gymnotiform weakly electric fish, swimming in a dark arena. For each fish, we compared the its initial behavior as it learned the relative location of landmarks and food with its behavior after learning was complete, i.e. after time/distance to locate food had reached a minimal asymptotic level. During initial exploration when the fish did not know the arena layout, trajectories included many sharp angle head turns that occurred at nearly completely random intervals. After spatial learning was complete, head turns became far smoother. Interestingly, the fish still did not take a stereotyped direct route to the food but instead took smooth but variable curved trajectories. We also measured the fish's heading angle error (heading angle – heading angle towards food). After spatial learning, the fish's initial heading angle errors were strongly biased to zero, i.e. the fish mostly turned towards the food. As the fish approached closer to the food, they switched to a random search strategy with a more uniform distribution of heading angle errors.
INTRODUCTION
Learning the spatial relationships of important environmental features is essential for behaviors such as foraging, and such learning has been studied in vertebrates ranging from fish (Braithwaite et al., 1996; Jun et al., 2015) to mammals including rodents (Alvernhe et al., 2012) and primates (Lührs et al., 2009). Vision is typically the dominant sense for spatial learning; although blind rats can also learn to navigate, the sense(s) utilized have not been clearly identified (Save et al., 1998). Weakly electric fish can learn spatial relationships in the dark using their electrosense (Jun et al., 2015; Engelmann et al., 2021). After learning, these fish use active sensing to identify landmarks (allothetic) and subsequently use path integration (idiothetic) to guide them from home or landmarks to food (Jun et al., 2015; Wallach et al., 2018; Engelmann et al., 2021). The time course for such learning has been established previously for pulse gymnotiform fish (Jun et al., 2015). The focus of that study was on the time course of learning and on the engagement of active sensing at landmarks. As in most spatial learning studies, Jun et al. (2015) made no attempt to examine the evolution of the fish's trajectories as it learned to efficiently find food. Notably, even after learning was complete, the learned trajectories were not simply direct routes from home to food but variable even after they had achieved minimal durations and distances (Fig. 1). Here, we close this gap by analyzing the trajectories of the fish in Jun et al.’s (2015) study to determine how flexible egocentric cue-based trajectories change during spatial learning.
MATERIALS AND METHODS
Experimental setup
The experimental setup is further detailed in our laboratory's previous paper (Jun et al., 2014). Video introductions are also available (Jun et al., 2013). The experiment made use of a 1.8×1.8×0.3 m tank resting on multiple layers of vibration-absorbing material (to minimize external vibratory stimuli). Water temperature was closely regulated to 25±1°C to prevent temperature-dependent electric organ discharge (EOD) rate fluctuations (Ardanaz et al., 2001). The power-line noise generated by the water heater underneath the tank was blocked by a Faraday cage. The tank was surrounded by a sensory-isolation chamber (to block external light, sound and radio-frequency noise). Air filtration was installed to expel excess humidity build-up caused by heating. The water was shallow (∼10 cm) to facilitate video recording. Within that tank was a circular tank (radius 80 cm) that constituted the experimental area.
The landmarks were built from thin (1.6 mm) acrylic sheets with suction cups attached to the bottom to fix them to the glass floor. Four types of landmarks were built: two squares (5.6 and 9.0 cm per side) and two circles (7.6 and 10.2 cm diameter). They were placed at rotationally symmetric positions for all fish. White grid paper of 5 cm spacing was attached underneath the glass floor to aid in landmark and food placement, and to enhance contrast with the brown fish.
Experimental protocol
Live mealworms were used as the food source and were kept in place by elastics on a suction cup. Water filtration was performed between every daily experiment, and water from each compartment (where the fish were housed prior to experiments) was mixed together during filtration to homogenize odorants.
In all experiments (including prior to the probe trials, where there was no food), thorough vacuuming of the tank bottom floor was performed as to be sure no remnants of the mealworm remained. Trials were repeated up to (but not always) four times per animal each day, and a single mealworm was used as the food source for each trial. When the trial lasted over 15 min, it was aborted.
Probe trials were conducted after the learning performance reached a stable plateau and followed the same protocol except that the food source was not present. For each fish, the probe trial was performed as one of the four trials run that day, with a random order (first, second, third or fourth trial).
The data
Previous research done in our lab (Jun et al., 2015) provided the data for the x and y coordinates for three fish (Gymnotus sp. Linnaeus 1758, ranging from 13.9 to 17.9 cm and labelled A, B and C) foraging in a circular tank (radius 80 cm; water depth ∼10 cm). The food source was always placed in a rotationally equivalent position at the near-center of the aquarium [coordinates (x,y)=(0 m,−0.1 m), (−0.1 m,0 m), (0 m,0.1 m) for fish A, B and C, respectively] based on the entry point (top right, bottom right and bottom left, for fish A, B and C, respectively). Jun et al. (2015) used four fish in their study, but a hard disk crash damaged the data for one fish so that it could not be used. Jun et al. (2015) showed that spatial learning in this fish was entirely comparable to the other fish, and so our smaller sample is still characteristic of electrosensory spatial learning in this species.
The data had a granularity of 100 frames s−1 but required smoothing as they were piecewise linear. We used a moving average of size 15 frames (seven on the right, center frame, seven on the left) to smooth out the trajectories. The data included the head orientation. Head orientation did not require smoothing, only the replacement of some spurious points when the fish would go from an angle of 0 to 360 deg or vice versa that were generated by our treatment of arithmetic modulo 360 deg.
In Jun et al. (2015), a definition was made for early learning (two sessions comprising of at most eight trials per fish) versus late learning (four sessions comprising of at most 12 trials and four probe trials per fish). The ‘late learning’ fish had reached asymptotically minimal trajectory distance and duration. We used these definitions for our analysis.
Change of heading angle
In this analysis, we used the ‘change in heading angle’ defined as the change in angle from time t to time t+1. We determined the distribution of change of heading angles for early and late learning; outliers of this distribution were taken as being 1.5 times the interquartile range (IQR) away from the first or third quartile (Balan and Lamothe, 2011). These outliers were defined as ‘sharp turns’ and we calculated the time intervals between the sharp turns. Note that sharp turns are thus defined uniquely for each fish and learning status. Because the distributions are so different between early and late learning, the outlier criteria of 1.5 times the IQR are at different absolute locations.
Error in heading angle
Because the location of the food source is recorded (and constant), we could calculate the optimal heading angle for the fish to get to the food source. We compared that with the current head angle. For our purposes, we call this the error in heading angle. The error in heading angle was designed to range from −180 to 180 deg, with 0 deg indicating that the fish is facing the food.
Distribution of error in heading angle
The fish, especially during early learning, spent a great deal of time along the walls; similar exploratory behavior has been described for mice upon entering a new arena (Fonio et al., 2009). This heavily distorted the distribution of heading angles. To remedy this distortion, we removed all instances of wall-swimming by eliminating the data where the fish was less than 15 cm from the wall. Another modification done was to give each trajectory the same weight instead of the inherently weighted average obtained by amalgamating short and long trajectories. That is, for each trajectory, we computed its own distribution of heading angle error, and the resulting empirical densities of heading angle error (one density function per trajectory) was then averaged to obtain a final empirical density for the collection (a collection being the trajectories that fall under one fish and one learning status). This way, the bias towards longer trajectories was eliminated.
Rayleigh test of uniformity
This allows us to determine statistical significance on whether a sample of angles originates from a uniform distribution. Low P-values indicate that the underlying distribution is less likely to be uniform. Variants of this test also allow us to determine whether there is a significant bias towards 0 (Jammalamadaka and Sengupta, 2001).
l2 distance from uniform distribution
Given a discrete distribution with finite support, we can define the l2 distance (Euclidean norm) between that distribution and the uniform distribution with that same support. This is done by taking the square root of the sum of squared differences between the distribution's values and that of the uniform distribution. Doing this allows us to measure how different from the uniform distribution our given distribution is.
EOD rate
In previous research in our lab (Jun et al., 2014), we investigated the EOD rate of the weakly electric fish Gymnotus sp. at rest and while locomoting; in particular, we found a strong increase in EOD rate associated with initiation of movement, i.e. strong acceleration. Here, we examined the EOD rate to determine whether it also increased during sharp turns, i.e. times of strong acceleration.
Jun et al. (2014) reported that an EOD rate increase typically preceded a spontaneous movement by approximately 1.5 s. We thus expanded the sharp turn periods to include the EOD rates 1.5 s before and after a sharp turn in our analysis. The EOD rates during the smooth swimming segments between the expanded sharp turn periods were then used for comparison.
RESULTS
As in Jun et al. (2015), we present measures that differentiate between early learning fish and late learning fish, effectively presenting trajectory measures that vary with learning.
Effect of spatial learning on heading angle
As a first step in our analysis, we provide the box plots of the change in head angle (Fig. 2). This effectively covers the statistics of IQR, number of outliers (1.5 times the IQR away from the first or third quartile), median and outlier threshold. The outliers are identified as sharp turns.
The median remains relatively unchanged at zero, while the IQR range is consistently greater for late versus early learning fish. The number of outliers (sharp turns) is much greater for early learning fish. We note that the size of the datasets between fish and between learning status is very variable, and so a more appropriate statistic is percentage outliers instead of number of outliers (Table 1). Note that the differences between early and late learning in Table 1 are not found when the outlier threshold for early learning fish is used for late learning fish.
Intervals between sharp turns
For the early fish, we have found that the interval between sharp turns follows an exponential distribution (Fig. 3), indicating that the process may be random. The mean time interval between sharp turns was 1.64, 1.30 and 1.36 s for fish A, B and C, respectively. Sharp turns could occur within sensing distance from a landmark (<4 cm; Jun et al., 2015) and therefore might be a response to sensory input from the landmark. Alternatively, the sharp turns might occur in open water (>4 cm from a landmark) and therefore might be generated by internal neural dynamics. For early learning and across all three fish, we found 160 instances of sharp turns near landmarks and 1612 instances of sharp turns in open water. We emphasize that, in the latter case, there is no exogenous sensory input that might have evoked the turn. Furthermore, at a level of 95% confidence, fish A and C had no serial correlation at lag 1, and fish B had a weak positive serial correlation (0.19). When replacing time by distance travelled in between sharp turns, we obtained an exponential distribution again and the serial correlation at lag 1 of fish A was statistically not significant, whereas fish B and C had a very weak positive serial correlation (0.14 for both). Average speed over these intervals had a correlation at lag 1 of 0.65, 0.79 and 0.76 for fish A, B and C, respectively. This indicates that the fish swam at a fairly constant speed and explains the similarity of the distance and time results. Overall, we conclude that the fish initiated sharp turns nearly randomly and the exponential distribution of inter-turn intervals suggest that they might be modelled as a Poisson process. We also tried power law fits but found they were poor in comparison (Fig. 3).
EOD rate
We found no relationship between EOD rate and change in direction. The mean EOD rate for intervals temporally close to and including sharp turns (±1.5 s; see Materials and Methods) was 74.4, 73.9 and 72.5 pulses s−1 for fish A, B and C, respectively. The intervals that were not identified as sharp turns and were not 1.5 s away from a sharp turn (intervals of straight head motion) had median EOD rates of 74.3, 72.7 and 72.6 pulses s−1 for fish A, B and C, respectively. As the fish are known to increase their EOD rate when near landmarks, we considered looking at open water only (>4 cm away from the landmarks). When only looking at open water swimming, EOD rates during sharp turns had means of 74.2, 72.8 and 72.3 pulses s−1 for fish A, B and C, respectively. During smooth motion, the average EOD rate was 74.0, 72.9 and 72.8 pulses s−1 for fish A, B and C, respectively. For the late fish, using the same threshold to define outliers as early fish, sharp turns had EOD rate with medians of 82.65, 77.34 and 76.4 pulses s−1 for fish A, B and C, respectively. During smooth motion, the median EOD rates were 114.07, 76.77 and 76.8 pulses s−1 for fish A, B and C, respectively. Jun et al. (2014) reported large increases in EOD rate (∼8 Hz) before and during the spontaneous initiation of movement. In contrast, there was clearly no significant difference in EOD rate between smooth swimming and sharp turns.
Effects of spatial learning on heading angle error
The heading angle error is the difference between the current direction the fish is heading and the direct direction towards the food (see Materials and Methods). Our initial comparison of the entire error distribution did not reveal any significant difference between early versus late learning fish (not shown). Given that the fish efficiently find food during late learning and heading angle error from a landmark to food is reduced after learning (Jun et al., 2015), we initially wondered whether the late fish that knew where the food was initially employed an ‘exploration’ strategy until they decided on an ‘exploitation’ strategy (Sutton and Barto, 2014), and, once they had estimated that they were close to the food, turned to swim directly towards it. To test this hypothesis, we divided each late trajectory into the first 50% and the last 50%. We then computed their distributions (one for the first 50%, and one for the last 50%). If the hypothesis was true, we would see a strong bias centered around 0 for the second half (when the fish goes straight to the food), and no bias in the first half.
Our hypothesis was wrong. The first half of the late learning trajectories had strong bias near 0, i.e. the fish were mostly headed towards the food (Fig. 4Ai–Ci, blue). In contrast, early learning trajectories were not biased to zero (Fig. 4Ai–Ci, green). The second half was not biased towards the food in either late (blue) or early (green) trials, i.e. the fish were headed more randomly with respect to the food (Fig. 4Aii–Cii). When the entire trajectory was examined, this difference was washed out.
We assessed these results statistically through the circular mean, statistic and Rayleigh test of uniformity (Mardia and Jupp, 2000) (Table S1) and found evidence consistent with the conclusions drawn from Fig. 4. These results indicate a difference between the first and second half of the trajectories. Particularly, we found some differences in the Rayleigh test P-values that make the first half of the late learning fish trajectories stand out from the second half and from the early learning trajectories. To a lesser extent, the for the first half of the late learning fish differs from the second half and from the early learning fish. These differences are not enough to be statistically significant. However, only splitting the trajectories into two results in large intervals of time. As a result, differences that are more finely time-dependent could be washed out and go undetected statistically. Thus, a finer-grained analysis is important for the purposes of meaningful statistical tests.
We therefore extended this analysis to an analysis of the change in heading error over time. We extracted ‘slices’ of trajectories. A slice is a sub-trajectory for a particular interval of time. As we do not have infinite data, we cannot take arbitrarily small slices. Nevertheless, we want it fine enough that we see progress over time (over the slice number). A balance between the two yields slices of 0.3 s (approximately 1/20th of most trajectories). We can look at the first 10 slices taken from late learning fish A as an example to see how the distribution of heading direction error changes over time (Fig. 5).
For the first five slices, the fish mostly heads towards the food, with randomly occurring trajectories with a lesser number of large heading angle errors that correspond to the loop structures seen in Fig. 1B. The last five trajectories paint a very different picture. There is no longer a clear high peak at 0; the heading angle error can have multiple peaks far from 0 (slices 6, 7 and 10) or appear nearly uniform (slices 8 and 9). In order to better understand this non-intuitive finding, we plotted the fish locations for all of these trials (Fig. 6A).
Here, we see that fish A on average appears to be moving towards the food and that its closest location to the food diminishes in the later slices. Combining the data illustrated in Figs 5 and 6 suggests that the fish is initially oriented towards the food but, as it becomes closer to food, its trajectories become more random and lose their precise orientation. Finally, we analyzed the overall change in trajectories for all three fish (Fig. 7).
Notice that the late learning distribution gradually converges to a uniform distribution (Fig. 7B) as the fish approach the food (average slope −0.021, one-sided t-test). This is not the case for early learning (Fig. 7A), where there is no downward slope, indicating no change in distribution (average slope −0.005, one sided t-test). This is a strong finding, showing a clear difference between early and late learning fish and reveals the unexpected finding that, after learning, the fish are initially more oriented towards the food but search more randomly when they near the food.
We considered the possibility that the fish were initially orienting to olfactory or passive electrosensory signals emanating from the food (Von der Emde and Bleckmann, 1998). Jun et al. (2015), using a strong increase in EOD rate, determined that the passive electric signal was detected at 4 cm from prey; the EOD rate increase did not occur during probe trials. The initial distance to prey location was far greater than 4 cm (87.3 cm) and was therefore unlikely to depend on passive electrosensory signals (Jun et al., 2015). We checked the probe trials when no food was present in order to determine whether olfactory cues might play a role in the initial orientation towards prey. We used two tests for this purpose. First, we found similar results of initial orientation to prey as in Fig. 5 for fish A (N=4) and fish C (N=3) but not fish B (N=4) (Fig. S1 illustrates this point for fish A). Second, we analyzed the distance the fish traversed before it reached the 4 cm passive electrosense detection distance. Because of the low sample size (early max. N=6, late max. N=12, probe max. N=4, per fish), we pooled all fish together to effectively triple the sample size (early N=17, late N=36, probe N=11). Using these pooled samples and for both median (Wilcoxon test) and mean (t-test), we found that the early trials took longer to get to 4 cm to the food than both the late and the probe trials. Meanwhile, the late and probe trials were not statistically different. The results are shown in Table 2. Because the tank was thoroughly cleaned before every probe trial, we can conclude that the fish do not orient themselves through a tuned olfactory sense, and instead use spatial information.
DISCUSSION
Jun et al. (2015) first analyzed spatial learning of gymnotiform fish in the dark, i.e. when they only had their electrosense for identifying landmarks and food, and presumably learned to go from landmarks to food utilizing path integration via idiothetic cues (Jun et al., 2015; Wallach et al., 2018). Here, we updated this analysis by focusing on and comparing the trajectories taken during early versus late learning. In early learning, the trajectories are very complex, with stretches of relatively straight (low curvature) swimming interrupted by many sharp turns (outliers) that result in a very different swim direction (Fig. 2). The trajectories are also very different across trials. This is not surprising given that the fish has no idea as to the food location and is exploring its environment (Fig. 1A). In contrast, shorter trajectories of the late learning trials are mostly smooth with far fewer sharp turns (outliers in Fig. 2). The late trajectories are surprising in two ways. First, they are typically not a minimum energy straight route between home or a landmark and the food; instead, they may take complicated routes often consisting of loops that temporarily point away from the food (Fig. 1B). Second, the routes are not at all stereotyped but greatly vary from trial to trial (Fig. 1B). Given the great differences between early and late learning trajectories, we discuss them separately.
Early learning trajectories
Foraging has been extensively studied under two different conditions: (1) where cues (e.g. odorants) as to the food location are sparsely and erratically distributed in the animal's environment and (2) where there are no local cues that might serve to guide the animal's search and food is sparsely distributed over a large area. Two prominent strategies for the first case are ‘infotaxis’ (Vergassola et al., 2007) and ‘energy constrained proportional betting’ (Chen et al., 2020); both require continuous monitoring of the relevant sensory cue. Clearly, these strategies would not be applicable in our case, where there are no sensory cues available when the fish is far from home or a landmark (Jun et al., 2015). In the second case, a prominent theory suggests that foraging is a ‘Levy flight’ – random walks with distances between successive locations following a long-tailed power law distribution (Campeau et al., 2022; Viswanathan et al., 1996). Searching in these cases is typically over very long distances (Viswanathan et al., 1996). We found that the intervals (time or distance) between sharp turns were well described by an exponential distribution with only a poor fit by a power law distribution. However, it should be noted that the tank diameter used for the experiments was only 1.5 m (Jun et al., 2013) and so longer intervals were effectively not possible. In the wild, gymnotiform fish appear to forage over much larger areas (Steinbach, 1970; Henninger et al., 2020). It will therefore be important to study foraging of gymnotiform fish in the wild to determine whether the distance intervals between successive search sites also follow a putatively optimal power law distribution.
Jun et al. (2014) have noted that the fish utilized in our study made random swim starts. The underlying mechanisms for random swim starts and sharp turns are likely different. The intervals between random starts were lognormal with means ranging from 3.8 to 5.3 s, and thus longer than the mean of the exponential distribution of sharp turn intervals (1.4 to 1.6 s). Furthermore, there was no increase in EOD rate associated with sharp turns in contrast with the strong increase associated with swim starts (Jun et al., 2014). Melanson et al. (2017) proposed that the non-stationary dynamics driving random swim starts were driven over long time scales by the peptidergic hypothalamic neurons already known to be important for vertebrate motor activity.
In contrast, a recent theoretical analysis (Recanatesi et al., 2021) suggested that fast variable timing of behavior sequences could be generated by reciprocally coupling a thalamic feedforward nucleus with a cortical recurrent network to generate metastable attractors. The gymnotiform thalamus and pallium includes circuitry (Giassi et al., 2012a,b; Trinh et al., 2016; Elliot et al., 2016) and physiology (Trinh et al., 2019; Elliot and Maler, 2015), consistent with the Recanatesi et al. (2021) model. These pallial regions are already believed to be responsible for spatial learning and navigation (Fotowat et al., 2019; Wallach et al., 2018; Mazzitelli-Fuentes et al., 2022). Pulse gymnotiform fish may therefore be a simple model for investigating the neural bases of apparently random behavior over a wide range of time scales.
Late learning trajectories
Trajectories after learning initially head towards the food location, but, once near the site, the fish swims erratically (Figs 4–7). Although the number of sharp turns is reduced (Fig. 2), the fish's trajectories are rarely directly towards the food, but are still variable and often looped (Fig. 1). This is surprising because the energy expended to find food increases with trajectory length. We consider two, not necessarily exclusive, views as to why the initial straight heading for food is not maintained: (1) accumulation of path integration error and (2) a mechanism to reduce predictability and therefore predation.
The path integrator is dependent on noisy signals from multiple sources including vestibular and proprioceptive afferents, and these result in accumulation of error within the neural path integrator of a wide range of taxa including mammals (McNaughton et al., 1996), insects (Muller and Wehner, 2010) and shrimp (Patel and Cronin, 2020). Interestingly, in the shrimp, path integration error results in loops in the trajectory similar to those illustrated in Fig. 1. Our data are therefore consistent with Muller and Wehner (2010): in the absence of error correction by landmarks, the fish become increasingly uncertain as to the food location and switch to a random search strategy (Wallach et al., 2018).
A second hypothesis is that the trajectory variability serves to reduce predictability. Jun et al. (2014) hypothesized that the reason for the fish's random swim starts was to reduce predictability and therefore predation risk. By the same reasoning, we hypothesized that predictable direct routes to a food source would also increase predation risk and that this is mitigated by the unpredictable sharp turns within even late trajectories.
In either case, the vestibular system provides input heading direction via its responses to rotations in the horizontal plane and is therefore essential for path integration (Wiener et al., 1995). Vestibular afferents code best for frequencies <20 Hz (Sadeghi et al., 2007), and we assume that smooth turning motions are well encoded while the sharp turns may produce higher frequency signals that are not faithfully encoded. We hypothesize that the mostly smooth but variable trajectories are a search mechanism compensating for path integration error while the sharp turns may act to reduce predictability and predation risks.
Conclusions
Weakly electric fish learn to find food in the dark primarily by the use of path integration (Engelmann et al., 2021). The smooth learning curves reported by Jun et al. (2015) suggested that this was a simple process. Our more detailed analyses of the changes in trajectories during learning demonstrates that, even in a fish, spatial learning is far from simple and that factors other than minimizing trajectory length and duration play a role in the learning process.
Acknowledgements
We thank Simone Azeglio for discussions and help with data interpretation. We would also like to thank two anonymous reviewers for their suggestions that have greatly improved the quality of the paper.
Footnotes
Author contributions
Conceptualization: C.M., M.F., L.M.; Methodology: C.M., M.F., L.M.; Software: C.M.; Formal analysis: C.M.; Investigation: C.M.; Data curation: C.M.; Writing - original draft: C.M.; Writing - review & editing: C.M., M.F., L.M.; Visualization: C.M.; Supervision: M.F., L.M.; Project administration: C.M., M.F., L.M.; Funding acquisition: M.F., L.M.
Funding
We acknowledge the support of the Natural Sciences and Engineering Research Council of Canada (NSERC) funding reference numbers RGPIN-2017-06901 (M.F.) and RGPIN-2017-147489 (L.M.).
References
Competing interests
The authors declare no competing or financial interests.