Research Articles: Behavioral/Cognitive Task related sensorimotor adjustments increase the sensory range in electrolocation https://doi.org/10.1523/JNEUROSCI.1024-19.2019

Cite as: J. Neurosci 2019; 10.1523/JNEUROSCI.1024-19.2019 Received: 14 May 2019 Revised: 9 November 2019 Accepted: 18 November 2019

This Early Release article has been peer-reviewed and accepted, but has not been through the composition and copyediting processes. The final version may differ slightly in style or formatting and will contain links to any extended data.

Alerts: Sign up at www.jneurosci.org/alerts to receive customized email alerts when the fully formatted version of this article is published.

Copyright © 2019 the authors

Title: Task related sensorimotor adjustments increase the sensory range in electrolocation

Abbreviated title: Sensorimotor learning improves the sensory range

Authors: Federico Pedraja1, Volker Hofmann1,2, Julie Goulet1, Jacob Engelmann1*

Affiliations: 1 Bielefeld University, Faculty of Biology/CITEC, AG Active Sensing, Postfach 100131, D-33501 Biele- feld, GERMANY 2 McGill University, Department of Physiology, 3655 Promenade Sir William Osler, Montreal, QC, H3G 1Y6 CANADA * Corresponding author: Jacob Engelmann AG Active Sensing Bielefeld University D-33501 Bielefeld, Germany Tel +49-521-106-4641 [email protected] Number of pages: 38 Number of figures: 9 Number of words: abstract (163 words), introduction (556 words), discussion (1609 words).

Competing interests: Authors of this manuscript do not have any financial or non-financial compet- ing interests. Acknowledgments: This work was supported by the Cluster of Excellence Cognitive Interaction Tech- nology ‘CITEC’ (EXC 277) and the DFG (EN 826/5-1).

ABSTRACT

1 and motor control traditionally are studied separately. However, motor activity can serve 2 as a scaffold to shape the sensory flow. This tight link between motor actions and sensing is particu- 3 larly evident in active sensory systems. Here, we investigate how the weakly electric mormyrid fish 4 Gnathonemus petersii of undetermined sex structure their sensing and motor behavior while learn- 5 ing a perceptual task. We find systematic adjustments of the motor behavior that correlate with an 6 increased performance. Using a model to compute the electrosensory input, we show that these 7 behavioural adjustments improve the sensory input. As we find low neuronal detection thresholds at 8 the level of medullary electrosensory neurons, it seems that the behavior-driven improvements of 9 the sensory input are highly suitable to overcome the sensory limitations, thereby increasing the 10 sensory range. Our results show that motor control is an active component of sensory learning, 11 demonstrating that a detailed understanding of contribution of motor actions to sensing is needed to 12 understand even seemingly simple behaviors.

1

13 SIGNIFICANCE STATEMENT

14 Motor-guided sensation and perception are intertwined, with motor behavior serving as a scaffold to 15 shape the sensory input. We characterized how the weakly electric mormyrid fish G. petersii, as it 16 learns a perceptual task, restructures its sensorimotor behavior. We find that systematic adjustments 17 of the motor behavior correlate with increased performance and a shift of the animal’s sensory at- 18 tention. Analyzing the afferent electrosensory input shows that a significant gain in information re- 19 sults from these sensorimotor adjustments. Our results show that motor control can be an active 20 component of sensory learning. Researching the sensory corollaries of motor control thus can be 21 crucial to understand sensory sensation and perception under naturalistic conditions.

2

INTRODUCTION

22 Exploratory behavior is a crucial substrate for learning (Loewenstein, 1994). As the animals’ move- 23 ments influence the sensory input, re-organizing the motor patterns with respect to recent experi- 24 ence may contribute to learning thereby improving behavior. Analyzing these modifications can thus 25 reveal how motor action contributes to learning (Wolpert and Landy, 2012; O’Hora et al., 2013) and 26 aid decision making through action selection (Charlesworth et al., 2011; O’Hora et al., 2013; 27 Zgonnikov et al., 2017). 28 While the variability of motor behavior may facilitate motor learning by widening the search space 29 from which behaviors are instantiated (Brainard and Doupe, 2013; Wu et al., 2014), the same varia- 30 bility can set bounds on the task-optimization of motor control (van Beers et al., 2002). This is partic- 31 ularly evident in active sensory systems, where the sensory input directly depends on the motor out- 32 put. Here the strong sensorimotor dependencies may be exploited by an animal to adjust motor be- 33 havior in order to not only improve the motor but also the sensing efficiency (Friston, 2010; Little and 34 Sommer, 2013; Gordon et al., 2014). 35 36 We here investigated how sensorimotor behavior changes while Gnathonemus petersii, a pulse type 37 weakly , learned a detection task. During active electrolocation these fish obtain sensory 38 information through brief discharges of a specialized electric organ in their tail (electric organ dis- 39 charge, EOD). The discharge rate is under top-down control and changes in a context-dependent 40 manner (Post and von der Emde, 1999; Caputi et al., 2003). Each emitted EOD creates a 3- 41 dimensional electric field around the fish which is perturbed by nearby objects (Lissmann and 42 Machin, 1958). Also motion of the animal can perturb the electric field (e.g., tail movement (Sawtell 43 et al., 2006)), both of which are perceived by electroreceptors in the skin of the fish. To discriminate 44 between the predictable (re-afferent) and unpredictable (ex-afferent) components of the sensory 45 input, weakly electric fish are known to rely on a sophisticated neuronal circuitry (Sawtell et al., 46 2005; Bell et al., 2008) which enables them to analyze their nearby environment. 47 Not all (re-afferent) sensory consequences of behavior must be unfavorable however: Similar to oth- 48 er organisms (Poteser and Kral, 1995; Kern et al., 2001), weakly electric fish exhibit a variety of stere- 49 otyped behaviors (Toerring and Belbenoit, 1979; Toerring and Moller, 1984; Nelson and Maciver, 50 1999; Hofmann et al., 2014). Recent studies have revealed that behaviorally relevant sensory infor- 51 mation can emerge from such strongly patterned sensorimotor behaviors, i.e. weakly electric fish 52 actively exploit these sensorimotor dependencies (Hofmann et al., 2017; Pedraja et al., 2018).

3

53 The ability to control the timing of sensory sampling while at the same time being able to shape the 54 properties of the sensory input through their motor behavior makes weakly electric fish particularly 55 suitable to study how changes in exploratory behaviors can guide sensory-driven learning efficiently. 56 We here focussed on a reinforced object detection task and found that performance was progres- 57 sively enhanced by consistent changes of the motor patterns. These changes resulted in an increased 58 sensory range. Our results add further support to the idea that weakly electric fish actively improve 59 sensing capabilities by selecting purposeful components from their motor repertoire and focus their 60 electric attention in a goal-directed manner. Such behavioral control of the sensory input might con- 61 tribute to improving neuronal stimulus detection and encoding, as we found neuronal performance 62 to be relatively poor at the level of the medulla. 63

4

64 MATERIAL AND METHODS

65 Animals. Wild-caught Gnathonemus petersii of either sex were obtained from a commercial fish 66 dealer (Aquarium Glaser, Rodgau, Germany) and housed in communal 400L aquaria. The water tem- 67 perature in these aquaria and the set-up was 25 ± 1 °C at a conductivity of 100 ± 5 μS cm−1 and a 68 12L:12D photoperiod. Fish were fed with bloodworms. All procedures for animal maintenance and 69 preparations comply with the current animal protection law of the Federal Republic of Germany and 70 have been approved by the local authorities (Landesamt für Natur, und Verbraucherschutz 71 Nordrhein-Westfalen: 87–51- 04.2010.A202).

72 Behavior

73 Training setup. Five G. petersii (length of 11 ± 1 cm) housed in separate experimental tanks and fed 74 with bloodworms to satiation three times per week before the beginning of the behavioral experi- 75 ment. The experimental tanks (120 · 50 · 50 cm) were divided in a living area (60 · 50 cm; 30 cm, wa- 76 ter level) that was separated by a plastic gate from the experimental area (60 · 50 cm; 10 cm, water 77 level). The floor in the experimental area was 20 cm above the floor of the living area, which con- 78 fined the movements of the animal in the experimental area into two dimensions. A plastic plate 79 divided the proximal end (20 cm) of the experimental arena in two compartments. Perpendicular to 80 this plate a 1 cm wide plastic strip marked the entry to the compartments on the floor. A metal cube 81 (2 · 2 · 2 cm) was placed on the floor at the decision line, centered in front of the cued compartment 82 where it served as a cue to the rewarded compartment (S+). Experiments were performed in dark- 83 ness (< 0.1 lux measured above the water level) and videotaped from the top (60 fps; AVT Marlin F- 84 131 & F-033) using IR-illumination (880 nm) from below. This wavelength is beyond the perceptual 85 range of this species (Ciali et al., 1997). EODs were recorded differentially (custom-built electrode 86 array, 0.6 – 40 kHz band pass) and stored as events (PC audio card, 12 bit, 10 kHz) alongside acquired 87 videos.

88 Experimental design, video tracking and statistical analysis. Animals first learned to swim through 89 the opened gate to the proximal end of the arena to receive food. Once fish did this reliably training 90 commenced, and videos of each trial were acquired. Each trial started by opening the gate and end- 91 ed with the fish swimming back to the living area. Crossing of the decision line was scored as a choice 92 and correct choices were food rewarded. After the fish returned to the living area the gate was 93 closed. Which of the two compartments was cued was determined in a pseudo-random fashion 94 (Gellermann, 1933). The cube was removed from the tank and re-positioned after each trial, even 95 when the same compartment was cued in consecutive sessions. Training was done for six days a 96 week with one session of 20 - 30 trials per day. When the performance reached 80% correct trials in 5

97 six consecutive sessions, learning we considered learning to be completed. We then separated the 98 data of each fish into three learning stages: Stage I contained the first six sessions where perfor- 99 mance was below 60% (511 trials from 5 animals); Stage II the consecutive six sessions (530 trials) 100 where performance was >60% and <80% and stage III comprises the first six session after the fish 101 exceeded 80% performance (592 trials). 102 In addition, we determined the sensory detection range after learning was completed by gradually 103 increasing the distances of the cue from the decision line (2 – 12 cm). At each distance, 20 - 40 test 104 trials were conducted before increasing the test distances. Similar to the training procedure, sessions 105 were done for six days a week with 20 control and 10 test trials per session. The detection limit was 106 determined as the object distance where the sigmoidal fit to the performance reached 75%.

107 Using a background subtraction approach the animals’ center of mass was determined off-line using 108 custom written MATLAB routines (R2016b 64 bit, MathWorks, Natick, MA USA). The posture of the 109 animal was obtained by applying a 3rd order polynomial fit through the midline of the body. Head and 110 tail positions were determined based on the spindle-like shape of the fish’s body with the head being 111 closer to the body’s center of mass. The position of the object was also tracked. From the change of 112 the animal’s position between consecutive frames we determined the 2D kinematics (i.e. thrust, slip 113 and yaw velocity) which were used for the behavioral classification (see Hofmann et al. (2014) for 114 more information). In trials where the cue was in the left compartment the data was mirrored along 115 the long axis of the arena in order to have movement prototypes in consistent relation to the cued 116 compartment.

117 To quantify the spatial distribution of behaviors the arena was binned (bin size 1 · 1 cm). The distance 118 to the cube was measured as the Euclidean distance between the fish’s head and the object. In trials 119 where the fish chose the wrong compartment, distance was calculated with respect to the virtual 120 object position (i.e., we assume the object to be present in the compartment the fish had erroneous- 121 ly chosen). To illustrate the average trajectories per fish and learning stage, we obtained the mean 122 direction in which fish passed from one spatial bin to the next and the corresponding vector strength 123 ( = ∙ with being the number of elements in the bin and the Rayleigh’s coefficient of 124 angular dispersion). Based on these values the average gradient of the trajectories was visualized 125 using the streamline-function in MATLAB. This only served as a visualization-tool, while all analysis is 126 based on single trajectories. Sampling density (SD) was calculated as the number of EODs emitted per 127 distance traveled (EOD count · cm-1) using swim speed and the EOD rate per frame. To calculate at- 128 tracting sets, spatial maps were generated from all trajectories. From each trajectory, the first coor- 129 dinate received a weight of +1 and the last coordinate of -1. Weights for coordinates in between 130 were linearly interpolated based on travelled time and distance. For each session, we superimposed

6

131 all weighted trajectories, resulting in cumulative 2D maps. The size of the attracting sets was defined 132 as the area in which data fell below a threshold which was defined by two standard deviations 133 (standard deviation was calculated based on all values for all fish) above the minimum value of the 134 map. 135 Transient increases of the EOD rate (E-scans) were detected from the z-scored first derivative of the 136 EOD frequencies. Variance and mean for the z-transform were based on pooled data of a given train- 137 ing trial. Accelerations exceeding a z-value of 1.5 were defined as E-scans and their location was de- 138 fined by the position at which the E-scan began.

139 All statistical analyses were performed using MATLAB and PAST 3 (Paleontological statistics software 140 package for education and data analysis version 3.1). Normality of data was examined by the 141 Shapiro–Wilk test and tested for homogeneity of variance with Levene’s test (significance criterion of 142 p d 0.05 in both cases). The appropriate parametric (t-test for linear regressions) or non-parametric 143 tests (Wilcoxon-signed rank test, Mann-Whitney pairwise test and Kruskal-Wallis test) were used 144 accordingly and are indicated in the results section and captions throughout. Data used for multiple 145 comparisons was post-hoc corrected (Bonferroni) when necessary using p d 0.05 for significance. 146 Transition probabilities of SPMs were tested using Pearson’s χ2 test.

147 Behavioral classification. We classified the behavior based on clustering algorithms as previously 148 described (Braun et al., 2010; Geurten et al., 2010; Hofmann et al., 2014). Kinematics were clustered 149 hierarchically (Ward’s criterion) and the quality and stability of the clusters were assessed to deter- 150 mine the optimal number of clusters. Next, data was clustered applying a k-means algorithm with the 151 optimal number of clusters regarding quality and stability (ten in our case). The resulting centroid of 152 each cluster (thrust, slip and yaw velocities) was used to express the kinematic properties of identi- 153 fied clusters that we here refer to as “prototypical movements” (PMs). PMs resemble the basic mo- 154 tor components of the recorded behavior on a frame-by-frame basis. PMs with yaw velocities above 155 half of the maximum observed yaw velocity (64°· s-1) were defined as left or right turn PMs, respec- 156 tively. PMs where the thrust velocities exceeded 75% of the maximum observed thrust (43.5 cm· s-1) 157 were considered a high thrust PMs, while PMs with thrust values lower than 25% of this maximum 158 were considered low thrust PMs. Using this categorization, we calculated thrust- and turn-triggered 159 averages of electromotor behavior (E-scans) and the quality of the sensory input (Fisher information, 160 see below). From these averages we compared the E-scan probability and Fisher information for the 161 100 ms surrounding different PMs.

162 To characterize behavior on larger timescales, we calculated the transition probabilities between 163 PMs. The probabilities were processed in a hidden Markov Model to determine the most frequent

7

164 sequences of four consecutive PMs, termed “super-prototypical movements” (SPMs) (Braun et al., 165 2010). Their complexity was reduced by combining SPMs with comparable PM composition (e.g. 166 merging PM-sequence 1-1-1-2-1-1-2-2 with PM-sequence 2-2-1-2-2-2-1-1). The 300 most frequent 167 SPMs were then further analyzed with respect to where (arena) and when (learning stage) they oc- 168 curred. We then focussed on the SPMs that changed the strongest between learning stages I and III. 169 That is, in each area of the arena we obtained the SPMs with the strongest drop in their recruitment 170 probability between stage I against III as well as those that showed the strongest increase in their 171 recruitment probability when comparing learning stages III against I. SPMs were again categorized by 172 their yaw and thrust velocities. In turn-dominated SPMs the mean yaw exceeded at least half of the 173 maximum mean yaw velocity of all SPMs (29°· s-1). The remaining SPMs were grouped based on the 174 maximum average thrust velocity (42 cm· s-1), resulting in low (<25% of max), medium (between 25- 175 75% of max) and high thrust SPMs (>75 % of max). The spatial distribution of different SPMs was 176 analyzed based on the x and y coordinates of the first PM in each SPM sequence. This was accumu- 177 lated and fitted with a 2-D Gaussian. For visualization we shown the area of these fits where the SPM 178 probability is above 0.1%. On average 89% of the individual data falls within this contour (range: 77- 179 96%).

180 Electric image model. Electric images (EI) were computed with software developed by Rother 181 (Rother, 2003). This approach was verified and utilized in previous studies (Rother et al., 2003; 182 Migliaro et al., 2005; Sanguinetti-Scheck et al., 2011; Hofmann et al., 2013, 2017; Pedraja et al., 183 2014). The model consists of a geometric reconstruction of the fish´s body and a calculation of the 184 transcutaneous field by solving the Poisson equation for the fish’s boundary using the Boundary Ele- 185 ment Method. Briefly, this method determines the boundary electrical distributions solving a linear 186 system of M · N equations for M poles and N nodes, with the unknown variables being the trans- 187 epithelial current density and potential at each node (Pedraja et al., 2014). The trans-epithelial cur- 188 rent density and potential is calculated for each node and linearly interpolated for the triangles de- 189 fined by the nodes, forming the geometry of fish and objects (Fig. 1A). From this the electric images 190 for each trajectory were calculated as the difference between amplitude of positive EOD peak in 191 presence and absence of the object (Fig. 1B).

192 Fisher information analysis. To estimate how informative the electric images (sensory input) are with 193 respect to an estimate of the location of the object, we calculated the Fisher information. As detailed 194 elsewhere (Silverman et al., 2013; Miller et al., 2016) the formal definition of Fisher information 195 when estimating an unknown parameter is p(|) 1 () = (|)

8

196 where (|) is the probability of observing given . In our case, the measurement depends on a 197 function Υ(∙) of the parameter , 198 = Υ(, ) + ,

199 where Υ(, ) is the electric current density at the nodes of the fish at the fish’s location () and is 200 zero mean noise with variance . The Fisher information then is calculated as

Υ(,) 201 (, ) = ∙ . 202

(,) 203 The best estimate () of the position of the cube is obtained when the partial derivative ( ) is 204 maximal. When approaching the cube this will occur at the position where the slope in the electric 205 field is highest. (, ) can be considered as the change of the distributed information that an elec- 206 tric image provides on the position of the cube with respect to the variance of the noise. Here the 207 noise is based on the first EI of each trajectory. Integrating the distributed information (, ) over 208 the nodes of the modelled fish yielded in a single measure of information at each location (see blue 209 line in Fig. 1C). 210

211 Artificial trajectories. To evaluate the dependence of the Fisher information on the trajectories to 212 the cube, artificial trajectories to the target were simulated. In these, the fish body was kept straight 213 and the swim speed and EOD rate were constant. We chose two trajectories where the fish targeted 214 the object lateral to its center of mass and one where it approached frontally. For both, we then cal- 215 culated the electric images and Fisher information. By concatenating electric images from the frontal 216 and lateral approach, we simulated an undulatory trajectory in which the electric image moves over 217 the head region of the fish. A qualitative comparison of the Fisher information reached by these dif- 218 ferent approaches to the target was then conducted.

219 Physiology

220 Surgery. Electrophysiological experiments were performed in 16 G. petersii (length of 11 ± 2 cm). 221 Prior to experiments fish were anesthetized in buffered 3-aminobenzoic acid ethyl ester methanesul- 222 fonate salt (MS-222 0.1 g · L-1, Sigma-Aldrich), immobilized with an intramuscular injection of 20 μl 223 Pancuronium bromide (1:100 in Ringer, Braun-Melsungen) and transferred to a holder in the experi- 224 mental tank (60 · 40 · 15 cm). During surgical procedures, fish were respirated with MS-222 solution 225 for anesthesia (0.05 g · L-1). In addition, the surgery site was treated with a local anesthetic (Xylocaine 226 2%, Astra Zeneca). Afterwards the skin at the dorsal part of the cranium was removed and the head 227 fixed to a plastic rod (Formatray, Kerr). Then craniotomy was carried out above the caudal end of the

9

228 cerebellum. 229 After surgery fish were respirated with freshwater and the tank-water was exchanged to remove any 230 MS-222 residuals. Spinal cord activity (see below) resumed typically within 10 - 15 minutes following 231 the end of anesthesia. In all cases, water conductivity was 100 ± 5 μS and respiration rate was 232 40 ml · min-1.

