To thrive, organisms must maintain physiological and environmental variables in suitable ranges. Given that these variables undergo constant fluctuations over varying time scales, how do biological control systems maintain control over these values? We explored this question in the context of phototactic behavior in larval zebrafish. We demonstrate that larval zebrafish use phototaxis to maintain environmental luminance at a set point, that the value of this set point fluctuates on a time scale of seconds when environmental luminance changes, and that it is determined by calculating the mean input across both sides of the visual field. These results expand on previous studies of flexible phototaxis in larval zebrafish; they suggest that larval zebrafish exert homeostatic control over the luminance of their surroundings, and that feedback from the surroundings drives allostatic changes to the luminance set point. As such, we describe a novel behavioral algorithm with which larval zebrafish exert control over a sensory variable.

All living organisms exert control over a variety of physiological variables. For example, animals employ sophisticated control systems to keep body temperature, body mass, blood osmolarity and many other parameters within narrow ranges critical for bodily function (Cannon, 1939). Many of these homeostatic processes involve comparing moment-to-moment values of the controlled physiological variables with ‘set points’ that the control system seeks to maintain. When a variable deviates from its set point, the control system acts, often via negative feedback, to restore the variable to its set value.

Conceptualizations of homeostatic control often treat set points as fixed in value, but changing environmental or internal conditions could render an existing, fixed, set point maladaptive (Woods and Ramsay, 2007). When this occurs, a robust control system ought to flexibly adjust its set point to a range adaptive to the new conditions. This process has been termed allostasis (Morville et al., 2018 preprint; Sterling, 2012), and allostatic shifts in set points occur everywhere across the animal kingdom. For example, many endothermic animals exhibit an elevated body temperature set point, fever, in response to infection (Cabanac and Massonnet, 1974; Moltz, 1993), whereas animals that hibernate through the winter reduce their body temperature set point during hibernation, but increase their caloric set point before hibernation sets in (Mrosovsky and Fisher, 1970; Ortmann and Heldmaier, 2000). Finally, homeostatic and allostatic control can involve behavioral, in addition to physiological, changes. Ectothermic animals that regulate body temperature by seeking out warmer or cooler regions of the environment also exhibit behavioral fever (Rakus et al., 2017). Despite the ubiquity of allostasis in physiology, it is still poorly understood how physiological control systems adjust their set points in response to changing internal and external conditions, and how allostasis interacts with homeostatic control.

In this study, we establish luminance-based navigation in larval zebrafish as a model for investigating behavioral allostatic control. Previous work on luminance-based navigation in larval zebrafish has focused on their tendency to orient and swim towards brighter regions of luminance gradients; this behavior is termed positive phototaxis (Brockerhoff et al., 1995; Chen and Engert, 2014; Chen et al., 2018; Guggiana-Nilo and Engert, 2016; Karpenko et al., 2020; Wolf et al., 2017). However, in naturalistic environments, luminance varies widely, both throughout the day and as fish move into and out of shade. Therefore, a strategy of purely positive phototaxis might not be adaptive to larval zebrafish, and it is likely too simplistic a view of this complex behavior. Indeed, evidence of flexibility in the phototactic behavior of larval zebrafish has been documented. One study demonstrated that larval zebrafish avoid light sources that are too bright and that this avoidance depends on the luminance to which fish are pre-adapted (Burgess et al., 2010). Another study revealed that larval zebrafish exhibit negative phototaxis in gradients of near-infrared light (Hartmann et al., 2018). These findings suggest that the phototactic behavior of larval zebrafish is flexible and can be modulated by environmental luminance and its history.

We sought to characterize the behavioral algorithms that underlie the flexibility of phototaxis in larval zebrafish. Towards that end, we delivered closed-loop luminance gradient stimuli to freely swimming larval zebrafish that were pre-adapted to different luminance histories, and we formulated simple behavioral algorithms that could explain the resultant behavior. We found that larval zebrafish perform positive and negative phototaxis to orient towards a set point luminance, the value of which depends on the luminance history of their surroundings. Furthermore, fish compute the set point luminance using visual information from both eyes. These findings uncovered previously unappreciated principles underlying phototaxis in larval zebrafish, namely that the larval zebrafish employs phototaxis to maintain its experienced luminance at a fixed value and that its luminance preference fluctuates in response to changing environmental luminance conditions. We believe that this behavioral control of experienced luminance can serve as a model for investigating neural implementations of homeostatic and allostatic control.

Experimental model and subject details

Experiments were conducted according to the guidelines of the National Institutes of Health and were approved by the Standing Committee on the Use of Animals in Research of Harvard University. Animals were handled according IACUC protocol #2729. For all experiments, we used wild-type larval zebrafish (strains AB and WIK), aged 5–8 days post-fertilization (dpf). We did not determine the sex of the fish we used. Fish were raised in shallow Petri dishes and fed ad libitum with paramecia after 4 dpf. Fish were raised on a 14 h:10 h light:dark cycle at around 27°C. All experiments were done during daylight hours (4–14 h after lights on). All protocols and procedures were approved by the Harvard University/Faculty of Arts and Sciences Standing Committee on the Use of Animals in Research and Teaching (Institutional Animal Care and Use Committee).

Method details

Design of system for tracking and closed-loop video projection

For behavioral experiments related to Figs 13, we used the same behavioral system for tracking freely swimming larval zebrafish as in Bahl and Engert (2020). Larval zebrafish swam freely in custom-made, circular, acrylic dishes with black walls and filled with filtered system water. Dish diameter was 12 cm; wall height was 5 mm. Fish were bottom-lit using light-emitting diode (LED) arrays (940 nm, Cop Security) so that the shadow they cast could be used to determine their position and orientation. We tracked the fish using a Grasshopper3-NIR camera (FLIR Systems) equipped with a zoom lens (Zoom 7000, 18–108 mm, Navitar) and a long-pass filter (R72, Hoya). Frame data were stably acquired at around 90 frames s−1 and analyzed in real time to extract fish position and orientation. For each experiment, we used two groups of four cameras, with each group of four connected to a different computer; thus, each computer could track four separate fish simultaneously. Fish were tracked using code written in C++, Python 3.7 and OpenCV 4.1 (see ‘Quantification and statistical analysis’, below). We delivered visual stimuli locked to the position and orientation of the fish.

Fig. 1.

Larval zebrafish orient towards a set point during luminance-based navigation. (A) Schematic diagram of the experimental setup. Larval zebrafish swim freely while visual stimuli are presented locked to fish reference frames (see Materials and Methods). (B) Experimental design. Each trial consisted of two periods. During the first period (‘pre-adaptation’) fish were held in a dim (L=0.25, n=11 fish) or bright (L=0.75, n=8 fish) environment for at least 10 s. Immediately following pre-adaptation, fish were subjected to a test period for at least 3 s. During the test period, the left and right sides of the environment relative to the fish were held at brightness values (BL, BR) selected pseudo-randomly from the set {0, 0.25, 0.50, 0.75, 1.00}. (C) Change in orientation of fish over the last 3 s of pre-adaptation. The color bar reflects equal luminance on the two sides of the fish. Each trace shows the change in orientation in a single trial for a single animal. Orientation values are presented relative to the animal's orientation 3 s before test period onset. Blue traces: condition 1 (n=11 fish, 2200 trials). Red traces: condition 2 (n=8 fish, 720 trials). Thicker traces show the mean of each condition (partial overlap with dashed line). (D) Statistical comparison between pre-adaptation periods in conditions 1 and 2. Top: gray histogram shows bootstrapped distribution of trials shuffled randomly and split with 2200 trials in one group and 720 in another to preserve group size (1000 bootstrapped means). Red and blue ticks show observed means for conditions 1 and 2, respectively (μ1=0.40 deg, μ2=−4.72 deg); they fall within the 90% confidence interval (CI) of the shuffled mean [−7.31 deg, 1.26 deg]. Bottom: the bootstrapped null distribution of the difference in means between the two conditions (1000 bootstrapped differences). Trials were shuffled and sorted as described for the histogram above. The purple tick shows the observed difference in means (μ1−μ2=5.12 deg), which falls within the 80% CI of the shuffled difference [−7.25 deg, 6.89 deg]. (E) Same as C for the test period. Negative orientation angles were defined to be in the bright direction and positive orientation angles were defined to be in the dim direction, as shown in the color bar. Note the clear separation between the two conditions. (F) Same as D for the test period. Observed means and difference between means fall completely outside bootstrapped distributions for shuffled data (1000 bootstrapped values for each distribution), indicating a difference significant to P<0.001. (G) Analysis of the test period for trials in which one side of the fish was at set point luminance. The luminance of the other side was considered the test luminance. The shaded region denotes the set point luminance. Bias towards the set point side depended significantly on the test luminance (ANOVA, d.f.=4, P<0.05 for both conditions): bias towards the set point luminance was higher when the test luminance deviated from the set point than when the test luminance was equal to the set point luminance (condition 1: test luminance 0.25 versus test luminance 1.0, t-test P<0.01; condition 2: test luminance 0.75 versus test luminance 0.0, t-test P<0.01). Error bars denote standard deviation across fish. (H) Explanation of abbreviations and calculations used to generate I. (I) Percentage of leftward swims plotted as a function of relative distance from the set point: EREL. Higher EREL values drive higher leftward swim bias (t-test on slope of linear fit, P<0.001). Error bars denote standard deviation across fish.

