Sung Soo Kim1,2,3, Ann M Hermundstad4, Sandro Romani4, L F Abbott4,5, Vivek Jayaraman6. 1. Janelia Research Campus, Howard Hughes Medical Institute, Ashburn, VA, USA. sungsoo@ucsb.edu. 2. Department of Molecular, Cellular, and Developmental Biology, University of California, Santa Barbara, Santa Barbara, CA, USA. sungsoo@ucsb.edu. 3. Neuroscience Research Institute, University of California, Santa Barbara, Santa Barbara, CA, USA. sungsoo@ucsb.edu. 4. Janelia Research Campus, Howard Hughes Medical Institute, Ashburn, VA, USA. 5. Zuckerman Mind Brain Behavior Institute, Columbia University, New York, NY, USA. 6. Janelia Research Campus, Howard Hughes Medical Institute, Ashburn, VA, USA. vivek@janelia.hhmi.org.
Abstract
Many animals rely on an internal heading representation when navigating in varied environments1-10. How this representation is linked to the sensory cues that define different surroundings is unclear. In the fly brain, heading is represented by 'compass' neurons that innervate a ring-shaped structure known as the ellipsoid body3,11,12. Each compass neuron receives inputs from 'ring' neurons that are selective for particular visual features13-16; this combination provides an ideal substrate for the extraction of directional information from a visual scene. Here we combine two-photon calcium imaging and optogenetics in tethered flying flies with circuit modelling, and show how the correlated activity of compass and visual neurons drives plasticity17-22, which flexibly transforms two-dimensional visual cues into a stable heading representation. We also describe how this plasticity enables the fly to convert a partial heading representation, established from orienting within part of a novel setting, into a complete heading representation. Our results provide mechanistic insight into the memory-related computations that are essential for flexible navigation in varied surroundings.
Many animals rely on an internal heading representation when navigating in varied environments1-10. How this representation is linked to the sensory cues that define different surroundings is unclear. In the fly brain, heading is represented by 'compass' neurons that innervate a ring-shaped structure known as the ellipsoid body3,11,12. Each compass neuron receives inputs from 'ring' neurons that are selective for particular visual features13-16; this combination provides an ideal substrate for the extraction of directional information from a visual scene. Here we combine two-photon calcium imaging and optogenetics in tethered flying flies with circuit modelling, and show how the correlated activity of compass and visual neurons drives plasticity17-22, which flexibly transforms two-dimensional visual cues into a stable heading representation. We also describe how this plasticity enables the fly to convert a partial heading representation, established from orienting within part of a novel setting, into a complete heading representation. Our results provide mechanistic insight into the memory-related computations that are essential for flexible navigation in varied surroundings.
Internal representations of an animal’s spatial relationship to its surroundings are essential for flexible navigation[3,8-10]. Although these representations must be stable to be useful for planning and goal-oriented behavior, they must also adapt to changes in environmental and behavioral contexts. Indeed, the representations provided by head direction cells, grid cells, and place cells are all known to remap in different surroundings on the basis of spatially relevant sensory information[23-26]. A central question in navigation concerns how the brain carries out this flexible transformation of sensory information into a stable internal representation[2,27]. In insects, a multi-functional brain region called the central complex (CX)[11] (Fig. 1a) plays a key role in visually guided navigation, including flexible heading selection[7,9,28,29] and place learning[30]. Many of these abilities rely on successfully incorporating visual information from landscapes[31] or the pattern of polarized light and chromatic gradients in the sky[4,5,32] to generate an internal representation of heading in the CX; specifically, a ‘bump’ of activity in ‘compass’ (also known as E-PG) neurons in the ellipsoid body (EB)[3], a substructure of the CX (Fig. 1a, b). These neurons are an important part of a ring attractor network[33] that maintains and updates the heading representation based on self-motion[34,35] and visual signals[3]. Visual inputs are brought to the EB by GABA-ergic ‘ring’ neurons[12], which have localized spatiotemporal receptive fields (RFs)[13-16] (Fig. 1c). Here, we show how network plasticity enables the flexible generation of a stable compass-neuron heading representation in different visual scenes.
Figure 1 |
E-PG neurons stably represent heading in different visual environments.
a, Central complex. EB: ellipsoid body, PB: protocerebral bridge, BU: bulb, FB: fan-shaped body, NO: noduli, AOTU: anterior optic tubercle. Visual inputs to EB arrive from optic lobe through AOTU to ring neuron dendrites in BU[14,15]. b, Ring neurons (purple and green) project from BU to entire circumference of EB. Compass neurons (solid gray arrows) innervate single EB wedges. Dashed arrows, P-EN neurons (angular velocity). Small blobs in EB, synapses between ring and compass neurons. See ref[34] for circuit details. c, Fictive sample receptive fields (red: excitatory, blue: inhibitory) of two ring neurons (purple and green in b) shown in flattened representation of visual field (gray rectangle). Vertical stripe presented in visual arena activates green ring neuron. d, Imaging setup. e, Tethered flying fly. f, EB segmented into 16 regions of interest (ROIs). g, Population vector average (PVA) of ΔF/F0 computed to obtain angular position and amplitude of compass neuron activity bump. h, Compass neuron calcium transients during closed-loop tethered flight in visual environment derived from natural scene (top), ‘forest’ (‘F’). Middle, actual scene presented on blue LED arena with discretized brightness. Snapshots of compass neuron activity in EB at times, t1 and t2, corresponding to different scene orientations. Bottom, ΔF/F0 of 16 ROIs over time. Grayscale band, PVA amplitude. Red line, scene orientation. GCaMP signal color coded in blue. Black line, PVA. i, Calcium transients from fly in h in different scene (top), ‘open space’ (‘O’). j, Distribution of mean pinning offset across flies. Offset distribution for ‘O’ is significantly different from uniform for unknown reasons (O: 39 trials, 10 flies, unimodality test by randomization, p<0.0001; F: 40 trials from 10 flies, p=0.3603).
Optogenetic remapping of heading representation
To explore the flexibility of the fly’s heading representation, we used two-photon calcium imaging to monitor compass-neuron population responses in head-fixed flies flying in a virtual reality (VR) arena consisting of light-emitting-diode (LED) panels. The VR setup gave the insect one-dimensional (1D) closed-loop control of its orientation[33] relative to visual scenes (Fig. 1d–g; see Methods). Visual environments were derived from two different natural scenes (Fig. 1h, i). The compass-neuron response in these scenes rapidly stabilized into an activity bump in the EB that maintained a consistent angular relationship to the visual scene as the fly turned (Fig. 1h, i). Previous studies in simpler visual settings, such as a single stripe, have shown that the bump tracks the visual scene but with an offset between the angular position of the bump in the EB and the angular orientation of the stripe relative to the fly. This ‘pinning offset’ between the bump and visual cues (see Methods) seldom changes across trials for a given fly in a specific visual setting, but differs across flies[3,33-35]. We found that the pinning offset also varied significantly across different naturally derived scenes for a single fly and across flies for the same scene (Fig. 1j). We argue that this variable but stable offset is the natural outcome of plasticity in synapses that flexibly ‘map’ different visual scenes onto the heading representation.If activity-dependent plasticity between visual inputs and compass neurons underlies the observed variability in offset (Fig. 1j), experiencing an imposed artificial relationship between the scene and the bump should induce a sustained change in offset (as proposed for mammalian navigation systems[17,18]). In a previous study of tethered flying flies, we used two-photon-localized optogenetics to temporarily displace a compass-neuron bump in the EB by an arbitrary angle[33]. Here, as previously, the original bump (Fig. 2a, d top) was quickly replaced by a displaced bump generated by focal optogenetics (Fig. 2b; Extended Data Fig. 1a). We then paired this artificial bump with an open-space scene (Fig. 1i) placed at a predetermined angular position in the arena relative to the bump (Fig. 2b, d middle; Supplementary Video 1). We repeatedly shifted the artificial bump through eight positions around the EB while simultaneously shifting the scene around the visual arena to maintain its fixed angular relationship to the imposed bump (Fig. 2b, d middle). A five-minute pairing protocol was sufficient to change the offset, and the newly imposed relationship between the visual scene and the compass-neuron bump was clearly preserved in subsequent closed-loop probe trials (Fig. 2c, d bottom, Extended Data Fig. 1f, h, l). Such remapping could also be induced with simpler visual scenes (e.g., a single stripe, Extended Data Fig. 1b, e, g, i, m), but not without the optogenetic reagent or in darkness (Extended Data Fig. 1j, k, n, o). Thus, we find strong experimental support for plasticity that allows visual surroundings to be flexibly remapped onto the compass neuron population upon sustained experience of a specific angular relationship between the bump and the scene.
Figure 2 |
Manipulation of heading representation pinning offset.
a-d, Activity snapshots of compass neurons before (a), during (b) and after (c) optogenetic manipulation in open loop (imposed natural scene orientations at top, with vertical red lines emphasizing relative orientations). See Extended Data Fig. 1a for optogenetic stimulation protocol. a, Original pinning offset (arrow in d shows time of this snapshot). b, Optogenetic imposition of new offset. (i) Left, bump imposed on left side of EB (below, red rectangle) when scene oriented as at top. Right, 45° counter-clockwise rotated scene and bump with offset as in left. (ii) Sequence of optogenetically imposed EB offsets (see d middle, Methods). (iii) Expanded view of same sequence. c, After manipulation. Bump position relative to same visual scene orientation as in a shifted by offset imposed in b (compare d top and bottom). d, Compass neuron activity before (top), during (middle), and after (bottom) optogenetic manipulation. See Supplementary Video 1. e, Simulation snapshots. Time-varying synaptic weights between ring and compass neurons (see Extended Data Fig. 2). Simulation begins with random synaptic weights (left). Synapses between coactive ring and compass neurons weakened. Synapses from inactive ring to active compass neurons potentiated (see Supp. Info. for different plasticity rules). Weight matrix stabilizes over time (right). See Supplementary Video 2. Vertical purple rectangle, sample mapping from ring neuron #16 to all compass neurons. f, Simulated compass neurons when ring neuron #16 is active. g, Distribution of bump offsets across 500 simulations. h, Simulated optogenetic bump shift. Left, weight matrix before manipulation. Second and third from the left, new map develops while existing map weakens. Right two panels, consolidation of new map during probe trial. Dashed red rectangle, initial synaptic weights from ring neuron #9 to compass neurons. Solid red rectangle, same weights after consolidation; offset shifted.
Extended Data Figure 1 |
Manipulation of pinning offset of visual scene relative to heading representation.
a, Schematic: simultaneous calcium imaging and localized optogenetic stimulation. b-d, Snapshots of compass neuron population activity before, during and after optogenetic manipulation in open loop (orientations of imposed single-stripe visual scene shown at top). b, Bump offset close to zero before optogenetic manipulation (arrow in e shows time of this snapshot). c, Optogenetic imposition of new offset. Left, when vertical stripe is in front of fly, bump was imposed on right side of EB (rectangle). Right, 45° rotated scene and bump with same offset as shown at left. This offset was sequentially imposed across 8 positions of visual scene and EB for approximately two seconds per position for five minutes (see e middle). d, Snapshot of compass neuron calcium transients after manipulation (see e bottom). Note that bump position relative to same visual scene as in b is now shifted by offset imposed in c. e, 60-second segments of imaging before (top), during (middle), and after (bottom) a 5-min optogenetic manipulation. Convention same as in Fig. 1. f: Bootstrapped distribution of the mean difference between the imposed and actual offset shifts in Fig. 2 (natural scene), which was not significantly different from zero (19 trials from 10 flies, bootstrapped mean difference test, two-sided, p=0.6276). g, Bootstrapped distribution of the mean difference between the imposed and actual offset shifts in b-d (single stripe), which was not significantly different from zero (25 trials from 14 flies, two-sided, p=0.8932). h-k, Distribution of imposed (x-axis) versus actual (y-axis) offset shifts across flies. Distribution is significantly linear along the identity line (circular linearity test; h, natural scene, 19 trials from 10 flies, p<0.0001; i, single stripe, 25 trials from 14 flies, p<0.0001; j, no CsChrimson, 14 trials from 10 flies, p=0.0934; k, in darkness, 17 trials from 10 flies, p=0.6064). l-o, Absolute change in offset across two trials before manipulation (blue) and across two trials after manipulation (yellow), and absolute change in offset induced by manipulation (red). Bootstrapped mean difference tests, one-sided. n same as h-k. l, Natural scene, bootstrapped mean difference test between epochs before and during manipulation, p=0.0464; between epochs during and after manipulation, p=0.0024. m, Single stripe, bootstrap tests of the mean difference showed significant difference between baseline offset shifts and manipulated offset shifts (p=0.0207 between epochs before and during manipulation; p=0.0252 between epochs during and after manipulation). n, No CsChrimson control, bootstrap tests of the mean difference did not show any significant difference; p>0.05 for all pairs. o, Darkness control, bootstrap tests of the mean difference did not show any significant difference; p>0.05 for all pairs. Baseline offset shifts were comparable to experimental group (m), but greater than control group without CsChrimson (n). This suggests that baseline offset variance in experimental group might be due to higher baseline activity of compass neuron population induced by weak activation of CsChrimson during two-photon imaging.
Attractor model with plasticity creates a stable visual-motor compass
The experience-dependent remapping we observed (Fig. 2a–d), which involves co-activation of specific visual inputs and compass neurons, is strongly suggestive of Hebbian plasticity, which has been hypothesized to explain how mammalian head direction cells tether to visual cues[17,18]. We built an anatomically-motivated circuit model to better understand the impact of such a plasticity mechanism on scene-to-bump remapping. The key components of the model are (Fig. 2e–h, see Supplementary Information for implementation details): (i) visual ring neurons that distribute visual feature information to all compass neurons throughout the EB[13-15,36] (Fig. 1b, c, Fig. 2f) —for simplicity, we treat ring neuron RFs as only encoding azimuthal information, ignoring the 2D spatiotemporal complexity of their responses[14] (but see Fig. 5); (ii) ring attractor dynamics, a form of all-to-all competitive network dynamics that ensure a single compass-neuron bump that can remain active in darkness[33-35]; (iii) a plasticity rule whereby co-activation of GABA-ergic inhibitory ring neurons and compass neurons results in a depression of the synaptic weight between them[37] (‘inhibitory’ Hebbian plasticity[17-21]) while activation of compass neurons alone results in potentiation (see Supplementary Information for alternative plasticity rules). In the model, which shares some conceptual similarities with recent models of mammalian head direction cells[20] and grid cells[22], the fly’s turns cause a retinotopic shift of the visual stimulus, activating a different set of ring neurons, and angular velocity signals carried by so-called P-EN neurons[34,35] (Fig. 1b, dotted lines) rotate the compass-neuron bump. For a stable heading representation, visual-input-driven and angular-velocity-driven bump positions should be in register. That is, for any given heading, plasticity should ensure that inhibitory ring neurons create a position of decreased inhibition in the EB that coincides with where the P-EN input moves the bump —essentially a self-consistent mapping of visual cues onto the bump.
Figure 5 |
Stability of bump dynamics is predicted by two-dimensional information in visual scenes.
a, Four natural scenes (‘F’, forest, Fig. 1h; ‘O’, open field, Fig. 1i; ‘D’, dense forest; ‘B’, bush), downsampled and discretized. Two artificial scenes with same local features at same (‘SE’) and different elevations (‘DE’). b, Circular variance of instantaneous pinning offset with natural scenes (4 repetitions of two scenes per fly, 40 trials from 10 flies for each condition, see Methods). Bump reliably tracked orientation of forest and open-space scenes (indicated by low circular variance; F: mean=0.2771, 95% CI=[0.2231, 0.3344], O: mean=0.2180, 95% CI=[0.1616, 0.2828]). Tracking poor (high circular variance) for dense-forest and bush scenes (D: mean= 0.5163, 95% CI= [0.4557, 0.5752], B: mean= 0.5528, 95% CI= [0.4893, 0.6135]). Bootstrap tests of difference in mean circular variance between each pair of scenes showed significant difference across all pairs (two-sided, p<0.0001) except between dense-forest and open-space scenes (two-sided, p=0.169), and between dense-forest and bush scenes (p=0.406). c, Circular variance of instantaneous pinning offset within artificial scenes SE and DE (4 repetitions of both scenes per fly, 40 trials from 10 flies, see Methods). Offset stable (low circular variance) for different-elevation scene (mean=0.1212, 95% CI=[0.1046, 0.1392]), but not for same-elevation scene (mean=0.7521, 95% CI=[0.6937, 0.8045]). Mean circular variance between scenes significantly different (two-sided bootstrap test, p<0.0001). d, 2D autocorrelation of natural scenes. e, 1D and 2D autocorrelation of artificial scenes SE and DE. Note the identical 1D autocorrelation but different 2D autocorrelation.
We first tested the model for a simple scene with a single vertical stripe (Extended Data Fig. 1b–e), simulating the fly turning through the scene (Fig. 2e–g, Supplementary Video 2; see Extended Data Fig. 2a–c for a complex scene). These rotations ensured both that the bump traveled around the EB and that ring neurons corresponding to all visual feature positions were selectively co-activated at appropriate angular orientations. Starting with random synaptic weights, Hebbian plasticity produced a spatially consistent mapping and stable offset between the heading representation and the angular position of the single visual feature (Fig. 2e). Simulating optogenetic manipulation as current injection into model compass neurons reproduced the remapping phenomenon (Fig. 2h, Extended Data Fig. 2d, e). These results account for the varying offsets observed across flies[3], the persistence of an offset for a given scene in a single fly, and the flexibility that allows the EB to track heading within different visual scenes.
Extended Data Figure 2 |
Simulation – Mapping of a complex scene onto stable heading representation and optogenetic bump offset shifting.
a, A complex one-dimensional scene was generated via a mixture of four von Mises functions with random mean directions and random concentration parameters. Shown for t=0. b-c, Model simulation. Ring neuron population activity (b top) serves as the assumed source of visual input. Time series of angular velocity obtained from tethered flight data was used to compute movement of visual scene. b bottom, compass neuron population activity during simulated orientation. c, Time-varying synaptic weights between ring and compass neurons. Simulation began with random synaptic weights (left) and random initial activity of compass neuron population. Ring attractor dynamics ensure a stable bump, albeit with random offset. Initial turning of bump not enforced by visual cues but by angular velocity signal from tethered flight data. Same 400-second turning signal repeated three times (see Supplementary Information). Synaptic weights stabilize over time (c, right). Note that after learning, a vertical cross-section of stabilized synaptic weight matrix resembles model ring neuron activity profile shown in a. d, Simulation of optogenetic shift in offset. Simulation began with the stable mapping shown in c. e, During probe trial, newly mapped offset was consolidated. Note that all simulation results shown are based on a post-synaptically gated plasticity rule unless otherwise stated. See Extended Data Fig. 5 and 6, and Supplementary Information for differences in predictions made by post- and pre-synaptically gated plasticity rules.
Optogenetic inversion of scene-to-heading mapping
In further simulations, the natural concurrence between scene movement and bump position during turns could be inverted, with visual cues overriding self-motion input to drive the bump ‘backwards’ (Fig. 3a, b). In optogenetic offset-induction experiments, we found that the actual network was indeed flexible enough to induce an inverted remapping in which visual input drove the bump around the EB in the opposite direction than would be expected (Fig. 3c, d, Supplementary Video 3). In the model, the inversion was eventually corrected after prolonged self-motion-driven ring attractor dynamics (Fig. 3b, rightmost panel), but the short trial duration in our physiological experiments likely limited our ability to observe such a correction in vivo. Thus, although self-motion exerts a strong influence over bump movement, network plasticity allows for a strong and remarkably flexible driving role for visual cues.
Figure 3 |
Optogenetically imposed inverse mapping of visual scene onto compass neurons
a, Inverse mapping protocol, in which stripe is angularly displaced opposite to optogenetic bump displacement. b, Simulation of inverse mapping. Inverse mapping complete after 864 s, and maintained during initial period of probe trial (left panel under ‘PROBE’). Sustained angular velocity input eventually corrects map in simulations (right panel under ‘PROBE’). c, 60 s segments of in vivo calcium transients before (top), during (middle), and after (bottom) 10-minute manipulation. Before manipulation, bump followed direction of stripe motion (top). After manipulation, bump motion mirrors stripe motion but in opposite angular direction (bottom). Also see Supplementary Video 3. d, Circular variance (CV) of bump offset during probe trial computed for normal arrangement of EB ROIs (‘normal’), and for inverse arrangement of EB ROIs (‘inverse’). 4 out of 8 flies tested showed smaller CV for inverted arrangement of EB ROIs (white dots), indicating that map was indeed inverted. Poor bump tracking, resulting from incomplete map manipulation, observed in one fly, resulting in intermediate CVs for both maps (black solid dots). Gray solid dots, three flies maintained correct map.
Remapping after experience of an ambiguous scene
Ring attractor dynamics ensures a single heading representation at any given time even for complex scenes, but under some circumstances this can be unstable[4]. For example, a scene with two identical stripes at diagonally opposite locations (Extended Data Fig. 3) makes orientation within the scene inherently ambiguous[3]. Our model predicts that, upon prolonged exposure to the two-stripe scene, the plasticity mechanism creates a visual map with two potential offset angles. If a single stripe scene is then presented, this results in two competing heading representations, with the ring attractor network selecting one of the them at any particular time (Extended Data Fig. 3b, c). We found a similar effect experimentally in some probe trials after just five minutes of in vivo closed-loop experience with a two-stripe scene in the absence of any optogenetic manipulation (Extended Data Fig. 3d–i, Supplementary Video 4). In a companion study[38], Fisher et al. find electrophysiological and imaging signatures of offset switches in a larger fraction of experiments after walking flies experience such ambiguous scenes for longer durations. These results demonstrate how exposure to an ambiguous visual scene can, through the interactive influence of plasticity and ring attractor dynamics, affect the reliability of an otherwise stable heading representation.
Extended Data Figure 3 |
Bump dynamics after a closed-loop two-stripe manipulation.
a-c, Simulation of time evolution of synaptic weight matrix, induced by visual scene with two vertical stripes. Conventions same as in Extended Data Fig. 2. a, Simulation began with stabilized synaptic weight matrix shown in Fig. 2e. Visual input provided was two narrow von Mises functions, separated by 180°. Ring attractor dynamics ensure that compass neuron population maintains single bump. Over time, synaptic weight matrix develops two distinct bands of weak synapses (right panel) representing weakened connections from two active sets of ring neurons to a compass-neuron bump. b-c, When system is then presented with visual scene that has only one vertical stripe, there are two possible outcomes: ring attractor dynamics stabilize an offset that is either 180° shifted from original offset (b) or the same as original offset (c). d-i, Natural bump offset shifting with two identical vertical stripes (no optogenetic manipulation) separated by 165° in 330° arena. d-f, 60-second segments of compass neuron calcium transients before (d), during (e), and after (f) manipulation. Convention same as in Fig. 2d, except that red line represents position of either one (d, f) or two (e) stripes. Imaging snapshots shown in left panels were taken at times indicated with arrows beneath right panels. Bump offset shifted by 180° in f, relative to its position in e. Also see Supplementary Video 4. g, Distribution of absolute shift in offset measured across trials from all flies. Left, baseline variance; change in offset across two trials before manipulation. Right, baseline variance; change in offset across two trials after manipulation. Center, change in offset across two trials separated by a manipulation trial. In three cases (n=19), shift in offset was close to 180°. Note that unlike in simulations, in most two-stripe trials, the bump position covers only half of the EB because of the circular symmetry of the stimulus, which may underlie the apparently low yield of shifting (but see h and i; see Supplementary Information for further discussion). h, Number of bumps during initial 15 s of 16 trials that did not exhibit shift of 180° was significantly greater in trial immediately following manipulation trial (red) than in subsequent trial (blue) (bootstrap test of the mean difference, one-sided, p=0.0004), indicating that initial competition between two bumps eventually stabilizes to single bump. This implies that the manipulation trial generated two competing offsets. i, Deviation of bump offset during initial 15 s relative to average bump offset during last 30 s of same trial was also significantly greater in trial immediately following manipulation than in subsequent trial (bootstrap test of mean difference, one-sided p=0.0036), which is a natural consequence of a competition between two alternating bumps before one stabilizes.
Attractor-driven completion of a partial map in a novel setting
In our remapping experiments thus far, the fly performed multiple complete rotations to establish a stable heading representation in a novel setting, which seems unlikely under natural conditions. Drosophila can see nearly 320° of the visual scene from a single orientation[39] and the E-PG bump typically activates more than 90° of the EB[3], suggesting that even limited experience of a scene should trigger Hebbian plasticity that impacts a large sector of the EB. In the model, we found that full mapping of a visual scene could occur even if the bump was only rotated by 180° or less during optogenetic manipulation (Fig. 4a, b; Extended Data Fig. 4). We directly tested this prediction by imposing an angular relationship between a vertical stripe and an artificial compass-neuron bump, but, this time, limiting the range of bump positions to 180°. Indeed, we found that, in the majority of flies (6 of 10), experiencing this limited range of bump positions was sufficient to induce a stable heading that matched the imposed offset in the probe period of the trial (Extended Data Fig. 4d, e). We could successfully induce a full remapping of the single stripe scene in a few flies even in a more constrained situation in which the range of bump positions spanned only 60° (7 of 20 flies, Extended Data Fig. 4i, j, k). Further analysis revealed that successful remapping was more likely when the stripe and the bump started inside the newly mapped region in the probe trial, consistent with simulations (Extended Data Fig. 4f–h, j, k). This likely occurred because the internally-generated angular velocity signal could move the bump into regions not previously traversed while still preserving the new offset, thereby allowing the new heading representation to stabilize. We also observed full remapping after limited-angle exposure in experiments with a natural scene (Fig. 4a, c, d). These results provide insights into how Hebbian plasticity combined with ring attractor dynamics enables the fly to convert information gathered from limited views of a novel scene into a complete heading representation within that scene.
Figure 4 |
Experience of only 180° of rotation during optogenetic manipulation suffices to induce global remapping.
a, Experimental protocol in which optogenetic manipulation and experience of scene orientations span only 180°. b, Simulation of protocol with simple single-stripe scene. After manipulation (t = 840 s under ‘OPTO-STIM’): two sets of weak synapses (top-left & bottom-left); upper right corner of weight matrix completely erased. During probe trial, newly imposed offset propagated across entire weight matrix (‘PROBE’). c, 60-second segments of compass population calcium transients before (top), during (middle), and after (bottom) optogenetic manipulation spanning 180° of EB and using naturalistic scene as oriented in a. Compare offsets in top and bottom panels. d, Distribution of absolute offset shift across flies. Left, baseline before manipulation. Right, offset shift by manipulation (10 flies, two-sided bootstrap test of mean difference, * p=0.0002).
Extended Data Figure 4 |
Global offset shift by local optogenetic manipulation
Convention is the same as in Extended Data Fig. 2. a-e, Local optogenetic manipulation spanning 180°. a, Simulation begins with stabilized synaptic weight matrix shown in Fig. 2e. Over time, new map spanning 180° replaced approximately half of original map (right). Portion of synaptic weight matrix corresponding to visual orientations that were not presented was erased over time (upper right corner of right panel). b-c, After manipulation, two potential maps, original map and newly-imposed map, compete. Which map eventually stabilizes and strengthens depends on whether or not bump and stimulus begin in newly mapped region of EB in trial immediately following manipulation. d, Compass neuron calcium transients before (top), during (middle), and after (bottom) optogenetic manipulation spanning 180° of the visual scene and the EB. Convention same as in Fig. 2d. Compare offsets in the top and bottom panels. e, Distribution of absolute shift in offset, measured across flies. White dots: baseline before manipulation, Black dots: offset shift by manipulation (10 flies, bootstrapped mean difference test, one-sided, * p<0.0001). f-k, Local optogenetic manipulation spanning 60°. f, Simulation begins with stabilized synaptic weight matrix shown in Fig. 2e. Note that, over time, newly-imposed map replaces portion of original map, which spans more than 60° because of non-zero width (118° tail to tail) of bump (bottom right). g-h, After the manipulation, two potential maps, the original map and the newly imposed map, compete. After the epoch of manipulation, if the bump begins in the manipulated region (see t=0 of top b), the new map is likely to dominate and eventually strengthen. i-k, Optogenetic manipulation spanning 60° of the visual scene and the EB. i, 60-second segments of compass neuron population activity before (top), during (middle), and after (bottom) manipulation. Note that position of stripe (bottom) is not in manipulated domain, yet bump is shifted to optogenetically-imposed offset (compare offsets in the top and bottom panels). j, Left, data from 60°-span manipulation, after which a closed-loop probe trial begins with the stripe in position that was sampled during manipulation. Open dots, baseline variance of offset around mean, before manipulation. Solid blue dots, shift in offset induced by 60°-span manipulation. Across the population, the shift was significant (bootstrapped mean-comparison, one-sided, p<0.0013). Right, data from 60°-span manipulation, after which closed loop probe trial begins with stripe outside set of positions sampled during manipulation. Open dots, baseline variance. Solid red dots, shift in offset induced by manipulation. Note that the shift was only marginally significant across the population (bootstrapped mean-comparison, one-sided, p=0.012). Global extrapolation of local manipulation was facilitated when stripe began in manipulated positions in probe trial (*, binomial exact test p=0.0059; see Methods). k, Same data as j but re-categorized. Left, in probe trials, both bump and stripe began in position sampled during manipulation (4 out of 20 flies). All 4 flies showed great than 90° shift during probe trials. Right, all other conditions (16 out of 20 flies). Three out of sixteen flies showed greater than 90° shift. Facilitation of global extrapolation when both bump and stripe began in manipulated positions was significant (*, binomial exact test p=0.0012; see Methods).
Stability of heading representation in 2D visual scenes
Looking across all experiments, we observed that heading representations exhibit a varying degree of stability across different scenes (Fig. 5a, b). We wondered whether structure in the vertical dimension, typical for natural scenes and known to be encoded by visual ring neurons[13,14,40], could resolve potential ambiguities in scenes with repeating visual features in the horizontal dimension (for example, scene SE in Fig. 5a). Using artificial stimuli, we found that the bump reliably tracked the orientation of an artificial scene with four identical objects placed at different elevations, whereas it could not stably track when these objects were placed at the same elevation (Fig. 5c). This stability is well-predicted by how distinctly single-peaked the two-dimensional auto-correlation of each scene is (Fig. 5d, e). We conclude that the two-dimensional organization of a scene[13,14,40] contributes to the generation and stability of the pinning offset.Some insects are capable of snapshot-based navigation[31,32,41,42] in which stored visual scenes are recalled to drive scene-specific directional actions. Further analysis of our model indicated that multiple visual maps can be stored simultaneously if plasticity between visual ring neurons and compass neurons is pre-synaptically gated and the network has access to a rich ring neuron representation of visual scenes[15,36] (see Supplementary Information and Extended Data Fig. 5 and 6). Other spatially informative sensory inputs, including spectral[43], mechanical (for example, wind[44]), and olfactory cues[45], may also contribute to differentiating natural sensory environments.
Extended Data Figure 5 |
Deterministic offset difference between two artificial scenes with the same local feature but different two-dimensional organization.
See Supplementary Information for detailed discussion.
a, Compass neuron calcium transients measured during closed-loop tethered flight in an artificial scene, ‘arrangement A’ (‘A’). Convention is the same as Fig. 1h. b, Calcium transients from the same fly as in a, but with a different artificial scene, ‘arrangement B’ (‘B’). c, Distribution of mean offset of each trial, pooled across all flies (see Methods). Distributions of offsets relative to scene ‘A’ and ‘B’ were not significantly different from uniform (n=40 trials from 10 flies, unimodality test by randomization, p=0.0819 for ‘A’, p=0.1525 for ‘B’). Compare with Fig. 1j. d, Distribution of offset shifts between two trials. Distribution of offset shifts between two artificial scenes, measured across flies, was significantly different from uniform distribution (unimodality test by randomization, A→B, n=10 flies, p<0.0001; B→A, n=10 flies, p<0.0001). Shift in offset was similar across different encounters with same scene, indicating that offset was stable (unimodality test by randomization, A→A, n=10 flies, p=0.0001; B→B, n=10 flies, p=0.0004). Compare with Extended Data Fig. 6e. e, Parameter sweep to explore how 2D Gaussian filters of different standard deviations (S.D.) applied to the artificial scenes in a (arrangement A) and b (arrangement B) would affect shifts in offset between the two scenes. Filters represent simplified effect of ring neuron filtering of scenes. Shifts in offset should approximately match azimuthal shifts that would produce the best match (i.e., maximum 2D cross-correlation) between the filtered scenes. Each axis represents increasing S.D.s of the applied 2D Gaussian filter (see g). Point marked with red ‘X’ shown in f. f, 2D cross-correlation between two scenes in a and b after applying 2D Gaussian filtering with 15° S.D. (red ‘X’ in e). This filter size corresponds to a 30° full-width at half-maximum (FWHM) receptive field, which matches the average size of the minor axis of ellipses that fit ring neuron receptive fields[13,40]. Higher filter sizes up to 60° FWHM (average size of the major axis of elliptical fits of ring neuron receptive fields[13,40]) require similar azimuthal shifts to obtain a best match between the scenes (not shown in e). Note that azimuthal shift for best match for this range of filters is 165°, a half rotation of the scene on the visual arena, as observed in d. g, Scenes in a and b after applying Gaussian filtering with 15° S.D. h-i, Simulation of pre- and post-synaptically gated plasticity rules applied when model network is exposed to the two different filtered scenes shown in g. h, Evolution of synaptic weight matrix with a pre-synaptically gated plasticity rule. Top left, Initial random synaptic weight matrix from 8×32 ring neurons to one of 32 compass neurons. Top right, after exposure to scene ‘A’. Each compass neuron responds most to a ‘snapshot’ of the scene at a certain orientation. Second row, After exposure to scene ‘B’, a new ‘snapshot’ is mapped to the compass neuron heading representation. Note that the locations of top two horizontal bars in arrangements ‘A’ and ‘B’ overlap (red rectangles), which corresponds to a 165° shift in the 2D cross-correlation in e and f (or a 180° shift in the 360° arena in simulations). This deterministic offset shift results in the same pinning offset and a retrieval of the same heading representation as before when the scene is repeated later (bottom two rows). Third and fourth rows, repeated exposure to scene ‘A’ and ‘B’. Bottom two rows, retrieval of the original offset. i, Evolution of synaptic weight matrix with post-synaptically gated plasticity rule. The result is almost identical to h, given that all ring neurons and compass neurons are activated during simulation. j-k, Simulated offset shifts with pre- (i) and post-synaptically (j) gated plasticity rules. 100 simulations for each rule. Both pre- and post-synaptic rules reproduced the population data in d.
Extended Data Figure 6 |
Memory capacity of different plasticity rules.
a-d, Simulation of pre- and post-synaptically gated plasticity rules with simple 2D scenes. a, Initial random synaptic weight matrix from 2×32 ring neurons to one of 32 compass neurons. b, Two simple simulated scenes activate mutually exclusive ring neurons (‘T’, top ring neurons are active; ‘B’, bottom ring neurons are active). c, Evolution of synaptic weights for a pre-synaptically gated plasticity rule. Top left, initial random weight matrix before presenting scene ‘T’. Top right, after exposure to scene ‘T’, only synapses from active ring neurons (top row of ring neurons in e) were updated, while synapses from all other ring neurons (bottom row of ring neurons in e) remained intact. Second row, after exposure to scene ‘B’, ring neurons that were previously inactive became activated, and their synapses were updated. Third row, when scene ‘T’ was presented again, offset between scene orientation and bump position was same as when scene ‘T’ was first presented (see f). d, Evolution of synaptic weights for a post-synaptically gated plasticity rule. Note that synapses from inactive ring neurons are erased upon each encounter with a new scene. This would shift offset across two encounters of same scene if fly experiences a different scene between them. e, Population data from 10 flies. Distribution of offset shifts between two trials in Fig. 1h, i. Distribution of offset shifts between two different natural scenes, measured across flies, is not significantly different from uniform distribution (unimodality test by randomization, F→O p=0.489, O→F p=0.1504). Different encounters of same scene lead to similar, near-zero offset shifts, indicating stability of offset (unimodality test by randomization, F→F p=0.0035, O→O p<0.0001). f-g, Simulated offset shifts with pre- (f) and post-synaptically (g) gated plasticity rules. 100 simulations for each rule.
Discussion
We have shown how inhibitory Hebbian plasticity can rapidly transform visual feature information into an attractor-driven internal representation. Angular velocity input to the attractor converts an emerging mapping based on limited views of a scene into a complete and consistent heading representation, a potentially critical function in animal navigation. The induction of inverse maps emphasizes the remarkable flexibility of the system. A key issue that remains unresolved regards the nature of bump dynamics during translation in a 2D environment. Mammalian head direction cells are unaffected by translation[1], but our model suggests that the compass circuit tracks the angle between the fly’s orientation and an object in the visual scene without correcting for translation, potentially making it a ‘local’ compass. However, the plasticity we have identified required only a few minutes and may be even faster under natural conditions when the system can coopt an existing mapping from ring to compass neurons. In our simulations (data not shown), this timescale prevented nearby objects and transient stimuli —such as neighboring conspecifics that would not move coherently with the animal’s bearing— from being mapped, but tethered the compass to distant objects that moved coherently with the fly’s turns.The locus of plasticity is likely to be synapses between ring and compass neurons, an idea also favored by Fisher et al., who present electrophysiological evidence consistent with plasticity altering inhibitory visual inputs to individual compass neurons in their companion study[38]. At a synaptic and biophysical level, it remains to be seen how the Hebbian mechanism we have proposed relates to and interacts with other forms of plasticity such as STDP[46,47], or with plasticity-inducing mechanisms such as nitric oxide signaling in the EB[48], dopaminergic modulation, as seen in the fly mushroom body[37,49], or plateau potentials, as seen during remapping of hippocampal place cells[50].Our results support a model in which plasticity is constantly active to allow rapid adaptation to new settings, enabling the ring attractor to generate a single heading direction even in a complex environment. Such stable sensorimotor representations likely enable animals small and large to overcome transient uncertainties in their surroundings as they pursue diverse behavioral goals.
METHODS
Nomenclature
We follow an abbreviation convention agreed upon by most research groups working in the central complex[51]: For compass neurons[33], E (Ellipsoid Body) before ‘-’ represents predominantly spiny and putatively postsynaptic processes, and P (Protocerebral Bridge) and G (Gall) after ‘-’ represent predominantly bouton-like and likely presynaptic processes. Fully expanded, E-PG stands for PBG1–8.b-EBw.s-D/Vgall.b[51]. Similarly, P-EN neurons (Fig. 1), which arborize in the N (noduli), refer to PBG2–9.s-EBt.b-NO1.b neurons[51].
Terminology
In the manuscript, we use the term ‘heading representation’ to describe what the E-PG neurons encode. Note, however, that the representation often persists when a tethered fly is standing still on a ball[3] —that is, when it has no heading in a strict sense. Based on such data, we would define ‘heading’ as the angular orientation of the fly’s body-axis in a visual scene. Future experiments may well determine that E-PG neurons represent the head-direction of the fly, but all E-PG imaging experiments thus far, including those in this study, have been performed on head-fixed flies in tethered preparations, leaving this issue unresolved.
Fly stocks
Fly stocks were described previously[33,34]. Briefly, flies with either a codon-optimized UAS-GCaMP6f [52] or a recombinant of UAS-CsChrimson-mCherry-tag[53] and UAS-GCaMP6f or codon-optimized-UAS-GCaMP6f [52] were driven by split-GAL4[54,55] SS00096 from the Rubin lab. All experiments were performed with 6–10 day old female flies. Flies were randomly picked from their housing vials for all experiments. All flies were raised from the egg stage on standard cornmeal and soybean–based medium[56] or with additional 0.2 mM all-trans-retinal[53] for flies with CsChrimson.
Fly preparation for imaging during head-fixed flight
The procedure for fly preparation was described previously[33]. Briefly, flies were anaesthetized on a cold plate at 4°C. The front legs were removed and the proboscis was pressed into its head capsule and immobilized with wax to minimize brain movement. The fly was tethered at the tip of a tungsten wire and positioned under a custom-designed stainless-steel shim as previously described[13,57,58]. The back of the head capsule was kept nearly vertical to maximize exposure of the fly’s eyes to the surrounding LED arena. UV curable adhesive was used to fix the head under the shim, then the cuticle at the top of the head and fat cells were carefully removed and trachea were carefully pushed to the back of the brain to optically reveal the center brain.
Visual stimulation
Visual arena
The hardware was described previously[33]. Briefly, a female fly was placed at the center of the arena and visual stimuli were presented on a vertically placed cylindrical LED display[59] spanning 330° in azimuth and 60° in elevation. The display was covered with multiple layers of color filter to avoid excessive leak into a photon detector and a diffuser to avoid reflection[3,13,57]. The wingbeat amplitude of each wing was computed online by analyzing images acquired with a camera, using custom-built image analysis software written in MATLAB, similar to a previously described method[58]. The image acquisition rate of the camera was 119.2 Hz, which was slow enough to capture the full shadow of wings to compute the wingbeat amplitude. For closed-loop experiments, the gain was 5.1°/s for each degree of the difference between the left and right wingbeat amplitudes (ΔWBA) [60]. Air was manually puffed at the fly if it stopped flying. The data during this stalled period was excluded from analyses.
Stimuli
We used various visual stimuli. Natural scenes were derived from panoramic photographs taken at the Janelia Research Campus. Utilizing the full luminance resolution of the arena resulted in excessive leak into a photon detector even after multiple layers of filters, making it impossible to detect bump position, especially with extremely low laser power used for simultaneous imaging and optogenetic stimulation. Further, the level of light at full luminance was enough to activate CsChrimson in most flies. To reduce the light leak and undesired activation of CsChrimson, we downsampled and monochromatized natural scene photographs (Fig. 1h, i, 4a, and 5a) to four luminance levels close to a log scale (0, 2, 6, and 15). Other visual stimuli include a bright vertical stripe spanning 60° in elevation and 15° in azimuth (Fig. 3a, Extended Data Fig. 1b, 3b, 4d, and 4i), two bright vertical stripes 165° apart (Extended Data Fig. 3a), a random dot pattern of which each pixel is either maximum bright or dark, and patterns containing four small horizontal bars each spanning 30° in azimuth and 15° in elevation (Extended Data Fig. 5a, b). Note that all the stimuli used in this study were presented on a blue LED arena. We used a gray scale in the figures for visual clarity. To avoid a sudden luminance change that might induce a startle response in flies, the 30° arena gap behind the fly was stitched in all protocols to maintain overall luminance. Thus, when an object crosses the gap, it does not disappear but jumps across it.
Protocols
Optogenetic bump offset shift
An experiment (14 flies, Extended Data Fig. 1b–d, i, and m) began with a 1 min exposure to a closed-loop random dot stimulus (Trial 1). It was followed by three 1 min closed-loop single stripe trials (Trials 2–4), a 5 min optogenetic manipulation trial that imposes a fixed 90° offset between the bump and a scene (Trial 5), three 1 min closed-loop single stripe trials (Trial 6–8), another 5 min optogenetics trial with −90° offset (Trial 9), and two 1 min closed-loop single stripe trials (Trials 10–11). Each trial was followed by a 15 s dark trial before the next trial started. During optogenetic manipulation trials, eight positions in the EB, separated by 45° (with a visual stimulus of a corresponding offset), were sequentially stimulated, each of which took approximately 2–2.5 s. The initial position of the visual stimulus during closed-loop trials was random. Trial 2 was used for flies to establish a stable offset. Trials 3–4 and trials 7–8 were used to measure the baseline variability of the bump offset within a single fly before optogenetic manipulation. Trials 6–7 and Trials 10–11 were used to measure the baseline variability after optogenetic manipulation. Trials 4 and 6 were used to measure the effect of optogenetic manipulation in trial 5 (90° offset). Trials 8 and 10 were used to measure the effect of optogenetic manipulation in trial 9 (−90° offset). Control experiments (10 flies each) used the same order of trials except that either CsChrimson was not expressed (Extended Data Fig. 1j and n) or the stripe was not presented (Extended Data Fig. 1k, o) during manipulation trials. A natural scene was also tested (Fig. 2a–d, Extended Data Fig. 1f, h, and l). To increase statistical power, all data collected before or after the −90° protocol were rotated 180° and pooled with 90° protocol during analyses.
Bump offset shift with two vertical stripes
The order of trials was identical to optogenetic bump offset shift experiments, but, during manipulation trials, two stripes at opposite sides of the visual field (165° apart in the 330° arena) were presented under closed-loop control (Extended Data Fig. 3d–i). Trials 6 and 10 were used to measure the number of bumps and the bump offset variance for the initial 15 seconds after manipulation trials, and Trials 7 and 11 were used as control trials. 10 flies were tested.
Forced optogenetic inverse mapping
There were two 1-minute single stripe closed-loop trials followed by 10 minutes of an optogenetic inverse mapping trial and 2 minutes of a probe trial (Fig. 3). Consecutive trials were separated by a 3 s dark trial.
Natural scene protocols
Two 2 min closed-loop trials with a downsampled and monochromatized forest scene were presented (Trials 1–2). They were followed by two 2 min closed-loop trials with an open-space scene (Trials 3–4), and all 4 trials were repeated (Trials 5–8). All consecutive trials were separated by a 5 s dark trial. The initial scene orientation of each trial was random. Trials 2 and 5 were used to measure the offset shift between two forest scene trials separated by open-space scene trials. Trials 4 and 7 were used to measure the offset shift between two open-space scene trials separated by forest scene trials. Trials 2 and 3 were used to measure the offset shift during the transition from a forest scene to an open-space scene. Trials 4 and 5 were used to measure the offset shift during the transition from an open-space scene to a forest scene. 10 flies were tested (Fig. 1h, i, 5b and d). The whole protocol was repeated for another pair of less reliable natural scenes (‘dense forest’ and ‘bush’, Fig. 5a, b, and d). Finally, to address the relevance of 2D organization of the visual scene to the bump position computation, the same protocol was repeated with two scenes of 4 artificial objects: in each scene, four horizontal objects were presented with equal azimuthal separation and either the same or different elevations (Fig. 5a, c and e).
Bump offset shift with limited optogenetic manipulation
An experiment (Fig. 4, Extended Data Fig. 4) began with a 1 min closed-loop trial with a single stripe (Trial 1). It was followed by a 2 min closed-loop single stripe trial (Trial 2), a 30 s open-loop probe trial (Trial 3), a 5 min open-loop manipulation trial (Trial 4), a 30 s open-loop probe trial (Trial 5), a 2 min closed-loop trial (Trial 6), a 30 s open-loop probe trial (Trial 7), a 5 min open-loop manipulation trial (Trial 8), a 30 s open-loop probe trial (Trial 9), a 2 min closed-loop trial (Trial 10). All consecutive trials (except the probe trials following manipulation trials) were separated by a 3 s dark trial. The initial scene orientation of closed-loop trials was random. During Trial 2, the bump offset was roughly determined by visual inspection. Then a target offset was determined to be 180° away from this baseline offset and optogenetically imposed during manipulation trials. Three manipulation protocols were used (10 flies each). The first protocol (local protocol 1) spanned 60° of the EB, in which three positions separated by 30° were optogenetically stimulated. Each position was stimulated for 1.5 s-2.5 s in sequence. The probe trials were composed of the same visual stimuli used during optogenetics trials to measure the effectiveness of the optogenetic manipulation. The position of a stripe in closed-loop probe trials began at the middle of the range of stripe positions used during manipulation. The second protocol (local protocol 2) spanned 60° of the EB, in which three positions separated by 30° were optogenetically stimulated. Each position was stimulated for 1.5s-2.5s in sequence. During probe trials, two stripe positions (one at the center of the manipulated area and another 180° away from it) were repeatedly presented (each for 3 s) to probe the global effect of local manipulations. The position of a stripe in closed-loop probe trials was random. For further analysis, flies from the two protocols (1 and 2) were pooled (Extended Data Fig. 4j and k) and regrouped depending on the position of the bump and the stripe at the beginning of the probe trial. The last protocol (local protocol 3) spanned 180° of the EB (Extended Data Fig. 4d), in which eight positions separated by 22.5° were optogenetically stimulated. The same probe stimuli as local protocol 2 were used in addition to eight stripe positions separated by 45° to cover all orientations. The offset during probe trials was measured over the last 5 seconds. The last protocol was repeated with a natural scene (Fig. 4).The position of the pattern, wingbeat amplitudes, air-puffing signal, and two-photon frame trigger were all simultaneously collected using custom software written in MATLAB that utilized National Instrument data acquisition hardware.
Two-photon calcium imaging
Calcium imaging was performed using a custom built two-photon microscope[61]. We used a 40x objective (NA 1.0, 2.8mm WD) and a GaAsP photomultiplier tube (PMT). A Chameleon Ultra II laser tuned to 930 nm with a custom-built pulse compressor was used as the excitation source with a maximum power of 8 mW at the sample. We used the same saline as in previous studies[3] with adjusted calcium concentration at 2.0 mM. We imaged the EB over 6-plane volumes using a fast remote focusing technique[62], which was modified in-house, at a rate of 9.8 Hz volume rate (256×256 resolution, 58.8 Hz frame rate) with an equal spacing of 3–6 μm between individual scanning planes. The objective was tilted by 30° to enable imaging of the ellipsoid body with the fly’s head at a natural, vertical angle.
Two-photon optogenetic stimulation
The protocol used was largely along previously described lines[33], but differed in a few details. A single two-photon laser source was used for both imaging and optogenetic stimulation, by temporally modulating the laser power, which was implemented using the PowerBox feature in ScanImage[61] replacing the custom MATLAB software described in previous work[33] (Extended Data Fig. 1a). Increased two-photon efficiency due to a pulse compressor allowed a lower laser power for imaging and optogenetic stimulation than previously described[33]. For the calcium-imaging-only period, a maximum laser power of 2 mW was used for both forward and backward scanning phases. During optogenetic stimulation of CsChrimson, the laser power was kept the same except for the defined stimulation area only during the forward scanning phase, where a maximum laser power of 30 mW (typically 20 mW) was used. To prevent tissue damage, this laser power was manually adjusted during each trial to a minimal power that was sufficient to develop a bump at the site of stimulation. On average, the optogenetically induced GCaMP signal measured during backward scanning phase was 13.3% greater than the normal condition across flies (one-tailed paired-ttest, p=0.022) in the optogenetic bump-shifting experiment with a natural scene. This higher than natural activity was required to inhibit the naturally generated bump. However, two vertical-stripe protocol results indicate that plasticity can be induced at the natural activity level.
Data analysis
We used MATLAB for data analysis. To avoid bias, no statistical methods were used to predetermine the power and the sample size. The fixed-offset optogenetic experiment used 14 flies, and the forced optogenetic inverse mapping experiments relied on 8 flies. All other experiments were performed until data from 10 flies was collected.
Calculation of fluorescence changes
The background noise level was predetermined by measuring the oscillatory noise from the PMT. This level was then subtracted from all imaging data, and the data was half-rectified before further analysis. A running average intensity projection of a volume (6 planes) at a given time was computed for each pixel. Then, 16 ROIs were manually assigned, as previously described[33]. Next, time series for each ROI were obtained by taking the average of the fluorescence signal within the ROI at each point in time. For calcium imaging experiments without optogenetics, ΔF/F0 was computed using F0 as the mean of the lowest 10% of signals in each ROI. No further temporal smoothing was applied.
Population vector average (PVA) of a bump and its amplitude
As a simple measure of the bump position and strength, the PVA was computed as the weighted vector average across EB wedges, with the weight determined by the fluorescence level (ΔF/F0), and the vector determined by the position of each ROI in the EB. The amplitude of the PVA was determined as the length of the average vector. We used brewermap (S. Cobeldick, MathWorks file exchange) with a color scheme ‘blue’ from http://colorbrewer2.org/ to depict all PVA plots.
Calculation of the number of bumps
For each frame, a bump was defined as any contiguous set of ROIs with ΔF/F0 greater than a threshold value (defined in each frame to be the mean ΔF/F0 across ROIs + 1 s.d.)[3] (Extended Data Fig. 3h).
Offset between the estimated bump position and the pattern position, and offset deviation
For a given trial, the first 15 seconds were discarded, as were time points when the fly did not fly, which were determined by the wingbeat amplitude. The offset between the absolute scene orientation (to the experimenter) and the PVA estimate was calculated as the mean angular difference for the remaining time. The deviation was calculated as the circular variance. Note that the visual arena, covering 330°, was mapped to 360°, as was the position of the scene.
Analysis of optogenetic offset manipulation trials
The exact artificial offset imposed by optogenetic stimulation during manipulation trials was determined by the mean angular difference between the scene orientation and the PVA during optogenetic stimulation.
Circular linearity test
For the optogenetic manipulation protocol, the expected amount of offset shift was assumed to be the same as the artificially imposed amount of shift. The sum of absolute angular difference between these two values across flies was used as a test statistic. To obtain the null distribution, the observed amounts of shift were randomized across flies and the sum of absolute angular differences was calculated, all of which was repeated 10,000 times. The p-value was calculated by counting the number of outcomes from randomization that were smaller than the test statistic (Extended Data Fig. 1h–k).
Circular unimodality or circular asymmetricity test
We used this test to determine if a set of directional data was significantly unimodal or asymmetric. The circular variance of the data was used as a test statistic. Each data point was assigned a random direction sampled from a circularly uniform distribution, after which the circular variance was calculated. This random assignment procedure was repeated 10,000 times to generate a null distribution. The p-value was determined by the number of times when the circular variance was smaller than the test statistic (Fig. 1j, Extended Data Fig. 5c). Note that this method only reliably works for unimodal data and may generate false negative results for multi-modal data.
Bootstrap test of the mean difference
This test was used to establish the difference of means of two datasets when they did not satisfy the assumption of Gaussian distributions. The difference of means of two data sets was used as a test statistic. Two sets of data were pooled, random samples were assigned to each group either with (bootstrap) or without (randomization) replacement, and the difference of means of two groups were calculated. This process was repeated 10,000 times to generate the null distribution. The p-value was computed by counting the number of events whose outcome was greater than the test statistic (Extended Data Fig. 1l–o). Note that random sampling both with and without replacement generated similar p-values in all tests in our study.
Circular variance of pinning offset
The variance in pinning offset relative to each scene (Fig. 5b and c) was computed as the circular variance of the instantaneous pinning offset along the time of a single trial. Each fly experienced 4 repetitions of two scenes. For each scene, all trials were pooled across flies (total 40 trials each).
Circular variance of inverse map
The circular variance (CV) of the bump offset during the probe trial was calculated for both normally arranged EB ROIs and inversely arranged EB ROIs. If the CV of the latter was smaller than the former, the mapping from the visual scene orientation to compass neurons was determined to be inverted (Fig. 3d).
Binomial exact test
For Extended Data Fig. 4j; Baseline probability of flies shifting offsets by more than 90° is one out of seven if stripe starts outside manipulated positions (red dots). Assuming binomial sampling from this distribution, chance of six or more flies out of 13 shifting their offsets by more than 90° (blue dots) is p=0.0059. For Extended Data Fig. 4k; Baseline probability of flies shifting offsets by more than 90° is three out of sixteen if stripe or bump starts outside manipulated positions (red dots). Chance of all four flies shifting offsets by more than 90° (blue dots) assuming binomial sampling with a probability of 3/16 is p=0.0012.
Natural scene analysis
Each scene was smoothed with a 2D Gaussian filter with a standard deviation of 4 pixels (Extended Data Fig. 5e). Then the 2D autocorrelation of each scene was calculated (Fig. 5d). Each scene was tiled horizontally (three copies) and the top and the bottom were padded with zeros. Then, Matlab function xcorr2 was applied to this tiled scene and another scene representing the center of this tiled scene. The middle range of azimuth values of the outcome (corresponding to the azimuthal range of one scene within the tiled image) was finally normalized by the maximum value to obtain 2D autocorrelation. The 1D autocorrelation was obtained by first taking the average intensity of the smoothed scene over elevation, then applying xcorr between this 1D trace and a concatenated version of this trace, and finally normalizing by the maximum value. 2D cross-correlation was computed in the same way except xcorr2 was applied to two tiled scenes: one scene with three horizontal copies of itself padded at the top and bottom, and another scene without horizontal copies but padded at the top and bottom.
Manipulation of pinning offset of visual scene relative to heading representation.
a, Schematic: simultaneous calcium imaging and localized optogenetic stimulation. b-d, Snapshots of compass neuron population activity before, during and after optogenetic manipulation in open loop (orientations of imposed single-stripe visual scene shown at top). b, Bump offset close to zero before optogenetic manipulation (arrow in e shows time of this snapshot). c, Optogenetic imposition of new offset. Left, when vertical stripe is in front of fly, bump was imposed on right side of EB (rectangle). Right, 45° rotated scene and bump with same offset as shown at left. This offset was sequentially imposed across 8 positions of visual scene and EB for approximately two seconds per position for five minutes (see e middle). d, Snapshot of compass neuron calcium transients after manipulation (see e bottom). Note that bump position relative to same visual scene as in b is now shifted by offset imposed in c. e, 60-second segments of imaging before (top), during (middle), and after (bottom) a 5-min optogenetic manipulation. Convention same as in Fig. 1. f: Bootstrapped distribution of the mean difference between the imposed and actual offset shifts in Fig. 2 (natural scene), which was not significantly different from zero (19 trials from 10 flies, bootstrapped mean difference test, two-sided, p=0.6276). g, Bootstrapped distribution of the mean difference between the imposed and actual offset shifts in b-d (single stripe), which was not significantly different from zero (25 trials from 14 flies, two-sided, p=0.8932). h-k, Distribution of imposed (x-axis) versus actual (y-axis) offset shifts across flies. Distribution is significantly linear along the identity line (circular linearity test; h, natural scene, 19 trials from 10 flies, p<0.0001; i, single stripe, 25 trials from 14 flies, p<0.0001; j, no CsChrimson, 14 trials from 10 flies, p=0.0934; k, in darkness, 17 trials from 10 flies, p=0.6064). l-o, Absolute change in offset across two trials before manipulation (blue) and across two trials after manipulation (yellow), and absolute change in offset induced by manipulation (red). Bootstrapped mean difference tests, one-sided. n same as h-k. l, Natural scene, bootstrapped mean difference test between epochs before and during manipulation, p=0.0464; between epochs during and after manipulation, p=0.0024. m, Single stripe, bootstrap tests of the mean difference showed significant difference between baseline offset shifts and manipulated offset shifts (p=0.0207 between epochs before and during manipulation; p=0.0252 between epochs during and after manipulation). n, No CsChrimson control, bootstrap tests of the mean difference did not show any significant difference; p>0.05 for all pairs. o, Darkness control, bootstrap tests of the mean difference did not show any significant difference; p>0.05 for all pairs. Baseline offset shifts were comparable to experimental group (m), but greater than control group without CsChrimson (n). This suggests that baseline offset variance in experimental group might be due to higher baseline activity of compass neuron population induced by weak activation of CsChrimson during two-photon imaging.
Simulation – Mapping of a complex scene onto stable heading representation and optogenetic bump offset shifting.
a, A complex one-dimensional scene was generated via a mixture of four von Mises functions with random mean directions and random concentration parameters. Shown for t=0. b-c, Model simulation. Ring neuron population activity (b top) serves as the assumed source of visual input. Time series of angular velocity obtained from tethered flight data was used to compute movement of visual scene. b bottom, compass neuron population activity during simulated orientation. c, Time-varying synaptic weights between ring and compass neurons. Simulation began with random synaptic weights (left) and random initial activity of compass neuron population. Ring attractor dynamics ensure a stable bump, albeit with random offset. Initial turning of bump not enforced by visual cues but by angular velocity signal from tethered flight data. Same 400-second turning signal repeated three times (see Supplementary Information). Synaptic weights stabilize over time (c, right). Note that after learning, a vertical cross-section of stabilized synaptic weight matrix resembles model ring neuron activity profile shown in a. d, Simulation of optogenetic shift in offset. Simulation began with the stable mapping shown in c. e, During probe trial, newly mapped offset was consolidated. Note that all simulation results shown are based on a post-synaptically gated plasticity rule unless otherwise stated. See Extended Data Fig. 5 and 6, and Supplementary Information for differences in predictions made by post- and pre-synaptically gated plasticity rules.
Bump dynamics after a closed-loop two-stripe manipulation.
a-c, Simulation of time evolution of synaptic weight matrix, induced by visual scene with two vertical stripes. Conventions same as in Extended Data Fig. 2. a, Simulation began with stabilized synaptic weight matrix shown in Fig. 2e. Visual input provided was two narrow von Mises functions, separated by 180°. Ring attractor dynamics ensure that compass neuron population maintains single bump. Over time, synaptic weight matrix develops two distinct bands of weak synapses (right panel) representing weakened connections from two active sets of ring neurons to a compass-neuron bump. b-c, When system is then presented with visual scene that has only one vertical stripe, there are two possible outcomes: ring attractor dynamics stabilize an offset that is either 180° shifted from original offset (b) or the same as original offset (c). d-i, Natural bump offset shifting with two identical vertical stripes (no optogenetic manipulation) separated by 165° in 330° arena. d-f, 60-second segments of compass neuron calcium transients before (d), during (e), and after (f) manipulation. Convention same as in Fig. 2d, except that red line represents position of either one (d, f) or two (e) stripes. Imaging snapshots shown in left panels were taken at times indicated with arrows beneath right panels. Bump offset shifted by 180° in f, relative to its position in e. Also see Supplementary Video 4. g, Distribution of absolute shift in offset measured across trials from all flies. Left, baseline variance; change in offset across two trials before manipulation. Right, baseline variance; change in offset across two trials after manipulation. Center, change in offset across two trials separated by a manipulation trial. In three cases (n=19), shift in offset was close to 180°. Note that unlike in simulations, in most two-stripe trials, the bump position covers only half of the EB because of the circular symmetry of the stimulus, which may underlie the apparently low yield of shifting (but see h and i; see Supplementary Information for further discussion). h, Number of bumps during initial 15 s of 16 trials that did not exhibit shift of 180° was significantly greater in trial immediately following manipulation trial (red) than in subsequent trial (blue) (bootstrap test of the mean difference, one-sided, p=0.0004), indicating that initial competition between two bumps eventually stabilizes to single bump. This implies that the manipulation trial generated two competing offsets. i, Deviation of bump offset during initial 15 s relative to average bump offset during last 30 s of same trial was also significantly greater in trial immediately following manipulation than in subsequent trial (bootstrap test of mean difference, one-sided p=0.0036), which is a natural consequence of a competition between two alternating bumps before one stabilizes.
Global offset shift by local optogenetic manipulation
Convention is the same as in Extended Data Fig. 2. a-e, Local optogenetic manipulation spanning 180°. a, Simulation begins with stabilized synaptic weight matrix shown in Fig. 2e. Over time, new map spanning 180° replaced approximately half of original map (right). Portion of synaptic weight matrix corresponding to visual orientations that were not presented was erased over time (upper right corner of right panel). b-c, After manipulation, two potential maps, original map and newly-imposed map, compete. Which map eventually stabilizes and strengthens depends on whether or not bump and stimulus begin in newly mapped region of EB in trial immediately following manipulation. d, Compass neuron calcium transients before (top), during (middle), and after (bottom) optogenetic manipulation spanning 180° of the visual scene and the EB. Convention same as in Fig. 2d. Compare offsets in the top and bottom panels. e, Distribution of absolute shift in offset, measured across flies. White dots: baseline before manipulation, Black dots: offset shift by manipulation (10 flies, bootstrapped mean difference test, one-sided, * p<0.0001). f-k, Local optogenetic manipulation spanning 60°. f, Simulation begins with stabilized synaptic weight matrix shown in Fig. 2e. Note that, over time, newly-imposed map replaces portion of original map, which spans more than 60° because of non-zero width (118° tail to tail) of bump (bottom right). g-h, After the manipulation, two potential maps, the original map and the newly imposed map, compete. After the epoch of manipulation, if the bump begins in the manipulated region (see t=0 of top b), the new map is likely to dominate and eventually strengthen. i-k, Optogenetic manipulation spanning 60° of the visual scene and the EB. i, 60-second segments of compass neuron population activity before (top), during (middle), and after (bottom) manipulation. Note that position of stripe (bottom) is not in manipulated domain, yet bump is shifted to optogenetically-imposed offset (compare offsets in the top and bottom panels). j, Left, data from 60°-span manipulation, after which a closed-loop probe trial begins with the stripe in position that was sampled during manipulation. Open dots, baseline variance of offset around mean, before manipulation. Solid blue dots, shift in offset induced by 60°-span manipulation. Across the population, the shift was significant (bootstrapped mean-comparison, one-sided, p<0.0013). Right, data from 60°-span manipulation, after which closed loop probe trial begins with stripe outside set of positions sampled during manipulation. Open dots, baseline variance. Solid red dots, shift in offset induced by manipulation. Note that the shift was only marginally significant across the population (bootstrapped mean-comparison, one-sided, p=0.012). Global extrapolation of local manipulation was facilitated when stripe began in manipulated positions in probe trial (*, binomial exact test p=0.0059; see Methods). k, Same data as j but re-categorized. Left, in probe trials, both bump and stripe began in position sampled during manipulation (4 out of 20 flies). All 4 flies showed great than 90° shift during probe trials. Right, all other conditions (16 out of 20 flies). Three out of sixteen flies showed greater than 90° shift. Facilitation of global extrapolation when both bump and stripe began in manipulated positions was significant (*, binomial exact test p=0.0012; see Methods).
Deterministic offset difference between two artificial scenes with the same local feature but different two-dimensional organization.
See Supplementary Information for detailed discussion.a, Compass neuron calcium transients measured during closed-loop tethered flight in an artificial scene, ‘arrangement A’ (‘A’). Convention is the same as Fig. 1h. b, Calcium transients from the same fly as in a, but with a different artificial scene, ‘arrangement B’ (‘B’). c, Distribution of mean offset of each trial, pooled across all flies (see Methods). Distributions of offsets relative to scene ‘A’ and ‘B’ were not significantly different from uniform (n=40 trials from 10 flies, unimodality test by randomization, p=0.0819 for ‘A’, p=0.1525 for ‘B’). Compare with Fig. 1j. d, Distribution of offset shifts between two trials. Distribution of offset shifts between two artificial scenes, measured across flies, was significantly different from uniform distribution (unimodality test by randomization, A→B, n=10 flies, p<0.0001; B→A, n=10 flies, p<0.0001). Shift in offset was similar across different encounters with same scene, indicating that offset was stable (unimodality test by randomization, A→A, n=10 flies, p=0.0001; B→B, n=10 flies, p=0.0004). Compare with Extended Data Fig. 6e. e, Parameter sweep to explore how 2D Gaussian filters of different standard deviations (S.D.) applied to the artificial scenes in a (arrangement A) and b (arrangement B) would affect shifts in offset between the two scenes. Filters represent simplified effect of ring neuron filtering of scenes. Shifts in offset should approximately match azimuthal shifts that would produce the best match (i.e., maximum 2D cross-correlation) between the filtered scenes. Each axis represents increasing S.D.s of the applied 2D Gaussian filter (see g). Point marked with red ‘X’ shown in f. f, 2D cross-correlation between two scenes in a and b after applying 2D Gaussian filtering with 15° S.D. (red ‘X’ in e). This filter size corresponds to a 30° full-width at half-maximum (FWHM) receptive field, which matches the average size of the minor axis of ellipses that fit ring neuron receptive fields[13,40]. Higher filter sizes up to 60° FWHM (average size of the major axis of elliptical fits of ring neuron receptive fields[13,40]) require similar azimuthal shifts to obtain a best match between the scenes (not shown in e). Note that azimuthal shift for best match for this range of filters is 165°, a half rotation of the scene on the visual arena, as observed in d. g, Scenes in a and b after applying Gaussian filtering with 15° S.D. h-i, Simulation of pre- and post-synaptically gated plasticity rules applied when model network is exposed to the two different filtered scenes shown in g. h, Evolution of synaptic weight matrix with a pre-synaptically gated plasticity rule. Top left, Initial random synaptic weight matrix from 8×32 ring neurons to one of 32 compass neurons. Top right, after exposure to scene ‘A’. Each compass neuron responds most to a ‘snapshot’ of the scene at a certain orientation. Second row, After exposure to scene ‘B’, a new ‘snapshot’ is mapped to the compass neuron heading representation. Note that the locations of top two horizontal bars in arrangements ‘A’ and ‘B’ overlap (red rectangles), which corresponds to a 165° shift in the 2D cross-correlation in e and f (or a 180° shift in the 360° arena in simulations). This deterministic offset shift results in the same pinning offset and a retrieval of the same heading representation as before when the scene is repeated later (bottom two rows). Third and fourth rows, repeated exposure to scene ‘A’ and ‘B’. Bottom two rows, retrieval of the original offset. i, Evolution of synaptic weight matrix with post-synaptically gated plasticity rule. The result is almost identical to h, given that all ring neurons and compass neurons are activated during simulation. j-k, Simulated offset shifts with pre- (i) and post-synaptically (j) gated plasticity rules. 100 simulations for each rule. Both pre- and post-synaptic rules reproduced the population data in d.
Memory capacity of different plasticity rules.
a-d, Simulation of pre- and post-synaptically gated plasticity rules with simple 2D scenes. a, Initial random synaptic weight matrix from 2×32 ring neurons to one of 32 compass neurons. b, Two simple simulated scenes activate mutually exclusive ring neurons (‘T’, top ring neurons are active; ‘B’, bottom ring neurons are active). c, Evolution of synaptic weights for a pre-synaptically gated plasticity rule. Top left, initial random weight matrix before presenting scene ‘T’. Top right, after exposure to scene ‘T’, only synapses from active ring neurons (top row of ring neurons in e) were updated, while synapses from all other ring neurons (bottom row of ring neurons in e) remained intact. Second row, after exposure to scene ‘B’, ring neurons that were previously inactive became activated, and their synapses were updated. Third row, when scene ‘T’ was presented again, offset between scene orientation and bump position was same as when scene ‘T’ was first presented (see f). d, Evolution of synaptic weights for a post-synaptically gated plasticity rule. Note that synapses from inactive ring neurons are erased upon each encounter with a new scene. This would shift offset across two encounters of same scene if fly experiences a different scene between them. e, Population data from 10 flies. Distribution of offset shifts between two trials in Fig. 1h, i. Distribution of offset shifts between two different natural scenes, measured across flies, is not significantly different from uniform distribution (unimodality test by randomization, F→O p=0.489, O→F p=0.1504). Different encounters of same scene lead to similar, near-zero offset shifts, indicating stability of offset (unimodality test by randomization, F→F p=0.0035, O→O p<0.0001). f-g, Simulated offset shifts with pre- (f) and post-synaptically (g) gated plasticity rules. 100 simulations for each rule.
Authors: Basil el Jundi; Eric J Warrant; Marcus J Byrne; Lana Khaldy; Emily Baird; Jochen Smolka; Marie Dacke Journal: Proc Natl Acad Sci U S A Date: 2015-08-24 Impact factor: 11.205
Authors: Ysabel Milton Giraldo; Katherine J Leitch; Ivo G Ros; Timothy L Warren; Peter T Weir; Michael H Dickinson Journal: Curr Biol Date: 2018-08-30 Impact factor: 10.834
Authors: Aljoscha Nern; Arthur Zhao; Mai M Morimoto; Edward M Rogers; Allan M Wong; Mathew D Isaacson; Davi D Bock; Gerald M Rubin; Michael B Reiser Journal: Elife Date: 2020-11-18 Impact factor: 8.140
Authors: Volker Hartenstein; Mark A Frye; Ben J Hardcastle; Jaison J Omoto; Pratyush Kandimalla; Bao-Chau M Nguyen; Mehmet F Keleş; Natalie K Boyd Journal: Elife Date: 2021-03-23 Impact factor: 8.140
Authors: Feng Li; Jack W Lindsey; Elizabeth C Marin; Nils Otto; Marisa Dreher; Georgia Dempsey; Ildiko Stark; Alexander S Bates; Markus William Pleijzier; Philipp Schlegel; Aljoscha Nern; Shin-Ya Takemura; Nils Eckstein; Tansy Yang; Audrey Francis; Amalia Braun; Ruchi Parekh; Marta Costa; Louis K Scheffer; Yoshinori Aso; Gregory Sxe Jefferis; Larry F Abbott; Ashok Litwin-Kumar; Scott Waddell; Gerald M Rubin Journal: Elife Date: 2020-12-14 Impact factor: 8.140