233 EOD playback. Paralysis blocks the myogenic electric organ, but the descending command signal of 234 the pacemaker nucleus persist and can be used to trigger a synthetic EOD at the time and amplitude 235 of the natural EOD. Amplitude and timing of the EOD of each individual was measured before the 236 surgery by sedating the fish with Etomidate (Etomidate-Lipuro, 400 μg · L-1, Braun Melsungen, Mel- 237 sungen) and recording the command signal and the EOD. Timing of the command signal was meas- 238 ured with a hook-shaped electrode around the electric organ (amplification x500, MA 103, Electronic 239 Workshop University Cologne, band-pass filtering 1 Hz – 1 kHz). The natural EOD was measured (am- 240 plification x50, MA 103, Electronic Workshop University Cologne, band-pass filtering 10 Hz - 30 kHz) 241 with a dipole electrode placed in the water close to the left eye and oriented perpendicular to the 242 fish’s main body axis. As a playback a pre-recorded EOD (DG1000 waveform generator, RIGOL tech- 243 nologies, Bejing, China; A385 Stimulus isolator, WPI, Sarasota, FL USA) was issued via two silver- 244 wires, one of which was implanted into the EO and the other was placed caudal to the fish’s tail. The 245 playback was triggered by the command signal with the pre-determined delay and set to match the 246 natural EOD’s amplitude.

247 Electrophysiological recording. Tungsten electrodes (3 ± 2.5 MΩ, Eckhorn 7 electrode Microdrive & 248 SUA amplifier, 1000x, MTREC Thomas recording, Giessen, Germany) were inserted through the pos- 249 terior part of the cerebellum towards the medial zone of the electrosensory lateral line lobe (ELL). 250 Electrode depth and the local field potential (LPF, 10 Hz) was monitored until the plexiform layer of 251 the ELL was reached. Then filter settings were adjusted (band pass: 100 - 3000 Hz) and electrodes 252 were carefully advanced to isolate single unit activity. Recordings were digitized (25 kHz sampling 253 rate, 12 bit resolution, Spike 2 v6 & CED Micro 1401-MKII, CED, Cambridge, UK) and stored for offline 254 analysis.

255 Stimulation. We recorded from principal cells of the medial zone of the ELL. These cells show either 256 an excitatory response to an increase in local EOD amplitude (E-cells; n = 8) or an inhibitory response 257 (I-cells; n = 12). Receptive fields are heterogeneous in size and location on the body (Metzen et al., 258 2008) and the center was determined with a small dipole electrode over which a local playback of 259 the EOD was issued while moving it alongside the animal. Receptive fields were predominantly locat- 260 ed on the head and first third of the trunk of the animals. Afterwards the global EOD mimic was again 261 presented for at least 1 minute before presenting a cube (2 · 2 · 2 cm; metal for E-cells; plastic for I- 10

262 cells) in the center of the respective receptive field. The object was presented for 1 minute during 263 which typically 30 - 70 EODs were registered (median EOD interval 357 ms; 25% percentile: 224 ms). 264 The distance of the object surface relative to the skin surface was randomly varied between 1 and 265 35 mm using a micromanipulator and in-between each stimulus presentation we recorded 1 minute 266 of ongoing activity without the object being present.

267 Analysis. Spikes were extracted and sorted using a wavelet separation with following PCA and cluster 268 analysis (Spike 2, CED). Further analysis included only well isolated single units and was carried out 269 with custom written routines in MATLAB. ELL units fire a burst of spikes following each EOD with 270 changes in the burst parameters encoding for electrosensory stimuli. We characterized the mean 271 firing rate, maximum firing rate and latency of each burst. Mean firing rate was determined as the 272 number of spikes following the EOD within a 150 ms window. For this, only spikes within a given EOD 273 interval were included in the analysis. Results were qualitative similar for shorter spike count win- 274 dows (i.e. 100 or 50 ms). Maximum firing rate was determined as the peak of the convolved firing 275 rate (15 ms boxcar convolution). Burst latency was determined as the latency of the first elicited 276 spike relative to the EOD time. 277 We used a receiver-operating-characteristic (ROC) analysis to quantify if and at which distance neu- 278 ronal activity would enable the detection of the object. For this, we used the probability distributions 279 of the burst parameters as determined for stimulated and ongoing activity to calculate the probabil- 280 ity of true positive and false positive hits. The area under the ROC-curve (AUC) was used as a sensitiv- 281 ity measure at a given distance of the cube. This measure was plotted as a function of distance and 282 fitted by a sigmoidal function. The detection limit was determined as the point where the fit fell be- 283 low a sensitivity of 0.7. The population average was assessed through calculating a sliding bin (bin 284 width 2 cm) of the raw sensitivity data.

11

285 RESULTS

286 In the current study, we investigated the object detection performance of the weakly electric fish 287 Gnathonemus petersii. First, we will present results from single unit recordings of medullary elec- 288 trosensory principal neurons. Based on these recordings, we establish the distances at which physical 289 objects can be detected neuronally. We then contrast the neuronal results with the behavioral per- 290 formance levels, emphasising the often-underestimated contribution of sensorimotor interactions 291 for perception.

292 Detection limits based on neuronal recordings in ELL. 293 The electrosensory lateral line lobe (ELL) is the 1st central nucleus of the ascending electrosensory 294 pathway and receives converging input from electroreceptor afferents (Bell et al., 1989, 2005; 295 Hollmann et al., 2016). Afferent responses are directly related to the local amplitude modulation of 296 the EOD, however even large conductive objects modulate afferent activity only within a range of 297 about 10 mm (Szabo and Hagiwara, 1967; Gomez et al., 2004). It is known that ELL principal cells can 298 have large and complex receptive fields (Metzen et al., 2018), their detection threshold for physical 299 object distance however, has not been established. 300 We recorded the responses of 20 isolated ELL principal cells in immobilized animals (n = 16) to ob- 301 jects (metal & plastic cube, edge length 2 cm) presented within the receptive fields center (RF) at 302 varying distances up to 40 mm from the skin of the fish (Fig. 2A). ELL principal cells typically issued a 303 short burst of spikes following each EOD (Fig. 2B). We characterized these burst in terms of their 304 latency, their maximum firing rate and the mean firing rate (see also methods), which are the param- 305 eters that typically change in response to a presented stimulus. To evaluate object detection, we 306 analyzed responses using a receiver operating characteristic (ROC). For this, response distributions 307 were obtained over several instances of EOD emission and compared to ongoing activity (Fig. 2C; top: 308 object at 5 mm (red) vs. ongoing activity (black), bottom: object at 17 mm (blue) vs. ongoing activity 309 (black)). ROC sensitivity, quantified by the area under the ROC curve (Fig. 2D), decreased in a sig- 310 moidal fashion (Fig. 2E, solid line). 311 312 Detection distance was defined as the point where the sigmoidal fit fell below 0.7 (Fig. 2E, see ar- 313 row). On average, this distance was within the range of 10 mm (Fig. 2F, population average n = 20 314 neurons analyzed with spike counts), irrespective of the parameter used to analyse responses 315 (Fig. 2G; mean ± std: spike count: 9.3 ± 5.4 mm; latency: 8.3 ± 4.8 mm; firing rate: 10.0 ± 7.9 mm). 316 Threshold in these groups (different parameters analyzed) were not significantly different (Kruskal 317 Wallis, p = 0.90). In addition, the detection distance did not increase significantly when the best pa- 318 rameter per cell were pooled (Kruskal Wallis, p = 0.76). While the responses of some individual neu- 12

319 rons allowed for object detection up to a distance of 28 mm, the average detection threshold across 320 the recorded population was poor and roughly within a range of 10 mm. 321 322 Task acquisition is paralleled by sensorimotor alterations. 323 We trained five fish to detect a metal cube of the same size as used in physiology (Fig. 3A and meth- 324 ods). All fish reached a stable performance within 22.8 ± 3.8 sessions (Fig. 3B and Fig. 3-1). Based on 325 the performance the data was split for further analyses (Fig. 3B, stage I < 60% (light cyan), stage II 60 326 - 80 % (dark cyan), stage III > 80% (violet)). 327 Figure 3C depicts the average movements (black lines) of one fish during the three different stages. 328 The mean heading direction within each spatial bin (1 cm2) is shown as a color code (left to right as 329 blue to red) showing that trajectories in phase I (Fig. 3C) were mainly straight, corresponding to the 330 chance-level performance in this stage (Fig. 3B, light cyan). With learning, trajectories showed a 331 characteristic increase of right-turns (red) in area II (Fig. 3D-E). While traversing the arena, fish grad- 332 ually decreased their speed (Fig. 3F) with swim speeds being slightly higher close to the object in 333 incorrect trials (Fig. 3F). In addition, the dispersion of the trajectories (distribution along the shorter 334 axis of the arena) decreased with learning, showing that fish preferentially swam along the middle of 335 the arena in later learning stages (Fig. 3G). Altogether these changes resulted in a better alignment of 336 the fish’s heading with the object (Fig. 3H-J, mean direction: 321°, 330° and 333° for stage I-III; Wil- 337 liam-Watson test for difference in orientation, p < 0.001; mean vector strength: 0.72, 0.79 and 338 0.86 for stages I-III, respectively). Note that fish were rewarded at the end of the arena, i.e., only 339 after having passed the object. As such they were not forced to target the object. 340 These results, centered on the general motor behavior, already show that improved performance

341 went along with adjustments of the motor behavior.

342 343 Motor behavior is altered by a differential recruitment of basic kinematic components. 344 The ten prototypical movements revealed here (Geurten et al., 2010; Hofmann et al., 2014) were 345 either thrust-dominated (PMs 1-4), or turn-dominated PMs (right-turn PMs 6, 8, 10 and left-turn PMs 346 5, 7, 9) (Fig. 4A). The separation in ten PMs did not change with learning. While the frequency of PM 347 1 dropped by 29% when comparing stage I and III, the frequency of the other PMs did not change as 348 strongly with learning (average variation between stage I and III: 7.5 r 3.8 %). What changed with 349 learning, however, was the kinematic composition of the behavioral sequences (SPM, Fig 4B). We 350 here focus on the nine SPMs with the strongest change of occurrence between the learning stages III 351 and I in correct trials (see methods). These were also among the most frequently occurring SPMs in 352 absolute terms (see Fig. 4-1 for details). Learning led to a reduction of thrust dominated SPMs (Fig.

13

353 4C, shades of black) and in increase in right-turn dominated SPMs (Fig. 4C, red), while left-turn domi- 354 nated SPMs were barely affected (Fig. 4C, blue).

355 356 The change in the recruitment of the SPMs was spatially specific. Thrust dominated SPMs initially 357 occurred throughout the arena (Fig. 4D) but were confined to area I (high thrust speed; Fig. 4E) and 358 area III after learning (slow zigzagging movement SPM 7; Fig. 4E). Of particular interest are the modi- 359 fications in areas II and III. The most prominent change is the emergence of right-turn dominated 360 SPMs with learning. These SPMs mainly occurred in area II (Fig. 4F vs. G) and were typically followed 361 by a slow thrust SPM (SPM 5) or the slow zigzagging movement (SPM 7, Fig. 4E) towards the object. 362 Note that SPM 5 was the most frequent SPM in area III after learning, but did not change as much 363 between learning stages (Fig. 4-1B). The conditional probability that right-turn SPMs in area II were 364 followed by SPM 7 was 33% and 59% for SPM 5 (χ2 test with Monte Carlo permutations, p < 0.0002). 365 The zigzagging pattern of SPM 7 consisted of a succession of left and right PMs, resulting in an aver- 366 age change of the heading of the animals’ head of 3.77 ± 2.14° per cycle at a frequency of approxi- 367 mately 21 Hz, (see SPM 7 Fig. 4B). Similar to PMs, left-turn dominated SPMs changed less with learn- 368 ing and were found close to the object both before and after learning (Fig. 4H vs. I).

369 Altered behavior is reflected in the formation of an attracting set. 370 Altered trajectories may represent overt actions reflecting the internal motor decision-making pro- 371 cess necessary to improve the performance with learning. In this context trajectories leading to be- 372 havioral choices have been used to map how motor behavior may represent the formation of inter- 373 nal states like goals (O’Hora et al., 2013; Zgonnikov et al., 2017). Applying this approach to our data 374 we find that at the start of learning, from any start point the fish's trajectory will end up within one 375 of the two compartments. These stable endpoints form two attracting sets ("sinks") around the two 376 possible locations of the object (Fig. 5A, see Fig. 5-1 for all fish). With learning, a single attracting set 377 emerged at the entry of the reinforced (S+) compartment (Fig. 5B & C). This attracting set became 378 more distinct with learning, i.e., its size decreased (Mann-Whitney pairwise test with Bonferroni post 379 hoc test: stages I - II p = 0.13, stages I - III p = 0.04 and stages II - III p = 0.49; Fig. 5D) and its peak am- 380 plitude increased (Mann-Whitney pairwise test with Bonferroni post hoc test: stages I - II p = 0.06, 381 stages I - III p = 0.03 and stages II-III p = 0.11; absolute values; Fig. 5E). Overall, these results show 382 that the fish learned to focus their behavioral attention from an initially bimodal to a unimodal at- 383 tracting set.

384 385 386 Sampling behavior adapts alongside kinematics.

14

387 The emergence of a single attracting set indicates that the animals learned to attend to and use the 388 object in their motor planning. To understand if and how this affected the sensory sampling behav- 389 ior, we calculated the sampling density (SD, number of EODs emitted per distance traveled, 390 EOD · cm 1). SD increased towards the object (Fig. 6A – C, see Fig. 6-1 for all fish). This rise was shal- 391 low and undistinguishable between correct and incorrect trials in stage I (t-test for slopes to linear 392 regression, p = 0.051, see Fig. 6D cyan vs. black line). With learning however, the SD increased steep- 393 er in correct trials (t-test for slopes, p < 0.001, stage II and III), resulting in higher SD values close to 394 the object (Fig. 6E dark cyan vs. black; Wilcoxon-signed-rank test p ≤ 0.0495 for stage II; Fig. 6F violet 395 vs. black, p ≤ 0.02 for stage III). The average EOD rate also increased with learning (mean ± std: 32.56 396 r 17.14, 34.43 r 16.18, 39.45 r 14.61 EODs · s-1, Kruskal-Wallis test with Bonferroni post hoc test: 397 stage I vs II p=0.001; stage I vs III p=6.49e-31; stage II vs III p=2.85e-16). However, EOD rates in- 398 creased only slightly when the fish approached the decision line (see z-scored data in Fig. 6-2). The 399 increase of the SD with proximity to the object thus mainly was due to the reduced swim velocity 400 (compare to Fig. 3F and SPM data in Fig. 4). This suggests that the region of the attracting set also 401 recruited the highest sampling behavior.

402

403 Sensory consequences of behavioral adaptations. 404 To understand how the spatial changes in SD translate to sensory information, we used a biophysical 405 model to calculate the electric images (EI, the afferent sensory input) (Pedraja et al., 2016; Hofmann 406 et al., 2017). From these, we calculated the Fisher information (FI) between successive EIs (see 407 methods and Fig. 1). FI can be regarded as an upper bound on the variance of the estimation of the 408 cube detectability that a given EI provides. As expected, FI increased with proximity to the cube 409 (Fig. 7A – C, top graphs). Interestingly the increase was significantly stronger in later learning stages 410 (median FI: stage I: 1.90 · 104, stage II: 1.64 · 105 and stage III: 3.32 · 105; Kruskal-Wallis test with Bon- 411 ferroni post hoc test, p < 0.001 for all comparisons). The distance over which FI was increased be- 412 tween learning stages progressively increased with learning (Fig. 7A – C, bottom, white arc indicates 413 significant areas; stage I vs. II: 5 cm; stage I vs. III: 6 cm; Kruskal-Wallis test with Bonferroni post hoc 414 test, p values between 1 · 10-4 - 0.049). This shows that the sensory information is enhanced by the 415 sensorimotor adjustments with learning. 416

417 Behavioral and physiological detection ranges. 418 The mean physiological detection limit for ELL units reported here (9.2 mm) are similar to those re- 419 ported for electroreceptor afferents (Szabo and Hagiwara, 1967; Gomez et al., 2004). To obtain an 420 estimate of the detection range on the organismal level (perception) and in context of unrestrained

15

421 behavior, we tested detection ranges in our experimental tank with fish that had completed training 422 (Fig. 7D-E; stage III, see methods). This detection threshold (Fig. 7E; mean ± std: 65 ± 6 mm; N = 5) 423 was about 7-fold higher than the thresholds determined in physiology. Nonetheless, this behavioral 424 threshold is in agreement with detection range estimates reported using different approaches (¼ to 425 ½ body length, equivalent to 5 to 8 cm in our fish, (Push and Moller, 1979; Toerring and Belbenoit, 426 1979)). 427 We assumed FI-level at the detection limit (Fig. 7F. i.e. 65 mm distance) to be the minimum infor- 428 mation that trained fish required to detect the object. Naïve fish (Fig. 7F; stage I), in comparison, 429 needed to get significantly closer to the object (44.5 mm) to achieve a similar FI-level. This still is 430 about 4.8-times better than the physiological threshold. We interpret this to reflect the contribution 431 of different neuronal mechanisms in coping with challenging signal-to-noise conditions (e.g. popula- 432 tion coding, feedback influence, see discussion), and cannot be revealed in the single cell recordings 433 conducted here. The additional 1.4-fold increase of the threshold with learning likely is due to the 434 electromotor adjustments reported here. Our study thus provides a first estimate of the efficiency of 435 the neuronal mechanisms in dealing with the low signal to noise problem and in addition supports 436 the hypothesis that an active choice of sensing behavior can substantially contribute to improve the 437 detectability of weak stimuli. 438 439 Linking motor patterns with information and electromotor responses. 440 To further understand the means by which behavioral adjustments can increase sensory information 441 we turned to a simple theoretical abstraction. Figure 9 shows the amplitude of the electric images of 442 a fish approaching a metal cube for different scenarios at a constant SD: Once for the fish approach- 443 ing the cube frontally with the EI being focussed on the head (Fig. 8A), once for an angled approach 444 to the edge of the cube that places the EI more laterally (Fig. 8B), and once for a straight approach to 445 the side of the cube that again places the EI laterally (Fig. 8C). The increase in electric image ampli- 446 tude is higher in the later cases (black lines). This translates into higher FI (blue lines) between suc- 447 cessive sampling events. The EI gradient is less steep when an object is frontally approached (see Fig. 448 8 and Fig. 4 in Hofmann et al. 2017). Thus, by moving the electric image over the head region, fish 449 could potentially exploit the heterogeneity of the electric field geometry and pre-receptor mecha- 450 nisms, to increase the gradient and thereby the sensory information. To explore this, we modeled EIs 451 and calculated FI for a virtual scanning behavior, in which the EI is moved repetitively from the 452 frontal to the lateral side of the body side (Fig. 8D). This results in a strongly increased FI. This virtual 453 approach is reminiscent of SPM 7, a kinematic pattern selectively recruited after learning. This sug- 454 gests that the variation of the electric image’s position due to rotatory movements in the approach 455 may be crucial in enhancing the information the animal can obtain with this behavior.

16

456

457 To analyze if electromotor (i.e. sensory) behavior was associated with specific kinematic patterns or 458 motion primitives (i.e. PM or SPMs) we analyzed the likelihood that SPMs were associated with a 459 specific electromotor display. E-scans are transient rises of the EOD frequency (Post and von der 460 Emde, 1999; Jun et al., 2016) that occur when the sensory input deviates from the recent sensory 461 past (Caputi et al., 2003). E-scans were found in 5.8 r 4.5% (mean r standard deviation) of the SPMs. 462 The three SPMs that were specifically elevated after learning in areas II and III also had significantly 463 elevated E-scan probabilities (SPM 7: 25%, SPM 12: 20% and SPM 13: 14%; χ2 test with Monte Carlo 464 permutations: p < 0.01, see Fig. 9A & B). Likewise, the three SPMs specific to area I also had elevated 465 E-scan levels (SPM 1: 24%, SPM 9: 16% and SPM 10: 30%; χ2 test with Monte Carlo permutations: p < 466 0.01, see Fig. 9A & B).

467 To analyze if E-scans occurred linked to specific kinematics and to reveal their effect on the sensory 468 information, we calculated PM-triggered averages (see material and methods). No change was found 469 in E-scan frequency following right-turn PMs in straight approaches passing from area I to III directly 470 (Fig. 9C bottom). However, E-scan probabilities increased for right-turn PMs when fish transverse 471 from area I to II to III (diagonal approach; Fig. 9D bottom; Kruskal-Wallis test with Bonferroni post 472 hoc test: p = 0.02). In both cases Fisher information was elevated after the turns (Fig. 9C & D top; 473 Kruskal-Wallis test with Bonferroni post hoc test; direct: p = 0.02; diagonal: p = 0.005). No such rela- 474 tion for E-scans or Fisher information was found for left-turn (Fig. 9-1A & B for direct and diagonal 475 approaches) or high thrust PMs (Fig. 9-1C & D for direct and diagonal approaches), while low thrust 476 PMs again led to an increased FI (Fig. 9-1E & F, Kruskal-Wallis test with Bonferroni post hoc test; di- 477 rect: p = 0.002; diagonal: p = 0.008). This indicates that the sequence of right-turn dominated SPMs 478 and the consecutive slow zigzagging or gliding SPMs in area III (Figs. 4 & 8) are essential stereotyped 479 motor patterns that are linked with a stereotyped electromotor response that together result in an 480 improved sensory information (see also Fig. 5). 481

