Flies are often observed to approach dark objects. To a naive observer they seem to pay selective attention to one out of several objects although previous research identified as a possible underlying mechanism a reflex-like fixation behavior integrating responses to all objects. In a combination of behavioral experiments and computational modelling, we investigated the choice behavior of flies freely walking towards an arrangement of two objects placed at a variable distance from each other. The walking trajectories were oriented towards one of the objects much earlier than predicted by a simple reactive model. We show that object choice can be explained by a continuous control scheme in combination with a mechanism randomly responding to the position of each object according to a stochastic process. This may be viewed as a special form of an implicit attention-like mechanism, for which the model does not require an explicit decision mechanism or a memory for the drawn decision.

Despite being known mostly for their flight behavior, flies often also explore their environment by walking. During such explorations, flies have frequently been observed to approach distinct dark objects (Wehner, 1972). For a human observer, individual walks in the presence of multiple objects seem to indicate selective attention to a single target because on individual trajectories the flies usually turn towards one of the objects in a quick turn, apparently indicating a decision to approach the chosen target.

In flies, the mechanisms underlying such object-related orientation behavior have mostly been studied in tethered flight. In such experimental paradigms with a single object, such as a vertical bar, flies tended to fixate this object for most of the time in the frontal visual field. They accomplished this by generating a torque depending on the object's azimuthal position and being directed towards it. The torque generated in this turning response peaked when the object was at a fronto-lateral position (Reichardt, 1973). Consequently, the object moved into the frontal visual field and was stabilized in front of the animal. A similar mechanism was proposed for walking flies (Horn and Wehner, 1975; Horn, 1978).

When a fly was confronted with not one but two objects in a closed-loop tethered flight scenario, it fixated on one of them unless the objects were close to each other; then, the midpoint between them was fixated (Reichardt, 1973; Poggio and Reichardt, 1973; Reichardt and Poggio, 1975). These experiments led to the conclusion that, if confronted with two objects, flies reacted simultaneously to both by summing the torque responses predicted to be induced by each individual object according to the fixation characteristic determined for an object when presented in isolation. This additive concept was consistent with the observation that, when the objects were separated by 60 deg or more, one object could be fixated frontally. In this case, the distance between objects exceeded the distance between the azimuthal positions of torque maxima observed with single objects. Thus, the torque generated by the more lateral object in the pair was smaller than the torque generated by the more frontal object. If the two objects were less far apart, they generated similar torque responses, resulting in the animal orienting itself towards the mid-line between the two objects (Reichardt, 1973; Reichardt and Poggio, 1976). Similarly, the behavioral data obtained from walking flies facing two or three objects could be explained by adding the responses elicited by them when presented individually (Horn and Wehner, 1975). All these conclusions were based on the overall behavioral performance averaged over many flights or walks and animals.

In contrast, when scrutinizing the time-dependent performance of flies during individual flights in an open-loop two-object paradigm with one bar in each half of the visual field at corresponding positions, the torque responses of the two bars did not cancel out if these were oscillated synchronously in anti-phase, in contrast to predictions by the additive fixation model. Instead, the flies responded as if only one bar was present, apparently ignoring the other temporarily before switching after some time to respond to the other bar (Wolf and Heisenberg, 1980). This behavior was interpreted as a consequence of selective attention and attention switching between the objects. These analyses were performed under tethered flight conditions, in which the animal could not approach the objects, essentially simulating the condition that the objects were at an infinite distance, a situation occurring in a fly's real life only under very special conditions.

To overcome this limitation, we performed behavioral experiments on free-walking flies in a specially designed object choice paradigm. The use of a walking paradigm made it possible to monitor object-oriented decision behavior of largely unconstrained flies using video techniques, an approach that was not possible with free-flying flies. Some work has already been done on walking flies to address which object parameters appeared to be attractive to them, resulting in frequent approaches, such as the height and width of a bar (Wehner, 1972), as well as, based on studies in a virtual reality closed-loop paradigm, its distance as inferred from relative motion cues (Schuster et al., 2002). Further systems analysis suggested that flies were attracted by fast-moving bars in general (Mronz, 2004). Despite this evidence on object preferences of walking flies, a comprehensive concept of how individual flies select an object for approach in a choice situation is still lacking.

To address this issue, we developed a behavioral paradigm in which object selection behavior of freely walking blowflies (Lucilia sp.) could be recorded for various spatial relationships between the objects and the fly. The time-dependent object selection and fixation behavior was then related to the performance of the classical additive fixation model (see above) as well as a newly developed model that combined the simultaneously summed response to individual objects with the ability to stochastically ‘ignore’ one of them. In contrast to the classical additive fixation model, this new model was sufficient to reproduce the choice behavior of walking flies as characterized by our experiments. It further revealed that apparent choice behavior can be explained without the need for an explicit decision module.

Animals and animal preparation

We did our experimental analysis on female blowflies (Lucilia sp.) bred in our laboratory. Animals were captured 1–3 days after hatching, briefly anesthetized with CO2, and prevented from flying by placing a drop of wax on the wing joints. The prepared animals were kept in a cage with ad libitum access to sugar and water.

Experimental setup

Our experimental setup (Fig. 1) consisted of an irregular pentagonal arena (for dimensions, see Fig. 1A), constructed of canvas frames covered with a random cloud pattern (spatial statistics matched to average natural images without showing discernible objects: 1/f amplitude spectrum).