Fig. 1.

Larval zebrafish orient towards a set point during luminance-based navigation. (A) Schematic diagram of the experimental setup. Larval zebrafish swim freely while visual stimuli are presented locked to fish reference frames (see Materials and Methods). (B) Experimental design. Each trial consisted of two periods. During the first period (‘pre-adaptation’) fish were held in a dim (L=0.25, n=11 fish) or bright (L=0.75, n=8 fish) environment for at least 10 s. Immediately following pre-adaptation, fish were subjected to a test period for at least 3 s. During the test period, the left and right sides of the environment relative to the fish were held at brightness values (BL, BR) selected pseudo-randomly from the set {0, 0.25, 0.50, 0.75, 1.00}. (C) Change in orientation of fish over the last 3 s of pre-adaptation. The color bar reflects equal luminance on the two sides of the fish. Each trace shows the change in orientation in a single trial for a single animal. Orientation values are presented relative to the animal's orientation 3 s before test period onset. Blue traces: condition 1 (n=11 fish, 2200 trials). Red traces: condition 2 (n=8 fish, 720 trials). Thicker traces show the mean of each condition (partial overlap with dashed line). (D) Statistical comparison between pre-adaptation periods in conditions 1 and 2. Top: gray histogram shows bootstrapped distribution of trials shuffled randomly and split with 2200 trials in one group and 720 in another to preserve group size (1000 bootstrapped means). Red and blue ticks show observed means for conditions 1 and 2, respectively (μ1=0.40 deg, μ2=−4.72 deg); they fall within the 90% confidence interval (CI) of the shuffled mean [−7.31 deg, 1.26 deg]. Bottom: the bootstrapped null distribution of the difference in means between the two conditions (1000 bootstrapped differences). Trials were shuffled and sorted as described for the histogram above. The purple tick shows the observed difference in means (μ1−μ2=5.12 deg), which falls within the 80% CI of the shuffled difference [−7.25 deg, 6.89 deg]. (E) Same as C for the test period. Negative orientation angles were defined to be in the bright direction and positive orientation angles were defined to be in the dim direction, as shown in the color bar. Note the clear separation between the two conditions. (F) Same as D for the test period. Observed means and difference between means fall completely outside bootstrapped distributions for shuffled data (1000 bootstrapped values for each distribution), indicating a difference significant to P<0.001. (G) Analysis of the test period for trials in which one side of the fish was at set point luminance. The luminance of the other side was considered the test luminance. The shaded region denotes the set point luminance. Bias towards the set point side depended significantly on the test luminance (ANOVA, d.f.=4, P<0.05 for both conditions): bias towards the set point luminance was higher when the test luminance deviated from the set point than when the test luminance was equal to the set point luminance (condition 1: test luminance 0.25 versus test luminance 1.0, t-test P<0.01; condition 2: test luminance 0.75 versus test luminance 0.0, t-test P<0.01). Error bars denote standard deviation across fish. (H) Explanation of abbreviations and calculations used to generate I. (I) Percentage of leftward swims plotted as a function of relative distance from the set point: EREL. Higher EREL values drive higher leftward swim bias (t-test on slope of linear fit, P<0.001). Error bars denote standard deviation across fish.

Fig. 2.

Larval zebrafish possess a unitary phototactic set point that depends on luminance on both sides of the fish. (A,B) Schematic diagrams of two competing hypotheses for the behavioral algorithm that larval zebrafish use for set point seeking. In A, each eye has its own luminance set point (SPL and SPR). BL and BR are the brightness experienced by the left and right eye, respectively. In B, there is a unitary set point (SP) that approaches the mean of BR and BL. Other computations are identical to those for A except that BR and BL are compared with SP instead of SPL and SPR. See Materials and Methods for implementation of models. (C) Experimental setup. During pre-adaptation, one side of the fish was bright and the other side was dark. During the test period, the luminance of the bright side was decreased to a final value between the two pre-adaptation values. (D) Simulated turn angle distributions of the two models in A and B during the test period. (E) Cumulative turn angle over the first six bouts predicted by the two models. In all panels, cumulative turn angles were defined to be the cumulative orientation change reached after the first six swim bouts during the first 5 s of the test period or the last 5 s of the pre-adaptation period. Color bar shows luminance; positive angles are defined to be towards higher luminance. (F) Schematic drawing showing that the two models predict opposite behavioral outcomes. (G) Turn angle distribution over all turns made during the first 5 s of the test phase. (H) Cumulative turn angle observed in real fish. (I) Mean cumulative angle change after six swim bouts during pre-adaption and test periods for eight fish. The slight positive phototaxis during pre-adaptation was enhanced during the test period (paired t-test). (J) Schematic diagram of the second experiment, in which the dark side of the pre-adaptation environment was brightened. (K) Mean cumulative angle change after six swim bouts during pre-adaptation and test periods for eight fish. The slight positive phototaxis during pre-adaptation was suppressed during the test (paired t-test).

Fig. 2.

Larval zebrafish possess a unitary phototactic set point that depends on luminance on both sides of the fish. (A,B) Schematic diagrams of two competing hypotheses for the behavioral algorithm that larval zebrafish use for set point seeking. In A, each eye has its own luminance set point (SPL and SPR). BL and BR are the brightness experienced by the left and right eye, respectively. In B, there is a unitary set point (SP) that approaches the mean of BR and BL. Other computations are identical to those for A except that BR and BL are compared with SP instead of SPL and SPR. See Materials and Methods for implementation of models. (C) Experimental setup. During pre-adaptation, one side of the fish was bright and the other side was dark. During the test period, the luminance of the bright side was decreased to a final value between the two pre-adaptation values. (D) Simulated turn angle distributions of the two models in A and B during the test period. (E) Cumulative turn angle over the first six bouts predicted by the two models. In all panels, cumulative turn angles were defined to be the cumulative orientation change reached after the first six swim bouts during the first 5 s of the test period or the last 5 s of the pre-adaptation period. Color bar shows luminance; positive angles are defined to be towards higher luminance. (F) Schematic drawing showing that the two models predict opposite behavioral outcomes. (G) Turn angle distribution over all turns made during the first 5 s of the test phase. (H) Cumulative turn angle observed in real fish. (I) Mean cumulative angle change after six swim bouts during pre-adaption and test periods for eight fish. The slight positive phototaxis during pre-adaptation was enhanced during the test period (paired t-test). (J) Schematic diagram of the second experiment, in which the dark side of the pre-adaptation environment was brightened. (K) Mean cumulative angle change after six swim bouts during pre-adaptation and test periods for eight fish. The slight positive phototaxis during pre-adaptation was suppressed during the test (paired t-test).