482 In summary, we have established that the object detection range for ELL neurons under static condi- 483 tions is significantly lower than the behavioral detection range. While learning the task fish alter the 484 electromotor behavior in a coordinate manner that results in enhanced information levels. Electro- 485 motor learning, in addition to neuronal mechanisms, thus can be an important factor in enhancing

486 the sensory range.

17

487 DISCUSSION

488 To which degree sensing depends on the mutual interactions of sensory and motor processes is a 489 fundamental question in neuroscience (Gordon et al., 2011). Examples for the contribution of motor 490 behavior include situations where movements stabilize sensory input, or directly enhance or gener- 491 ate sensory information. In either case, movement is an integral part of sensing. This is particularly 492 evident in active sensory systems, where motor control and sensing are directly connected (Ahissar 493 and Assa, 2016).

494 The experimentally obtained detection range of ELL units reported here likely underestimates the 495 natural sensitivity of ELL units. This is because, among other factors, the ELL sensitivity likely depends 496 on feedback (Chacron, 2005; Sawtell and Bell, 2008; Clarke and Maler, 2017; Enikolopov et al., 2018; 497 Hofmann and Chacron, 2019) as well as feedforward mechanisms and natural behaviour. Further- 498 more, population activity is likely a better determinant of perception and behavior than the activity 499 of single neurons (Pitkow and Angelaki, 2017; Runyan et al., 2017; Ni et al., 2018). It is also possible 500 that stimulus detection is encoded in a parallel pathway (McGillivray et al., 2012; Huang and 501 Chacron, 2016), where the selective decoding of information of ELL efferents with high detection 502 ranges could improve the perceptual range. The reported detection limits thus provide a lower esti- 503 mate of the performance under natural conditions. Future studies should validate these results both 504 for single units and on the population level in freely behaving fish.

505 In our experiments fish learned to find and swim to the area marked by a metal cube. Apart from 506 slight variations in the time fish took to acquire this task, all animals learned to solve it and further 507 did so using very similar sensorimotor patterns. This involved a refined use of the arena, emergence 508 of targeted turn patterns and an increase of the sampling density in vicinity to the object. This is 509 comparable to the kinematic data published for this species (Hofmann et al., 2017) for spontaneous 510 approaches towards novel objects where alterations of the sensorimotor behavior were found to 511 contribute to the shaping of the sensory input, leading to the emergence of depth information. No- 512 tably, in the present study, changes of the motor patterns occurred both within and outside of the 513 detection range of the electric system, suggesting that they are driven by sensory information (i.e. 514 reactive control) as well as internalized predictions. Together this resulted in changes of the animals’ 515 spatial attention with learning. A particular case are the different slopes of the SD in correct and in- 516 correct trials. As these happen before sensory information becomes available, it may indicate a 517 switch between two sampling modes. Hypothetically, this could be explained as an optimized forag- 518 ing behavior where fish actively seek the rewarded compartment most of the time but occasionally

18

519 put less effort into localizing the object, probably to seek out the area of low reward/food probabil- 520 ity.

521 Wave-type weakly electric fish position themselves with a preferred distance to transversely moving 522 objects, where the slope of the signal is highest, corresponding to the Fisher-optimal distance (Clarke 523 et al., 2015). Similarly, echolocating bats track targets by aiming their acoustic beam to hit the object 524 off center, i.e., where the slope in the acoustic beam amplitude is the highest (Yovel et al., 2010). In 525 addition, unconditioned approaches to objects of G. petersii were shown to be oriented along the 526 field gradient in a manner that may enable fish to determine the distance to their object (Hofmann et 527 al., 2017). These examples show that in active sensing animals, the most informative aspects of the 528 sensory input often are linked to the highest gradient in the carrier signal. 529 We found that, with learning, fish altered their sensorimotor behavior in a manner that increased 530 sensory information, likely resulting in the improved detection range after learning. A potential strat- 531 egy to achieve this is bringing the electric image onto the part of the sensory surface where it causes 532 the strongest change in EI amplitude, thus increasing the gradient in the temporal afferent signal (Fig. 533 8A-C) (Babineau, 2006). We here suggest a further option in which fish actively move the sensory 534 input over their foveal head region, a strategy that will significantly increase information about a 535 target (Fig 8D). Fish did focus the input to the head, but not to the front. They further recruited a 536 motor prototype consisting of a slow zigzagging towards the object. This indicates that this third op- 537 tion may indeed be used to enhance sensory input. Future studies, using refined videography, should 538 thus address if the positioning of the electric images on the foveal head region is different in tasks 539 that demand the fish to detect an object versus one where object features need to be discriminated. 540 Likewise, electrophysiological studies on freely behaving fish are required to directly address the 541 predicted improvement of the neuronal detection limits through specific learned motor behaviors. 542 The ability to actively regulate the sensory input is emerging as a general research question. A partic- 543 ularly striking example for this comes from a wave-type weakly electric Gymnotiform fish, that en- 544 gages in energetically inefficient foraging in order to enlarge the electrosensory range (Snyder et al., 545 2007; MacIver et al., 2010; Biswas et al., 2018). An alternative strategy, increase of the signal’s ampli- 546 tude, seems to be common in echolocating toothed whales and bats (Madsen and Surlykke, 2013). 547 Contrary to these species, weakly electric fish, likely due to the energetic costs of maintaining the 548 EOD (Markham et al., 2016) and the spherical dissipation of the energy (Nelson and Maciver, 1999), 549 appear to have favoured motor adjustments as a means to increase the sensory range. These motor 550 adjustments include a reduced swim speed close to informative objects in the environment that re- 551 sult in elevated SD rates (see results and Jun et al., 2016). In addition to a reduction in energy ex- 552 penditure, this motor-dependent modulation of the SD rate might also enable an easier change in

19

553 swim direction upon encountering informative regions in space (e.g. B-scans, Jun et al., 2016). Where 554 studied, rises of the SD were coupled to reduced swim speeds. Elevated SD rates thus might also 555 reflect motor necessities inherent to the motor behaviour. While our study can not conclusively dis- 556 ambiguate motor and sensory objectives, a recent study by Fotowat and colleagues (Fotowat et al., 557 2019) provides strong support to the view that SD is crucially involved in the active regulation of in- 558 formation transmission and sensing. Recording from neurons in the dorsal pallium of freely swim- 559 ming Gymnotiform fish revealed neurons that were specifically active directly after elevated sam- 560 pling density rates. This is consistent with the interpretation that changes of motor and electromotor 561 activity (here SD rate) can result in an improved neuronal representation. Future studies are needed 562 to further separate sensory and motor objectives of changes in the sampling density.

563 A second behavioral parameter that was adjusted as fish learned the task was turning (during ap- 564 proaches that initially targeted the wrong compartment). These turns (SPMs 12, 13 & 14) orient the 565 animal to the informative region (area III), where another set of SPMs (5 and 7) was recruited. The 566 turns predominantly occurred outside of the neuronal detection range of the object and were fol- 567 lowed by elevated E-scans rates. This argues for a coordinate control of motor and electromotor 568 behaviours that together result in an increase of the information near an object. 569 Similar to head scans of rodents (Monaco et al., 2014), transient rises of the sampling frequency have 570 been considered to serve special functions in the formation of spatial memories (Jun et al., 2016) and 571 have further been implicated as overt displays of sensory expectations (Moller, 1995). Indeed, startle 572 responses of the EOD were amongst the first evidence for the hypothesis (Heiligenberg, 1980, 1988) 573 that weakly electric fish can compare current afferent input against an internal reference or memory 574 of the past afference (Hall et al., 1995). E-scans linked to these turns might be overt displays that 575 signal a match between expected and perceived sensory input (see Moller, 1995). Finally, using zig- 576 zagging in the final approach may further provide additional sensory information. An alternative ex- 577 planation of E-scans being associated to turns is that the animals seek to maintain the sensory 578 change between successive sampling events within a preferred range. The transient increase of the 579 EOD rate may thus serve to compensate the steep change of the sensory input that follows the turns. 580 Further studies that allow clamping the level of sensory change in freely behaving fish are required to 581 investigate this hypothesis. Evidence for an active buffering of the level of sensory input has recently 582 been shown for a different sensorimotor behavior in a wave-type weakly electric fish (Biswas et al., 583 2018). The finding that motor behavior which are relevant in regulating the sensory flow are fairly 584 stereotyped, will also enable direct studies of their role in neuronal processing, as these motor be- 585 haviors easily can be quantified in the ongoing behavior and thus allow to directly connect them with 586 neuronal data (Kern et al., 2001).

20

587 Active sensing in its most common form involves the generation of movements. Whether and how 588 these are controlled with respect to their sensory corollaries is mostly unknown. Our results show 589 that motor control can be an active component of sensory learning. Similar effects are to be ex- 590 pected in other sensory systems, particularly near-range and active sensory systems. A better under- 591 standing of the strategies guiding sensory learning thus will likely lead to a better understanding of 592 sensorimotor integration, variation of behavior in natural contexts and learning in general. Active 593 shaping of the sensory flow in general, may further be of interest in technical systems, where acous- 594 tic beam forming of field shaping can be used to acquire different information using different sen- 595 sorimotor configurations when required.

21

596 CITATIONS

597 Ahissar E, Assa E (2016) Perception as a closed-loop convergence process. Elife 5:1–26 Available at: 598 https://elifesciences.org/articles/12830.

599 Babineau D (2006) Modeling the electric field of weakly electric fish. J Exp Biol 209:3636–3651 600 Available at: http://jeb.biologists.org/cgi/doi/10.1242/jeb.02403.

601 Bell CC, Han V, Sawtell NB (2008) Cerebellum-Like Structures and Their Implications for Cerebellar 602 Function. Annu Rev Neurosci 31:1–24 Available at: 603 http://www.annualreviews.org/doi/10.1146/annurev.neuro.30.051606.094225.

604 Bell CC, Meek J, Yang JY (2005) Immunocytochemical identification of cell types in the mormyrid 605 electrosensory lobe. J Comp Neurol 483:124–142 Available at: 606 http://doi.wiley.com/10.1002/cne.20414.

607 Bell CC, Zakon H, Finger TE (1989) Mormyromast electroreceptor organs and their afferent fibers in 608 mormyrid fish: I. Morphology. J Comp Neurol 286:391–407 Available at: 609 http://doi.wiley.com/10.1002/cne.902860309.

610 Biswas D, Arend LA, Stamper SA, Vágvölgyi BP, Fortune ES, Cowan NJ (2018) Closed-Loop Control of 611 Active Sensing Movements Regulates Sensory Slip. Curr Biol 28:4029-4036.e4 Available at: 612 http://www.sciencedirect.com/science/article/pii/S0960982218314660.

