Non-preferred contrast responses in the Drosophila motion pathways reveal a receptive field structure that explains a common visual illusion

Diverse sensory systems, from audition to thermosensation, feature a separation of inputs into ON (increments) and OFF (decrements) signals. In the Drosophila visual system, separate ON and OFF pathways compute the direction of motion, yet anatomical and functional studies have identified some crosstalk between these channels. We used this well-studied circuit to ask whether the motion computation depends on ON-OFF pathway crosstalk. Using whole-cell electrophysiology we recorded visual responses of T4 (ON) and T5 (OFF) cells and discovered that both cell types are also directionally selective in response to non-preferred contrast motion. We mapped T4s’ and T5s’ composite ON-OFF receptive fields and found they share a similar spatiotemporal structure. We fit a biophysical model to these receptive fields that accurately predicts directionally selective T4 and T5 responses to both ON and OFF moving stimuli. This model also provides a detailed mechanistic explanation for the directional-preference inversion in response to a prominent visual illusion, a result we corroborate with electrophysiological recordings and behavioral responses of flying flies.


Introduction 28
In both invertebrate and vertebrate visual systems, neuronal signals bifurcate into parallel 29 pathways that preferentially encode luminance increments (ON) or luminance decrements (OFF) 30

T4 and T5 neurons have a similar structure to their non-preferred contrast receptive fields 124
To uncover the mechanism for generating directionally selective responses to NC stimuli in T4 125 and T5 cells, we mapped the 'static' receptive fields of both cells. Since our moving bar stimuli 126 are composed of discrete steps (determined by the display's LED size), we can decompose them 127 into bar flashes presented at each position along the movement trajectory for the duration of a 128 single step (Fig. 1A). We presented bar flashes to T4 and T5 cells with long inter-stimulus 129 intervals randomized for contrast (bright and dark), position along the PD-ND axis, width, and 130 duration, such that they provided no motion information. 131 132 The PC receptive field, which maps responses to bright stimuli in T4 and dark stimuli in T5, has 133 the same overall structure previously reported [30] depolarizing responses on the leading side 134 of the receptive field growing towards the center, while responses on the trailing side of the 135 receptive field display rapid depolarization followed by sustained hyperpolarization (Fig. 2A). 136 The NC receptive field structure is distinct from the PC receptive field yet remarkably similar 137 between T4 and T5 ( Fig. 2A). For both T4 and T5, we find that NC depolarizing responses are 138 shifted towards the trailing side, while NC hyperpolarizing responses are shifted towards the 139 receptive field center (defined by PC responses; Fig. 2A,B). Although this receptive field 140 structure is most evident in responses to long duration flashes of wide bars, it is also measured 141 (with reduced magnitude) in responses to narrower bars ( Fig 2C). Since the difference between 142 moving bar responses to NC and PC stimuli hinted at different underlying mechanisms (Fig. 1E), 143 we highlight three features of NC flash responses that differentiate them from PC responses yet 144 are common to both T4 and T5. 145 146 The first feature is prominent in the receptive field center NC responses that exhibited a strong 147 hyperpolarization aligned to stimulus onset ( Fig. 2A, first vertical line in each panel) and a 148 depolarization following stimulus offset (second vertical line). The offset of a dark flash is 149 accompanied by a luminance increment which is expected to evoke a depolarizing response in 150 T4s; likewise, the bright flash offset is a luminance-decrement, the preferred stimulus for T5s. 151 However, we find that the onset of these stimuli (signaling a luminance change opposite to the 152 preferred one for each cell type) also evoked substantial responses. In response to NC bar onset, 153 5/53 T4 and T5 were hyperpolarized in the receptive field center but depolarized on the trailing side. 154 The depolarization response rise times (Fig. 2D) for PC stimuli in both T4 and T5 are position-155 independent and follow stimulus onset (t = 0). Conversely, rise start times for NC stimuli 156 responses show a clear positional dependence: following stimulus offset on the receptive field 157 leading side and center, yet following stimulus onset on the trailing side (albeit slower than for 158 bright flashes, Fig. 2D). These results suggest specific interaction between ON and OFF signals, 159 with T4 receiving both depolarizing and hyperpolarizing inputs induced by luminance 160 decrements, and T5 receiving both depolarizing and hyperpolarizing inputs induced by 161 luminance increments. 162

163
The second common feature, hyperpolarization in response to NC flashes decayed faster than 164 hyperpolarization in response to PC flashes, is summarized for positions 0:2 (Fig. 2E). PC 165 responses can be modeled by a combination of a fast excitatory conductance and a slow 166 inhibitory one [29,30]. Consequently, the response decay time is likely dominated by the 167 persistent inhibitory conductance pulling the membrane potential down. Since the 168 hyperpolarization present in the NC flash at the receptive field center preceded the depolarizing 169 component, we deduce that this hyperpolarization wanes faster than the slower PC 170 hyperpolarization. These results suggest there are (at least) 2 separate sources of inhibition 171 affecting the receptive field structure, one in response to the onset of PC stimuli and one in 172 response to the onset of NC stimuli. 173

174
The third common feature of the NC responses is stimulus-duration-dependent offset 175 depolarization. In response to a short dark flash, T4 cells hyperpolarized during stimulus 176 presentation and then returned to baseline. When the same bar was presented for longer, its 177 disappearance evoked a strong depolarization (Fig. 2F, top). The dependence on stimulus 178 duration is not linear (Fig. 2G, paired sample t-test p < 0.001), and does not appear to rely on an 179 intrinsic mechanism (Fig. S1). In T5 cells a similar, but smaller, stimulus-duration dependence is 180 seen at the offset of a bright flash (Fig. 2F, bottom), exhibiting a weak sublinearity (Fig. 2G,  181 paired sample t-test p < 0.01). Both the offset responses and the input history dependence were 182 not found in our previous measurements of PC responses and were therefore not incorporated 183 into our previous models [29,30]. The T5-optimized model was fit using the identical architecture and accurately reproduces T5 250 responses to both bright and dark flashing bars at all positions (Fig. 3E). Since T5 prefer 251 luminance decrements, this model has Edec in the receptive field center and Idec towards the 252 trailing side (Fig. 3E, bottom). This asymmetric configuration generates a directional preference 253 for moving dark bars [30]. The spatial filter for Iinc is towards the leading side and generates the 254  For dark stimuli, the excitation peak precedes inhibition, while for bright stimuli the excitatory 273 conductance peaks in between the Iinc onset peak and the Idec offset peak (similar to results of the 274 T4-optimized model, Fig. S3, S4). For dark and bright PD bar motion, the peak membrane 275 depolarization results from the temporal separation between the inhibitory and the excitatory 276 9/53 conductances ( Fig. 3G, vertical gray lines). This simple mechanism makes clear predictions 277 about the range of stimulus speeds for which NC directionally selective responses can be 278 generated. Since the excitatory and inhibitory inputs that structure the T4 and T5 receptive fields 279 are understood to arise from physical circuit elements with fixed positions relative to each other 280 [9], the logic of E-I overlap in ND versus E-I separation in PD can only function within a 281 specific stimulus speed range. If a bar moves too fast, then E-I conductances will increase their 282 temporal overlap, if it moves too slow, ND responses will be more separated (Fig. S5)

Four-conductance model explains illusory motion percept 289
The mechanism we describe for generating directionally selective responses to NC moving bars 290 should require a trailing stimulus edge, since it provides the offset signal that drives the dominant 291 (PC) conductance pair. For the T5 example, Edec and Idec are the major conductances responding 292 to both PC and NC bar motion (Fig. 3G), but for NC bar motion, they respond to the trailing 293 edge delta input (capturing offset responses in Fig. 2A). To test this requirement, we recorded 294 and simulated T5 responses to dark and bright moving edges (see inset Fig. 4A; no trailing 295 luminance change, but a large return-to-baseline luminance change, lacking any directional 296 information, occurs when edge disappears). We again find that the model, simulated with the 297 same parameters as in Fig. 3, predicts the magnitude, dynamics and directional selectivity of the 298 measured T5 responses to moving dark edges (Fig. 4A, left). Both the recordings and the model 299 predictions show similar responses to a bright moving edge, featuring a prominent offset 300 depolarization when the edge disappears (Fig. 4A, right). Importantly, these offset responses do 301 not differentiate between the two directions. These results confirm our hypothesis that directional 302 selectivity to NC stimuli requires a trailing luminance-change boundary, and show that moving 303 PC, but not NC, edges drive directionally selective responses. 304 305 Can this model predict T4 and T5 responses to the specific ON-OFF combination that give rise 306 to the reverse-phi illusion? In standard 'phi' or apparent motion stimuli, discrete sequential edge 307 displacements are perceived as smooth motion in the direction of displacement (explains why 308 humans enjoy movies played at only 24 frames/second). In the reverse-phi motion illusion, 309 which has been documented in animals as diverse as flies [12], fish [15], and humans [11,33], 310 displacement is combined with contrast inversion (dark turns bright and vice versa) resulting in 311 motion perceived in the direction opposite to the displacement. T4 and T5 neurons have recently 312 been shown to exhibit inverted directional responses to reverse-phi [28]. Based on our detailed 313 characterization of T4 and T5 responses to bright and dark flashes, we asked whether the 314 directionally inverted response to reverse-phi could also be predicted by the receptive field 315 structure captured in our model. 316

317
A minimal version of reverse-phi illusory motion can be evoked by the sequential presentation of 318 two adjacent bars with opposite contrasts [12,28,34]. We presented an NC bar (dark for T4, 319 bright for T5) followed by an adjacent PC bar in multiple positions along each cell's receptive 320 field. Since the bar flashes appear sequentially, they signal directional information, and were 321 structure. Responses to leading-side stimuli had the same directional preference as to moving PC 327 bars, but responses showed an inverted directional preference for pairs that included trailing-side 328 positions (Fig. 4D). This directional preference inversion was largest for wider bars presented for 329 longer durations (Fig. 4D, S6). We used the T4-and T5-optimized models (same parameters as 330 in Fig. 3) to simulate responses to these NC-PC bar pairs and found they accurately predicted the 331 inversion in directional preference in both cells, including the specific relationship between the 332 inversion and receptive field positions (Fig. 4E). 333 334 Which aspects of the receptive field structure captured by our model account for this striking 335 inversion at the heart of the reverse-phi illusion? An NC bar (dark for example T4, Fig. 4F) in 336 the receptive field center evokes a strong inhibitory response (Idec). When followed by a PC bar 337 (bright for T4) on the trailing side, another strong inhibitory response is evoked (Iinc). So while 338 11/53 the bars "move" in the preferred direction, the response is strongly inhibited (Fig. 4F, top, 339 compare to Fig. 4B PD response -1 → 3). Conversely, when the dark bar first appears on the 340 trailing side it evokes an excitatory response (Einc) activated at stimulus offset. A subsequent 341 bright bar in the receptive field center evokes a strong depolarizing response (same Einc 342 conductance) due to the stimulus onset. Therefore, while the bars "move" in the non-preferred 343 direction, the net response is strongly excitatory (Fig. 4F, bottom, compare to Fig. 4B ND 344 response -1  3). The parsimonious model based on the high-resolution characterization of the 345 static receptive field predicts not only PC and NC moving bar responses (Fig. 3), but also 346 responses to moving edges (Fig. 4A), and the illusory response to PC-NC mixing reverse-phi 347 stimuli (Fig. 4D). 348 349 350

Behaviorally measured perception of reverse-phi stimuli corroborates model predictions 351
Since T4 and T5 cells are the majorif not exclusive -source of motion information in the fly's 352 visual system [35], we hypothesized that reverse-phi stimuli inducing stronger directional 353 preference reversal in T4/T5 should also evoke stronger reversal in the fly's behavioral response. 354 Tethered flying flies turn in the direction of a coherently rotating grating pattern, a reaction 355 known as the syn-directional optomotor response [36]. However, in the reverse-phi stimulus, a 356 contrast inversion appears at every motion step (Fig. 5A, inset), to which flies respond by turning 357 against the pattern's rotation [12]. The receptive field mapping ( presented tethered flies with gratings, comprised of bars with one of three widths, rotating at one 362 of three speeds. We presented both standard and reverse-phi versions of these patterns in both 363 directions. The spatial wavelength and rotation speed of the pattern are known to affect the 364 optomotor response [37,38]. Accordingly, we find that for the standard patterns rotating at 30°/s, 365 wider bars led to increased turning (Fig. 5B, black). Flying flies exhibited a robust reverse-phi 366 illusion, by turning in the direction opposite to the standard motion response, with a similar 367 effect of bar width: wider bars resulted in larger turns (Fig. 5B, red). The narrowest bar gratings 368 presented evoked weak turns to standard motion and almost no responses to reverse-phi motion 369 12/53 ( Fig. 5C, left). Suggesting that the rotating narrow-bar standard grating was perceived as a 370 modest level of motion, but the contrast inversions in the reverse-phi pattern were too weak to 371 invert the motion percept. Flies responded to the wider-bar, slower standard motion patterns with 372 reduced turning, but with increased opposite-direction turning to the corresponding reverse-phi 373 stimuli (Fig. 5C, right). This behavioral characterization of reverse-phi responses corroborate our 374 predictions from the electrophysiological measurements captured by our model: wider, slower 375 bars drive stronger responses from NC conductances (T4: Edec and Idec, T5: Einc and Iinc), which 376 are necessary for inverting the T4 and T5 directional preference. As a consequence, slower, In this study, we used whole-cell recordings from the directionally selective ON-preferring T4 383 cells and the OFF-preferring T5 cells and showed they also encode the motion direction of non-384 preferred contrast features (Fig. 1). We mapped their composite ON-OFF receptive fields and 385 revealed a structure that is common to both T4 and T5 (Fig. 2), suggesting that both cell types 386 receive direct, non-canonical inputs (T4 from OFF; T5 from ON). We proposed a unified model 387 architecture to capture this composite receptive field, and showed that this model accurately 388 predicts directionally selective responses to moving bars of either contrast (Fig. 3). The model, 389 with no further modifications, predicted the inversion in T4's and T5's preferred direction in 390 response to minimal reverse-phi motion, and also the specific receptive field locations where this 391 inversion was measured (Fig. 4). Finally, we measured behavioral turning of tethered flying flies 392 to reverse-phi motion and found strong evidence that the stimuli that evoked stronger NC 393 responses in T4/T5 (wider bars, longer durations; Fig. 2) also evoked stronger behavioral 394 inversion (Fig. 5). 395 396

Connecting our data-driven model to motion pathway circuitry 397
One important goal of systems neuroscience is to connect functional measurements and the 398 models developed to explain them with actual neural circuit mechanisms. The Drosophila 399 motion-detection circuit, with a fully reconstructed connectome, genetic access to many cell 400 13/53 types, and multiple functional studies of these cells, is an exciting system for making these 401 connections. Nevertheless, at present we cannot simply map specific model conductances to 402 inputs from specific upstream neurons. While both T4 and T5 neurons receive multiple PC-403 encoding excitatory inputs clustered around their dendritic central region [9,22] and functional 404 studies have shown these pre-synaptic neuron types to have different temporal and spatial filters 405 [20,24,25,39], we were able to model the PC depolarization in the receptive field center with a 406 single excitatory conductance. Similarly, we could model a single PC inhibitory conductance, 407 while connectomics studies have revealed at least three potential inhibitory inputs on the trailing 408 side of the T4 dendrite [9]. It appears that T4 and T5 responses may mask additional complexity 409 not yet uncovered, or their upstream inputs could interact (directly or indirectly) to produce 410 simpler downstream effects. 411

412
What are the sources of the NC-mediated hyperpolarization? The T4-optimzed model places this 413 conductance just to the leading side of the receptive field center, accounting for dark-flash 414 hyperpolarization. Mi9 depolarizes to dark stimuli [24,25], is glutamatergic [31], and therefore 415 likely inhibitory, and could contribute to this conductance. However, the synapses from this 416 columnar cell type are found at the distal-most (leading) edge of T4's dendrite [9], where we 417 measure minimal NC-mediated hyperpolarization (Fig. 2). Further, we find similar NC 418 hyperpolarization in our T5 measurements, but no source of NC inhibition has been described 419 among the major T5 inputs. These discrepancies suggests that the circuit function of Mi9 420 remains unresolved, and that there may be undiscovered sources of NC-mediated inhibition for 421 T4 and T5 neurons. Reconciling these model-circuit discrepancies will require better 422 characterization of the upstream input neurons and their influence on T4 and T5, benefitting 423 from perturbations using specific driver lines to alter neuronal function. Additionally, given the 424 importance of both contrast changes and absolute luminance [40], assaying these cells with more 425 complex visual stimuli should be an essential aspect of this characterization and could uncover 426 new functions of these inputs. 427 428

Contributions of the unified model architecture 429
Prior to the discovery of ON/OFF rectification by medulla neurons [18][19][20], nearly all models of 430 fly motion detection, including the famous Hassenstein-Reichardt elementary motion detector, 431 14/53 used non-rectified inputs signaling both luminance increments and decrements [41,42]. In 432 addition to fitting the spatial and temporal tuning of insect motion detection, these classic models 433 could also reproduce the reverse-phi illusion (a primary reason that multiplication was used for 434 correlating offset signals). However, since we now understand that directional selectivity is 435 computed by parallel T4 and T5 pathways, these classic models are less relevant and we must 436 reevaluate the inverted selectivity to reverse-phi motion. Indeed, newer models have included 437 rectified inputs [20,24,34,43], with models designed to explain the inverted directional 438 preference to reverse-phi motion specifically including NC inputs (either as a shift in the 439 rectification of PC inputs [10,44], or as separate inputs [45,46]). Our model differs markedly 440 since it is subject to the strong constraints imposed by optimizing parameters to reproduce the 441 high temporal and spatial resolution whole-cell electrophysiological measurements of T4 and T5. 442 Additionally, our models are only trained to reproduce the static receptive field of T4 and T5 443 neurons, but are used to predict responses to dynamic stimuli such as moving bars, edges, and 444 minimal reverse-phi motion. Our model is also the first (to our knowledge) in flies to incorporate 445 stimulus offset responses (see [47] in mice). These offset components provide an intuitive 446 explanation for why moving NC bars cause directionally selective responses while moving edges 447 with the same contrast do not (Fig 4A), and they play a critical role in generating the inverted 448 directional preference to reverse-phi motion (Fig. 4F). Importantly, by including offset responses 449 in our model we can both predict the responses to reverse-phi stimuli and provide a mechanistic 450 explanation for the illusion in flies (Fig. 4F). 451 452

On the utility of the reverse-phi illusion 453
The reverse-phi illusion continues to provoke scientific interest more than half a century after it 454 was discovered in humans [11]. In both vertebrates and invertebrates, this motion illusion 455 appears to depend on local computations with similar spatial and temporal tuning as for standard 456 apparent motion [12,48]. Therefore, the illusory percept is likely derived from the motion 457 computation itself. Once challenge is that neural correlates of the reverse-phi illusion have been 458 found throughout different visual pathways, from visual cortical neurons in primates [49] to the 459 optic lobe in flies [44]. A previous study that proposed a related mechanism for the reverse-phi 460 inversion seen in visual cortex, acknowledged the limitation of using data collected from diverse 461 neuronal population to constrain models [50]. By contrast, the well-characterized Drosophila 462 15/53 motion-vision circuit is an ideal system to study this illusion and its implication for motion 463 vision, especially since the reverse-phi-mediated inversion of directional preference is found in 464 the very same cells responsible for directionally selective motion detection [28]. 465 466 Why is the origin of directional selectivity linked to an inversion in directional preference when 467 contrast alternates? The response inversion has been proposed to facilitate more accurate motion 468 speed estimates [28,51] or to cancel out random correlations in noisy visual inputs [12]. Our 469 biologically constrained model of T4 and T5 responses explains the reverse-phi inversion as a 470 consequence of an inhibitory NC component near the receptive field center. The existence of this 471 NC inhibitory subfield is common not only to T4 and T5 neurons (despite their distinct set of 472 upstream inputs), but also to reverse-phi-illusion-sensitive neurons in primate visual cortex 473 [49,50]. This raises a possibly deep question: was the requirement to perceive reverse-phi motion 474 as inverted the primary driver for the receptive field structure, or was the receptive field structure        Figure 3 24/53 and bright (bottom) bar stimuli (same widths and speeds as Fig. 1D). Marker size denotes the 2 different speeds, with larger markers representing slower movement. Marker color denotes movement direction, as in C. (E) Comparing the measured and the predicted responses, same as B but for the averaged T5 cell (n=5 cells cardinally aligned PD-ND axis). The identical model architecture was used as for T4, but since it was optimized to fit T5 responses, light decrement conductances received stronger weights. Note that the T5-optimized model has Einc fed by a spatial filter on the leading side of the receptive field, to generate the leading-side bright stimulus onset component. (F) Same as D for the same averaged T5 cell as in E, presenting both dark (top) and bright (bottom) moving bar responses. (G) Example T5 moving bar responses to explain the generation of directional selectivity.
The numbers on the right correspond to numbered stages in A. Top row: Mean measured responses to 4-LED wide dark (left columns) and bright (right columns) bars moving in the preferred and non-preferred directions overlaid with predicted responses from the same model cell with the same parameters as in E. Middle row: conductance traces that generated the voltage responses above. Note that the E-I increment pair has very little contribution to dark moving bar responses. Bottom row: summed total excitatory and inhibitory conductances for the 4 conditions. Gray vertical lines added to facilitate comparisons between peak voltage (top row) and the corresponding conductances.        This figure shows the same as schematic as in Figure 3A, here separated into the two input conditions, by explicitly showing the inputs to a single spatial position resulting from a dark and bright bar flashes.
(A) A dark flash presents a leading (in time) luminance decrement edge and a trailing luminance increment edge. The Edec-Idec conductance pair receives the pulse input with the duration of the bar's presence. The Einc-Iinc conductance pair receives a filtered delta input at the time of the bar's disappearance, with a magnitude that depends on the duration of the bar's presentation. The rest of the schematic is equivalent to the example presented in Figure 3.   Due to the differences in assaying the receptive fields of cells with PD-ND axis aligned to cardinal directions (on the display) compared to cells with PD-ND axis aligned diagonally (on the display), we averaged the responses for cardinal and diagonal separately, and optimized and simulated the model responses to each separately. This figure displays results from our full model, which has additional parameters (see Methods).  Due to the differences in assaying the receptive fields of cells with PD-ND axis aligned to cardinal directions compared to cells with PD-ND axis aligned diagonally, we averaged the responses for cardinal and diagonal separately, and optimized and simulate the model responses to each separately. This figure displays results from our reduced model. Results from the reduced model optimized using T4 and T5 averages of cardinally aligned cells are presented in the main figures.
(Ai) Mean measured responses to 4-LED wide flashes of bright and dark bars at 10 positions (gray, same averaged cell as in Figure 3, n=5 cells with cardinally aligned PD-ND axis) compared to predicted model responses (green/black) for an averaged T4 cell (same parameters as in Figure 3).    (A) Boxplot summary of measured response maxima differences for T4 cells presented with flashing dark-bright pairs. No-overlap stimuli with 160 ms duration are the same responses presented in Figure 4D. Overlap stimuli had the same temporal structure (1 st bar dark, 2 nd bright each presented for the duration stated above the panel) but included 50% spatial overlap between the 2 bars (also indicated by the positions, in receptive field coordinates, along the x-axis). Dots represent means from individual cells. Note that numbers for different pairs vary, since different cells were presented with different sets of pairs. (B) Boxplot summary of measured response maxima differences for T5 cells presented with flashing bright-dark pairs. No-overlap stimuli with 160 ms duration are the same response presented in Figure 4D. 41

Lead contact
Further information and requests for resources and reagents should be directed to and will be fulfilled by the lead contact, Michael B. Reiser (reiserm@janelia.hhmi.org).

Materials availability
This study did not generate new unique reagents.

Data and code availability
Following the standard established in prior publications, we will make the dataset and code required to produce the major results of this study available at the time of publication. Preparing these materials is quite time-consuming, and so we will do this to correspond to the final version of the manuscript.

METHOD DETAILS
Electrophysiology. T5 recording are from cells that were included in our previous paper (n = 17 cells), and were performed as published [1], T4 recordings are from a newly acquired dataset (n = 15 cells). The experimental methods are similar to our prior manuscript [1] and will be briefly summarized below. Flies were anesthetized on ice and transferred to a chilled vacuum holder where they were mounted, with the head tilted down, to a customized platform machined from PEEK using UV-cured glue (Loctite 3972). To reduce brain motion, the proboscis was fixed to the head with a small amount of the same glue. The posterior part of the cuticle was removed using syringe needles and fine forceps. The perineural sheath was peeled using fine forceps and, if needed, further removed with a suction pipette under the microscope. To further reduce brain motion, muscle 16 [4] was removed from between the antennae.
The mounted, dissected flies were positioned on a rigid platform mounted on an air table.
Recordings were obtained from labeled cell bodies under visual control using a Sutter SOM microscope with a 60X water-immersion objective. To visualize the GFP labeled cells, a monochrome, IR-sensitive CCD camera (ThorLabs 1500M-GE) was mounted to the microscope, an 850 nm LED provided oblique illumination (ThorLabs M850F2), and a 460 nm LED provided GFP excitation (Sutter TLED source). Images were acquired using Micro-Manager [6], to allow for automatic contrast adjustment.
All recordings were obtained from the left side of the brain. Current clamp recordings were sampled at 20KHz and low-pass filtered at 10KHz using Axon multiClamp 700B amplifier (National Instrument PCIe-7842R LX50 Multifunction RIO board) using custom LabView (2013 v.13.0.1f2; National Instruments) and MATLAB (Mathworks, Inc.) software. Shortly after breaking in, recordings were stabilized with a small injection of a hyperpolarizing current (0-3pA) setting the membrane potential to a range between -60 to -55mV (uncorrected for liquid junction potential). Occasionally, the injected current required adjustments, but these were done prior to the acquisition of the single bar flash data. To verify recording quality, current step injections were performed at the beginning of the experiment.

Current injection experiments.
For the experiment presented in Fig. S1 the current step injections described above were preceded with a hyperpolarizing current of different duration. This procedure was performed prior to the presentation of visual stimulation. The magnitude of the hyperpolarizing and the following depolarizing injection were adjusted manually to evoke a similar membrane voltage response between cells (~ 10 mV). Hyperpolarization current injections ranged between -1 to -2 pA, while depolarizing current injections varied between 0.5 and 2 pA.
Visual stimuli (electrophysiology). The visual display was the same setup used and described in our previous paper [1]. Details are briefly summarized here. The display was constructed from an updated version of the LED panels previously described [7]. The arena covered slightly more than one half of a cylinder (216° in azimuth and ~72° in elevation) of the fly's visual field, with the diameter of each pixel subtending an angle of (at most) 2.25° on the fly eye. Green LEDs (emission peak: 565 nm) were used, bright and dark stimuli were presented on an intermediate intensity background of ~31 cd/m 2 .
Visual stimuli were generated using custom written MATLAB code that allowed rapid generation of stimuli based on individual cell responses. In contrast to the published stimulus control system [7], we have now implemented an FPGA-based panel display controller, using the same PCIe card (National Instrument PCIe-7842R LX50 Multifunction RIO board) that also 44/53 acquired the electrophysiology data. This new control system (implemented in LabView) streams pattern data directly from PC file storage, allowing for on-line stimulus generation.
To map the receptive field (RF) center of each recorded cell, three grids of flashing preferred contrast (dark for T5, bright for T4) squares were presented at increasing spatial resolution. Each flash stimulus was presented for 200ms. First, a 6  7 grid of non-overlapping 5  5 LEDs (~11°11°) preferred contrast squares was presented (Fig. 1A). If a response was detected, a denser 3  3 grid with 50%-overlapping 5  5 LEDs (~11°11°) preferred and non-preferred contrast squares (to verify cell polarity) was presented at the estimated position of the RF center. If a recorded cell was consistently responsive to the first two mapping stimuli, a third protocol was presented to identify the RF center. A 5  5 grid of 33 LED squares (~7°7°) of the preferred contrast separated by 1 pixel-shifts was presented at the estimated center of the second grid stimulus. The location of the peak response to this stimulus was used as the RF center in subsequent experiments. Once the RF center was identified, a moving bar stimulus was presented in 8 directions with 80ms step duration (equivalent to ~28°/s). The bar was 9 pixels in height and 1, 2, or 4 pixels in width. When moving in the cardinal directions, the motion spanned 9 pixels. In the diagonal directions bar motion included more steps to cover the same distance (13 steps vs. 9 steps). Once the preferred direction had been estimated, bright and dark bar flashes were presented on the relevant axis for widths 1,2 and 4. To verify full coverage of RF, this stimulus was presented over an area larger than the original motion window (at least 13 positions; results in Fig. 2). Following this procedure, cells were presented with additional stimuli using the same PD-ND axis and RF center as reference frames. All stimuli were presented in a pseudorandom order within stimulus blocks. All stimuli were presented 3 times, except for single bar flashes that were repeated 5 times. The inter-stimulus interval was 500ms for moving stimuli and 800ms for single bar flashes (to minimize the effect of ongoing inhibition on the responses to subsequent stimuli). Other presented stimuli were: 1) Moving bar. After identifying the PD-ND axis, bright and dark moving bar stimuli were presented along this axis using either 40ms or 160ms steps (equivalent to 56°/sec or 14°/sec respectively). Bar height was the same as for the mapping stimuli (9 LEDs) and width was either 1,2 or 4 LEDs (corresponding to 2.25°, 4.5° or 9°). Results are presented in Fig. 1, Fig. 3, Fig. S3 and Fig. S4. The moving bar stimuli presented to T4 and T5 cells were not identical. T5 cells were presented with a bar moving into and out of a presentation "window". Meaning, a 4-LED wide bar would first appear as a 1-LED bar and would only achieve its full width once the trailing edge crossed into the stimulus window. For T4 cells, the bar's leading edge traversed the same distance but the stimuli appeared and disappeared as full width bars. 2) Moving edges. Moving edge stimuli were presented in the same stimulus windows as the moving bars (and spanned the same number of steps), and with the same two values of step durations. After the edge has passed through the entire stimulus window, it disappeared, and the entire window reverted to the background levels. Results in Fig.  4A. 3) Minimal Reverse Phi. Bar pairs were presented such that the first bar was of the nonpreferred contrast followed by a bar of the preferred contrast (bright-dark for T5; dark-bright for T4). For T5 cells, stimuli were presented in 2 different configurations. Either bars were of width 2 and the delay between the first and the second bar was adjusted to maintain a fixed speed (i.e., correcting the temporal delay to account for the spatial difference in positions), or bars were of width 4 and the second bar was presented directly after the first, regardless of positional difference. For T4 cells, only the second configuration was used since it elicited a stronger response. Results in Fig. 4 and Fig. S6. Responses presented in Fig. S6: stimuli with overlapping positions were 4-LED wide bars displayed with a 2-LED spatial overlap (bar center positions indicated along a-axis). Essentially, non-overlapping 4-LED wide bar pairs spanned 8 LEDs, while overlapping bar pairs spanned 6 LEDs, with the 2 middle LEDs inverting from non-preferred contrast to preferred contrast.
Behavioral experiments. Flies were reared on standard cornmeal molasses medium on a 16:8 hours light:dark cycle and were tested 0-4 hours before their subjective night to increase activity levels. All experiments were conducted on female flies from the same genotype that was used to label T4 neurons (VT015785-p65ADZp (attP40); R42F06-ZpGdbd (attP2)). Flies were cold anesthetized and tethered to a tungsten wire with UV-cured glue. Flies were given at least 30 min to recover while holding a small piece of paper, to discourage tethered flight. For these experiments the flies were placed in a center of a different visual arena spanning 270° in azimuth and ~120° in elevation. The arena consisted of 192X64 LED array with the diameter of individual LED subtending ~1.875°. The stimulus control system was the same as for the electrophysiology. The fly's wings were illuminated from above by an IR LED (ThorLabs M850F2) and their position was monitored by an optical wingbeat analyzer (JFI Electronics Laboratory, University of Chicago, Chicago, IL, USA). Data acquisition was performed with the same control system as for electrophysiology, but with a 1KHz sampling rate.
Visual stimuli (behavior): Rotating grating (standard or reverse phi) stimuli were presented in 2 second open-loop trials interleaved with 5 second "stripe fixation" closed-loop trials, during which the fly actively controlled the position of a 30° dark bar. These closed-loop trials were used to keep the fly flying and engaged in the task. Each open-loop stimulus was presented 5 times. Trials in which the fly stopped flying were excluded from the analysis. Stimuli presented in the open-loop condition were full field rotation gratings with bar widths of 5.5°, 9.25° and 13° (or 3 different spatial wavelengths with a duty cycle of 11°, 18.5° and 26° respectively), each moving with 3 angular velocities (30°/sec, 60°/sec, or 120°/sec) and 2 direction. Stimuli were presented either in the standard form, with a grating of bright over gray; or in the reverse phi form, with a bright (dark) over gray inverting to dark (bright) over gray with each motion step (see Fig. 5A).

T4/T5 neuron model
We modeled the membrane potential responses of T4 and T5 neurons with a singlecompartment conductance-based neuron model [1,8], whose dynamics are described by The model has four conductances: One pair of excitatory ( ) and inhibitory ( ) conductances respoding to luminance increments, and a second pair of conductances, and , for luminance decrements. All the conductances are measured in units of leak conductance. The reversal potential for the leak, excitation, and inhibition are denoted by , , and respectively. We examined the model dynamics in the limit of small neuronal integration time [1,8]. With this approximation, the dynamics of Equation 1 become where = + and = + are the the total excitatory and inhibitory conductances respectively, and = − − . Each of the four conductances is the sum of local contributions from receptive field locations along the PD-ND axis ( ( , ), = , , , ), weighted by a spatial receptive field amplitude, described by a Gaussian. For instance, the luminance increment excitatory conductance is described by where , , and denote respectively the amplitude, center, and size of the Gaussian spatial receptive field. The receptive field locations are indexed by the location along the PD-ND axis (relative to the location corresponding to the empirically measured center of the receptive field of a neuron, = 0). Spatial locations are discretized on a uniform grid with a spacing corresponding to the smallest width of flashed bars used in the experiment. Similarly, for the remaining conductances: