Reversing Stimulus Timing in Visual Conditioning Leads to Memories with Opposite Valence in Drosophila

Animals need to associate different environmental stimuli with each other regardless of whether they temporally overlap or not. Drosophila melanogaster displays olfactory trace conditioning, where an odor is followed by electric shock reinforcement after a temporal gap, leading to conditioned odor avoidance. Reversing the stimulus timing in olfactory conditioning results in the reversal of memory valence such that an odor that follows shock is later on approached (i.e. relief conditioning). Here, we explored the effects of stimulus timing on memory in another sensory modality, using a visual conditioning paradigm. We found that flies form visual memories of opposite valence depending on stimulus timing and can associate a visual stimulus with reinforcement despite being presented with a temporal gap. These results suggest that associative memories with non-overlapping stimuli and the effect of stimulus timing on memory valence are shared across sensory modalities.


Introduction
Animals associate sensory stimuli in their environment with concurrent reinforcement in order to generate anticipatory behavior. Interestingly, perfect stimulus-reinforcement overlap does not lead to the strongest associative memories; instead the greatest memory effects are found when a stimulus precedes reinforcement with a partial temporal overlap, highlighting the predictive nature of associative learning [1]. Interestingly, temporal overlap between stimulus and reinforcement is dispensable for associative learning. For example, during conditioned taste aversion, an animal associates a consumed food item with the "feeling of sickness" occurring hours after ingestion; and this food item is avoided during subsequent encounters [2,3]. In addition to stimuli that precede an aversive reinforcement, the stimuli that follow the aversive reinforcement are relevant, since gaining preference towards these stimuli may help to keep the exposure to a threat at a minimum (for a discussion within the framework of the threat-imminence model, see [4]).
Drosophila is an excellent model for studying the role of stimulus timing in associative memory, given its experimental accessibility at molecular, cellular and behavioral levels. Indeed adult and larval Drosophila can form associations between an odor and subsequent electric shock, even when these two are separated by a temporal gap (i.e., trace conditioning), such that they later avoid the trained odor [5][6][7][8]. When stimulus timing is reversed during training, such that the odor follows the electric shock, flies form an oppositely valenced memory and subsequently approach this odor [6,9,10]. It has been proposed that during this kind of training, the odor becomes a predictor for the "feeling of relief" [11,12] (for discussion of alternative safetybased explanations, see [4,13,14]; for the corresponding effect of stimulus timing on appetitive olfactory conditioning in honey bee, see [15]). Thus, one kind of reinforcement, i.e., electric shock, can establish two opposite conditioned behaviors towards an odor, depending on stimulus timing.
In this study, we systematically characterized the effect of stimulus timing in visual conditioning using a classical conditioning paradigm with chromatic visual cues and electric shock reinforcement [16]. Visual stimuli lend themselves to better temporal control than olfactory stimuli [7]. In human and rodent subjects, training with non-overlapping visual stimuli and electric shock reinforcement leads to opponent memories depending on stimulus timing (i.e. trace vs. relief conditioning) [17,18]. Can insects perform such visual trace and relief conditioning tasks? Honeybees clearly maintain a trace of visual information in free flight [19][20][21][22][23]; whereas Drosophila preserves a trace of visual stimuli at least for orientation purposes [24]. However, it has not been tested whether insects can use traces of visual stimuli for formation of associative memories and whether reversing the stimulus timing influences the associative valence in insects in the visual modality.
In order to tackle these questions in Drosophila, we first optimized the training parameters in our recently developed visual conditioning paradigm [16]. We then systematically varied the relative timing of visual stimulus and reinforcement, to probe for visual trace and relief memories.

Flies
Drosophila melanogaster were reared in mass culture at 25°C, at 60% relative humidity, under a 12-12-hour light-dark cycle on a standard cornmeal-based diet. The Canton-Special (CS) wild type strain was used for all experiments. Before experiments, 1-3 day old flies were collected in fresh food vials and kept overnight at 25°C and 60% relative humidity. Each behavioral experiment employed 30-40 flies of mixed gender and was performed in dim red light.

Visual conditioning setup
Computer-controlled LED arrays were used to generate visual stimuli (green/blue light: 452 nm and 520 nm (Seoul Z-Power RGB LED) or 456 nm and 520 nm (H-HP803NB, and H-HP803PG, 3W Hexagon Power LEDs, Roithner Lasertechnik)) from beneath the flies [16,25]. LEDs were fitted in a substructure (165 mm below the arena), which allowed homogeneous illumination of a piece of filter paper used as a screen. The light intensities were controlled by current and calibrated using a luminance meter BM-9 (Topcon Technohouse Corporation) or a PR-655 SpectraScan 1 Spectroradiometer: 14.1 Cd/m 2 s (blue) and 70.7 Cd/ m 2 s (green) [16,25]. To deliver electric shock punishment, a custom made arena with a transparent shock grid was used [16]. The shock grid was composed of a glass plate (9x9 cm) with a laser-structured transparent ITO grid (1.6 mm width with 0.1 mm of gaps). A plastic ring (wall) and a glass lid for the arena were coated with diluted Fluon (10%; Fluon GP1, Whitford Plastics Ltd., UK) to prevent flies from walking on the lid and wall. Consequently, flies were forced to stay on the shock grid at the bottom of the arena. To analyze data from behavioral experiments, the distribution of the flies was recorded during the test phase from above with a CMOS camera (Firefly MV, Point Grey, Richmond, Canada) controlled by custom made software [26]. Four setups were run in parallel.