613 Brainard MS, Doupe AJ (2013) Translating Birdsong: Songbirds as a Model for Basic and Applied 614 Medical Research. Annu Rev Neurosci 36:489–517 Available at: 615 http://www.annualreviews.org/doi/10.1146/annurev-neuro-060909-152826.

616 Braun E, Geurten B, Egelhaaf M (2010) Identifying Prototypical Components in Behaviour Using 617 Clustering Algorithms Brembs B, ed. PLoS One 5:e9361 Available at: 618 https://dx.plos.org/10.1371/journal.pone.0009361.

619 Caputi AA, Aguilera PA, Castelló ME (2003) Probability and amplitude of novelty responses as a 620 function of the change in contrast of the reafferent image in G. carapo. J Exp Biol 206:999–1010 621 Available at: http://jeb.biologists.org/cgi/doi/10.1242/jeb.00199.

622 Chacron MJ (2005) Feedback and Feedforward Control of Frequency Tuning to Naturalistic Stimuli. J 623 Neurosci 25:5521–5532 Available at: 624 http://www.jneurosci.org/cgi/doi/10.1523/JNEUROSCI.0445-05.2005.

625 Charlesworth JD, Tumer EC, Warren TL, Brainard MS (2011) Learning the microstructure of successful 626 behavior. Nat Neurosci 14:373–380 Available at: http://www.nature.com/articles/nn.2748.

627 Ciali S, Gordon J, Moller P (1997) Spectral sensitivity of the weakly discharging electric fish 628 Gnathonemus petersi using its electric organ discharges as the response measure. J Fish Biol 629 50:1074–1087 Available at: http://doi.wiley.com/10.1111/j.1095-8649.1997.tb01631.x.

630 Clarke SE, Longtin A, Maler L (2015) The neural dynamics of sensory focus. Nat Commun 6:8764 631 Available at: http://www.nature.com/articles/ncomms9764.

632 Clarke SE, Maler L (2017) Feedback Synthesizes Neural Codes for Motion. Curr Biol 27:1356–1361 633 Available at: https://linkinghub.elsevier.com/retrieve/pii/S0960982217303986.

634 Enikolopov AG, Abbott LF, Sawtell NB (2018) Internally Generated Predictions Enhance Neural and 635 Behavioral Detection of Sensory Stimuli in an Electric Fish. Neuron 99:135-146.e3 Available at: 636 https://linkinghub.elsevier.com/retrieve/pii/S0896627318304744.

637 Fotowat H, Lee C, Jun JJ, Maler L (2019) Neural activity in a hippocampus-like region of the teleost 638 pallium is associated with active sensing and navigation Thirumalai V, Behrens TE, Chacron MJ, 639 eds. Elife 8:e44119 Available at: https://doi.org/10.7554/eLife.44119.

22

640 Friston K (2010) The free-energy principle: a unified brain theory? Nat Rev Neurosci 11:127–138 641 Available at: http://www.nature.com/articles/nrn2787.

642 Gellermann LW (1933) Chance Orders of Alternating Stimuli in Visual Discrimination Experiments. 643 Pedagog Semin J Genet Psychol 42:206–208 Available at: 644 https://doi.org/10.1080/08856559.1933.10534237.

645 Geurten BRH, Kern R, Braun E, Egelhaaf M (2010) A syntax of hoverfly flight prototypes. J Exp Biol 646 213:2461–2475 Available at: http://jeb.biologists.org/cgi/doi/10.1242/jeb.036079.

647 Gomez L, Budelli R, Grant K, Caputi AA (2004) Pre-receptor profile of sensory images and primary 648 afferent neuronal representation in the mormyrid electrosensory system. J Exp Biol 207:2443– 649 2453 Available at: http://jeb.biologists.org/cgi/doi/10.1242/jeb.01053.

650 Gordon G, Fonio E, Ahissar E (2014) Emergent Exploration via Novelty Management. J Neurosci 651 34:12646–12661 Available at: http://www.jneurosci.org/cgi/doi/10.1523/JNEUROSCI.1872- 652 14.2014.

653 Gordon G, Kaplan DM, Lankow B, Little DY-J, Sherwin J, Suter B a, Thaler L (2011) Toward an 654 Integrated Approach to Perception and Action: Conference Report and Future Directions. Front 655 Syst Neurosci 5:20 Available at: 656 http://journal.frontiersin.org/article/10.3389/fnsys.2011.00020/abstract.

657 Hall C, Bell C, Zelick R (1995) Behavioral evidence of a latency code for stimulus intensity in mormyrid 658 electric fish. J Comp Physiol A 177:29–39 Available at: 659 http://link.springer.com/10.1007/BF00243396.

660 Heiligenberg W (1980) The jamming avoidance response in the weakly electric fishEigenmannia. 661 Naturwissenschaften 67:499–507 Available at: http://link.springer.com/10.1007/BF01047630.

662 Heiligenberg W (1988) Electrosensory Maps Form a Substrate for the Distributed and Parallel Control 663 of Behavioral Responses in Weakly Electric Fish. Brain Behav Evol 31:6–16 Available at: 664 https://www.karger.com/Article/FullText/116571.

665 Hofmann V, Chacron M (2019) Novel functions of feedback in electrosensory processing. Front Integr 666 Neurosci 13:52.

667 Hofmann V, Geurten BRH, Sanguinetti-Scheck JI, GÃ3mez-Sena L, Engelmann J (2014) Motor patterns 668 during active electrosensory acquisition. Front Behav Neurosci 8 Available at: 669 http://journal.frontiersin.org/article/10.3389/fnbeh.2014.00186/abstract.

670 Hofmann V, Sanguinetti-Scheck JI, Gómez-Sena L, Engelmann J (2013) From static electric images to 671 electric flow: Towards dynamic perceptual cues in active . J Physiol 107:95–106 672 Available at: https://linkinghub.elsevier.com/retrieve/pii/S092842571200037X.

673 Hofmann V, Sanguinetti-Scheck JI, Gómez-Sena L, Engelmann J (2017) Sensory Flow as a Basis for a 674 Novel Distance Cue in Freely Behaving Electric Fish. J Neurosci 37:302–312 Available at: 675 http://www.jneurosci.org/lookup/doi/10.1523/JNEUROSCI.1361-16.2017.

676 Hollmann V, Engelmann J, Gómez-Sena L (2016) A quest for excitation: Theoretical arguments and 677 immunohistochemical evidence of excitatory granular cells in the ELL of Gnathonemus petersii. 678 J Physiol 110:190–199 Available at: 679 https://linkinghub.elsevier.com/retrieve/pii/S0928425716300225.

680 Huang CG, Chacron MJ (2016) Optimized Parallel Coding of Second-Order Stimulus Features by 681 Heterogeneous Neural Populations. J Neurosci 36:9859–9872 Available at: 682 http://www.jneurosci.org/cgi/doi/10.1523/JNEUROSCI.1433-16.2016.

683 Jun JJ, Longtin A, Maler L (2016) Active sensing associated with spatial learning reveals memory- 684 based attention in an electric fish. J Neurophysiol 115:2577–2592 Available at: 685 http://www.physiology.org/doi/10.1152/jn.00979.2015. 23

686 Kern R, Petereit C, Egelhaaf M (2001) Neural Processing of Naturalistic Optic Flow. J Neurosci 687 21:RC139–RC139 Available at: http://www.ncbi.nlm.nih.gov/pubmed/11306645.

688 Lissmann HW, Machin KE (1958) The mechanism of object location in Gymnarchus niloticus and 689 similar fish. J Exp Biol.

690 Little DY, Sommer FT (2013) Learning and exploration in action-perception loops. Front Neural 691 Circuits 7:1–19 Available at: 692 http://journal.frontiersin.org/article/10.3389/fncir.2013.00037/abstract.

693 Loewenstein G (1994) The psychology of curiosity: A review and reinterpretation. Psychol Bull 694 116:75.

695 MacIver MA, Patankar NA, Shirgaonkar AA (2010) Energy-Information Trade-Offs between 696 Movement and Sensing Friston KJ, ed. PLoS Comput Biol 6:e1000769 Available at: 697 https://dx.plos.org/10.1371/journal.pcbi.1000769.

698 Madsen PT, Surlykke A (2013) Functional Convergence in Bat and Toothed Whale Biosonars. 699 Physiology 28:276–283 Available at: 700 http://www.physiology.org/doi/10.1152/physiol.00008.2013.

701 Markham MR, Ban Y, McCauley AG, Maltby R (2016) Energetics of Sensing and Communication in 702 Electric Fish: A Blessing and a Curse in the Anthropocene? Integr Comp Biol 56:889–900 703 Available at: https://academic.oup.com/icb/article-lookup/doi/10.1093/icb/icw104.

704 McGillivray P, Vonderschen K, Fortune ES, Chacron MJ (2012) Parallel Coding of First- and Second- 705 Order Stimulus Attributes by Midbrain Electrosensory Neurons. J Neurosci 32:5510–5524 706 Available at: http://www.jneurosci.org/cgi/doi/10.1523/JNEUROSCI.0478-12.2012.

707 Metzen MG, Engelmann J, Bacelo J, Grant K, von der Emde G (2008) Receptive field properties of 708 neurons in the electrosensory lateral line lobe of the weakly electric fish, Gnathonemus petersii. 709 J Comp Physiol A 194:1063–1075 Available at: http://link.springer.com/10.1007/s00359-008- 710 0377-4.

711 Metzen MG, Huang CG, Chacron MJ (2018) Descending pathways generate perception of and neural 712 responses to weak sensory input Kohn A, ed. PLOS Biol 16:e2005239 Available at: 713 https://dx.plos.org/10.1371/journal.pbio.2005239.

714 Migliaro A, Caputi A a., Budelli R (2005) Theoretical Analysis of Pre-Receptor Image Conditioning in 715 Weakly Electric Fish. PLoS Comput Biol 1:e16 Available at: 716 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&lis 717 t_uids=16110331.

718 Miller LM, Silverman Y, MacIver MA, Murphey TD (2016) Ergodic Exploration of Distributed 719 Information. IEEE Trans Robot 32:36–52 Available at: 720 http://ieeexplore.ieee.org/document/7350162/.

721 Moller P (1995) Electric fishes: history and behavior. London: Chapman & Hall London.

722 Monaco JD, Rao G, Roth ED, Knierim JJ (2014) Attentive scanning behavior drives one-trial 723 potentiation of hippocampal place fields. Nat Neurosci 17:725–731 Available at: 724 http://www.nature.com/articles/nn.3687.

725 Nelson ME, Maciver MA (1999) Prey capture in the weakly electric fish Apteronotus albifrons: 726 sensory acquisition strategies and electrosensory consequences. J Exp Biol 202:1195–1203 727 Available at: http://www.ncbi.nlm.nih.gov/pubmed/10210661.