Fig. 1.

Sketch of experimental setup. (A) Sketch of a top view of the arena walls and position of the walking platform. Arena walls were 1 m high. (B) Sketch of the walking platform. Blue marks the position of the water moat, which was 0.5 cm deep. The visual barrier (‘Blinder’) is 3 cm high and leaves 0.5 cm on each side of the walkway.

Fig. 1.

Sketch of experimental setup. (A) Sketch of a top view of the arena walls and position of the walking platform. Arena walls were 1 m high. (B) Sketch of the walking platform. Blue marks the position of the water moat, which was 0.5 cm deep. The visual barrier (‘Blinder’) is 3 cm high and leaves 0.5 cm on each side of the walkway.

A walking platform was placed within the arena, centered against the 2 m long wall. The walking platform was cut from white PVC (for dimensions, see Fig. 1B) with an entry hole through which animals were individually introduced into the setup. To control the initial walking direction and orientation of the animal relative to the experimental arena when the objects came in sight, the entrance hole was surrounded by a water basin, and the view into the test arena was initially occluded by a visual barrier. Animals had to walk into the arena via a narrow walkway connecting the entry hole to the experimental area. By this arrangement, we achieved a relatively uniform walking direction and body orientation of the animals when entering the arena. A water moat surrounding the walking platform kept the animals on the platform. Both the water moat and the basin were connected and 0.5 cm deep. The walking platform was elevated by 5.5 cm above the supporting table to hide construction details of the setup from the animal's view.

Cylinders of 8.2 cm diameter and 20 cm height were placed at a distance of 60 cm from the end of the walkway. The cylinders were placed at three different angular positions relative to the midline of the walkway as a reference line (0 deg). If two objects were placed in the arena, one was placed in the right half of the arena and the other one in the left half.

The arena was illuminated indirectly through a diffusion screen by 6 white LED lamps (Marathon MultiLED, GS Vitec GmbH, Gelnhausen, Germany) placed above the arena. The resulting soft light reduced shadows and allowed for automated tracking of the walking flies.