Behavioral protocol
We applied differential conditioning followed by a binary choice test [16,25,26]. Approximately 40 flies were introduced into the arena using an aspirator and subjected to a single conditioning experiment. During training the whole arena was illuminated alternately with green and blue light, one of which was paired with electric shock. Conditioning has been shown to be reproducible with a protocol using 60 s of green and blue color presentation and 12 pulses of electric shock per trial [16]. We optimized this conditioning protocol to facilitate variation in stimulus timing. We varied exposure to either color between 5 s and 60 s per trial ( Fig 1A). As reinforcement, 1 to 12 1 s-long pulses of electric shock (AC 60 V) were applied every 5 s ( Fig  1A). The extent of training varied between 1 to 12 trials (Fig 1A and 1B). Two consecutive presentations of paired color and unpaired color were separated by a dark inter-color-interval (ICI) and an inter-trial-interval (ITI) of 12-120 s (Fig 1A-1C). For the experiments where we used variable stimulus timing we employed the following parameter values: 15 s of green and blue color with 3 electric shock pulses per trial, eight training trials and an ICI as well as ITI of 120 s (Figs 1D, 2 and S1 Fig (here duration of color presentation varies from 5 to 25 s)). In protocol optimization experiments, the onset of the visual stimulus preceded the onset of electric shock punishment by 4 s (inter-stimulus-interval (ISI) = -4 s, Fig 1A-1C). For conditioning with variable stimulus timing, different groups of flies were trained with different ISIs, negative numbers indicating that the onset of the paired color preceded the onset of the electric shock, positive numbers indicating that the onset of the paired color followed the onset of the electric shock (Fig 2 and S1 Fig).
In all experiments, the test started 60 s after the end of training. Unlike in the training phase, two diagonal quadrants of the arena were illuminated with green whereas the other two quadrants were illuminated with blue, to allow flies to choose between the two colors. The distribution of the flies was recorded for 90 s at 1 frame per second [26]. No electric shock was presented in the test; however a 1 s shock pulse (AC 90V) was applied 5 s before the beginning of the test to arouse the flies [16]. Two groups undergoing reciprocal contiguity for colors and electric shock (Green+/Blue− and Blue+/Green−) were trained in the same setup consecutively. A preference index (PI) was calculated for each group: PI = (# of flies on green quadrants-# of flies on blue quadrants) / Total # of flies. Thus, negative PI values indicate a preference for blue against green; whereas positive values indicate vice versa. The difference between the reciprocal groups in PI was then used to calculate a learning index (LI) for each video frame [26]: LI = (PI Green+/Blue− −PI Blue+/Green− ) / 2. Thus, negative LIs indicate conditioned avoidance of the paired color; whereas positive values indicate conditioned approach.

Statistics
Statistical analyses were performed with the Prism5 software (GraphPad). Groups that did not violate the assumption of normal distribution (Shapiro-Wilk test) and homogeneity of variance (Bartlett's test) were analyzed with parametric statistics: one-sample t-test or one-way analysis of variance (ANOVA) followed by planned pairwise multiple comparisons (Benjamini Hochberg). Datasets that did not fulfill the assumptions above were analyzed with non-parametric tests, such as one-sample Wilcoxon signed rank test or Kruskal-Wallis test followed by Dunn's multiple pairwise comparison. The significance level of statistical tests was set to 0.05.

Optimizing the training protocol
To find the best parameters for training, we first varied the duration of color presentation and electric shock reinforcement ( Fig 1A). Various experimental groups were exposed to the same total duration of color presentation and the same number of shock pulses, but distributed over different numbers of trials. For every group the paired color preceded the shock by 4 s (interstimulus-interval (ISI) = -4 s). We found the lowest conditioned avoidance when flies were trained with 5 s-long color presentation, a single shock pulse per trial and 12 training trials. Increasing the number of shock pulses to three was not sufficient to improve scores with color presentation of 5 s (compare Fig 1A with S1 Fig), suggesting that the exposure to visual stimuli was too short. Maximum conditioned avoidance was found when color duration of 15 s was paired with three shock pulses, repeated over four trials. Prolongation of the color presentation to 25 s under these conditions did not improve learning scores (S1 Fig). When the optimal protocol of 15 s of color presentation and three pulses of shock was used, flies showed significant learning scores even with a single training trial (Fig 1B). However comparisons across one, two, four and eight training trials showed that visual conditioning did improve with training repetition (Fig 1B). Thus, in all further experiments eight training trials were applied. In order to exclude any associations between the electric shock and the unpaired color, we considered increasing the interval between the two consecutive colors (inter-color-interval (ICI)) and between training trials (inter-trial-interval (ITI)). We tested different ICIs/ ITIs (30 s, 60 s, 120 s; Fig 1C), but found no significant difference across groups. Thus, the protocol in further experiments consisted of eight training trials with 15 s of blue and green stimulation, three electric shock pulses and an ICI and ITI of 120s (Fig 1D).

Fig 2. Effect of stimulus timing on visual memory. Conditioned behavior as a function of inter-stimulus interval (ISI). Red stripes indicate electric shock pulses.
Data points indicate onset of the paired color presentation with 15 s duration (x-axis) and mean learning index (y-axis). Error bars represent the SEMs. Black data points: Learning scores depended on the ISI (one-way ANOVA, F = 13.86, p < 0.001). Flies showed significant conditioned avoidance with overlapping paired color presentation and shock pulses (one sample t-tests, T > 8.3, p < 0.001, ISI = -14 s, -4 s) and when the paired color preceded shock by a short temporal gap (one sample t-tests, T > 2.9, p < 0.01; trace conditioning, ISI = -34 s, -19 s). Flies showed significant conditioned approach when the paired color followed shock with a gap (one sample t-tests, T > 2.648, p < 0.05; relief conditioning, ISI = +26 s, +34 s, +49 s, +56 s, +66 s, +76 s; for ISI = +19 s and +41 s; T < 1.493; p > 0.05). When the paired color followed shock with overlap, scores did not differ from zero (one sample t-tests, T < 2.

Effect of stimulus timing on visual memory
Using the conditions specified above, we trained independent groups of flies with ISIs varying from -64 s (the onset of the paired color preceded the onset of shock by 64 s) to +96 s (the onset of the paired color followed the onset of the shock by 96 s). No significant scores were found with very long ISIs in either direction (ISI = -64 s, -49 s and +96 s, Fig 2, black data points). When the paired color shortly preceded the shock flies acquired significant conditioned avoidance, independent of the duration of overlap between the two stimuli (ISI = -14 s and -4 s, Fig 2, black data points; see also S1 Fig). Critically, conditioned avoidance was found even when the paired color preceded the shock without overlap (ISI = -34 s and -19 s, Fig 2, black data points), but to a lesser extent. Thus, flies could indeed associate the trace of a visual cue with shock. To better resolve the temporal requirements for visual trace conditioning, we added further experimental groups with negative ISIs (Fig 2, grey data points), revealing that trace memory steadily weakened with increasing temporal gap between the offset of the paired color and the onset of the shock.
Interestingly, when the paired color followed the shock with overlap, flies showed weak or no conditioned avoidance (ISI = +4 s and +11 s, Fig 2, black data points). Critically however, when the paired color followed the shock with a temporal gap, flies approached the paired color in the test, suggesting relief conditioning (ISI = +19 s to +76 s, Fig 2, black data points). Thus, reversing stimulus timing indeed led to valence reversal in visual memory.

Discussion
By using a classical conditioning setup with visual chromatic cues and electric shock reinforcement we showed that fruit flies form memories of opposite valence depending on the relative timing of stimuli during training, as is the case for the olfactory modality [6,9]. Furthermore, flies can associate a visual stimulus with a delayed and temporally non-overlapping aversive reinforcement, similar to effects reported in olfactory conditioning [6][7][8]. The shapes of the ISI-learning curves in both modalities are similar: Conditioning with negative ISIs generates a sharper response peak with stronger scores than conditioning with positive ISIs (compare Fig 2  to [6,27]). These parametric similarities across modalities may point to a common underlying molecular mechanism.
Trace conditioning: visual vs. olfactory modalities A caveat of the olfactory conditioning paradigm is that residues of the odor may remain in the setup, confounding trace conditioning experiments [7]. In experiments presented here, this concern does not apply. Therefore, the time gap between the paired color presentation and electric shock should be bridged by cellular and/ or molecular mechanisms [28]. In visual conditioning, our analyses revealed that: (i) a minimum duration for visual stimulus presentation is necessary to establish significant conditioned avoidance (Fig 1 and S1 Fig); (ii) temporal overlap between the visual stimulus and the reinforcement improves learning scores (Fig 2) and; (iii) when the onset of the visual stimulus precedes the onset of the reinforcement the strongest conditioned avoidance is established (Fig 2). These features are similar to those found in other associative learning paradigms [1,29]. Furthermore, in visual trace conditioning, we found the duration of the temporal gap between the visual stimulus and the reinforcement to be a strong determinant of conditioned avoidance: Prolonged duration of the time gap steadily decreased memory performance (Fig 2, grey data points), in agreement with key features of olfactory trace conditioning [7] and possibly pointing to a common underlying mechanism. This is not a trivial finding as the change in the saliency of the trace of a stimulus over time could instead have depended on the sensory modality in question [30]. In general, sustaining any kind of sensory trace is likely costly since it may require sustained neural activity [31]. The finding that fruit flies maintain a "costly" trace of stimuli from different sensory modalities suggests that such ability is highly adaptive.
The neural mechanisms underlying visual and olfactory conditioning are surprisingly similar in Drosophila. The same set of dopaminergic neurons is sufficient and necessary for signaling electric shock reinforcement to a shared set of mushroom body neurons in both cases [16,[32][33][34]. Yet, it is still not known whether the same individual mushroom body intrinsic neurons serve both modalities or if there are dedicated subsets for each modality. Moreover, mushroom body neurons were suggested to maintain odor traces in olfactory conditioning [8,35]. Thus, it would be interesting to test whether this is also the case in visual conditioning.
Relief conditioning: visual vs. olfactory modalities As in olfactory conditioning [6,9,10], we found, for the first time, that in visual conditioning, flies approached the paired color when it followed the offset of shock reinforcement during training. In olfactory conditioning, a high number of training trials is required to induce such relief conditioning (> 4 trials [6,9,27]); applying eight training trials in our case resulted in good performance when flies were trained with colors (Figs 1B and 2). We applied few electric shock pulses per trial (three pulses of 1 s duration each) during training, adjusting for the detrimental effect of high shock intensity observed in olfactory relief conditioning [9]. It may be that relatively weak punishment leads to a stronger or quicker relief-effect upon its offset [36]. Our results would support such a mechanism as we could detect the highest relief conditioning score for a longer time delay between shock and color presentation (Fig 2; ISI Little is known about the neuronal mechanisms underlying olfactory relief conditioning in Drosophila [27,37,38]. Fly olfactory relief conditioning seems to differ from both olfactory punishment and reward conditioning with respect to the role of catecholaminergic neurons [37]. However, the role of the synapsin gene in the mushroom body neurons appears to be similar between olfactory relief conditioning and punishment conditioning [38].
Interestingly, in rats and humans, relief conditioning engages reward-circuitry [18], although analyses at the level of individual neurons are not feasible. The similarity of the present visual paradigm for relief conditioning in Drosophila to rat and human studies may be an advantage in future comparisons of the underlying neural circuits. Regardless, availability of fly relief conditioning paradigms across two different sensory modalities shall be instrumental in revealing conserved mechanisms for memory formation.
Studies across different phyla-i.e., insects, rodents, primates and humans, and across different sensory modalities-i.e., olfactory, visual, [17,18,[39][40][41][42] reveal that the effect of stimulus timing on memory valence and the learning about sensory traces are shared. The underlying molecular or cellular mechanisms may also be closely related across modalities and animals. Thus, identifying these mechanisms in Drosophila may have translational potential.