728 Ni AM, Ruff DA, Alberts JJ, Symmonds J, Cohen MR (2018) Learning and attention reveal a general 729 relationship between population activity and behavior. Science (80- ) 359:463–465 Available at: 730 http://www.sciencemag.org/lookup/doi/10.1126/science.aao0284.

24

731 O’Hora D, Dale R, Piiroinen PT, Connolly F (2013) Local dynamics in decision making: The evolution of 732 preference within and across decisions. Sci Rep 3:2210 Available at: 733 http://www.nature.com/articles/srep02210.

734 Pedraja F, Aguilera P, Caputi A a., Budelli R (2014) Electric Imaging through Evolution, a Modeling 735 Study of Commonalities and Differences Bethge M, ed. PLoS Comput Biol 10:e1003722 736 Available at: https://dx.plos.org/10.1371/journal.pcbi.1003722.

737 Pedraja F, Hofmann V, Lucas KM, Young C, Engelmann J, Lewis JE (2018) Motion parallax in electric 738 sensing. Proc Natl Acad Sci 115:573–577 Available at: 739 http://www.pnas.org/lookup/doi/10.1073/pnas.1712380115.

740 Pedraja F, Perrone R, Silva A, Budelli R (2016) Passive and active electroreception during agonistic 741 encounters in the weakly electric fish Gymnotus omarorum. Bioinspir Biomim 11:065002 742 Available at: http://www.ncbi.nlm.nih.gov/pubmed/27767014.

743 Pitkow X, Angelaki DE (2017) Inference in the Brain: Statistics Flowing in Redundant Population 744 Codes. Neuron 94:943–953 Available at: 745 https://linkinghub.elsevier.com/retrieve/pii/S089662731730466X.

746 Post N, von der Emde G (1999) The “novelty response” in an electric fishresponse properties and 747 habituation. Physiol Behav 68:115–128 Available at: 748 http://linkinghub.elsevier.com/retrieve/pii/S0031938499001535.

749 Poteser M, Kral K (1995) Visual distance discrimination between stationary targets in praying mantis: 750 an index of the use of motion parallax. J Exp Biol 198:2127–2137.

751 Push S, Moller P (1979) Spatial aspects of electrolocation in the mormyrid fish, Gnathonemus 752 petersii. J Physiol (Paris) 75:355–357 Available at: 753 http://www.ncbi.nlm.nih.gov/pubmed/512970.

754 Rother D (2003) Simulación de imágenes eléctricas en peces eléctricos de descarga débil. Imágenes 755 Eléctricas en Peces Eléctricos Descarga.

756 Rother D, Migliaro A, Canetti R, Gómez L, Caputi A, Budelli R, Gomez L, Caputi A, Budelli R, Gómez L, 757 Caputi A, Budelli R (2003) Electric images of two low resistance objects in weakly electric fish. 758 Biosystems 71:169–177 Available at: 759 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&lis 760 t_uids=14568217.

761 Runyan CA, Piasini E, Panzeri S, Harvey CD (2017) Distinct timescales of population coding across 762 cortex. Nature 548:92–96 Available at: http://www.nature.com/articles/nature23020.

763 Sanguinetti-Scheck JI, Pedraja EF, Cilleruelo E, Migliaro A, Aguilera P, Caputi AA, Budelli R (2011) Fish 764 Geometry and Electric Organ Discharge Determine Functional Organization of the 765 Electrosensory Epithelium Soares D, ed. PLoS One 6:e27470 Available at: 766 https://dx.plos.org/10.1371/journal.pone.0027470.

767 Sawtell NB, Bell CC (2008) Adaptive processing in electrosensory systems: Links to cerebellar 768 plasticity and learning. J Physiol 102:223–232 Available at: 769 http://www.sciencedirect.com/science/article/pii/S0928425708000478.

770 Sawtell NB, Williams A, Bell CC (2005) From sparks to spikes: information processing in the 771 electrosensory systems of fish. Curr Opin Neurobiol 15:437–443 Available at: 772 https://linkinghub.elsevier.com/retrieve/pii/S0959438805000978.

773 Sawtell NB, Williams A, Roberts PD, von der Emde G, Bell CC (2006) Effects of Sensing Behavior on a 774 Latency Code. J Neurosci 26:8221–8234 Available at: 775 http://www.jneurosci.org/cgi/doi/10.1523/JNEUROSCI.1508-06.2006.

776 Silverman Y, Miller LM, MacIver MA, Murphey TD (2013) Optimal planning for information 25

777 acquisition. In: 2013 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp 778 5974–5980. IEEE. Available at: http://ieeexplore.ieee.org/document/6697223/.

779 Snyder JB, Nelson ME, Burdick JW, MacIver MA (2007) Omnidirectional Sensory and Motor Volumes 780 in Electric Fish Maler L, ed. PLoS Biol 5:e301 Available at: 781 https://dx.plos.org/10.1371/journal.pbio.0050301.

782 Szabo T, Hagiwara S (1967) A latency-change mechanism involved in sensory coding of electric fish 783 (mormyrids). Physiol Behav 2:331–335 Available at: 784 https://linkinghub.elsevier.com/retrieve/pii/0031938467900479.

785 Toerring M-J, Moller P (1984) Locomotor and electric displays associated with electrolocation during 786 exploratory behavior in mormyrid fish. Behav Brain Res 12:291–306 Available at: 787 https://linkinghub.elsevier.com/retrieve/pii/0166432884901554.

788 Toerring MJ, Belbenoit P (1979) Motor programmes and electroreception in mormyrid fish. Behav 789 Ecol Sociobiol 4:369–379 Available at: http://link.springer.com/10.1007/BF00303243.

790 van Beers RJ, Baraduc P, Wolpert DM (2002) Role of uncertainty in sensorimotor control Parker A, 791 Derrington A, Blakemore C, eds. Philos Trans R Soc London Ser B Biol Sci 357:1137–1145 792 Available at: http://www.royalsocietypublishing.org/doi/10.1098/rstb.2002.1101.

793 Wolpert DM, Landy MS (2012) Motor control is decision-making. Curr Opin Neurobiol 22:996–1003 794 Available at: https://linkinghub.elsevier.com/retrieve/pii/S0959438812000827.

795 Wu HG, Miyamoto YR, Castro LNG, Ölveczky BP, Smith MA (2014) Temporal structure of motor 796 variability is dynamically regulated and predicts motor learning ability. Nat Neurosci 17:312– 797 321 Available at: http://www.nature.com/articles/nn.3616.

798 Yovel Y, Falk B, Moss CF, Ulanovsky N (2010) Optimal Localization by Pointing Off Axis. Science (80- ) 799 327:701–704 Available at: http://www.sciencemag.org/cgi/doi/10.1126/science.1183310.

800 Zgonnikov A, Aleni A, Piiroinen PT, O’Hora D, di Bernardo M (2017) Decision landscapes: visualizing 801 mouse-tracking data. R Soc Open Sci 4:170482 Available at: 802 http://rsos.royalsocietypublishing.org/lookup/doi/10.1098/rsos.170482.

803

26

804 Legends 805 Figure 1: Electric image analysis. A. View of the geometric model of the fish body with the color depicting the 806 transcutaneous current expressed as the difference between the perturbed and unperturbed electric field. The stippled 807 black line spanning the fish’s body indicates the positions where the EI were analyzed. B. Spatial sequence of the elec- 808 tric images calculated along the fish’s midline for a complete approach sequence. The position of the EI is expressed 809 relative to the length of the fish with the snout being the zero position (see panel A). The blue line represents the EI- 810 maxima as a function of distance to the object. C. As in B but for the Fisher information. The blue line shows the Fisher 811 information integrated over each image as a function of distance.

812 Figure 2: Object detection capabilities of hindbrain neurons. A. The activity of ELL principal neurons (n = 20) was rec- 813 orded in immobilized Gnathonemus petersii. Ongoing activity was recorded prior to each stimulus presentation (metal 814 or plastic cube, 2 cm side length). B. Neuronal activity (middle, black) typically consisted of a burst of action potentials 815 following the EOD (gray vertical line). For each burst we measured the number of spikes within 150 ms after each EOD 816 (top red), the latency of the 1st spike (red arrow) and the peak of the convolved firing rate (bottom, black trace & red 817 arrow). Only spikes within one EOD-cycle were included (median EOD rate = 357 ms). C. Probability distributions (solid 818 lines) for the measured parameters (here spike count) of the responses of an example E-unit stimulated with a metal 819 object at 17 mm (blue) and 5 mm (red) as well as ongoing activity (black). D. Receiver operating characteristics (ROC, 820 see Methods) obtained for the data shown in C. For each stimulation distance the probability of true positive (()) 821 was calculated as a function of the probability of false positive (()) classification. The area under the curve (AUC) 822 was assessed. E. ROC sensitivity (ROC AUC) as a function of distance of the object for an exemplary E-unit. The detection 823 distance of all units was determined as the point where a sigmoidal fit to the data exceeded an AUC of 0.7. In this ex- 824 ample the detection distance was 12 mm. Red and blue dots correspond to the data shown in C and D. F. Average ROC 825 data for 20 single units based on spike count probability. G. Distribution of detection distances of all units. While some 826 neurons had detection distances up to 28 mm, the average detection threshold was below 10 mm for all parameters. 827 Gray dots show the detection distances of individual neurons.

828 Figure 3: Performance and motor behavior change with learning. A. Top-view on the experimental arena. Upon lo- 829 wering the gate that separated the training and the living area, fish entered the arena. Note that the living area is not 830 shown in this figure. The task was to swim into the compartment marked with the metal cube (gray square). Here and 831 in all following figures, the data is presented with the object (square) on the right side of the arena as seen from the 832 view of the fish entering the arena. The arena was partitioned in three areas (I-III) for the later data analysis. B. Psycho- 833 metric function fitted to the data of one exemplary fish. Here and in the following the three performance levels used in 834 the analysis are indicated by color (learning stage I: < 60% of correct decision, light cyan; II: > 60 to 80%, dark cyan; III: > 835 80%, violet). C-E. Top view on the average movements (black lines) during the three stages for the same fish as shown 836 in panel B. The color code indicates mean heading direction (see sketch in H). F. Median swim speed (N = 5 fish) with 837 respect to the distance to the object in correct trials (top; n = 1119) and incorrect trials (bottom; n = 514). G. Box-plots 838 showing the width of the distribution of the fish along the width of the arena (in total 50 cm) for all trials (n = 1633 839 trials, N = 5). Width was quantified as the range including 90 and 10 percentile of the data of each individual fish. This 840 measure shows that with learning fish transitioned from exploring the whole width of arena to a more refined use of 841 the arena that brought them more towards the middle of the arena (Kruskal-Wallis test with Bonferroni post hoc; test 842 stage I vs. III: p = 0.03). H-J. With learning fish aligned better with the object (measured from the start of the trajectory 843 until decision line), as shown here by the mean alignment vector (black arrows, see α in sketch). Colored lines are circu- 844 lar histograms of the raw data. With learning the mean alignment became more oriented towards the object. Figure 3- 845 1: Psychometric functions of the five individual fish. Learning took 20-32 sessions. For analysis, data was segregated into 846 three learning stages (< 60% of correct decision, light blue; > 60 to 80%, blue; > 80%, dark blue).

847 Figure 4: The spatial recruitment of motor patterns (SPMs) shows pronounced changes in the different learning stag- 848 es. A. Kinematics of the 10 PMs depicting the relative centroid values of thrust slip and yaw. Blue bars indicate slip and 849 yaw components directed to the left, while red bars show the corresponding values for movements to the right. PMs 1- 850 4 are thrust-dominated, while PMs 5-10 are turn-dominated. B. Exemplary trajectory showing the fish’s head position 851 by the circles and the orientation of its body by the grey lines, while time since the start of the trial is indicated by the 852 size of the circles. Using the transition probabilities between PMs, chains of consecutive motor behaviors are extracted 853 (super-prototypical movements, SPM). As an example the kinematic sequence of SPMs 7 and 12 is shown by the series 854 circles where the numbered circles stand for the corresponding PM. C. Relative change of occurrence for the SPMs that 855 showed the strongest change comparing stage I to III (left) and stage III to I (right) for correct trials. Note that low to 856 medium thrust SPMs (light and darker gray) decreased, while high thrust SPMs (black) increased. Right turn (RT) domi- 857 nated SPMs (red) were more frequent in stage III. D-I. Spatial distribution of the SPMs shown in C for learning stages I 858 (top row, D, F and H) and III (bottom row, E, G and I). The colored ellipses are based on 2D-Gaussian fits to the spatial 27

859 distribution of SPM with colors separating thrust (grey), right turn (red) and left turn (blue) dominated SPMs. The num- 860 bers in E and G refer to the two SPMs detailed in B. Figure 4-1: Most frequent superprototypes (SPMs). Composition 861 and average values of the five most frequent SPMs for correct choices during stage I (A) and III (B) and for incorrect 862 choices in stage I (C) and III (D). Columns from left to right show the data for areas I to III, respectively. The PM- 863 transitions characterizing the SPMs are shown by the colored circles. The number in each circle represents the PM (see 864 legend on the bottom for details regarding coloration). SPM averages values are shown by the bars (thrust: black, slip 865 and yaw: red and blue, duration: stippled grey bar, distance: black and white bar). SMPs were sorted with respect to 866 average maximum values. > 75% slip or yaw speeds correspond to right or left turn. The remaining SPMs were grouped 867 according to their thrust component: < 25%, between 25% and 75% and > 75% average thrust speed correspond to low, 868 intermediate and high thrust SPM (see methods). SPMs that changed the most between learning stages are shown in 869 bold font.

870 Figure 5: Development of attracting sets states with learning. A_C. Attractor landscape diagram for the trajectories of 871 an exemplary fish in stages I to III (A-C, respectively). The color code depicts the attractor value, light solid lines show 872 average trajectories and black solid lines the area of the attracting set. Initially two attracting sets of similar size were 873 present, while attracting sets became more distinct around the object. D. Size of the attracting set (see methods) shown 874 as boxplots for all fish and learning stages. Attracting set size significantly decreased from stage I to stage III. (Mann- 875 Whitney pairwise test with Bonferroni post hoc test: stages I-II p = 0.13, stages I-III p = 0.04 and stages II-III p = 0.49). E. 876 Same as in D for the attracting set peak amplitude. Peak amplitude increased significantly from stage I to stage III 877 (Mann-Whitney pairwise test with Bonferroni post hoc test: stages I-II p = 0.13, stages I-II p = 0.06, stages I-III p = 0.03 878 and stages II-III p = 0.1). In all panels, asterisks indicate statistical significance (p < 0.05). 879 Figure 5-1: Attractor maps. Attractor landscape diagrams for all fish from stage I to III from left to right, respectively. 880 Red color represents hills (unstable states) while blue color represents valleys (stable states). As in the previous figures, 881 data was flipped in order of keep the object in the bottom part (black square). The plastic wall dividing the two com- 882 partments is shown as a horizontal grey line and the decision line is marked with a thin vertical grey line.

883 Figure 6: Change of the sampling density with learning. A-C. Distribution of the normalized sampling density (SD) for 884 the three stages of learning (data from exemplary fish). As in Fig. 3A, the open square shows the virtual position of the 885 cube, while the solid cube shows the cubes’ actual position. D-F. SD (z-scored) as a function of distance to the object 886 (correct trials, n = 1119; colored lines and shaded area depict median and median absolute deviation) and the virtual 887 object (incorrect trials, n = 514; black lines and light gray outlines show median and median absolute deviation). The 888 slopes and coefficient of determinations of the linear fits to the SD are shown in colored font for correct and in black 889 font for the incorrect trials. The distances over which SD was significantly increased in correct vs. incorrect trials are in- 890 dicated by green shaded areas (Wilcoxon-signed-rank test p = 2e-4 – 0.0495 and 7e-7 – 0.02 for stages II and III respec- 891 tively).Figure 6-1: Spatial maps of the sampling density (color-code) and mean trajectories (white lines). Each row rep- 892 resents the data of a single fish with learning stage I on the left, II in the middle and III on the right. Data was normalized 893 for each fish and phase, respectively. The decision line is marked with a thin vertical grey line. Data was flipped in order 894 of keep the object in the bottom part (grey square). Plastic wall dividing the two compartments is shown as a horizontal 895 grey line. Figure 6-2: EOD frequency. Median and median absolute deviation of the z-scored EOD frequency with re- 896 spect to the Euclidian distance from the object. Data was separated in correct (blue, N=5, 1119 trials) and incorrect tri- 897 als (black, N=5, 514 trials). In the latter case, distance is calculated to the virtual position of the object in the compart- 898 ment that the fish swam to, i.e., we treated the data as if an object had been present. Data for learning stages I-III is 899 shown from top to bottom, respectively.

900 Figure 7: Fisher information increases with object proximity and learning. A-C. Top: Fisher information as a function of 901 distance to the cube for the three learning stages (left to right). Colored lines show median, shaded areas median abso- 902 lute deviation. Green boxes show the range over which FI was significantly increased in successive learning stages 903 (Kruskal-Wallis test with Bonferroni post hoc test: p < 0.05). Note the log-scale of the y-axis. Bottom: spatial representa- 904 tion of the same data. Color code depicts values of FI, light gray lines show average trajectories superimposed. White 905 semicircles show the range for difference in FI showed in top panels. This data confirms that the behavioral adaptions 906 that were observed during learning in fact impact the available information to the fish. D. Top-view on the experimental 907 arena showing how the detection limit was measured in behavioral experiments for trained fish (i.e. after stage III). For 908 this, the cube was presented with increasing offset from its original position at the decision line (yellow to red). E. Psy- 909 chometric performance (correct choices as a function of distance between cube and decision line) of one fish. The de- 910 tection limit was determined as the distance of the object from the decision line where the performance (sigmoidal fit) 911 fell below 75%. The detection limits for all fish are summarized by the data depicted by the blue box-plot (mean: 65 912 mm). F Fisher information as a function of the distance of the fish to cube in stages I (cyan) and III (blue). The FI value at 913 the average behavioural detection limit (65 mm, see E) is indicated by the white circle with blue edge. To reach a similar 914 FI level during stage I, fish needed get closer to the object (44.5 mm, white circle with red edge). The red horizontal ar- 915 row indicates this 1.4 fold increase in sensory range following sensorimotor learning. The detection limit inferred from 916 the electrophysiological results was much lower (9.2 mm, black circle in E and F).

28

917

918 Figure 8: Changes in electric image positioning and motor behaviour modify Fisher information. A-C. Relation of the 919 electric image amplitude and the Fisher information modelled for different approaches of a fish to a metal cube; A. 920 straight approach; B. approach to the side of the cube and C. approach following a rotation of the cube. For the same 921 distance to the cube the amplitude and gradient between successive distances is higher for the more lateral position, 922 translating into a higher Fisher information rate. Amplitude further depends on the orientation between the cube and 923 the sensory surface, being highest when both are parallel to each other (B vs. C). D. The electric image amplitude of the 924 lateral (black line) and frontal position (light grey line) are superimposed. The white line alternating between both rep- 925 resents a hypothetical motor pattern in which a fish gradually reduces the distance to the cube and moves to alternate 926 the electric image between both positions. This virtual zigzagging induces an additional gradient between electric imag- 927 es and thus leads to higher Fisher information rates. Note that Fisher information is given in arbitrary units as the calcu- 928 lation is based on modelled data for which sigma (the noise level) cannot be used.

929 Figure 9: Object-directed turns increased sensory information and result in transient increases of sampling rates. A-B. 930 Spatial distributions of the SPMs (see methods) with the strongest change between learning stages I and III that also 931 showed an elevated E-scan probability (range: 14 - 30%, 25% for SPM 7). A: Right-turn dominated SPMs (red), B: thrust 932 dominated SPMs (gray). In both plots dots indicate positions of E-scans. Light gray lines are average trajectories. C. Fish- 933 er information (top) and E-scan probability (bottom) triggered on right-turns (PM based, PM occurrence at time 0) dur- 934 ing direct approaches (see C). FI was significantly increased after the right turn (positive time values, Kruskal-Wallis test 935 with Bonferroni post hoc test; direct p = 0.02). D. Same as C but for diagonal trajectories. FI and E-scan probability was 936 significantly increased after the right turn (Kruskal-Wallis test with Bonferroni post hoc test; FI: p = 0.005; E-scan proba- 937 bility: p = 0.02). In both panels, light gray numbers indicate the distance at which turns were observed on average 938 (mean ± SD). Figure 9-1: Fisher information and E-scan probability triggered for specific behaviors. A-B. Information 939 (top bars, black) and E-scan probability (bottom bars, grey) before and after left-turn PMs during direct and diagonal 940 approaches. Non-significant differences were found before and after the turns for FI nor for E-scan occurrence. C-D. As 941 in A&B for high thrust PMs. E-F. As in A&B for low thrust PMs. Here FI was significantly increased after the decrease in 942 thrust speed both for direct and indirect approaches (Kruskal-Wallis test with Bonferroni post hoc test; FI: p = 0.002 and 943 0.008 for direct and diagonal approaches respectively).

29