Fig. 3.

The luminance set point depends on environmental luminance history. (A) Schematic diagram of the experiment to probe temporal evolution of the set point. Fish were subjected to a first pre-adaptation period in either dim (L=0.25, condition 1) or bright (L=0.75, condition 2) luminance. Fish then experienced a second pre-adaptation period of varying length (condition 1: luminance increased to 0.75, condition 2: luminance decreased to 0.25). Finally, fish experienced a split-luminance test period (L=0 on left, L=1 on right). (B) Turn angle probability distribution for both conditions and different pre-adaptation 2 lengths (0, 3, 6, 9 or 12 s, as shown on the right). Low-angle swim bins were truncated (gray slashes) to allow for comparison of changes with larger angle turn distributions. Turn angle distributions were defined over all turns made during the first 5 s of the test phase (n=14 fish). (C) The number of right turns as a fraction of the total number of turns. Angle threshold for turn classification was 15 deg. Note the opposite turning bias for 0 s pre-adaptation 2 and 12 s pre-adaptation 2 in both conditions (t-test, P<0.001 for both conditions). Error bars denote standard deviation across fish.

Fig. 3.

The luminance set point depends on environmental luminance history. (A) Schematic diagram of the experiment to probe temporal evolution of the set point. Fish were subjected to a first pre-adaptation period in either dim (L=0.25, condition 1) or bright (L=0.75, condition 2) luminance. Fish then experienced a second pre-adaptation period of varying length (condition 1: luminance increased to 0.75, condition 2: luminance decreased to 0.25). Finally, fish experienced a split-luminance test period (L=0 on left, L=1 on right). (B) Turn angle probability distribution for both conditions and different pre-adaptation 2 lengths (0, 3, 6, 9 or 12 s, as shown on the right). Low-angle swim bins were truncated (gray slashes) to allow for comparison of changes with larger angle turn distributions. Turn angle distributions were defined over all turns made during the first 5 s of the test phase (n=14 fish). (C) The number of right turns as a fraction of the total number of turns. Angle threshold for turn classification was 15 deg. Note the opposite turning bias for 0 s pre-adaptation 2 and 12 s pre-adaptation 2 in both conditions (t-test, P<0.001 for both conditions). Error bars denote standard deviation across fish.

Visual stimuli

We delivered different luminance values to the fish by commanding a video projector (60 Hz, AAXA P300 Pico Projector) to project different grayscale pixel values, ranging from 0 (black) to 1 (white). We used an iPhone 11 Pro and the Lux Light Meter Pro app at a distance of about 5 cm above the dish to measure brightness levels: L=0 (0.46 lm), L=0.25 (1.78 lm), L=0.5 (9.42 lm), L=0.75 (19.16 lm), L=1 (32.49 lm) (Fig. S1A). Visual stimuli were projected from below onto white paper to disperse the light for visibility. Visual stimuli were projected in the reference frame of the fish. For split-luminance experiments, all pixels with negative x values in this coordinate system were defined to be left of the fish, and all pixels with positive x values were defined to be right of the fish. For all experiments, following the probe period, fish experienced the same luminance conditions as in the pre-adaptation period for at least 10 s. After this, the next trial began. For the experiments in Fig. 1, we included mirror symmetric controls (Fig. S2A).

Set point seeking experiments

As shown in Fig. 1, we held the fish in either dim (L=0.25) or bright (L=0.75) luminance for 10 s, and then subjected it to a split-luminance test period in which the luminance of the left and right sides of the fish was selected randomly from five possible pixel values (0, 0.25, 0.5, 0.75, 1). For the bright pre-adaptation experiments, the test period lasted for 10 s; however, we noticed a decrease in turning bias after the first few seconds due to adaptation (Fig. S2E,F). As a result, we limited the test period to 3 s for the dim pre-adaptation experiments and only analyzed the first 3 s of the test period in both conditions.

Split-luminance pre-adaptation experiments

As shown in Fig. 2, we held the fish in a split-luminance environment (luminance on dim side: L=0; luminance on bright side: L=1) for 16 s. After this pre-adaptation period, we changed the luminance of either the bright side or the dim side for 10 s.

Two pre-adaptation experiments

As shown in Fig. 3, we held the fish in an initial pre-adaptation period (L=0.25 or L=0.75) for 16 s. We then held the fish in a second pre-adaptation period; if the luminance during the initial pre-adaptation was L=0.25, the luminance during the second pre-adaptation was L=0.75. Conversely, if the luminance during the initial pre-adaptation was L=0.75, the luminance during the second pre-adaptation was L=0.25. Across different trials, the length of the second pre-adaptation period was chosen pseudorandomly from these possible values: 0 s (i.e. no second pre-adaptation), 3, 6, 9 and 12 s.

Modeling

Complete details on our in silico experiment settings and initializations of fish parameters are available on GitHub at https://github.com/diptodip/brightfish.

We simulated two computational models of zebrafish phototaxis: one using separate monocular information and one integrating binocular information. All simulations occurred within a 2D grid of dimensions (H, W) (rows, columns). In our simulations, both height (H) and width (W)=101 for the spotlight experiment (Fig. 4G) and H and W=51 for the partitioned halves experiments (Figs 2 and 4D). We simulated fish as points without volume within this grid. For both models, the fish calculates brightness in each eye as the mean value of all grid tiles falling within two coterminal rays originating from the fish position with an angle of 0.8π between them.

Fig. 4.

Luminance set point seeking is consistent with previously reported positive phototactic behavior. (A) Schematic diagram of the experiment described in Fig. 1B. (B) Simulated fish results for the experiment shown in A. Different conditions show opposite luminance preferences (exact test on difference between mean orientation after six bouts, P<0.01). (C) Replotted data from Fig. 1E for comparison. (D–F) Simulations of the split-arena phototaxis experiment performed by Brockerhoff et al. (1995). In D, simulated fish swam freely in a brightly lit (L=1) arena; after 500 simulation time steps, the right half of the arena was darkened (L=0). Note that the visual stimuli here were fixed in the lab reference frame, not the fish's reference frame. E shows swim paths and occupancy densities of 100 simulated fish during pre-adaptation and test periods. Arrowheads denote the final positions of the fish. F shows quantification of occupancy density of the left half of the arena during pre-adaptation and test periods for simulated fish and during the test period reported by Brockerhoff et al. (1995). Error bars denote standard deviation of mean occupancy. Pre-adaptation values were not significantly different from chance (t-test, P>0.25); test values were significantly larger than chance (t-test, P<0.001). (G) Simulations of the spotlight phototaxis experiment performed by Burgess et al. (2010). In both conditions, fish were pre-adapted to a dim environment (L=0.1). After 500 simulation time steps, the environment was either completely darkened (L=0, control condition) or darkened (L=0) except for a spotlight (L=1). The arena was 101×101 pixels, and the spotlight had a radius of 11 pixels. During pre-adaptation, fish positions were fixed to the middle of the arena. During the test period, fish were allowed to swim freely, and the visual scene was fixed to the lab reference frame, not the fish reference frame. (H) Swim paths during the test period in the spotlight condition; fish swam towards the spotlight. (I) Fish in the spotlight condition exhibited positive phototaxis if the spotlight luminance was similar to the pre-adaptation luminance and negative phototaxis if the spotlight luminance was too bright, consistent with Burgess et al.’s (2010) findings (pre-adaptation L=0.005). Rate was calculated as the average change in Euclidean distance from the spotlight after 500 time steps, divided by 500.

Fig. 4.