The behavior of walking blowflies was recorded at 90 frames s−1 using a camera (Basler acA 2040-90 μm, Basler AG, Ahrensburg, Germany) placed above the arena and custom-made recording software based on the Pylon 4 software suite (Basler AG). Animals were tracked on the video using the open-source software ivTrace (https://opensource.cit-ec.de/projects/ivtools).

The animal's position and orientation were automatically determined by fitting an ellipse to the body and using the orientation of the ellipse's long axis as a proxy for gaze direction and the center of the ellipse as the approximate position. The tracking results were reviewed and obvious misdetections were manually corrected to fit the position and orientation of the animals.

Experimental procedure

Individual blowflies were released from below through the entry hole into the experimental setup. Flies were recorded until they reached the borders of the walking platform. If an animal attempted to take off or failed to reach the outer borders of the platform because it refused to walk, it was captured and released again. Each individual was recorded under a given stimulus condition until it reached the borders of the platform 10 times. We recorded blowflies walking under seven conditions: in the absence of objects, in the presence of one object at 37 deg, at 60 deg or at 90 deg, and in the presence of two objects at 37 deg and 60 deg, at 37 deg and 90 deg, or at 60 deg and 90 deg. For each condition, we recorded 10 different flies. For both the one- and the two-object conditions, the object constellation was mirrored along the symmetry axis of the walking arena between experiments according to a pseudo-random sequence, to control for any potential asymmetry in the experimental arena that might have escaped our notice.

Characterization of walking trajectories

We defined the start of apparent object fixation as the onset of the time window in which at least one of the object's edges was kept in the frontal visual field, i.e. within ±30 deg relative to the midline of the animal, for at least 100 frames (∼1.11 s). In the following, these phases will be called ‘lock-on’.

Statistical analysis

To test whether two samples of walking directions in our data share a common underlying distribution, we applied the circular two-sample Kuiper test (circStat toolbox for MATLAB: Berens, 2009).

For a correlation test between the order of appearance of the objects in the visual field of the animal and the final approach, we computed the correlation coefficient and checked for significance of the correlation using the ‘corrcoef’ function of MATLAB.

We checked for a possible bimodality in the distribution of walking directions of the animals in the no-object condition by applying Hartigans' dip test for unimodality (R ‘diptest’ package).

To test for changes in time to lock-on between conditions and in the walking speed of the animals before and after lock-on, we applied the two-sample Kolmogorov–Smirnov test (MATLAB ‘kstest2’ function). Because not all walks of an animal ended at a target, the animals contributed different numbers of approaches to all analyses requiring object approach. To account for the resulting asymmetries and, in particular, for the fact that successive runs of a fly cannot be assumed to be statistically independent, we computed an average for each animal and applied the tests to these average values.

To test the hypothesis that the animals prefer a frontal object over a more lateral one, we counted the approaches to each object (trajectory ending within a 60 deg window centered on the object positions). For each animal we computed the differences between approach frequencies and applied a Wilcoxon signed rank test to the resulting data (MATLAB ‘signrank’ function).

Comparison between model and experimental data

To compare model performance and corresponding experimental data, we generated 100 walks for each condition for every model variant. The start location of the modelled animal was at the end of the walkway because we aimed to model the behavior of the animal once it was no longer constrained by the walkway. The exact positions and orientations were varied to match the observations in the experiments: for each walk recorded in the experiments, we started the model trajectory at the position at which the animal left the walkway and with the orientation it had in that moment.

Modelling: additive fixation model

We attempted to qualitatively reproduce the experimental data with a model that was inspired by previous work (Poggio and Reichardt, 1973; Horn and Wehner, 1975). This additive fixation model (AFM) achieved the fixation behavior by summing two behavioral components (Fig. 2): an object-induced turning behavior and a spontaneous stochastic turning tendency, as detailed below.

Fig. 2.

Sketch of models. Gray modules form the additive fixation model (AFM). Blue modules are extensions added for the stochastic attention model (SAM). The AFM generates spontaneous turns during walking from temporally filtered white noise to which the torque response to both objects is added. The resulting change in yaw orientation is integrated to update the retinal positions of the objects, assuming constant speed walking. In the SAM, the torque response to each object is added with a certain probability modulated by the attention curve. The inset shows the fixation characteristic generating the object responses as derived from experimental data: data in blue are mean±s.e.m. yaw speed (y0) observed when the object is at different azimuth positions (object bearing, ɸ0); the red curve shows the functional fit to the data used in the model.

Fig. 2.

Sketch of models. Gray modules form the additive fixation model (AFM). Blue modules are extensions added for the stochastic attention model (SAM). The AFM generates spontaneous turns during walking from temporally filtered white noise to which the torque response to both objects is added. The resulting change in yaw orientation is integrated to update the retinal positions of the objects, assuming constant speed walking. In the SAM, the torque response to each object is added with a certain probability modulated by the attention curve. The inset shows the fixation characteristic generating the object responses as derived from experimental data: data in blue are mean±s.e.m. yaw speed (y0) observed when the object is at different azimuth positions (object bearing, ɸ0); the red curve shows the functional fit to the data used in the model.

The object-induced turning behavior generated torque depending in amplitude on the azimuthal position of the object. We defined the corresponding characteristic function as:
formula
(1)
where y is the resulting yaw speed, ɸ is the azimuth position of the object, and A and B are free parameters controlling peak yaw speed and peak position, respectively. To parameterize the characteristic curve, we fitted the average yaw speed observed for a given retinal object position by varying A and B, using data obtained when a single object was initially present at 90 deg. The plot of yaw speed versus azimuthal position generated in this way followed an anti-symmetrical curve (see inset in Fig. 2). The parameters were generated by least-squares fit of Eqn 1 to the experimental data (R²=0.852). If two objects were present in the visual field, the resulting yaw torque for each object was determined individually for its actual retinal position according to the characteristic curve. The overall object-induced yaw torque was then obtained by adding the individual torque components.

The spontaneous stochastic turning tendency was implemented by temporally filtered white noise fluctuations. A filter kernel was determined from the spontaneous walking behavior of the flies in our setup without objects (for details, see Monteagudo Ibaretta, 2020). We determined the average fast Fourier transform (FFT) of the yaw speed for all recordings lasting at least 512 frames, allowing us to use 47 of the 100 recordings. Using the inverse fast Fourier transform (iFFT), we converted the average spectrum to a linear temporal filter kernel. Applying this filter to a white noise signal by convolution and normalizing the result to the standard deviation of the observed yaw velocities, we generated a sequence of spontaneous turns.

We assumed a response delay of the fly of 4 frames (∼44 ms), i.e. the object response was calculated for the object position 4 frames earlier. This delay approximated the neuronal latency observed for motion-sensitive wide-field neurons in the lobula complex of the fly (Warzecha and Egelhaaf, 2000). The walking speed was set constant throughout the simulations and corresponded to the average walking speed of 6.4 cm s−1 of our experimental animals along their trajectories. The simulated trajectory was updated at a 90 Hz frequency. The orientation of the model animal was updated by stepwise integration of its yaw speed, which is in turn controlled by two components: the spontaneous turns and the object response.

Modelling: stochastic attention model

The stochastic attention model (SAM) had the same overall structure as the AFM with just one extension added, i.e. the simulated animal ignored one or both objects stochastically (Fig. 2). This was accomplished by switching the object responses ‘on’ or ‘off’ before contributing to the overall yaw torque following a random process modulated by the object's azimuthal position. This random switch was applied independently in each update step and to each object in the visual field. The function describing the dependence of the switching probability on the object position was termed the attention curve and was assumed to be bell-shaped according to a von Mises distribution, i.e. the circular normal distribution. We used a modified von Mises distribution with a fixed maximum position at 0 deg (μ=0) and scaled by systematic parameter variation:
formula
(2)
where p(ɸ) is the attention probability for the object observed at the azimuthal position ɸ, C is a scaling constant, k is a constant concentration parameter, and I0 is the zero-order modified Bessel function. The object response was only added if a uniformly distributed random number between 0 and 1 was below the probability according to the value of Eqn 2. Otherwise, the object response was set to y=0 deg s−1. The attention curve generating the attention probability for a given object position was parameterized by systematic variation of the parameters k and C of Eqn 2 for 100 simulated trajectories and the similarity of the resulting model trajectories to the experimentally observed ones was assessed by visual inspection. The parameters were set to k=5.518 and C=96.37. The resulting von Mieses curve was the circular equivalent of a Gaussian with σ=25 deg and a maximum attention probability of p(0)=0.875.

Behavioral experiments

To gain insight into the goal selection mechanisms of walking blowflies, we analyzed their free walking behavior in a two-object paradigm and developed a model reproducing key features of the observed behavior.

In an environment without any obvious visual objects, most walks tended to proceed in their initial walking directions along fairly straight trajectories. Only in some cases did we observe flies walking on a strongly curved path or reorienting substantially between leaving the walkway and reaching the water moat (Fig. 3A). The overall distribution of walking trajectories was broad, roughly symmetrical around the center of the arena. Other than expected for a unimodal distribution, the distribution of the end points of the trajectories seemed to show a tendency of the animals to avoid the straight forward walking direction. However, model simulations without such a tendency resulted in a distribution of end points (Fig. S1) not significantly different from the experimental distribution (Kuiper test P>0.1). Further, the null-hypothesis of a unimodal distribution could not be rejected (Hartigans' dip test: P≈0.26) for the experimental data.

Fig. 3.

Trajectories of walking blowflies. (A) In the absence of any object. (B–D) With one object at 37 deg, 60 deg or 90 deg, respectively; and (E–G) with two objects, at 37 deg and 60 deg, at 37 deg and 90 deg, or at 60 deg and 90 deg, respectively. Trajectories are colored for better separability; colors do not imply any grouping. The polar histograms show the distribution of positions observed when the flies crossed a registration circle with 20 cm radius around the end of the walkway. Red silhouettes in B–G repeat the distribution of A for comparison (N=10, n=100).

Fig. 3.

Trajectories of walking blowflies. (A) In the absence of any object. (B–D) With one object at 37 deg, 60 deg or 90 deg, respectively; and (E–G) with two objects, at 37 deg and 60 deg, at 37 deg and 90 deg, or at 60 deg and 90 deg, respectively. Trajectories are colored for better separability; colors do not imply any grouping. The polar histograms show the distribution of positions observed when the flies crossed a registration circle with 20 cm radius around the end of the walkway. Red silhouettes in B–G repeat the distribution of A for comparison (N=10, n=100).

When objects were present, the animals significantly changed their walking behavior (Kuiper test P<0.001 for all conditions in pairwise comparison to the sample without objects).

In the presence of a single object presented at different azimuthal positions, in most walks the animals approached the object along fairly straight paths right from the moment they entered the arena (Fig. 3B–D). However, in some cases the animals walked in different directions on similarly straight trajectories; sometimes, animals even turned away from the object after initially heading towards it. Only a few walks led to a curved trajectory.

The objects were approached with a variable probability depending on their position in the arena (see histograms in Fig. 3B–D). An object at 37 deg, as seen from the initial walking direction, was approached more frequently than an object at 90 deg (Kolmogorov–Smirnov test P≈0.03). Approach frequencies seemed to decline with object eccentricity, although statistical tests between the other combinations showed no significance (Kolmogorov–Smirnov test P>0.1).

When confronted with two objects, most flies approached only one of them on a given walk, with the frequency of approach for either object depending on its azimuthal position (Fig. 3E–G). A variable proportion of flies did not approach either object or turned away after an initial object approach. Flies preferred the more frontal object over the lateral one (37 deg over 90 deg, Fig. 3F; Wilcoxon signed rank test P≈0.003; or 60 deg over 90 deg, Fig. 3G, P≈0.05), as in the single-object situation. However, this preference was not significant for the third condition (37 deg versus 60 deg, Fig. 3E; P≈0.4).

To assess how flies selected one or the other object, we analyzed when and where flies started fixating the object and what might have induced selection of one of the objects. We defined the start of object fixation as the onset of the time window in which at least one of the object's edges was kept in the frontal visual field, i.e. within ±30 deg relative to the midline of the animal, for at least 100 frames (∼1.11 s). In most cases, lock-on was observed early after leaving the walkway (Fig. 3). The time between leaving the walkway and fixation lock-on in the presence of a single object was very similar irrespective of object position (pairwise Kolmogorov–Smirnov tests P>0.05), with only a slight tendency to take longer if the object was more lateral. When two objects were present, the time to fixation lock-on was similar irrespective of object position (pairwise Kolmogorov–Smirnov tests) and was only slightly larger compared with the single object experiments (Fig. 4A). Fixation lock-on was located in many cases on the walkway or immediately after leaving it irrespective of object position; only in a few cases was the fixation lock-on located some distance away from the walkway (Fig. 4B).

Fig. 4.

Analysis of object lock-on during walks. (A) Boxplots of the time between leaving the walkway and object lock-on for a single object (left) and two objects (right) (dashed line, median; box, 25%/75% quartiles, whiskers, range; +, outlier values >1.5× box range; n=10). A few durations exceeding the limit of the y-axis are not shown in the plot. (B) Location of the lock-on moment. Upper row: single object. Lower row: two objects. Red dots indicate walks approaching the object more frontal to the walkway, blue dots the one more lateral.

Fig. 4.

Analysis of object lock-on during walks. (A) Boxplots of the time between leaving the walkway and object lock-on for a single object (left) and two objects (right) (dashed line, median; box, 25%/75% quartiles, whiskers, range; +, outlier values >1.5× box range; n=10). A few durations exceeding the limit of the y-axis are not shown in the plot. (B) Location of the lock-on moment. Upper row: single object. Lower row: two objects. Red dots indicate walks approaching the object more frontal to the walkway, blue dots the one more lateral.

To understand how blowflies selected the object they approached, we determined whether the animals tended to select the object they saw first when walking along the walkway. We calculated the correlation coefficient between an object seen first and the object eventually being approached. When the two objects were in a frontal position (37 deg and 60 deg), we found no correlation between having seen one of them first and approaching it (correlation coefficient=0.14, P≈0.21). Furthermore, if one of the objects was placed at 90 deg, it was never seen first but was still approached roughly a third of the times (compare Fig. 3A with 3E–G). Hence, whether an object was seen first was unlikely to be a major determinant of object choice.

Did the mean walking speed of blowflies change after the animal had started fixating the object? Across all experiments, the mean walking speed before and after fixation lock-on did not differ systematically (Fig. 5), suggesting that flies did not change their speed once they apparently decided to approach an object.

Fig. 5.

Comparison of mean walking speed of blowflies before and after lock-on to an approached object. Object arrangements are given above the box plots (dashed line, median; box, 25%/75% quartiles; whiskers, range; +, outlier values >1.5× box range; n=10; asterisks denote significant difference: Kolmogorov–Smirnov, P≈0.03).

Fig. 5.

Comparison of mean walking speed of blowflies before and after lock-on to an approached object. Object arrangements are given above the box plots (dashed line, median; box, 25%/75% quartiles; whiskers, range; +, outlier values >1.5× box range; n=10; asterisks denote significant difference: Kolmogorov–Smirnov, P≈0.03).

Modelled walking behavior

In our experiments, walking blowflies seemed to make remarkably quick choices, often starting to approach their goal early after leaving the walkway (Fig. 4A). How can this behavior be explained? For tethered flight, Poggio and Reichardt (1973) explained object choice as the result of each of the objects independently leading to a torque component. The torque caused by each object (‘object response’) followed a characteristic curve with the torque induced by an object depending on its azimuthal position in the visual field (Reichardt and Poggio, 1976). The object responses to each individual object were assumed to be summed and added to spontaneous torque fluctuations. We analyzed whether this AFM (Fig. 2) could explain the quick decisions we observed for freely walking blowflies.

To account for the spontaneous fluctuations in the walking direction (see Fig. 3), we added the object-induced response to angular velocity fluctuations based on the walking tracks of flies in our arena without any object (Fig. 3A; see Materials and Methods; Monteagudo Ibaretta, 2020). As the walking speed of blowflies did not change much after fixation lock-on or between the different object constellations, we set a constant modelled walking speed v=6.4 cm s−1, the average speed of blowflies recorded across all object constellations. With these parameters we could fit the spontaneous walking behavior of flies quite well (Kuiper test P>0.1).

When confronted with two objects, one at 37 deg and one at 60 deg, the trajectories generated by the AFM consisted mostly of rather smooth curves initially heading towards the midpoint between the objects and later bending towards one of them (Fig. 6B). This behavior was to be expected, based on previous literature (Reichardt and Poggio, 1976), as the tendency to turn towards one object was cancelled initially by the tendency to turn towards the other, i.e. when the retinal positions of the objects were relatively close to each other. However, this model performance did not match the behavior observed in walking blowflies in the same situation (Fig. 3E), in which in most cases the animals started moving towards one of the objects shortly after leaving the walkway.

Fig. 6.

Walking trajectories generated by the model. (A) Trajectories resulting from spontaneous turns in the absence of any object-related response. (B) Trajectories generated by the AFM without attention-like processes. (C–E) Trajectories generated by the SAM for single objects. (F–H) Trajectories generated by the SAM when tested with two objects. Trajectories were colored for better separability; colors do not imply any grouping. The polar histograms show the distribution of positions observed when the model trajectories crossed a registration circle with 20 cm radius around the end of the walkway. Red silhouettes in B–H repeat the distribution of A for comparison.

Fig. 6.

Walking trajectories generated by the model. (A) Trajectories resulting from spontaneous turns in the absence of any object-related response. (B) Trajectories generated by the AFM without attention-like processes. (C–E) Trajectories generated by the SAM for single objects. (F–H) Trajectories generated by the SAM when tested with two objects. Trajectories were colored for better separability; colors do not imply any grouping. The polar histograms show the distribution of positions observed when the model trajectories crossed a registration circle with 20 cm radius around the end of the walkway. Red silhouettes in B–H repeat the distribution of A for comparison.

In order to generate the early decision to walk towards one of the objects after the animal left the walkway, we hypothesized that the animal may have ignored one of the objects for some time, i.e. did not react to it, as has been described for flying fruit flies (Wolf and Heisenberg, 1980; Sareen et al., 2011). Therefore, we elaborated the AFM into our SAM by adding a random process that switched the object-induced torque responses ‘on’ or ‘off’ in each update step for computation of the summed yaw torque (see Materials and Methods).

The trajectories generated by the SAM (Fig. 6C–H) described mostly straight or slightly curved paths that often led to the object in the one-object constellation, or to one of the objects when two were present. Most importantly, the SAM accounted for the early decision to approach an object in a similar way to that observed in the experimental data. Moreover, a substantial number of trajectories did not lead to an object and even a few modelled trajectories seemed to change direction after the simulated animal first moved for some time on a fixation course. In addition, the model consistently generated a preference for individual frontal and fronto-lateral objects, i.e. objects at 37 deg or 60 deg, over lateral objects, as observed in walking blowflies. This preference was also observed when the model animal could choose between two objects at 37 deg or 60 deg versus one object at 90 deg. However, the model also produced a preference for an object at 37 deg over one at 60 deg in both the one-object and the two-object constellation, a result differing quantitatively from its experimental counterpart (Fig. 3; Wilcoxon signed rank test P<0.05).

Note that the data shown in Fig. 6 have the same number of trajectories per condition as the experimental data (100 walks). By re-running the simulation with different random seeds, a smoother estimate of the distributions shown in the polar histograms could be achieved (Fig. S1).

The time to fixation lock-on (Fig. 7A) was fairly quick in the one-object constellation if the object was at 37 deg and increased slightly for more lateral positions of the object. In the two-object constellation, the effect was the same, with the time to fixation onset being shorter when the objects were at 37 deg and 60 deg, somewhat longer for object positions at 37 deg and 90 deg and longest for a combination of 60 deg and 90 deg. Although this position dependence was not very strong, it differed to some extent from the experimental data. Also, the time to fixation onset tended to be shorter in the experiments even when compared with the shortest times observed in the model simulations (compare Figs 4A and 7A).

Fig. 7.

Analysis of object lock-on of the SAM. (A) Boxplots of the time between leaving the walkway and object lock-on (dashed line, median; box, 25%/75% quartiles; whiskers, range; n=10; asterisks denote significant difference: Kolmogorov–Smirnov, P<0.05). (B) Location of the lock-on moment. Upper row: single objects. Lower row: two objects. Red dots indicate walks approaching the object more frontal to the walkway, blue dots the one more lateral.

Fig. 7.

Analysis of object lock-on of the SAM. (A) Boxplots of the time between leaving the walkway and object lock-on (dashed line, median; box, 25%/75% quartiles; whiskers, range; n=10; asterisks denote significant difference: Kolmogorov–Smirnov, P<0.05). (B) Location of the lock-on moment. Upper row: single objects. Lower row: two objects. Red dots indicate walks approaching the object more frontal to the walkway, blue dots the one more lateral.

We also plotted the locations of the fixation onset for the modelled blowflies (Fig. 7B). For both the one- and two-object constellation, fixation onset was located close to the start of the trajectory at the end of the walkway. However, as a consequence of the wider spread of the time to fixation lock-on in the model data compared with the experimental counterpart, the locations of fixation onset were spatially more spread, especially when one object was at 90 deg (compare Figs 7B and 4B). Irrespective of these quantitative differences, the SAM matched the experimentally determined behavior in our two-object paradigm quite well.

The research literature on object-related orientation behavior of flies reports two seemingly contradictory findings. On the one hand, a reflex-like fixation mechanism was proposed that continuously added the responses induced by individual objects (Reichardt, 1973; Reichardt and Poggio, 1976). On the other hand, open-loop experiments with tethered flying flies suggested the presence of selective attention and active choice processes under symmetrical stimulation with moving objects (Wolf and Heisenberg, 1980).

These conclusions were mainly based on experiments on tethered flying flies in situations in which translation velocity could not be determined and, thus, did not affect the visual input, mimicking a situation with objects virtually placed at infinity. Therefore, we addressed the issue of object-related orientation with a choice paradigm in which blowflies could walk freely towards an object. When confronted with two objects, free-walking flies showed behaviors which might be interpreted as active decisions to approach either object. The flies seemed to quickly select the target approached. The initial azimuthal positions of the potential targets had an influence on their attractiveness but had little impact on the time needed to select the object to approach. However, which of the objects was seen first did not play an obvious role in target selection.

To investigate possible mechanisms underlying this selection process, we developed a computational model qualitatively reproducing the main features of the animals' performance. This model revealed that by including an attention-like mechanism, we could explain the apparent quick decision process that is a distinguishing feature of the behavioral data and could not be accounted for by the model simply adding the different object-induced responses. It should be noted that the stochastic attention mechanism we implemented did not explicitly assume a decision process or memory.

By observing behavior, one cannot pinpoint exactly when an animal draws a decision, but rather must rely on visible behavioral indicators, such as the onset of a turn, as a proxy for a decision. With the spatial layout of the setup, forcing the animals to walk over a narrow walkway into the setup of the possible fixation targets, we tried to harmonize the initial walking directions and retinal object positions. For analysis purposes, we defined the time at which the animal left the walkway as the reference point in time. At this point, all objects were visible for the animal in all conditions. We conclude from our observations that walking blowflies show a preference for objects depending on their initial azimuthal position, with frontal objects being preferred over lateral ones, both when only a single object is presented and when the flies are allowed to choose between two. Despite reacting to objects in an obvious manner, blowflies did not walk towards any object in a sizable proportion of walks for all tested object configurations and instead walked in other directions.

Once flies started fixating their goal, they tended to stick to this apparent decision. The short time interval between leaving the walkway and lock-on in all tested object configurations suggests that flies take a very similar amount of time to respond to the objects regardless of their position and that, even in a two-alternative choice situation, they only take slightly longer to decide. Thus, despite inevitable limitations in our methodology, we can be confident that the retinal position of the objects had little effect on the time the animal took to decide to approach one of them. This is in accordance with a previous study (Mronz, 2004) reporting largely constant reaction times of walking Drosophila towards objects presented at different azimuthal positions in the frontal visual hemisphere (0–90 deg), though the reaction times observed in that study of around 1 s were much larger than the ones we observed in Lucilia. This difference could result from differences in the experimental paradigms or species used, as Mronz (2004) measured the reaction time of Drosophila to sudden position changes of bars, while in our paradigm the objects became visible to the blowfly slightly before the reference time point.

The time until fixation lock-on was slightly larger when the fly was confronted with two objects compared with the single-object condition. A delay when choosing between multiple objects has been described for flies in the context of attention (van Swinderen, 2011), arguing that the presence of additional objects, referred to as distractors, draws attention away from the target objects. For Drosophila, in particular, it has been shown that the animal responds to only one of two stripe patterns moving in opposing directions in each half of the visual field, but that the response onset is delayed in comparison to the known response to a single rotating panorama (Tang and Juusola, 2010). In general, it is not really possible to assess the motivational state of a fly in most behavioral paradigms. This is different in, for example, social hymenopterans when foraging to support a hive. However, in our behavioral object selection paradigm, the flies appeared to be motivated to behave in that they spontaneously walked to one of the objects in most cases.

We tried to find a parsimonious mechanism that could qualitatively reproduce the observed quick apparent object choice behavior. It has been proposed that choice behavior between different objects is the result of the animal adding the turning responses generated by a static fixation characteristic to the available objects and spontaneous noise-like turning tendencies (Reichardt and Poggio, 1976). We first implemented this mechanism in our AFM. In simulations, we found that this model failed to generate a quick fixation decision between objects being close to each other. The AFM could generate a choice between two objects only if these were sufficiently separated. Otherwise, the two objects generated similar turning responses in opposite directions, causing the simulated animal to walk towards an intermediate position, as has been described before during tethered flight (Reichardt and Poggio, 1975). We conclude that, while we can find individual simulation runs of traces leading to an object from the start, in most cases the AFM is unable to generate a quick decision like we observed in walking blowflies.

Thus, we hypothesized that to quickly fixate an object in a two-object paradigm, it might be necessary for the animal to ignore one or the other object at least occasionally. This ability had already been concluded for Drosophila in a scenario involving two vertical objects in an open-loop tethered-flight paradigm (Wolf and Heisenberg, 1980) and thus seemed to be a reasonable assumption. The implementation in our SAM assigned a probability to react to each object which depended on its azimuthal position. This model feature led to qualitative reproduction of the quick responses observed in walking blowflies and thus revealed that ignoring part of the visual input for some short time window was sufficient to explain the observed behavior. This finding may immediately evoke the notion of attention, i.e. the ability to focus on parts of the visual input while ignoring the rest. Indeed, our two-object paradigm led to conclusions reminiscent to those of studies used to showcase and analyze competitive attention (van Swinderen, 2011; Nityananda, 2016). In these studies, an animal had to respond to one visual stimulus while suppressing the response to the other.

For our SAM, we simulated that each object had an independent probability to be taken into account or, conversely, to be ignored at each time step. The probability of attendance varied depending on the object's azimuthal position, reaching a maximum for a frontal object. Our model did not need to keep track of internal states or memorize the decisions taken; the generated object fixation and decision-like processes were emergent properties. The SAM could reproduce features of the observed animal's behavior: despite producing a robust fixation, it allowed for significant proportions of modelled flies to not approach any of the objects as well as to occasionally switch to a different goal after apparently starting to walk towards an object, as observed in walking blowflies.

For two objects the choice mechanism implemented in the SAM effectively selected one of four response types in each time step of the simulation: (1) stabilizing the fixation of an object when the more frontal object was the only one contributing to the yaw torque; (2) reorienting towards the other object if only the response to the more lateral object was ‘on’; (3) turning towards a compromise path when both objects contributed; or (4) ignoring both objects altogether. By modulating the probability of the stochastic process depending on object position in a bell-shaped attention characteristic, the first state, stabilizing fixation of the most frontal object, was selected with the highest probability, while the system still could reorient by randomly selecting one of the other states.

The experimental analysis of this study characterized the walking behavior when no object, one object and two objects were presented and provided a template for parameterization of the model that attempted to account for qualitative features of this behavior. A more detailed follow-up study of the walking behavior of blowflies in the scenario we investigated could resolve questions raised by the data we present. For example, we may have missed subtle changes in walking pattern correlated to the lock-on to a targeted object. Our data also suggest that the flies did not continue to walk straight forward when they left the guiding walkway. Although this tendency was not shown to be statistically significant, future experiments could reveal whether this is a general effect or related to the specific layout of our setup, having a corner in the back wall on the setup midline.

Multiple other factors affect choice and fixation behavior of flies apart from the azimuthal position of objects in the visual field. For example, Drosophila may show different preferences for bars depending on how wide they are (Wehner, 1972), although another study did not find different approach frequencies of Drosophila freely walking between differently sized cones (Robie et al., 2010). Moreover, Lucilia has different preferences for different colors (Fukushi, 1989). The SAM could be extended to address such preferences by tuning the object response curve to objects of variable characteristics or by adapting the attention curve to reflect preferential attention based on other stimulus parameters than the azimuthal position.

We thank Roland Kern for critically reading and helpful comments on the manuscript, and Tim Siesenop for animal breeding. We also thank two anonymous reviewers for their helpful comments.

Author contributions

Conceptualization: J.M., M.E., J.P.L.; Methodology: J.M., M.E., J.P.L.; Software: J.M.; Validation: J.M.; Formal analysis: J.M.; Investigation: J.M.; Resources: M.E.; Data curation: J.M.; Writing - original draft: J.M.; Writing - review & editing: J.M., M.E., J.P.L.; Visualization: J.M., J.P.L.; Supervision: M.E., J.P.L.; Project administration: J.M., M.E., J.P.L.; Funding acquisition: M.E.

Funding

This work was supported by the Deutsche Forschungsgemeinschaft Center of Excellence Cognitive Interaction Technology (CITEC, EXC 277).

Data availability

Data are available from Bielefeld University repository: https://doi.org/10.4119/unibi/2961542

Berens
,
P.
(
2009
).
CircStat: a MATLAB toolbox for circular statistics
.
J. Stat. Softw.
31
,
1
-
21
.
Fukushi
,
T.
(
1989
).
Learning and discrimination of coloured papers in the walking blowfly, Lucilia cuprina
.
J. Comp. Physiol. A
166
,
57
-
64
.
Horn
,
E.
(
1978
).
The mechanism of object fixation and its relation to spontaneous pattern preferences in Drosophila melanogaster
.
Biol. Cybern.
31
,
145
-
158
.
Horn
,
E.
and
Wehner
,
R.
(
1975
).
The mechanism of visual pattern fixation in the walking fly, Drosophila melanogaster
.
J. Comp. Physiol.
101
,
39
-
56
.
Monteagudo Ibaretta
,
J.
(
2020
).
Object directed behavior of walking blowflies
.
PhD thesis
,
Bielefeld University
,
Bielefeld
,
Germany
.
Mronz
,
M.
(
2004
).
Die visuell motivierte Objektwahl laufender Taufliegen (Drosophila melanogaster) -Verhaltensphysiologie, Modellbildung und Implementierung in einem Roboter
.
PhD thesis
,
Universität Würzburg
,
Würzburg
,
Germany
.
urn:nbn:de:bvb:20-opus-11748
.
Nityananda
,
V.
(
2016
).
Attention-like processes in insects
.
Proc. R. Soc. B Biol. Sci.
283
,
20161986
.
Poggio
,
T.
and
Reichardt
,
W.
(
1973
).
A theory of the pattern induced flight orientation of the fly Musca domestica
.
Kybernetik
12
,
185
-
203
.
Reichardt
,
W.
(
1973
).
Musterinduzierte Flugorientierung
.
Naturwissenschaften
60
,
122
-
138
.
Reichardt
,
W.
and
Poggio
,
T.
(
1975
).
A theory of the pattern induced flight orientation of the fly Musca domestica II
.
Biol. Cybern.
18
,
69
-
80
.
Reichardt
,
W.
and
Poggio
,
T.
(
1976
).
Visual control of orientation behaviour in the fly: part I. A quantitative analysis
.
Q. Rev. Biophys.
9
,
311
-
375
.
Robie
,
A. A.
,
Straw
,
A. D.
and
Dickinson
,
M. H.
(
2010
).
Object preference by walking fruit flies, Drosophila melanogaster, is mediated by vision and graviperception
.
J. Exp. Biol.
213
,
2494
-
2506
.
Sareen
,
P.
,
Wolf
,
R.
and
Heisenberg
,
M.
(
2011
).
Attracting the attention of a fly
.
Proc. Natl. Acad. Sci. USA
108
,
7230
-
7235
.
Schuster
,
S.
,
Strauss
,
R.
and
Götz
,
K. G.
(
2002
).
Virtual-reality techniques resolve the visual cues used by fruit flies to evaluate object distances
.
Curr. Biol.
12
,
1591
-
1594
.
Tang
,
S.
and
Juusola
,
M.
(
2010
).
Intrinsic activity in the fly brain gates visual information during behavioral choices
.
PLoS ONE
5
,
e14455
.
van Swinderen
,
B.
(
2011
).
Attention in Drosophila
.
Int. Rev. Neurobiol.
99
,
51
-
85
.
Warzecha
,
A. -K.
and
Egelhaaf
,
M.
(
2000
).
Response latency of a motion-sensitive neuron in the fly visual system: dependence on stimulus parameters and physiological conditions
.
Vis. Res.
40
,
2973
-
2983
.
Wehner
,
R.
(
1972
).
Spontaneous pattern preferences of Drosophila melanogaster to black areas in various parts of the visual field
.
J. Insect Physiol.
18
,
1531
-
1543
.
Wolf
,
R.
and
Heisenberg
,
M.
(
1980
).
On the fine structure of yaw torque in visual flight orientation of Drosophila melanogaster
.
J. Comp. Physiol.
140
,
69
-
80
.

Competing interests

The authors declare no competing or financial interests.

Supplementary information