Luminance set point seeking is consistent with previously reported positive phototactic behavior. (A) Schematic diagram of the experiment described in Fig. 1B. (B) Simulated fish results for the experiment shown in A. Different conditions show opposite luminance preferences (exact test on difference between mean orientation after six bouts, P<0.01). (C) Replotted data from Fig. 1E for comparison. (D–F) Simulations of the split-arena phototaxis experiment performed by Brockerhoff et al. (1995). In D, simulated fish swam freely in a brightly lit (L=1) arena; after 500 simulation time steps, the right half of the arena was darkened (L=0). Note that the visual stimuli here were fixed in the lab reference frame, not the fish's reference frame. E shows swim paths and occupancy densities of 100 simulated fish during pre-adaptation and test periods. Arrowheads denote the final positions of the fish. F shows quantification of occupancy density of the left half of the arena during pre-adaptation and test periods for simulated fish and during the test period reported by Brockerhoff et al. (1995). Error bars denote standard deviation of mean occupancy. Pre-adaptation values were not significantly different from chance (t-test, P>0.25); test values were significantly larger than chance (t-test, P<0.001). (G) Simulations of the spotlight phototaxis experiment performed by Burgess et al. (2010). In both conditions, fish were pre-adapted to a dim environment (L=0.1). After 500 simulation time steps, the environment was either completely darkened (L=0, control condition) or darkened (L=0) except for a spotlight (L=1). The arena was 101×101 pixels, and the spotlight had a radius of 11 pixels. During pre-adaptation, fish positions were fixed to the middle of the arena. During the test period, fish were allowed to swim freely, and the visual scene was fixed to the lab reference frame, not the fish reference frame. (H) Swim paths during the test period in the spotlight condition; fish swam towards the spotlight. (I) Fish in the spotlight condition exhibited positive phototaxis if the spotlight luminance was similar to the pre-adaptation luminance and negative phototaxis if the spotlight luminance was too bright, consistent with Burgess et al.’s (2010) findings (pre-adaptation L=0.005). Rate was calculated as the average change in Euclidean distance from the spotlight after 500 time steps, divided by 500.

At each time step, the simulated fish first updates its set point(s). The monocular fish has two set points, one for the left eye (SPL) and one for the right eye (SPR). It will calculate the differences:
formula
(1)
formula
(2)
where BL and BR are brightness values experienced by the left and right eye, respectively, and then use a learning rate r to update its set points:
formula
(3)
formula
(4)
The binocular fish has one set point. It will calculate the difference:
formula
(5)
And similarly use the learning rate to update the set point:
formula
(6)
After updating its set point(s), the fish turns in the direction of the eye with a smaller difference from the set point as described in Results; if the difference between the error signals from the left and right sides ELER>0, the fish turns right; otherwise, the fish turns left. The fish samples a turn angle from one of two normal (N) distributions – one from the no-turn distribution Δθn∼N(0.01, 0.50) and the other from the turn distribution Δθt∼N(0.52, 0.59). The choice of distribution is given by a binomial with probability of choosing the turn distribution f(ELER), where f is a non-linear function f(x)=c|x|(1/3), x∈[−1, 1], and c is maximum turn probability (we use c=0.75). The non-linearity f and maximum turn probability c are included to better map ELER to the turn behavior of real fish. The choice of exponent in f does not greatly affect fish behavior (data not shown). The sign of the turn direction is flipped for right turns versus left turns and we describe angles in radians. These distributions were generated by fitting Gaussian curves to turn angle distributions of the pre-adaptation period (no-turn distribution) or test period (turn distribution) of the condition in Fig. 1 where pre-adaptation luminance was 0.75 and the test period luminances were (0.75, 0) (data available from GitHub: https://github.com/diptodip/brightfish/tree/master/experiments). Then, the fish updates its heading as θ=(θ+Δθ)mod2π. Finally, the fish determines whether a swim occurs at this time step by sampling from a Bernoulli distribution with probability pmove. If the fish swims at this time step, it samples a move distance d∼N(μd, σd) and moves d units in its heading direction θ. We used a learning rate r of 0.001, a pmove of 0.2, and a move distance distribution d∼N(5.0, 1.0), chosen to roughly match fish swim/set point adjustment behavior within our arbitrary space and time coordinate space.

Quantification and statistical analysis

Closed-loop tracking and swim-bout detection for freely swimming zebrafish

Software used for tracking freely swimming larval zebrafish and detecting swim bouts in real time was the same as in Bahl and Engert (2020). First, the image background was calculated as the mode image over approximately 60 s. For each acquired image frame, the background was subtracted. In the mode-subtracted image, the center of mass was defined to be the position of the larval zebrafish, and we used second-order image moments to determine its orientation. To detect swim bouts, we calculated a variance over a rolling, 50 ms time window. Variance spikes, subject to interbout interval constraints, were used to determine swim bout times.

Statistical tests

Details of statistical tests used in this study can be found in the figure legends. Unless otherwise specified in the figure legends, error bars signify ±s.d. around the mean. Trials were selected pseudorandomly using the output of a random number generator and without human input. Sample sizes were not predetermined. We excluded fish that appeared for long periods in the image background, as this suggested that they were dead or otherwise immobile. All exclusion was done prior to data analysis.

Larval zebrafish orient towards a set point during luminance-based navigation

To deliver controlled luminance stimuli to freely swimming larval zebrafish (5–8 dpf), we employed a closed-loop video projection system (Fig. 1A) used in previous work (Bahl and Engert, 2020) (see Materials and Methods). Here, a high-speed camera recorded a video of a fish swimming in a shallow, circular dish, a computer-vision program then calculated its position and orientation in real time, and a projector used this information to deliver visual stimuli fixed to the fish's reference frame. As a result, the visual stimuli, and in particular a specific luminance, could be kept constant on the fish's eyes, even if the animal moved continuously through the arena (see Materials and Methods).

Larval zebrafish were pre-adapted to either a bright (L=0.75, see Materials and Methods) or a dim (L=0.25) luminance level for 10 s (Fig. 1B, pre-adaptation period). The following pixel gray-scale values and their respective luminance values were used: L=0 (0.46 lm), L=0.25 (1.78 lm), L=0.5 (9.42 lm), L=0.75 (19.16 lm) and L=1 (32.49 lm) (Fig. S1A). To allow for comparison with other work (Burgess et al., 2010), we estimated the intensity of our illuminations using a luminous efficacy of 90 lm W−1 to yield 45 µW cm−2 at L=0 and 3.2 mW cm−2 at L=1. Following this pre-adaptation period, the fish experienced a split-luminance environment: a test period in which one visual hemifield was bright (L=1) and the other visual hemifield was dim (L=0) (Fig. 1B). We included a mirror-symmetric control for all stimuli used in Fig. 1 (Fig. S2A). As shown in previous work (Colwill and Creton, 2011; Dunn et al., 2016; Fero et al., 2011; Huang et al., 2013; Johnson et al., 2020; Marques et al., 2018), during the pre-adaptation period, when fish experienced uniform luminance, we observed no significant bias in turn direction (Fig. 1C,D).

However, a comparison of the swimming statistics during the pre-adaptation period (Fig. 1C,D) and the test period (Fig. 1E,F) revealed that fish do not simply perform positive phototaxis, as has been suggested by previous studies (Brockerhoff et al., 1995; Guggiana-Nilo and Engert, 2016; Karpenko et al., 2020; Wolf et al., 2017); instead, they consistently turned towards the side closest in luminance to that in the pre-adaptation period. This indicates that larval zebrafish prefer a luminance similar to the pre-adaptation luminance, suggesting that this value serves as a set point for subsequent luminance-driven navigation. Thus, fish pre-adapted to a bright environment exhibited a turning bias towards the bright visual hemifield during the test period, while fish pre-adapted to a dim environment exhibited a turning bias towards the dim visual hemifield during the test period (Fig. 1E,F; Fig. S2D). The turning bias was highest immediately after switching from the pre-adaptation period to the test period, and gradually declined throughout the test period (Fig. S2E,F). To limit the effect of this adaptation on our analyses, we considered turning behavior only within the first 3 s of the test period for the analyses presented in Fig. 1. In addition, we examined whether there were differences in other bout statistics between the different pre-adaptation conditions (Fig. S2B,C). We found no difference in the latency to the first bout but saw a transient elevation in bout rate following the transition from the dim pre-adaptation to the test period.

If the pre-adaptation luminance is truly the luminance set point during the test period, then fish should prefer the pre-adaptation luminance to any other luminance. To investigate this, we held one visual hemifield constant at the pre-adaptation luminance during the test period and changed the luminance of the other hemifield over a large range of luminances (L=0, 0.25, 0.5, 0.75 and 1). To normalize differences in the number of swim bouts across different trials, we calculated the percentage of leftward swims (defined to be negative angles) and rightward swims (positive angles) for each trial. This measure corresponded well with the accumulated angle measure used in Fig. 1C–F (Fig. S2G). We next tested a large set of combinations of pre-adaptation and test values and found that, for all of these, the pre-adaptation luminance appeared to act as a set point for luminance-based navigation during the test period (Fig. 1G).

How might we formally characterize this relationship between pre-adaptation luminance and turning behavior? We hypothesized a simple behavioral algorithm that the fish might use: in the test period, the fish compares the brightness values experienced by the left eye (BL) and the right eye (BR) with the set point (SP) to generate two error signals (EL=|BL−SP|, ER=|BR−SP|). It then biases turning towards the direction of the smaller error. To determine how well our model describes light-seeking behavior, we analyzed turning data across all pre-adaptation and test period luminance conditions (2 pre-adaptation luminances×5 left visual hemifield test luminances×5 right visual hemifield test luminances=50 total conditions; Fig. S2H,I). For each condition, we calculated EREL and plotted the percentage of swims to the left as a function of EREL (Fig. 1H,I). Consistent with our model's predictions, when ER was larger than EL (EREL>0), fish swam leftward, and when ER was smaller than EL (EREL<0), fish swam rightward.

These results indicate that the larval zebrafish prefers the environmental luminance to which it is adapted. When it encounters environments of variable luminance, the fish moves to minimize deviations from the adapted luminance. We note that this behavior appears similar to the behavioral defense of a homeostatic set point, as seen in thermoregulation in larval zebrafish (Haesemeyer et al., 2018).

Larval zebrafish possess a unitary phototactic set point that depends on luminance on both sides of the fish

While our hypothesized behavioral algorithm describes the relationship between pre-adaptation luminance and split-luminance turning bias well, it assumes a common set point to which luminance values from both the left and right eyes are compared. An alternative to this unitary, binocular set point is two separate set points – one for the left eye and another for the right eye. Determining whether two monocular set points exist (Fig. 2A), or whether only one binocular set point exists (Fig. 2B) would inform hypotheses about where this set point is implemented in the brain. If two monocular set points exist, they might be implemented in earlier regions of the visual processing stream, such as the retina, before information from the two eyes has converged. In contrast, if only one binocular set point exists, it might be implemented in a brain region that integrates information from both eyes or extraocular photoreceptors that integrate global luminance information (Horstick et al., 2017).

The experimental paradigm described in Fig. 1B cannot differentiate between the two competing hypotheses schematized in Fig. 2A,B because during the pre-adaptation period, the two eyes experience the same luminance conditions, so we cannot tell whether pre-adaptation generates a unitary, binocular set point, or two separate monocular set points with the same luminance value. Therefore, we performed experiments in which we pre-adapted the fish to a split-luminance environment, in which one visual hemifield was relatively bright (L=1) and the other visual hemifield was relatively dim (L=0) for 16 s (Fig. 2C). Following this pre-adaptation period, we changed the luminance of either the bright (Fig. 2C) or the dim (Fig. 2J) visual hemifield to an intermediate value (L=0.5), while keeping the other one constant.

To show the differences in behavior predicted by these two competing models, we implemented both models computationally and simulated behavioral outcomes of the experiment presented in Fig. 2C (see Materials and Methods for details of model implementation). If each eye possesses its own luminance set point, then changing the luminance experienced by one eye would generate an error signal (Fig. 2; Fig. S3) that drives a turning bias away from that direction (Fig. 2D–F, green). In contrast, if luminance-based navigation is driven by a single set point, i.e. the mean luminance value of the two eyes (L=0.5), then the fish should turn away from the eye receiving constant illumination (Fig. 2D–F, yellow), as there the error signal remains high (Fig. 2; Fig. S3; EL). In the other eye the error drops from a high value to zero (Fig. 2; Fig. S3; ER).

We next tested these predictions from our model in behavioral experiments (Fig. 2G–I). We first observed that during pre-adaptation, fish exhibited a slight bias towards the bright side (Fig. 2I,K, pre-adaptation). We observed that when the bright side of the split-luminance environment was dimmed to an intermediate value, the fish exhibited a turning bias towards the changed side and away from the constant side (Fig. 2H,I). In other words, the positive phototaxis we observed during the test period was enhanced when we dimmed the bright side. Finally, when the dim pre-adaptation side was brightened, the initial positive phototactic bias was suppressed (Fig. 2K). This effect was smaller than when the bright pre-adaptation side was dimmed. A potential reason for the weaker effect upon brightening of the dim side might be that the measured luminance values are not translated linearly by the fish's nervous system.

Nonetheless, these data are consistent with the existence of a unitary set point generated by averaging luminance values across both visual hemifields. We believe that the drive to minimize deviations from this set point might sum or otherwise interact with innate luminance preferences, like those characterized previously (Brockerhoff et al., 1995) and observed here (Fig. 2I,K).

The luminance set point depends on environmental luminance history

The luminance of an animal's surroundings changes over short time scales, as the animal moves into and out of shade, and over long time scales, with the rising and setting of the sun. If the luminance that a larval zebrafish seeks depends on the luminance to which the fish has been pre-adapted, then this set point luminance should change over equivalent time scales. This could explain the gradual decline in turning bias that we observed (Fig. S2E,F) in the seconds after the fish's environment switched in luminance.

To more directly test our hypothesis that changing environmental luminance would alter the luminance set point of larval zebrafish, we performed experiments outlined in Fig. 3A. First, we subjected fish to an initial pre-adaptation period, termed pre-adaptation 1, in either bright (L=0.75) or dim (L=0.25) uniform luminance environments (Fig. 3A). Following pre-adaptation 1, we either transitioned the fish directly to a split-luminance test environment to assay turning bias (Fig. 3A, test), or we transitioned the fish to a second pre-adaptation period (termed pre-adaptation 2) of variable length (Fig. 3A). If pre-adaptation 1 was dim, then pre-adaptation 2 was bright (Fig. 3A, condition 1), and vice versa (Fig. 3A, condition 2). This test period lasted for 10 s, but to mitigate effects from behavioral adaptation, we considered bouts from the first 5 s of the test period.

When fish transitioned from pre-adaptation 1 directly into the test environment (i.e. 0 s of pre-adaptation 2), they exhibited a turning bias towards the luminance more similar to pre-adaptation 1 luminance (Fig. 3B,C, 0 s pre-adaptation 2), consistent with our findings presented in Fig. 1. In contrast, if we held the fish in pre-adaptation 2, they instead exhibited a turning bias towards the preadaptation 2 luminance (Fig. 3B,C). This switch in turning bias due to the second pre-adaptation period varied with its duration; a longer pre-adaptation drove a larger change in luminance set point (Fig. 3C). By contrast, when the second pre-adaptation was relatively short, around 3 s in duration, fish exhibited no strong bias towards either luminance during the split-luminance period. We conclude that environmental luminance fluctuations drive allostatic changes in the luminance set point over a time scale of seconds.

Taken with our observations that larval zebrafish seek a luminance set point, these data suggest that luminance-based navigation in larval zebrafish can be described by a ‘homeostatic–allostatic’ model. Over short time scales, the larval zebrafish exerts control over the luminance it experiences by using positive and negative phototaxis to orient towards a luminance set point. However, when the environmental luminance changes, the fish's luminance set point is allostatically modulated to reflect the new mean environmental luminance. We speculate that this allostatic modulation of the fish's set point might be coordinated with physiological changes in the fish's visual system (Burgess and Granato, 2007) that adapts it to the new environmental luminance.

Luminance set point seeking is consistent with previously reported phototactic behavior

Why have there been many robust observations of positive phototaxis in larval zebrafish but little previous evidence of the luminance set point seeking that we report here? One possibility is that fish have a stronger maximal preference towards light than towards darkness, as seen in Fig. 3C. In addition, we argue that because these previous studies generally pre-adapted fish to an environment brighter than the test environment, the fish showed a preference for brighter regions during the test period. Consequently, fish would orient and swim towards brighter regions of the test environment and thus exhibit positive phototaxis. Indeed, when previous studies pre-adapted fish to environments darker than the test environment, fish exhibited much less positive (Brockerhoff et al., 1995), and sometimes even negative, phototaxis (Burgess et al., 2010).

To demonstrate that an agent using our proposed homeostatic–allostatic algorithm for luminance-based navigation would perform positive phototaxis in similar experimental conditions to those used by previous studies, we modeled the behavior of virtual fish employing the algorithm schematized in Fig. 2B. This algorithm is implemented by comparing the luminance of the left and right eyes with a common set point, and biasing swims towards the side closer to the set point. Furthermore, the set point evolves over time to approach the mean luminance of the two eyes (see Materials and Methods). We used turning distributions obtained from the behavioral experiments shown in Fig. 1 (Fig. S4A). Note that our goal was not to recapitulate our and previous data with quantitative precision but instead to show qualitatively that the same agent can perform set point seeking and positive phototaxis without fine-tuning of parameters.

Using the homeostatic–allostatic model, we first sought to replicate the history-dependent, set point seeking behavior reported in Fig. 1C. We subjected model fish to the experimental conditions outlined in Fig. 1B (see Fig. 4A). Consistent with our reported results from Fig. 1, fish pre-adapted to the bright environment preferred the bright side of the test environment, while fish pre-adapted to the dim environment preferred the dim side (Fig. 4B). These results were qualitatively similar to those reported in Fig. 1E (see Fig. 4C). Furthermore, we found that our model could replicate the results from Figs 2K and 3 as well (Fig. S4C,D).

Next, we sought to use the same model to replicate two different accounts of phototaxis in larval zebrafish (Fig. 4D–I). In the first (Brockerhoff et al., 1995), model fish swam freely in a uniformly, brightly lit chamber for 500 model time steps (Fig. 4D, pre-adaptation); following this pre-adaptation period, we dimmed the right half of the chamber while keeping the left half bright (Fig. 4D, test). Fig. 4E exhibits the swim paths of 100 simulated fish, as well as their occupancy density in the chamber, during the pre-adaptation and test periods. The occupancy density in both conditions is quantified in Fig. 4F and compared with the value reported by Brockerhoff et al. (1995). During the pre-adaptation period, simulated fish showed no bias in occupancy between the left and right halves of the chamber (Fig. 4F, pre-adaptation), a result expected due to symmetry. However, during the test period, fish exhibited a strong bias towards the brighter, left side of the chamber (Fig. 4F, test), as seen in Brockerhoff et al. (1995).

We also sought to replicate Burgess et al.’s (2010) observations that phototactic direction depends on the relative luminance of the phototactic target to the pre-adaptation luminance (Fig. 4G). After pre-adapting simulated fish to an environment for 500 time steps at a fixed location at the center of the chamber, fish experienced either a control or a spotlight environment. In the spotlight environment, we dimmed the chamber except for a small spotlight, which was placed into the ‘target location’ in the lower right of the chamber. In the control environment, the entire chamber was dimmed. During this period, fish were free to swim around the chamber. We then let the simulation run for another 100 time steps and measured the rate at which fish moved towards or away from the target location. In the control environment, fish ended up, purely for geometrical reasons, further from the target (Fig. 4I, control, −0.15 pixels per time step, negative pixel values denote movement away from the target). However, in the spotlight environment, fish moved closer to the target relative to control if the target luminance was similar to the pre-adaptation luminance (Fig. 4I, spotlight, −0.08 pixels per time step, for spotlight/pre-adaptation=1). However, if the target luminance was too high (spotlight/pre-adaptation>2), fish exhibited strong negative phototaxis with pixels per time step values exceeding −0.3 (Fig. 4I, red curve).

We conclude from these data that our homeostatic–allostatic model of luminance-based navigation in larval zebrafish can generate both set point seeking behavior and previously observed phototaxis behavior in more realistic environments.

Phototaxis occurs in many domains of life, from bacteria and unicellular eukaryotes (Berthold et al., 2008; Nultsch, 1973) to plants (Legris and Boccaccini, 2020; Thimann and Curry, 1960) and animals (Brockerhoff et al., 1995; Chen and Engert, 2014; Hadler, 1964; Kane et al., 2013; Zhu et al., 2021). While phototaxis benefits photosynthetic organisms by allowing them to find sources of energy (Jékely, 2009), the purpose of phototaxis in heterotrophic animals that do not derive energy from light is not as obvious. Phototaxis likely serves a diverse set of functions across the animal kingdom; this diversity is reflected in the observed flexibility and context dependence of phototactic behavior in animals such as Drosophila melanogaster, honey bees and sea anemones (Ben-Shahar et al., 2003; Gorostiza et al., 2016; Pearse, 1974). Our work reveals that larval zebrafish may employ phototaxis in part to control the luminance levels of their surroundings. This principle unifies previous observations made about spatial phototaxis in larval zebrafish and helps to explain why environmental luminance affects phototactic strength and direction (Brockerhoff et al., 1995; Burgess et al., 2010).

Previously, Burgess et al. (2010) reported that, in larval zebrafish, phototactic direction depended on the brightness of the phototactic target relative to that of the pre-adaptation environment. If the phototactic target was much brighter than the pre-adaptation luminance, fish exhibited negative phototaxis; otherwise, the fish exhibited positive phototaxis. By formalizing light-seeking behavior in larval zebrafish as an example of homeostatic control, our study provides a possible explanation for why larval zebrafish exhibit negative phototaxis if the target is much brighter than the pre-adaptation luminance. We show that the pre-adaptation luminance serves as a luminance set point. In our model, fish perform either positive or negative phototaxis to maintain a stable environmental luminance. Furthermore, we show that the luminance set point is computed using information from both sides of the visual field and we characterized the dynamics with which the set point shifts when environmental luminance changes. However, this is not to say that larval zebrafish do not have innate luminance preferences. Fish might need to avoid overly bright regions to prevent photodamage or dark regions to maintain visibility. In those regimes, a pure taxis behavior might supersede the behavior we observe here. Indeed, we observed an asymmetry in our split-luminance pre-adaptation experiments (Fig. 2I,K), although we cannot rule out left–right asymmetry in our behavior rig. Additionally, earlier work on phototaxis in larval zebrafish (Burgess et al., 2010) provided evidence that OFF pathways in the visual system drive turning in phototaxis. Our work extends these pioneering discoveries by raising the possibility that the consequence of OFF pathway activation need not always drive aversive turns but instead depends on environmental luminance levels.

We speculate that control of environmental luminance benefits larval zebrafish because it enables them, over short time scales, to maintain luminance at a level to which their visual system is adapted. For example, if a larval zebrafish is dark adapted, sudden brightening of its surroundings will initially overwhelm the dynamic range of its visual system and thereby degrade its contrast sensitivity. If the fish remains in the bright environment, light adaptation would eventually raise the dynamic range of visual processing to better suit its new environment. However, the physiological adaptation to changing luminance necessitates a shift of the animal's luminance set point, or the animal would move towards the previous luminance to which it is no longer adapted. The short-term behavioral control of luminance we observed, and the longer-term shift in luminance preference, is similar to the allostatic modulation of a faster homeostatic control system. This motif, found in many homeostatic control systems, endows those systems with the ability to alter the value of their controlled variable to suit fluctuating environmental conditions.

Our characterization of a behavioral algorithm contributing to luminance-based navigation in larval zebrafish leads naturally to future directions that use this behavior as a model for investigating how homeostatic and allostatic control systems are implemented by the brain. This endeavor would leverage the unique advantages – genetic and optical accessibility (Ahrens et al., 2012, 2013) – of the larval zebrafish for uncovering the neural bases of behavior. Such studies would also dovetail nicely with previous work on the neural circuitry underlying phototaxis (Chen et al., 2018; Karpenko et al., 2020; Wolf et al., 2017; Zhang et al., 2017). It would also be particularly interesting to identify where in the brain the luminance set point is computed and stored. The results of our study suggest that the set point computation requires luminance information from both sides of the fish, so the computation might occur at a site in the brain that receives visual input from both eyes (although whether set point implementation requires the eyes remains untested). One possibility is the left dorsal habenula, which Zhang et al. (2017) showed was important for light seeking and contains cells that encode environmental luminance information. Another candidate brain region is the torus longitudinalis, which receives visual information from both eyes (Folgueira et al., 2020; Ito and Kishida, 1978), responds to changes in luminance with sustained firing (Northmore et al., 1983), and plays a role in orienting behaviors towards light (Gibbs and Northmore, 1996). Finally, the set point might be implemented by a brain region that receives extra-ocular photic stimulation. For example, previous work (Horstick et al., 2017) has shown that deep-brain photoreceptors affect phototactic behavior. A description of the set point's neural implementation will also allow targeted studies on how its value is updated when environmental luminance changes. Because homeostatic and allostatic control systems play vital roles in many aspects of animal physiology and behavior, understanding the implementation and evolution of the set point for luminance-based navigation could also yield insights into other physiological control systems.

We thank the members of the Engert lab and Ahrens lab for general feedback, as well as the following individuals for detailed feedback on and editing of the manuscript: Kristian J. Herrera, Yasuko Isoe, Robert E. Johnson, Lucy Lai, Stephen C. Thornquist and Hanna Zwaka.

Author contributions

Conceptualization: A.B.C., F.E.; Methodology: A.B.C.; Software: D.D., A.B.; Validation: A.B.C.; Formal analysis: A.B.C., D.D.; Investigation: A.B.C.; Resources: F.E.; Data curation: A.B.C., D.D.; Writing - original draft: A.B.C., D.D.; Writing - review & editing: A.B.C., D.D., A.B., F.E.; Supervision: A.B.C., F.E.; Funding acquisition: F.E.

Funding

A.B. was supported by the Human Frontier Science Program Long-Term Fellowship LT000626/2016. F.E. received funding from the National Institutes of Health (U19NS104653, R43OD024879, 2R44OD024879), the National Science Foundation (IIS-1912293) and the Simons Foundation (SCGB 542973). This material is based upon work supported by the National Science Foundation Graduate Research Fellowship Program awarded to A.B.C. under grant no. DGE1745303. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation. Deposited in PMC for release after 12 months.

Data availability

The swim data and analysis code used to generate Figs 1–3 are available from GitHub (https://github.com/diptodip/brightfish/tree/master/experiments). Raw data are available upon request. The code used in the modeling experiments for Fig. 4 is also available from GitHub (https://github.com/diptodip/brightfish).

Ahrens
,
M. B.
,
Li
,
J. M.
,
Orger
,
M. B.
,
Robson
,
D. N.
,
Schier
,
A. F.
,
Engert
,
F.
and
Portugues
,
R.
(
2012
).
Brain-wide neuronal dynamics during motor adaptation in zebrafish
.
Nature
485
,
471
-
477
.
Ahrens
,
M. B.
,
Orger
,
M. B.
,
Robson
,
D. N.
,
Li
,
J. M.
and
Keller
,
P. J.
(
2013
).
Whole-brain functional imaging at cellular resolution using light-sheet microscopy
.
Nat. Methods
10
,
413
-
420
.
Bahl
,
A.
and
Engert
,
F.
(
2020
).
Neural circuits for evidence accumulation and decision making in larval zebrafish
.
Nat. Neurosci.
23
,
94
-
102
.
Ben-Shahar
,
Y.
,
Leung
,
H.-T.
,
Pak
,
W. L.
,
Sokolowski
,
M. B.
and
Robinson
,
G. E.
(
2003
).
cGMP-dependent changes in phototaxis: a possible role for the foraging gene in honey bee division of labor
.
J. Exp. Biol.
206
,
2507
-
2515
.
Berthold
,
P.
,
Tsunoda
,
S. P.
,
Ernst
,
O. P.
,
Mages
,
W.
,
Gradmann
,
D.
and
Hegemann
,
P.
(
2008
).
Channelrhodopsin-1 initiates phototaxis and photophobic responses in chlamydomonas by immediate light-induced depolarization
.
Plant Cell
20
,
1665
-
1677
.
Brockerhoff
,
S. E.
,
Hurley
,
J. B.
,
Janssen-Bienhold
,
U.
,
Neuhauss
,
S. C.
,
Driever
,
W.
and
Dowling
,
J. E.
(
1995
).
A behavioral screen for isolating zebrafish mutants with visual system defects
.
Proc. Natl. Acad. Sci. USA
92
,
10545
-
10549
.
Burgess
,
H. A.
and
Granato
,
M.
(
2007
).
Modulation of locomotor activity in larval zebrafish during light adaptation
.
J. Exp. Biol.
210
,
2526
-
2539
.
Burgess
,
H. A.
,
Schoch
,
H.
and
Granato
,
M.
(
2010
).
Distinct retinal pathways drive spatial orientation behaviors in zebrafish navigation
.
Curr. Biol.
20
,
381
-
386
.
Cabanac
,
M.
and
Massonnet
,
B.
(
1974
).
Temperature regulation during fever: change of set point or change of gain? A tentative answer from a behavioural study in man
.
J. Physiol.
238
,
561
-
568
.
Cannon
,
W. B.
(
1939
).
The wisdom of the body
.
Chen
,
X.
and
Engert
,
F.
(
2014
).
Navigational strategies underlying phototaxis in larval zebrafish
.
Front. Syst. Neurosci.
8
,
39
.
Chen
,
X.
,
Mu
,
Y.
,
Hu
,
Y.
,
Kuan
,
A. T.
,
Nikitchenko
,
M.
,
Randlett
,
O.
,
Chen
,
A. B.
,
Gavornik
,
J. P.
,
Sompolinsky
,
H.
,
Engert
,
F.
et al. 
(
2018
).
Brain-wide organization of neuronal activity and convergent sensorimotor transformations in larval Zebrafish
.
Neuron
100
,
876
-
890.e5
.
Colwill
,
R. M.
,
Creton
,
R.
(
2011
).
Locomotor behaviors in zebrafish (Danio rerio) larvae
.
Behav. Processes
86
,
222
-
229
.
Dunn
,
T. W.
,
Mu
,
Y.
,
Narayan
,
S.
,
Randlett
,
O.
,
Naumann
,
E. A.
,
Yang
,
C.-T.
,
Schier
,
A. F.
,
Freeman
,
J.
,
Engert
,
F.
and
Ahrens
,
M. B.
(
2016
).
Brain-wide mapping of neural activity controlling zebrafish exploratory locomotion
.
Elife
5
,
e12741
.
Fero
,
K.
,
Yokogawa
,
T.
and
Burgess
,
H. A.
(
2011
).
The behavioral repertoire of larval zebrafish
. In
Zebrafish Models in Neurobehavioral Research
,
Neuromethods
vol 52
(ed. A. Kalueff and J. Cachat), pp.
249
-
291
.
Humana Press
.
Folgueira
,
M.
,
Riva-Mendoza
,
S.
,
Ferreño-Galmán
,
N.
,
Castro
,
A.
,
Bianco
,
I. H.
,
Anadón
,
R.
and
Yáñez
,
J.
(
2020
).
Anatomy and connectivity of the torus longitudinalis of the adult Zebrafish
.
Front. Neural Circuits
14
,
8
.
Gibbs
,
M. A.
and
Northmore
,
D. P.
(
1996
).
The role of torus longitudinalis in equilibrium orientation measured with the dorsal light reflex
.
Brain Behav. Evol.
48
,
115
-
120
.
Gorostiza
,
E. A.
,
Colomb
,
J.
and
Brembs
,
B.
(
2016
).
A decision underlies phototaxis in an insect
.
Open Biol
.
6
,
160229
.
Guggiana-Nilo
,
D. A.
and
Engert
,
F.
(
2016
).
Properties of the visible light phototaxis and UV avoidance behaviors in the larval Zebrafish
.
Front. Behav. Neurosci.
10
,
160
.
Hadler
,
N. M.
(
1964
).
Heritability and phototaxis in drosophila melanogaster
.
Genetics
50
,
1269
-
1277
.
Haesemeyer
,
M.
,
Robson
,
D. N.
,
Li
,
J. M.
,
Schier
,
A. F.
and
Engert
,
F.
(
2018
).
A brain-wide circuit model of heat-evoked swimming behavior in larval Zebrafish
.
Neuron
98
,
817
-
831.e6
.
Hartmann
,
S.
,
Vogt
,
R.
,
Kunze
,
J.
,
Rauschert
,
A.
,
Kuhnert
,
K.-D.
,
Wanzenböck
,
J.
,
Lamatsch
,
D. K.
and
Witte
,
K.
(
2018
).
Zebrafish larvae show negative phototaxis to near-infrared light
.
PLoS ONE
13
,
e0207264
.
Horstick
,
E. J.
,
Bayleyen
,
Y.
,
Sinclair
,
J. L.
and
Burgess
,
H. A.
(
2017
).
Search strategy is regulated by somatostatin signaling and deep brain photoreceptors in zebrafish
.
BMC Biol.
15
,
4
.
Huang
,
K.-H.
,
Ahrens
,
M. B.
,
Dunn
,
T. W.
and
Engert
,
F.
(
2013
).
Spinal projection neurons control turning behaviors in zebrafish
.
Curr. Biol.
23
,
1566
-
1573
.
Ito
,
H.
and
Kishida
,
R.
(
1978
).
Afferent and efferent fiber connections of the carp torus longitudinalis
.
J. Comp. Neurol.
181
,
465
-
475
.
Jékely
,
G.
(
2009
).
Evolution of phototaxis
.
Philos. Trans. R. Soc. Lond. B Biol. Sci.
364
,
2795
-
2808
.
Johnson
,
R. E.
,
Linderman
,
S.
,
Panier
,
T.
,
Wee
,
C. L.
,
Song
,
E.
,
Herrera
,
K. J.
,
Miller
,
A.
and
Engert
,
F.
(
2020
).
Probabilistic models of larval Zebrafish behavior reveal structure on many scales
.
Curr. Biol.
30
,
70
-
82.e4
.
Kane
,
E. A.
,
Gershow
,
M.
,
Afonso
,
B.
,
Larderet
,
I.
,
Klein
,
M.
,
Carter
,
A. R.
,
de Bivort
,
B. L.
,
Sprecher
,
S. G.
and
Samuel
,
A. D. T.
(
2013
).
Sensorimotor structure of Drosophila larva phototaxis
.
Proc. Natl. Acad. Sci. USA
110
,
E3868
-
E3877
.
Karpenko
,
S.
,
Wolf
,
S.
,
Lafaye
,
J.
,
Le Goc
,
G.
,
Panier
,
T.
,
Bormuth
,
V.
,
Candelier
,
R.
and
Debrégeas
,
G.
(
2020
).
From behavior to circuit modeling of light-seeking navigation in zebrafish larvae
.
Elife
9
,
e52882
.
Legris
,
M.
and
Boccaccini
,
A.
(
2020
).
Stem phototropism toward blue and ultraviolet light
.
Physiol. Plant
169
,
357
-
368
.
Marques
,
J. C.
,
Lackner
,
S.
,
Félix
,
R.
and
Orger
,
M. B.
(
2018
).
Structure of the Zebrafish locomotor repertoire revealed with unsupervised behavioral clustering
.
Curr. Biol.
28
,
181
-
195.e5
.
Moltz
,
H.
(
1993
).
Fever: causes and consequences
.
Neurosci. Biobehav. Rev.
17
,
237
-
269
.
Morville
,
T.
,
Friston
,
K.
,
Burdakov
,
D.
,
Siebner
,
H. R.
and
Hulme
,
O. J.
(
2018
).
The homeostatic logic of reward
.
bioRxiv
242974
.
Mrosovsky
,
N.
and
Fisher
,
K. C.
(
1970
).
Sliding set points for body weight in ground squirrels during the hibernation season
.
Can. J. Zool.
48
,
241
-
247
.
Northmore
,
D. P. M.
,
Williams
,
B.
and
Vanegas
,
H.
(
1983
).
The teleostean torus longitudinalis: responses related to eye movements, visuotopic mapping, and functional relations with the optic tectum
.
J. Comp. Physiol.
150
,
39
-
50
.
Nultsch
,
W.
(
1973
).
Phototaxis and photokinesis in bacteria and blue-green algae
. In
Behaviour of Micro-organisms
, pp.
70
-
81
.
Springer
.
Ortmann
,
S.
and
Heldmaier
,
G.
(
2000
).
Regulation of body temperature and energy requirements of hibernating alpine marmots (Marmota marmota)
.
Am. J. Physiol. Regul. Integr. Comp. Physiol.
278
,
R698
-
R704
.
Pearse
,
V. B.
(
1974
).
Modification of sea anemone behavior by symbiotic zooxanthellae: phototaxis
.
Biol. Bull.
147
,
630
-
640
.
Rakus
,
K.
,
Ronsmans
,
M.
and
Vanderplasschen
,
A.
(
2017
).
Behavioral fever in ectothermic vertebrates
.
Dev. Comp. Immunol.
66
,
84
-
91
.
Sterling
,
P.
(
2012
).
Allostasis: a model of predictive regulation
.
Physiol. Behav.
106
,
5
-
15
.
Thimann
,
K. V.
and
Curry
,
G. M.
(
1960
).
Phototropism and phototaxis
.
Comp. Biochem. Physiol.
1
,
243
-
309
.
Wolf
,
S.
,
Dubreuil
,
A. M.
,
Bertoni
,
T.
,
Böhm
,
U. L.
,
Bormuth
,
V.
,
Candelier
,
R.
,
Karpenko
,
S.
,
Hildebrand
,
D. G. C.
,
Bianco
,
I. H.
,
Monasson
,
R.
et al. 
(
2017
).
Sensorimotor computation underlying phototaxis in zebrafish
.
Nat. Commun.
8
,
651
.
Woods
,
S. C.
and
Ramsay
,
D. S.
(
2007
).
Homeostasis: beyond curt richter
.
Appetite
49
,
388
-
398
.
Zhang
,
B.-B.
,
Yao
,
Y.-Y.
,
Zhang
,
H.-F.
,
Kawakami
,
K.
and
Du
,
J.-L.
(
2017
).
Left habenula mediates light-preference behavior in Zebrafish via an asymmetrical visual pathway
.
Neuron
93
,
914
-
928.e4
.
Zhu
,
M. L.
,
Herrera
,
K. J.
,
Vogt
,
K.
and
Bahl
,
A.
(
2021
).
Navigational strategies underlying temporal phototaxis in Drosophila larvae
.
J. Exp. Biol.

Competing interests

The authors declare no competing or financial interests.

Supplementary information