RESEARCH ARTICLE

A theory of how active behavior stabilises
neural activity: Neural gain modulation byclosed-loop environmental feedback
Christopher L. Buckley1,2*, Taro Toyoizumi1*
1 Laboratory for Neural Computation and Adaptation, RIKEN Brain Science Institute, Saitama, Japan,
2 Department of Informatics and Engineering, University of Sussex, Falmer, United Kingdom

a1111111111
a1111111111
a1111111111
a1111111111
a1111111111

OPEN ACCESS
Citation: Buckley CL, Toyoizumi T (2018) A theoryof how active behavior stabilises neural activity:
Neural gain modulation by closed-loop
environmental feedback. PLoS Comput Biol 14(1):e1005926. https://doi.org/10.1371/journal.
pcbi.1005926
Editor: Daniel Bush, University College London,
UNITED KINGDOM
Received: August 3, 2017
Accepted: November 28, 2017
Published: January 17, 2018
Copyright: © 2018 Buckley, Toyoizumi. This is an
open access article distributed under the terms of
the Creative Commons Attribution License, which
permits unrestricted use, distribution, andreproduction in any medium, provided the original
author and source are credited.
Data Availability Statement: Data previously
published in Ahrens MB, Li JM, Orger MB, Robson
DN, Schier AF, Engert F, et al. Brain-wide neuronal
dynamics during motor adaptation in zebrafish.
Nature. 2012;485: 471–477. The data analysed in
the supplementary material was previously
published in Poulet JFA, Fernandez LMJ, Crochet
S, Petersen CCH. Thalamic control of corticalstates. Nat Neurosci. 2012;15: 370–372.

* c.l.buckley@sussex.ac.uk (CLB); taro.toyoizumi@brain.riken.jp (TT)Abstract
During active behaviours like running, swimming, whisking or sniffing, motor actions shapesensory input and sensory percepts guide future motor commands. Ongoing cycles of sensory and motor processing constitute a closed-loop feedback system which is central tomotor control and, it has been argued, for perceptual processes. This closed-loop feedback
is mediated by brainwide neural circuits but how the presence of feedback signals impacts
on the dynamics and function of neurons is not well understood. Here we present a simple
theory suggesting that closed-loop feedback between the brain/body/environment can modulate neural gain and, consequently, change endogenous neural fluctuations and responses
to sensory input. We support this theory with modeling and data analysis in two vertebrate
systems. First, in a model of rodent whisking we show that negative feedback mediated bywhisking vibrissa can suppress coherent neural fluctuations and neural responses to sensory input in the barrel cortex. We argue this suppression provides an appealing account ofa brain state transition (a marked change in global brain activity) coincident with the onset ofwhisking in rodents. Moreover, this mechanism suggests a novel signal detection mechanism that selectively accentuates active, rather than passive, whisker touch signals. Thismechanism is consistent with a predictive coding strategy that is sensitive to the consequences of motor actions rather than the difference between the predicted and actual sensory input. We further support the theory by re-analysing previously published two-photon
data recorded in zebrafish larvae performing closed-loop optomotor behaviour in a virtualswim simulator. We show, as predicted by this theory, that the degree to which each cell
contributes in linking sensory and motor signals well explains how much its neural fluctuations are suppressed by closed-loop optomotor behaviour. More generally we argue that our
results demonstrate the dependence of neural fluctuations, across the brain, on closed-loop
brain/body/environment interactions strongly supporting the idea that brain function cannot
be fully understood through open-loop approaches alone.

Funding: This research is supported by Japan
Agency for Medical Research and development,

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 20181 / 26

Gain modulation by closed-loop environmental feedback

AMED, under Grant Number JP15km0908001(TT), the RIKEN Brain Science Institute (TT, CLB)
and the University of Sussex (CLB). The funders
had no role in study design, data collection andanalysis, decision to publish, or preparation of themanuscript.
Competing interests: The authors have declaredthat no competing interests exist.

Author summary
Animals actively exploring or interacting with their surroundings must process a cyclicalflow of information from the environment through sensory receptors, the central nervous
system, the musculoskeletal system and back to the environment. This closed-loop sensorimotor system is essential for an animal’s ability to adapt and survive in complex environments. Importantly, closed loop feedback signals also regulate brainwide neuralcircuits for behavior. Specifically, the activity of coherent populations of neurons informmotor behaviours and in turn are influenced by sensory feedback signals mediated by theenvironment. We develop a theory that suggests that this feedback can explain the marked
changes in large-scale neural dynamics and sensory processing (together referred to as
brain state) that coincide with the onset of active behaviours. This feedback may contribute to flexible context dependent neural computations in brain systems.

Introduction
Neural response are strongly sensitive to behavioural state. The onset of movement such as
running and whisking is coincident with prominent modulations in neural activity in sensory
areas [1–3]. The rodent whisker system has become a key model system within which to investigate these changes [4–6]. The onset of active whisking in a previously quiet but attentive
rodent is correlated with a marked reduction in endogenous synchronous neural activity ofneurons in sensory areas; quantified as a reduction in low frequency fluctuations and adecrease in correlations between the membrane potentials of neurons in the barrel cortex [4].
Furthermore, membrane potential responses to experimentally induced perturbations of thewhisker are also reduced by the presence of whisking [6]. These changes suggest that movement reduces neural gain [7,8] in the barrel cortex suppressing neural fluctuations and sensory
response. Several internal pathways have been implicated in this gain regulation including various neuromodulatory pathways [9,10], intracortical feedback modulation by motor areas [11]or they could be directly triggered by changes in sensory input [12,13] via thalamo-corticalprojections [14]. Despite this gain reduction, robust responses to sensory input occur during
active contact events when the whisker collides with an object placed in the whisk field [5,6].
Thus, a whisking-induced gain reduction cannot by itself account for the difference in sensory
responses to whisker perturbations and active contact events without appeal to additional
mechanisms [15]. The reafference principle (RP) [16] also does not straightforwardly explainthese differences. The RP explains the amplitude of sensory response by a mismatch between
the actual sensory input and its prediction, where the prediction is based on an efference copy
(an internal copy of motor command). But the RP does not explain why sensory responses towhisker perturbations, which are always unpredicted, are suppressed during movement.
Active behaviours are defined by closed-loop feedback interactions between brain/body/environment which are central to motor control and, it has been argued, pivotal to account ofperceptual processes [17–19]. During active whisking reafferent sensory input (sensory input
resulting from one’s own actions) conveys information about proprioceptive sensory feedbackof whisking and which informs the subsequent motor control of the vibrissae [20,21]. Repeatedcycles of reafferent sensory input followed by motor output constitute a closed-loop feedback
interaction between cells in the barrel cortex and the vibrissae [22]. In this work, we show thatin this system closed-loop feedback mediated by whisking vibrissae can: 1. Suppress synchronous endogenous neural fluctuations and passive sensory responses, 2. Account for large
response to active touch events because of a transient interruption of this feedback. The results

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 20182 / 26

Gain modulation by closed-loop environmental feedback

provide a nuanced view of predictive coding where neurons represent predictions errors about
consequences of motor actions rather than the difference between the predicted and actual
sensory input. More generally these results strongly support the centrality of closed-loop interaction in perceptual apparatus [17] by suggesting a specific role they play in event detection.
To support a key prediction of this theory we examine how closed-loop interactions in a
motor control behaviour impact on neuronal fluctuations. Specifically, we re-analysed datafrom a second system, a larval zebrafish behaving in a virtual reality where fictive water flow issimulated by a grating (striped image) drifting across the fish retina [23]. In this set up zebrafish larvae are immobilised with a neuromuscular blocker. The fish’s attempted movements
relative to the grating are monitored through motor neuron activity and translated into appropriate modulation of the velocity of the grating [23]. With data from this setup we show thatthe presence of closed-loop interactions between neurons and fictive swim speed causes the
suppression of synchronous neural fluctuations across the fish brain in a manner analogous
with the rodent whisker system. Further we show that the amount of this suppression for eachneuron is correlated with the strength of its involvement in the optomotor signaling. Together,
these results suggest that understanding changes in neural activity across the brain caused by
the onset of movement requires the study of closed-loop brain/body/environment interactions
beyond open-loop sensory paradigms. Thus we strongly support the argument that a fullunderstanding of phenomenology of neural circuits during active behaviors requires moving
away from the idealisation of the brain as an input/output information processor toward its
role as a dynamic control system regulating behaviour [19].

Results
TheoryIn moving animals, the brain receives sensory input that originates in the external environment, or exafferent sensory input (Fig 1A, blue arc). In addition, efferent motor commands(Fig 1A, green arc) drive the body and environment and induce reafferent (self-generated) sensory input (Fig 1A, red arc) [16,24]. To develop an intuition of how closed-loop feedback,mediated by reafferent input, could impact on neural activity we introduce two model conditions. First, we assume that when an animal is not moving the brain receives only exafferent
input, we describe this as an open-loop condition (Fig 1B, top). Second, when the animal begins
to move the brain interacts with the environment coupling motor action and reafferent sensory input, we refer to this as a closed-loop condition (Fig 1C top). Note: it is likely that some
reafferent input is always present but our focus here is on the effect that the onset of a previously absent reafferent sensory pathway could have on neural activity. We examine these two
conditions in a simple idealized model, see [17] for a similar idealisation, where brain variable
B (which describes collective neural activity, e.g., membrane potential activity) receive input
from, or interacts with, the body and environment. In the open-loop condition the collective
neural activity, Bo(t), is assumed to be described in term of a first-order linear differential
equation,dBo ðtÞ
¼
dt

Bo ðtÞþ IðtÞ þ xo ðt Þ;tð1Þ

where ξo is white noise of instantaneous variance σ2 generated inside the brain, t is time, τ isthe time constant of the system and I(t) is exafferent input. Essentially, in the absence of input,
we represent collective neural activity as a simple leaky integrator system with leak timescale τdriven by endogenous noise (see Fig 1B, bottom, for traces). Of interest here is the magnitudeof fluctuations which can be calculated as the autocorrelation peak (instantaneous variance) of

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 20183 / 26

Gain modulation by closed-loop environmental feedback

Fig 1. A simple model of the brain-environment interaction. a, A schematic description of brain-body-environment interactions during closed-loop behavior. The
brain receives two types of sensory input: exafferent input (blue) that originates from the environment and reafferent input (red), which, while mediated by theenvironment, results from the consequences of an animal’s own actions. (b-d) Schematic diagrams of the interactions between the brain (B) and the body/environment
with example neural activity traces of the simple model described in the text with τ = 1.05 and w = −0.5. Each model is Euler integrated (dt = 0.01) and is driven bynormally distributed noise with zero mean and unit variance (the noise is slightly smoothed for presentation purposes). A perturbation (I = 2) is applied at t = 500 for
20 time units (grey bar). b, The brain receives no reafferent input (an open-loop condition) and exhibits collective activity that spontaneously fluctuates. The magnitudeof the fluctuations and the responses to perturbation are large. c, Reafferent input mediates closed-loop sensory feedback to the brain (a closed-loop condition). If thisfeedback is negative, the gain of the brain is reduced and both fluctuations and responses to perturbation are suppressed. d, A perturbation in the closed-loop condition
are combined with a brief interruption (20 time units) of the closed-loop feedback. Responses to perturbation are accentuated during the interruption but backgroundfluctuations are suppressed before and after the contact.
https://doi.org/10.1371/journal.pcbi.1005926.g001

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 2018

4 / 26

Gain modulation by closed-loop environmental feedback

variable Bo which is Peako = σ2 τ/2, and the gain of the response to sensory input (calculated as
the ratio between a static input and an equilibrium response), which is simply Gaino = τ. Thusin this simple system both the gain and the fluctuations are determined by the timescale of theendogenous dynamics. However, during the closed-loop condition we write the dynamics ofthe brain variable,dBc ðtÞ
¼
dt

Bc ðtÞ
þ wBc ðt Þ þ I ðt Þ þ xc ðt Þ;tð2Þ

where we have idealised reafferent input as a simple self-feedback signal with strength w, i.e.,
we have assumed this feedback is linear and instantaneous (we will relax this assumption
later). In this condition, the continuous cycles of reafferent input constitute a closed-loop feedback signal to the brain. The presence of this feedback changes the effective time constant toτeff = τ/(1−wτ). The magnitude of the fluctuations is now characterized by autocorrelation
peak Peak c = Peak o/(1−wτ) and the effective gain of the system is Gainc = Gaino/(1−wτ). In particular, if this feedback is negative (w < 0), it will suppress both fluctuations and the gain of
sensory responses, see Fig 1B and 1C (bottom panels). This very simple model suggests that, inprinciple, closed-loop feedback mediated by the body/environment could have a direct impact
on neural activity. One way to accentuate sensory responses is described in Fig 1D. Here thebrain initially has low closed-loop gain (Gainc = τ/(1−wτ)) and thus exhibits suppressed fluctuations. However, if during a sensory event (Fig 1D, grey bar) closed-loop feedback is interrupted, e.g., if whisking is interrupted by contact with an object (see below), then brain will
have temporarily high open-loop gain (Gaino = τ). Thus the combination of a large sensory
response and suppressed background fluctuations prior to sensory event can accentuate signal-to-noise ratios. In the following, we explain how these three conditions can be realized in
the rodent whisker system.

The rodent whisker system
The role of closed-loop feedback in a brain state transition. Does the presence of closedloop sensory feedback explain the changes in neural activity caused by the onset of whisking in
the rodent barrel cortex? We examined neural membrane potential recordings made in headfixed rodents with all but a single vibrissae removed [4,6], In these experiments rodents transitioned between two behaviours: a quiet attentive behaviour (i.e. awake and not sleeping, butwith stationary vibrissae) or spontaneous bouts of whisking [4,6]. In the absence of whisking
the membrane potential of neurons in the barrel cortex exhibit noisy fluctuations with a strong
1Hz component and correlations between neighbouring neurons are relatively high [4]. The
onset of active whisking suppresses these coherent neural fluctuations. In addition the sensory
responses of neurons to passive whisker deflections are also suppressed by whisking [4,6]. However, neurons robustly respond to active touch events when the whisker collides with, andbriefly comes to rest on, an object placed in the whisk field [4,6]. Furthermore, the coherent
neural fluctuations reappear if the whisker repeatedly collides with an object [6].
While the presence of closed-loop sensory feedback is a major difference between the quiet
attentive and active whisking states, it has been shown that coherent fluctuation of membranepotential are suppressed by whisking behavior even when the infra-orbital nerve (ION) is cut,removing sensory input from whiskers [5]. At first glance, the effect of this lesion seems to ruleout a role for closed-loop sensory feedback. Accordingly, we made a closer examination of therole sensory input plays in this suppression by further analysing the data from this ION cut
experiment, data supplied by the authors of [5]. We found that the latency between the onsetof whisking and the suppression of membrane potential fluctuations was longer under the

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 2018

5 / 26

Gain modulation by closed-loop environmental feedback

ION cut condition, as compared to the ION intact condition (see S1 Appendix). Thus, while
there are likely many internal mechanisms underlying brain state transitions such as thalamocortical input [25] or corollary discharge [26] this analysis suggests a role for sensory input
under physiological conditions.
A model of cortical-vibrissae interactions. To test whether closed-loop feedback could
plausibly explain the changes in brain activity caused by whisking we constructed a simplified
neural network model of cortical-vibrissae interactions (see Materials and Methods). Ourmodel comprises both an excitatory and inhibitory cortical population dynamically interactingwith a single vibrissa (Fig 2A). Slow coherent fluctuations of membrane potential at around
1Hz arise in this model from an interplay between the buildup of excitatory cortical activity
through recurrent activity and their eventual suppression by adaptation after ca. 1 s in eachcell. We model a simple flexible vibrissa as two hinged stiff mass-less sections of unit lengthwith relative angle θh (bending angle) connected at the base with protraction angle θp to thebody. The sections are constrained by simple torsion springs with spring constant k1 and k2
respectively, see Fig 2A. The center spring has an equilibrium value of zero angular displacement and thus tends to align both sections (see Materials and Methods) and whisker movement is driven by setting equilibrium position of the base spring. Fast whisking behavior is
manually turned on or off by a central pattern generator (CPG) that periodically drives thewhisker (~10 Hz) when CPG is on. Our theory (see Fig 1) suggests that negative sensory feedback could suppress coherent neural fluctuations. To model this, we assumed that corticalexcitatory neurons additionally drive protraction of the vibrissae, and, in turn, both excitatory
and inhibitory populations receive the sensory feedback of the whisker retraction angle θr =180˚ − θp. To model contact events a horizontal frictionless solid wall is placed above the whisker and, as the whisker collides with the wall, the whisker tip stops. In addition, we model acontact-detection signal capturing the stereotypical response of pressure sensitive cells in thetrigeminal ganglion [27]. Specifically, we deliver a brief square wave pulses (ca. 25 ms) triggered by each whisker contact event as an additional sensory input (see Materials and Methods). See the Discussion and S2 Appendix, for further discussion of the biological plausibilityof these model assumptions.
During the open-loop condition (i.e., the quiet attentive condition) the cortex exhibits significant synchronous low frequency membrane potential fluctuations which are suppressed in
the closed-loop condition (i.e., the freely whisking condition). Like the simple mode in Fig 1,
negative sensory feedback reduced the gain of the cortical system and replaced prominent (ca.
1 Hz) synchronous fluctuations of the membrane potential with fast (ca. 10 Hz), but weak,fluctuations locked into the whisking cycle, see Fig 2C. Furthermore, the average inter-neuralcorrelation of membrane potential for pairs of neurons was also suppressed (Fig 2D) indicating that coherent fluctuations across the network were suppressed.
We then examined the effect of whisker contact events on cortical dynamics. If we assume
the whisker is perfectly rigid and unbending then the whisker stops when it comes into contact
with the object interrupting sensory feedback as suggested in Fig 1D, see Fig 2A (grey line)
where touch events are marked by yellow lines. During periods of contact events the frequency
power and cross-correlation of membrane potential fluctuations were partially recovered, seeFig 2C and 2D (yellow lines), in agreement with experimental results [4,6]. We hypothesizedthat if the whisker is very flexible, then the protraction angle would change continuously,
despite contact of the tip, fully preserving sensory feedback of whisker movement. Note: to distinguish the effect of sensory feedback from touch-evoked signal, we applied the same squarewave pulse as a contact-detection signal regardless of whisker stiffness. We found that therecovery of 1–5 Hz power was stronger for a stiff whisker indicating that the interruption of
the closed-loop sensory feedback was important for this change, see Fig 3B and 3C.

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 2018

6 / 26

Gain modulation by closed-loop environmental feedback

Fig 2. Coherent fluctuations are suppressed by the presence of whisking in a simple model of the barrel cortex. a, A schematicof a simplified whisking model. 100 excitatory (Exc) and 100 inhibitory (Inh.) neurons receive sensory feedback via a single whisker
driven by a central pattern generator (CPG) and the excitatory neurons. Triangle and circles represent excitatory and inhibitory
synapse respectively. Onset of whisking occurs when the CPG is switched on. Sensory feedback is negative overall because theneurons that elicit whisker protraction are assumed to be driven by whisker retraction. The whisker comprise of two sections with abending angle, θh, and protraction angle θp. The base and tip sections are constrained by two springs with spring constants k1 andk2 respectively. Whisking is implemented by driving the equilibrium position of the base spring. The center spring is in equilibrium

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 20187 / 26

Gain modulation by closed-loop environmental feedback

at zero angular displacement and tends to align the whisker sections. The whisker is unit length and massless but constrained by asolid wall placed within the whisker’s reach. b, Membrane potential of cortical neurons (light lines for individual neurons and darkline for population average) and whisker position in a quiet attentive (open-loop condition: O) and whisking (closed-loop
condition: C) rodents. Periods of active touch (T) are also shown. Large and synchronous fluctuations of membrane potential were
suppressed during whisking. Active touch elicited reliable responses in these neurons. The vertical dotted line marks the onset ofwhisking and the vertical solid lines mark onset of individual touch event. c, The power spectrum (inset for variance) of membranepotential are averaged over cortical neurons and shown for each condition. d, Similarly cross-correlation (inset for correlation
matrix of randomly sampled neurons—color warmth indicates the degree of correlation) of membrane potential are averaged overcortical neurons and shown for each condition. Coherent low frequency fluctuations and inter-neural correlation are suppressed
during C relative to O but are recovered during T.
https://doi.org/10.1371/journal.pcbi.1005926.g002

A model of the impact of closed-loop feedback on sensory processing. The same model
also accounted for behavior-dependent changes in sensory processing [6] without assuming
additional mechanisms [15,28]. Specifically, in agreement with experimental results, we foundthat exafferent perturbation evoked large sensory responses in the quiet condition but
markedly smaller responses during the whisking condition (Fig 3D, [6]). Again, this was
because negative closed-loop sensory feedback decreased the gain of the cortical circuit. Furthermore, in agreement with experimental data, we also found that cortical neurons exhibited
more reliable responses to active touch events (i.e., events defined by a contact-detection signal
in addition to a clipping of the whisker angle) than the same contact-detection signal during
free whisking (Figs 2B and 3D). To quantify this effect in our whisker model, we computed a
discriminability index (see Materials Methods) that characterize the signal-to-noise ratio of
the response of the cortex to different sensory events. Effectively, this index measures the separation between the distributions of membrane potentials in the presence or absence of sensory
events and is high when an event is very discriminable from background. The value of theindex was similar for exafferent perturbations in the closed-loop and open-loop conditions,Fig 3E (blue and red bars), i.e., although the deflection-evoked response (signal) was greater inthe open-loop condition, so were background fluctuations of membrane potential (noise). In
contrast, the discriminability index was greater for contact events, Fig 3E, yellow bars. We
hypothesized this was because negative sensory feedback, that suppressed neural fluctuations
during whisking, was transiently removed during active touch events allowing endogenousrecurrent excitation to amplify the cortical response to the contact-detection signal (Fig 3D).
Thus, active touch events combined large sensory evoked responses (signal) and low background fluctuations (noise), which is beneficial for information coding. To confirm that thisincrease in discriminability was because of the transient interruption of the closed-loop feedback, we simulated vibrissae of different stiffness. The result shows that active touch event are
more discriminable when the whisker is stiff, suggesting the benefit of a well-timed interruption of the closed-loop feedback for amplifying cortical response, see Fig 3D (c.f. Fig 1D).
Hence, this model suggests that cortical neurons are selectively sensitive to the interruption of
the animal’s own active sensing.

Zebrafish virtual reality
A closed-loop versus replay condition. Our theory makes the strong prediction thatbrain dynamics are sensitive to closed-loop feedback rather than sensory input per se. To illustrate this prediction we returned to the simple conceptual model presented in Fig 1 and introduce a replay condition. In this condition sensory input to the brain in a closed-loop conditionis first recorded. This recording is then replayed in open-loop (i.e. as exafferent input) to an
identical brain albeit with a different instantiation of internal noise, see Fig 4. Under thisPLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 20188 / 26

Gain modulation by closed-loop environmental feedback

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 2018

9 / 26

Gain modulation by closed-loop environmental feedback

Fig 3. Negative closed-loop sensory feedback can account for the suppression of coherent fluctuations and sensory responses. a, The
relationship between the bending (θh: gray) and protraction angle (θp: red) in a flexible (top, k2/k1 = .1) and stiff (bottom, k2/k1 = 10) whisker. The
deflection of the protraction angle is smaller during contact if the whisker is stiff. b and c, The dependence of low frequency power and intra-neuralcorrelation on behavioural condition (O and C) and whisker stiffness, respectively. Data averaged over 100 trials for each condition. In all cases
standard error in the mean was much smaller than 1% of the mean. d, A comparison of the Membrane potential response to exafferent input during
O (blue), C (red) and an active touch event (yellow). Events begin at time 0. Active touch has the same baseline as C but a similar response
magnitude to O. e, The dependence of the discriminability index (see Materials and Methods) on behavioural condition (O and C) and increasing
whisker stiffness. Discrimination performance was improved with increasing whisker stiffness, reflecting the degree to which closed-loop sensory
feedback was interrupted during touch events.
https://doi.org/10.1371/journal.pcbi.1005926.g003

Fig 4. A theoretical prediction for the replay condition. Schematic diagrams and example traces of the simple model described in the text with τ = 1.05 and w =−0.5, same labelling conventions as Fig 1. Each model is Euler integrated (dt = 0.01) and is driven by normally distributed noise with zero mean and unit variance(the noise is slightly smoothed for presentation purposes). a, Reafferent input mediates closed-loop sensory feedback to the brain (a closed-loop condition: top panel)
suppressing fluctuations in brain activity (bottom panel). b, the brain receives a replay of the reafferent input received in the closed-loop condition as exafferent input(top panel). Any differences from the closed-loop condition are caused by the absence of feedback because the sensory input is identical to that in the closed-loop
condition. Note the noise is unique in each condition but sampled from the same distribution. In the replay condition fluctuations are much larger than in theclosed-loop condition because of the absence of negative feedback.
https://doi.org/10.1371/journal.pcbi.1005926.g004

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201810 / 26

Gain modulation by closed-loop environmental feedback

condition the dynamics of the brain, Br, can be written as:
dBr ðtÞ
¼
dt

Br ðtÞ
þ wBc ðt Þ þ xr ðt Þ;tð3Þ

where ξr is again white noise of instantaneous variance, σ2, that has the same statistics as theclosed-loop condition. Here, the brain receives the same sensory input as in the closed-loop
condition (Eq 2), i.e. wBc(t), but this time as exafferent input rather than reafferent input i.e.
sensory input depends on Bc not Br and thus is not real-time feedback. The magnitude of thefluctuations in this condition, again calculated as the autocorrelation peak of the brain variable,
is Peak r = Peakc + Peak o  2 wτ/(wτ −2). Thus, this simple model predicts that even though thebrain receives exactly the same total sensory input in the replay and closed-loop conditions theamplitudes of fluctuations will not be the same. In particular, if this feedback is negative, we
obtain Peak c < Peak o < Peakr, see Fig 1B and 1C and Fig 4A and 4B.
The effect of closed-loop feedback on brain-wide dynamics in a behaving zebrafish. To
test this prediction we turned to a second experimental system, where we reanalyzed two-photon calcium imaging data recorded from larval zebrafish behaving in a virtual flow simulator,
see introduction and [23] for full details. In this setup fish are immobilized with a neuromuscular blocker and fictive water flow is simulated by a grating (striped image) drifting across thefish retina (Fig 5A). Fictive swim bouts are then simulated by modulating grating speed basedon the power of motor neuron activity (defined as swim power) recorded electrophysiologically from motor nerve along the spine of the fish [23]. Under natural conditions fish avoid
being swept downstream by executing swim bouts (discrete bursts of swimming activity) inthe direction opposite to water flow. Under VR conditions, oncoming water flow is simulatedby allowing a grating to drift backward, in a tail-to-head direction, across the fish retina. Fish
compensate for this drift with a specific optomotor behaviour in which fictive forward swim
bouts temporally decelerate the grating maintaining their fictive horizontal position over time[23]. Despite neuromuscular blockade motoneuron firing is relatively normal under these conditions and fictive behaviours compare favourably with natural conditions [23,29]. During thisbehavior, visual input to the fish drives recorded motor activity which in turn affects the visual
stimulus constituting a closed-loop feedback between the fish brain and its environment. We
compared data from a closed-loop condition, where the fish actively maintain their position in
the virtual environment, to a replay condition, where the same fish receives a replay of theclosed-loop visual stimulus without real-time visual feedback (Fig 5A). The original work,[23], utilized the replay condition to identify neurons whose activity were strongly correlated
either with the sensory input or motor output. Instead, here we use the replay condition as astrong control condition to reveal how neural dynamics are changed by the presence of sensory feedback rather than exafferent sensory input. Notably, one of the strengths of this setup
is that the only information the fish received about oncoming flow was visual, i.e., there wasno proprioceptive input as the fish was paralyzed.
We found that neural activity was significantly different between the closed-loop and replay
conditions despite identical sensory input, see Fig 5B. In particular, we found both the averagemagnitude of neural fluctuations and cross-correlations were suppressed in the closed-loop
condition. While individual neurons were heterogeneous across the whole brain, on average
low frequency (0.01–0.15 Hz) fluctuations were suppressed (p = 0.046, sign test) and neurons
were decorrelated (p = 0.005, sign test) under the closed-loop condition compared to thereplay condition (Fig 6A). The changes in the geometric mean of low frequency power andcorrelation were highly correlated across simultaneously recorded pairs of cells (r = 0.69,
p<10−10, Spearman’s rank correlation), consistent with the hypothesis that both changes
reflect the strength of sensory feedback. (see Fig 5C). The decorrelation effect was not an

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201811 / 26

Gain modulation by closed-loop environmental feedback

Fig 5. Synchronous neural fluctuation are smaller in the presence of closed-loop sensory feedback. a The experimental setup as described in [23]. In theclosed-loop condition the grating stimulus is constructed based on motor nerve recording. In the replay condition the grating stimuli is a replay of stimulus seenin the closed-loop condition. b, Population averages of logarithmic low frequency power (mean over interval of [0.01 0.15] Hz) (left) and pairwise intra-neuralcorrelations (right) were both suppressed under the closed-loop condition relative to the replay condition. c, These changes in pairwise correlations and thegeometric mean of log low frequency power (replay–closed) were highly correlated in the recorded neurons.
https://doi.org/10.1371/journal.pcbi.1005926.g005

artifact of measurement noise, which may dominate correlation measures at high frequency,
because the result was robust to the removal of low-level calcium activity by thresholding (seeS3 Appendix).
The clearest difference between the closed-loop and replay conditions was the presence ofsensory feedback suggesting that it plays a causal role. One possibility is that feedback increases
the level of motor activity resulting in an increased efference copy signal which suppresses

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201812 / 26

Gain modulation by closed-loop environmental feedback

Fig 6. Closed-loop sensory feedback predicts suppression of neural fluctuations and correlations. a Schematic interactions of thebrain (each neuron) and the environment (the swim power) are shown under the closed-loop (Bc and Ec) and replay (Br and Er)
conditions. b, The afferent filter (F) and efferent filter (G) were estimated using the replay condition for each neuron by fitting linear
filters (see Materials and Methods), whose population averages, after normalizing to peak amplitudes, are summarized. On average, thebrain positively drove the environment, i.e. neural activity increased swim power (efferent filter G, green line) but the environment
suppressed the brain, i.e., swim power tended to inhibit neural activity (afferent filter F, blue line). By combining these two effects, wefound that self-feedback (H = FG, orange line, closed-loop feedback) was negative. Behavioural feedback (Ec ! Er, black line) is alsostrongly negative. c, These filters were then used to predict changes of neural fluctuations under the two conditions. The predicted

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201813 / 26

Gain modulation by closed-loop environmental feedbackchanges in each neuron based on the filters exhibited strong correlation with the actual changes. Some neurons (top 10%, red dots)
exhibited strong negative feedback and were suppressed under the closed-loop condition as predicted by our theory. d, The location ofthese neurons are overlaid with the morphology of a reference zebrafish, colors as in c. Top panel, side view; bottom panel, top view.
Neurons that have strong negative feedback and reduced neural fluctuations were predominantly located in the cerebellum. e, The naive
estimate of the afferent filter for each neuron in the closed-loop condition (quantified by the Ec ! Bc filter, naive afferent) was
qualitatively different from the afferent filter in the replay condition, see dashed and solid blue respectively (inset). However, thediscrepancy was well explained by our theory that accounted for the closed-loop feedback effect (Inset, brown line; see Materials andR
Methods). The prediction error ratio ( prediction, see text) was correlated with the degree to which low-frequency power is suppressed during
Rfilterthe closed-loop condition (yellow dots). Cells strongly stabilised by closed-loop feedback were explained well by the prediction (top 10%,red dots, as in c).
https://doi.org/10.1371/journal.pcbi.1005926.g006

synchronous neural fluctuations [11,26]. However, while motor activity levels were higher inthe closed-loop condition than in the replay condition, the trial-by-trial variation of neuralfluctuations was not explained by the motor activity level. Specifically, increases in motor
activity level were correlated with increases in low frequency power (r = 0.18, p < 10−2, Spearman’s rank correlation) and was not significantly correlated with changes in pairwise correlations between cells (r = 0.03, p > 0.5, Spearman’s rank correlation), see S3 Appendix.
We investigated if the strength of the sensory feedback could explain the observed changes
in low-frequency neural fluctuations, as predicted by our theory. Specifically, we asked if the
feedback mediated by the environment, estimated in the replay condition, predicted the degree
to which each neuron is suppressed in the closed-loop condition relative to the replay
condition.
To quantify the interactions between neurons and environmental variable we fitted the datawith linear filters that when convolved with GCaMP fluorescence of individual neurons, B,
best recover environmental variable, E (defined as activity of motor neurons which uniquelydetermines the visual stimulus), and vice versa, see Materials and Methods. Specifically, foreach observed neuron, we computed a linear filter, F, that describes how the closed-loop swim
power Ec (as quantified by the activity of motor neurons; a putative environmental variable)
affects replay neural activity Br i.e an afferent filter (Fig 6A, blue solid). We calculated linear filter, G, that describes how this neural activity Br affects the replay swim power Er, i.e., an efferent filter (Fig 6A, green solid; see Materials and Methods). Note: we refer to the swimming
power as the environmental variable because, in this experimental setup, visual stimulus isuniquely determined by a simple transformation of the motor nerve activity [23]. It is reasonable to assume that the same neural circuits characterized by these filters (Fig 6A orange solid)
also operate in the closed-loop condition (Fig 6A orange dashed). Hence, we estimate the sensory feedback for each neuron (Fig 6A, orange dashed) as a filter, H, which is a convolution ofthese afferent, F, and efferent, G, filters (see Materials and Methods and Fig 6A, orange solid),
i.e. H = F G. Note: using the replay condition to fit these filters avoids the potential confoundof calculating independent filters in the closed-loop condition. While these filters are neurondependent, the average peak-normalized filters showed clear net effects, see Fig 6B. On average, across cells, we found that the afferent filter (Fig 6B, blue line), was net negative, indicatingthat the swim-induced visual stimulus on average suppressed neural activity. The efferent filter(Fig 6B, green line), was strongly net positive, indicating that an increase in neural activity
drove swim behavior. Finally, the convolution of these filters was on average also negative (Fig
6B, red line), peaking at about 1 s. This suggests, that on average, increases in neural activity
self-suppressed after 1 s due to negative feedback. Notably, the negative sensory feedback interactions were also confirmed by a behavioral analysis, in which we calculated the linear filter
that describes how Er affects Ec (Fig 6B, black line), i.e. this represents a quantification of the
behavioural feedback.

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201814 / 26

Gain modulation by closed-loop environmental feedback

Next, we considered what the consequence of this negative feedback on each neuron’s activity would be. Like the whisker system our theory suggests that fluctuations in neural activity
should decrease if a cell receives negative feedback. If this is the case then we should be able topredict to what extent low frequency power is suppressed from the estimated strength of the
feedback (see Materials and Methods for derivation of this prediction). We found that predicted degree to which a neuron’s activity was suppressed during the closed-loop condition
relative to the replay condition was highly correlated with what was actually observed(r = 0.39, p < 10−8, Spearman’s rank correlation, see Fig 6C). To examine the role of ongoingcycles of feedback in these changes we estimated the degree to which a neuron’s activity would
be suppressed by only a single cycle of feedback loop (see Materials and Methods). We foundthat for cells with the largest change in low frequency (i.e. top 10% of log power ratio, replay/closed) the mean square error of the full feedback prediction was significantly less than that of
the single cycle prediction (p < 0.01, sign test; see Materials and Methods), indicating theimportance of multiple cycles of feedback.
Although the fluctuations in activity in the majority of cells across the fish brain were suppressed by the presence of closed-loop behavior, the top 10 percentile of cells that were bothstrongly suppressed and strongly involved in the negative feedback were clustered in the cerebellum (Fig 6D), a brain area implicated in sensory-motor planning and coordination [30].
This supports the idea that the cerebellum plays a central role mediating negative closed-loop
interaction between the brain and the environment by converting sensation into action in fish
during optic flow stabilization [31].
Finally, we tested if the interaction between the brain and environment is shaped by closedloop feedback. To examine this, we quantified the response of each neuron to sensory input inthe closed-loop condition, i.e., by computing an afferent filter from the closed-loop data without accounting for the feedback loop, a naive afferent filter (see Fig 6A, blue dashed) and compared this with the afferent filter computed in the replay condition (see Fig 6A, blue solid). If
feedback is weak the difference between the two should be small. These two filters were generally distinct in the observed neurons, but were particularly so for those cells that were strongly
stabilized by feedback (Fig 6E; Inset). To test if the closed-loop interaction could explain thisdiscrepancy, we theoretically predicted the naive afferent filter based on data from the replay
condition, i.e., using both the afferent and efferent filters (see Materials and Methods). We
found that, on average, this closed-loop effect could account for the discrepancy for the closedloop stabilized cells (Fig 6E; Inset). To quantify this for each cell, we calculated the meansquare error between the prediction and naive afferent filter (Rprediction), and the mean squareerror between the afferent and naive afferent filter (Rnaive). The performance of the prediction
R

is then quantified by the prediction error ratio ( prediction). This ratio was significantly less than
Rnaiveone (median = 0.8, p < 10−11, sign test), indicating that the prediction was more accurate
when accounting for the closed-loop effect. It was also positively correlated (r = 0.25, p<10−13,
Spearman’s rank correlation) with the degree to which individual cells were stabilized in theclosed-loop condition (Fig 6E). Altogether, these results indicate that neural dynamics, as well
the relationship between sensory stimulus and behavior, not only depend on brain circuits,
but are also dynamically shaped by the mutual interaction between the brain and theenvironment.

Discussion
In this study we proposed the idea that negative closed-loop sensory feedback during active
behavior reduces network gain, which in turn, suppresses synchronous neural fluctuations

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201815 / 26

Gain modulation by closed-loop environmental feedback

Fig 7. A summary of the experimental systems studied. Closed-loop sensory feedback (Top) explains neural activity
in both systems, as summarized in the table (Bottom).
https://doi.org/10.1371/journal.pcbi.1005926.g007

and modulates sensory responses. We supported this with modelling and data analysis in thewhisker system and in a behaving zebrafish, see summary Fig 7. The formal component of ourtheory, i.e., that closed-loop sensory feedback can modulate a system’s gain, is well documented in dynamical systems theory and control theory [32,33]. This gain control occurs eventhough the pathways mediating feedback are purely additive (c.f. Eqs 1 and 2; i.e., effectively
repeated cycles of feedback accumulate over time and produce a multiplicative effect). Thus, aconstitutively active closed-loop feedback that mediates action-perception cycles is essential
for the form of gain control we propose. This means that discrete and intermittent involvement of reafferent input does not imply gain modulation. For example, the classical reafference
principle explains neural responses by a one-time detection of the mismatch between an efference copy (predicted) and reafferent (actual) input [16]. However, this situation is likely aninaccurate idealization to describe the closed-loop systems studied here. For example, in thezebrafish system, swim bouts typically occur every 700 ms and this interval closely overlappedwith the peak of the estimated sensory feedback interaction (Fig 6B). Hence, the neural
responses in the fish experiment suggest a more dynamic system, where neural activity evokedby many cycles of action and sensation are continuously and mutually interacting.
The idea that closed-loop feedback is central to cognition is not new and has early precedents in behavioral psychology [19], resonate with a movement in embodied cognitive science[18,34,35] and has recently been proposed as concrete alternative to input/output conceptionof perceptual processing [17,36]. Our work shares the view of these proposals and provides a
specific example where brain function is contingent on closed-loop interactions between
brain/body/environment. Furthermore, we provided a mathematical model showing why neural dynamics underlying cognitive states cannot be recapitulated even if the sensory input during active behavior is identically repeated, i.e., a replay condition [37].

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201816 / 26

Gain modulation by closed-loop environmental feedback

The presence of continuous negative closed-loop sensory feedback during active behavior
is fundamental for our theory. In our rodent study we assumed negative closed-loop sensory
feedback was mediated directly by a cortical-whisker circuit. However, our theory is agnostic
to the detail of the neural implementation and several other schemes are possible (see S2Appendix). This assumption is consistent with the idea that the barrel cortex comprises anested set of servo control loops that regulate various aspects of whisker dynamics [22]. At thelevel of the whole vibrissa system multiple parallel and nested feedback loops both positive andnegative most likely exist [22].
In zebrafish, the presence of negative feedback during swimming behavior is a priori necessary for optic-flow stabilization behavior because the fish must act in opposition to perceived
optic flow in order to minimize horizontal displacement [38,39]. Interestingly, neurons thatreceived strong negative feedback and were substantially stabilized were located in the cerebellum (Fig 6D). This is consistent with the theoretical viewpoint that the cerebellum is strongly
involved in the action-perception cycle [40–42].
We suggest that closed-loop sensory feedback plays a major role in brain state control.
However, importantly, we do not propose this mechanism is mutually exclusive with othermechanisms, such as thalamo-cortical input [25] or neuromodulation [10,43,44] because brain
state transitions also occur in the absence of sensory feedback e.g., the onset of running that
does not change the visual input [3,45], during sleep [46,47], or by dissection of the sensory
nerve [5,25]. Mechanisms underlying brain state transitions are likely to be redundant andoccur even in the absence of mechanisms, such as thalamo-cortical input [25] or corollary discharge [26], albeit involving further delay (see S1). Such functional redundancy may help tomaintain the stability of brain state [44,48,49]. Furthermore, the relative importance of internaland external mechanisms might adaptively change in an experience-dependent manner [50].
In the whisking model, we proposed that the regulation of cortical gain by closed-loop sensory feedback could explain enhanced active touch. Specifically, negative sensory feedback
during whisking reproduces suppressed fluctuations and reduces responses to passive whisker
stimulation (see Figs 2 and 3). Moreover, robust neural response to active touch events could
be explained by the interruption of this feedback when the whisker is driven into an external
object. These interruptions transiently release the cortex from a low gain state and enhancing
sensory responses to salient sensory stimuli. This mechanism for active touch contrasts withthe account of sensory processing suggested by the reafference principle [16], which postulates
that motor efference is discounted from sensory input, allowing animals to sense exafferent
signals (externally caused sensory input) without being confounded by the consequences of
their own motor actions. In contrast, our theory suggests that the sensory system is insensitive
to pure exafference during active sensing [4]; see Fig 3, but sensitive to the interruption of reafference which may allow animals to focus attention on the consequences of their own motor
actions. This idea is supportive of other work that has cast doubt on the role of efference copy
during active sensing [51]. This mechanism is also distinct from the most common form ofpredictive coding [52], where neural activity represents the error between the actual and thebrain’s prediction of sensory input. Instead our suggestion could be viewed as a more specificform of predictive coding where neurons represent predictions errors about consequences ofmotor actions, in this sense it is closer to the idea of active inference [53,54].
While it is straightforward to generalize this sensory mechanism to other tactile systems, its
implication for other modalities is less clear. However, in theory, closed-loop sensory feedback
could be interrupted anywhere along the action-perception cycle, thus dynamically regulatingneural gain. The timely interruption of this feedback, possibly related to transient freezing of
behavior, could serve as a general mechanism for temporarily accentuating neural responses
against a background of reduced noise. For example, closed-loop sensory feedback could be

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201817 / 26

Gain modulation by closed-loop environmental feedback

gated by the frequency of miniature eye movements [55] a hypothesis that complements a previous proposal suggesting such movements are under active closed-loop control [56]. Furthermore, cerebellum neurons, which are strongly involved in the sensory-motor cycle, could be
suppressed in anticipation of salient sensory events by a relevant brain area, such as the reticular formation [31,57].
The importance of using naturalistic sensory stimuli to study and manipulate brain state
dynamics is widely demonstrated [58]. However, an important prediction of our theory (Fig4), supported by our experimental findings is that brain dynamics during active sensing cannot
be fully recapitulated or re-encoded, even if the same sensory input is precisely recorded andreplayed back into a passive brain. These results provide evidence that brain state during active
behaviors can only be accurately understood by a quantitative account of ongoing brain-environment interactions [18].

Material and methods
A whisking model
To investigate the ‘in principle’ feedback between barrel cortex and whiskers we model a simple cortical circuit that interacts with a single whisker, see Fig 2A. Our cortical circuit comprises of N excitatory and N inhibitory neurons (i = 1. . .N are excitatory and i = N+1,. . ., 2N
are inhibitory, N = 100) modeled as a linear dynamical system by,
P2N
x_ i ¼ xi þ j¼1 wij xj ai wx y yp þ xi þ I;
which is numerically simulated by a Euler forward integration method with time-bin dt = 0.5
ms. Hereafter, all time derivatives are taken to represent single-step differences divided by dt_(e.g. xðtÞ
¼ ½xðt þ dtÞ xðtÞ=dtÞ, but we omit the ms time unit. wij is the synaptic strengthfrom neuron j to i, ai is an adaptation current described below, θp is the whisker protraction
angle interacting with neurons with weight wxθ = 0.002, I is exafferent input that takes
I = 0.035 upon whisker stimulation and otherwise zero, and ξi is independent white noise ofunit variance added to each neuron. We interpret xi as both the firing rate and membranepotential, assuming a roughly linear relationship between the two. Entries in the connectivity
matrix are assigned as wij = bijJ + b0 ijg for excitatory synapses (j = 1. . ., N) and wij = −b@ijg forinhibitory synapses (j = N + 1,. . .,2N), where bij, b0 ij, b@ij are all random binary values that takeb0 > 0 with probability p = 0.1 and 0 with probability 1 − p, respectively. The weights are scaledg0
by J ¼ pN1 and g ¼ p2Npð1, so that dynamics are insensitive to the parameter values of p and N.
pÞNote that the eigenvalue spectrum of the connectivity matrix wij is centered around b0 and
spread with the radius b0g0 in the limit of large N. Hence, the network is excitation dominated.
The variability of weight values across neurons is controlled by the magnitude b0g0 of the excitatory-inhibitory-balanced component and this variability is controlled by the parameter g0 =0.05, which reproduces highly synchronized up/down-like fluctuations during the quiet state.
To promote significant network fluctuations observed in the barrel cortex we scale of the connectivity matrix b0 such that the lead eigenvalue of this matrix is close to unity ( 0.975 andthe dynamics are close to instability. We include an adaptation current that gives these fluctuations a low frequency (ca. 1 Hz) component modelling up/down-like oscillations [59–61] inthe absence of neuron/whisker interactions. The adaptation current is integrated asa_i ¼

0:07ai þ 0:008xi

Over time, the adaptation variable slowly builds upon neural activity and suppresses neurons, resulting in the ca. 1-Hz oscillation. Consequently, in the absence of interactions with the

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201818 / 26

Gain modulation by closed-loop environmental feedback

whisker, implemented by setting wxθ = 0, this simple network reproduces the power spectrum
and cross-correlogram of neurons in the barrel cortex [5,6], see Fig 2B and 2C.
We model a simple flexible vibrissa as two hinged sections (with bending angle θh) connected at the base (with protraction angle θp to the body) of unit length which are constrainedby simple torsion springs with spring constant k1 and k2 respectively, see Fig 2A. We assume
the whisker is light and frictionless and simulated it by numerically minimising the energy ofthe system,
E ¼ k1 ðypk
2yeq Þ þ 2 y2h ;2where θeq equilibrium value of the base spring. Here, only the ratio k1/k2 is important for the
results and, without losing generality, we set k1 = 1. The central hinge spring has an equilibrium value of zero angular displacement and thus tends to align both sections. Whisking isdriven both by the cortex and a central a pattern generator (CPG) [62]. Specifically, the equilibrium value of the base spring, θeq is set as,y_eq ¼

0:93yeq þNwyx X
x þ u;
N i¼1 iwhere the second term on the right-hand side is the sum of activity in the cortical excitatory
population and the third term is the external CPG activity. Here u is modeled as simple stochastic oscillator, given byu_ ¼:98u þ 2pFwhisk v þ xu

v_ ¼

:98v

2pFwhisk u þ xv ;where Fwhisk = 10Hz is the frequency of the oscillator and ξu, ξv are independent Gaussian
white noise. wθx = 0.085 describes the relative strength of the cortex versus the CPG in driving
the whisker variable. With this parameter, the whisker is mainly driven by the CPG and is only
modulated by cortical activity. In this model, most excitatory neurons respond to whisker
retraction and drive whisker protraction. Adding a separate counterpart population that
responds to whisker protraction and drives whisker retraction in a similar manner does notchange the model’s behavior.
We simulate a passive deflection of the whisker by a brief injection of input of I = 0.035 tothe cortical neurons for c.a 25 ms. The magnitude of this input approximately matches theevoked change over the standard deviation of the membrane potential (DVm =sVm ) in response
to magnetic whisker deflection during the whisking condition [5].
Contact events are simulated by simulating a horizontal solid wall is placed above the whisker (1 unit length away). To simulate contact with the wall we solve the energy equation subject to the length constraint in the vertical direction,sinðyp Þ þ sinðyp

yh Þ < 1:

Thus, as the whisker collides with the wall it deforms accordingly, see Fig 2A. By adjusting
the relative stiffness of each torsion spring (i.e. k2/k1), we can control the degree to which the
protraction angle is affected by contact events, e.g., if the whisker is very flexible, the protraction angle will change continuously, despite contact of the tip. During contact we also inject an
input (I = 0.035) to the cortical neurons for the duration of the contact event, but for no longer
than 25 ms to simulate contact-detection signal that results from the stereotypical response of

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201819 / 26

Gain modulation by closed-loop environmental feedbackpressure sensitive cells in the trigeminal ganglion [27]. The model was run for 200 s in theclosed loop, open-loop, and sustained period of active touch to calculate all quantitative
measures.

Quantifying signal-to-noise in the whisking model
To quantify the discriminability of whisker contact events we calculated an information theoretic measure of generalized signal-to-noise-ratio. Specifically, we calculated the Chernoff distance [63–65] between probability distributions, p1(x) and p0(x), in the presence or absence ofa sensory event, respectively. Specifically, this measureZCðp1 k p0 Þ  min log p1 l ðxÞp0 1 l ðxÞdx
0<l<1summarises the detectability of whisker stimulation based on population responses and, unlikea naive calculation of signal-to-noise ratio, is applicable even when p1(x) and p0(x) are very different distributions. For our model, the probability distribution for each condition is welldescribed by a Gaussian distribution,
 



1
1=2
1
p0=1 ðxÞ ¼ j2pC0=1 j exp
x m0=1 C0=1 x m0=1 ;2where C0/1 and μ0/1 are covariance matrix and vector of means, respectively, in the presence(with subscript 1) or absence (with subscript 0) of a sensory event. By substituting this into theexpression for Chernoff distance and employing the Gaussian integral identity and expressing
the Chernoff distance in terms of C0, C1, and μ0, μ1, we calculate the covariance and mean
between a small number of neurons (here three), randomly selected from the cortical network
described above. We calculate covariance’s across ensembles of 500 networks every 10 ms for aperiod of 1 s, starting at the onset of the sensory event. Minimization with respect to λ is computed numerically.

Zebrafish experimental data
In a transgenic fish expressing the calcium indicator GCaMP2 brain-wide calcium activity wasmonitored using a two-photon microscope to scan single planes in the brain. We analyzed thecalcium signal (ΔF/F) at various sample frequencies (ca. 2−3 Hz) across 1908 cells in 32 fish,see [23] and electrical recordings of swim power. We analyzed data taken from a 6-minrecording of 1−6 prominent calcium sources per fish, putative neurons, across 600 trials. In
the first 3 min, the fish performed the closed-loop optomotor behavior. For the subsequent 3
min, each fish was presented with the stimulus received in the closed-loop stimulus which is arepeat of what the animal experienced in the previous 3 min, the replay condition.
In the original study, the gain (i.e., the multiplicative factor between fictive swim power,
and the speed of visual feedback) was alternated between a high and low gain condition every
30 s. This gain alternating protocol is not relevant to the current study. To reduce this variability in data, we subtracted the mean activity level in each gain setting in our analysis (from bothbrain and behavior variables). Notably, our main results were qualitatively the same, even
without such subtraction of the means.

Zebrafish data analysis
We distinguish variables in the closed loop condition (Bc and Ec) and replay condition (Br andEr), see Fig 5B. Specifically, we assume that the closed-loop dynamics in the frequency domain

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201820 / 26

Gain modulation by closed-loop environmental feedback

are described by the following equations,Bc ðoÞ ¼ FðoÞEc ðoÞ þ RBc ðoÞ

ð4ÞEc ðoÞ ¼ GðoÞBc ðoÞ
where F(ω) is an afferent filter describing the interaction from the environment to the brain(i.e., the Ec ! Bc filter, see Fig 5B dashed blue arrow) and G(ω) is an efferent filter from thebrain to the environment (i.e., the Bc ! Ec filter, see Fig 5B dashed green arrow), respectively,
and RBc ðoÞ is the residual inputs not accounted of by the filters. Note: we have assumed thatthe noise on the environment is negligible, this is a reasonable assumption given that visualflow is directly modulated by motor nerve activity. Similarly, we also write the replay dynamics
in the frequency domain as,
Br ðoÞ ¼ FðoÞEc ðoÞ þ RBr ðoÞ

ð5Þ

Er ðoÞ ¼ GðoÞBr ðoÞ:In the replay condition, neurons are driven by the recorded visual stimulus in the closedloop condition, which is determined by fish’s motor activity in the closed-loop condition Ec.
Note: we have made the assumption that F(ω) and G(ω) are the same filter in the both conditions (i.e., the interactions with the same color in Fig 6A have the same property) because thesensory and motor circuits in the brain remain the same between the conditions.
We use Eq 5 in the replay condition to fit the linear filters F(ω) and G(ω) because the computation would be more involved in the closed-loop condition than the replay condition. We
first calculate linear filter F (Fig 6A, solid blue arrow) that minimizes the mean square error
between the observed variable Br and the convolution F  Ec over time. Next, we determine G(t) by first calculating the residual variability of neural activity in the replay condition that cannot be accounted for by the closed-loop environment, i.e., RBr ðoÞ ¼ Br ðoÞ FðoÞEc ðoÞ andsubsequently calculating how RBr drives the environment in the replay condition Er, effectively
determining the Br ! Er interaction (Fig 6A, solid green arrow). The filters were constrained
as a superposition of Laguere functions. We use Laguere functions up to the order that best satisfied the Akaike Information Criterion [66]. Almost all filters had an order that was midrange between 1 and 15. The Ec ! Br ! Er interaction (Fig 6A solid orange arrow) is thenstraightforwardly computed by the convolution of both filters, H(ω) = F(ω)G(ω). Based on theassumption that the filters are the same in the two conditions, we assume that self-feedback inthe closed-loop condition (Fig 6A, dashed orange arrow) is the same as H(ω).
In our investigation, we calculated the ratio of the low frequency power of neural fluctuations between the closed-loop and replay conditions. We then compare this empirical ratiowith the theoretically expected ratio based on the estimated filters. To derive this theoretically
expected ratio, we write the dynamics of neural activity in the closed- and replay conditions in
the frequency domain as,
Closed loop : Bc ðoÞ ¼ HðoÞBc ðoÞ þ RBc ðoÞ ¼ ð11HðoÞÞ RBc ðoÞ

Replay : Br ðoÞ ¼ HðoÞBc ðoÞ þ RBr ðoÞ;where H(ω) = F(ω)G(ω) is the estimated combined filter in the frequency domain and weassume the noise in the closed- and replay conditions have the same power spectrum, i.e.,

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201821 / 26

Gain modulation by closed-loop environmental feedback22

RBc ðoÞ ¼ RBr ðoÞ . The ratio of the power between each condition is then,2

Bc ðoÞ
12 ¼
2HðoÞ þ 1
Br ðoÞ

HðoÞ

2:

We also investigated the effect of accumulative cycles of feedback on brain dynamics bycomparing the full closed-loop effect with a control effect that includes only one-time feedback. Namely, we can expand the contribution of each cycle in a geometric series as
Bc ðoÞ ¼ ð11HðoÞÞ RBc ðoÞ ¼ ð1 þ HðoÞ þ H 2 ðoÞ þ H 3 ðoÞ   ÞRBc ðoÞ

where the O(Hn) term in the above Taylor expansion describes the effect from signal propagation along the feedback loop for n times. By neglecting the contributions with n>1, we canwrite the effect of a single cycle of feedback effect as,
B1 ðoÞ ¼ ð1 þ HðoÞÞRBc ðoÞ:This yields an alternative expression for the ratio of the power between each condition that
only includes one-time effect of feedback as,
2

B1 ðoÞ
12 ¼
22:
HðoÞ þ 1 þ HðoÞBr ðoÞ
To further investigate how the effective interaction between the brain and the environment
depends on the closed-loop feedback, we compare Ec ! Br filter in the replay condition andthe Ec ! Bc filter in the closed-loop condition naively computed by neglecting closed-loop
effects. Notably, the naïve Ec ! Bc filter in the closed-loop condition generally has an acausal
component, because the brain Bc and the environment Ec are mutually interacting (see below).
Thus to calculate these filters we use Hermite rather than the Laguere functions to capture theacausal (t<0) side of the filter. To quantify the difference between these filters, using Eq 4, we
write
Ec ðoÞ ¼ ð11HðoÞÞ ðGðoÞRBc ðoÞÞ;and thus the naive Ec ! Bc filter in the closed-loop condition is




2
Ec ðoÞRBc ðoÞ
jRBc ðoÞj
Bc ðoÞEc  ðoÞ
GðoÞ
¼
F
ð
o
Þ
þ
¼
F
ð
o
Þ
þ
Ec ðoÞEc  ðoÞ
Ec ðoÞEc  ðoÞ
1 HðoÞ jEc ðoÞj2
where  describes complex conjugate. Hence, this filter is different from the corresponding filter F(ω) in the replay condition by the second term. To predict the second term without know2
2
ing RBc, we again assume jRBc ðoÞj  jRBr ðoÞj , where the latter spectrum is based on theresidual RBr computed in the replay condition.

Supporting information
S1 Appendix. Analaysis of supplementary whisker data.
(DOCX)
S2 Appendix. Alternate schemes for sensory feedback in the whisker system.
(DOCX)
S3 Appendix. Supplementary fish data analysis.
(DOCX)PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201822 / 26

Gain modulation by closed-loop environmental feedback

Acknowledgments
We would like to thank the authors of Ahrens et. al. (2012) for kindly providing the zebrafish
data and Poulet et. al. (2012) providing the rodent whisking data. We would like to thankCharles Yokoyama, Alexandra V Terashima, Hokto Kazama, Masanori Murayama, Robert
Froemke, L.F. Abbott and Thomas Collett for helpful comments on the manuscript, andMisha Ahrens, Hideaki Shimazaki, Sylvain Crochet for stimulating discussions.

Author Contributions
Conceptualization: Christopher L. Buckley, Taro Toyoizumi.
Data curation: Christopher L. Buckley.
Formal analysis: Christopher L. Buckley, Taro Toyoizumi.
Investigation: Christopher L. Buckley.
Methodology: Christopher L. Buckley, Taro Toyoizumi.
Software: Christopher L. Buckley.
Supervision: Taro Toyoizumi.
Validation: Christopher L. Buckley, Taro Toyoizumi.
Visualization: Christopher L. Buckley, Taro Toyoizumi.
Writing – original draft: Christopher L. Buckley, Taro Toyoizumi.
Writing – review & editing: Christopher L. Buckley, Taro Toyoizumi.

References
1.

Berger H. Über das Elektrenkephalogramm des Menschen. Archiv für Psychiatrie und Nervenkrankheiten. 1929; 87: 527–570.

2.

McCormick DA, McGinley MJ, Salkoff DB. Brain state dependent activity in the cortex and thalamus.
Curr Opin Neurobiol. 2015; 31: 133–140. https://doi.org/10.1016/j.conb.2014.10.003 PMID: 25460069

3.

Niell CM, Stryker MP. Modulation of visual responses by behavioral state in mouse visual cortex. Neuron. 2010; 65: 472–479. https://doi.org/10.1016/j.neuron.2010.01.033 PMID: 20188652

4.

Crochet S, Petersen CCH. Correlating whisker behavior with membrane potential in barrel cortex of
awake mice. Nat Neurosci. 2006; 9: 608–610. https://doi.org/10.1038/nn1690 PMID: 16617340

5.

Poulet JFA, Petersen CCH. Internal brain state regulates membrane potential synchrony in barrel cortex of behaving mice. Nature. 2008; 454: 881–885. https://doi.org/10.1038/nature07150 PMID:
18633351

6.

Crochet S, Poulet JFA, Kremer Y, Petersen CCH. Synaptic mechanisms underlying sparse coding ofactive touch. Neuron. 2011; 69: 1160–1175. https://doi.org/10.1016/j.neuron.2011.02.022 PMID:
21435560

7.

Salinas E, Sejnowski TJ. Gain modulation in the central nervous system: where behavior, neurophysiology, and computation meet. Neuroscientist. 2001; 7: 430–440. https://doi.org/10.1177/
107385840100700512 PMID: 11597102

8.

Harris KD, Thiele A. Cortical state and attention. Nat Rev Neurosci. 2011; 12: 509–523. https://doi.org/
10.1038/nrn3084 PMID: 21829219

9.

Lee S-H, Dan Y. Neuromodulation of Brain States. Neuron. 2012; 76: 209–222. https://doi.org/10.1016/
j.neuron.2012.09.012 PMID: 23040816

10.

Polack P-O, Friedman J, Golshani P. Cellular mechanisms of brain state-dependent gain modulation invisual cortex. Nat Neurosci. 2013; 16: 1331–1339. https://doi.org/10.1038/nn.3464 PMID: 23872595

11.

Zagha E, Casale AE, Sachdev RNS, McGinley MJ, McCormick DA. Motor cortex feedback influences
sensory processing by modulating network state. Neuron. 2013; 79: 567–578. https://doi.org/10.1016/j.
neuron.2013.06.008 PMID: 23850595

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201823 / 26

Gain modulation by closed-loop environmental feedback

12.

Churchland MM, Yu BM, Cunningham JP, Sugrue LP, Cohen MR, Corrado GS, et al. Stimulus onset
quenches neural variability: a widespread cortical phenomenon. Nat Neurosci. 2010; 13: 369–378.
https://doi.org/10.1038/nn.2501 PMID: 20173745

13.

Tan AYY, Chen Y, Scholl B, Seidemann E, Priebe NJ. Sensory stimulation shifts visual cortex from synchronous to asynchronous states. Nature. 2014; 509: 226–229. https://doi.org/10.1038/nature13159
PMID: 24695217

14.

Poulet JFA, Fernandez LMJ, Crochet S, Petersen CCH. Thalamic control of cortical states. Nat Neurosci. 2012; 15: 370–372. https://doi.org/10.1038/nn.3035 PMID: 22267163

15.

Nguyen Q-T, Quoc-Thang N, David K. Positive Feedback in a Brainstem Tactile Sensorimotor Loop.
Neuron. 2005; 45: 447–457. https://doi.org/10.1016/j.neuron.2004.12.042 PMID: 15694330

16.

von Holst E. Relations between the central Nervous System and the peripheral organs. The British Journal of Animal Behaviour. 1954; 2: 89–94.

17.

Ahissar E, Assa E. Perception as a closed-loop convergence process. Elife. 2016; 5. https://doi.org/10.
7554/eLife.12830 PMID: 27159238

18.

Beer RD. Dynamical approaches to cognitive science. Trends Cogn Sci. 2000; 4: 91–99. PMID:
10689343

19.

Powers WT. Feedback: beyond behaviorism. Science. 1973; 179: 351–356. PMID: 4682961

20.

Diamond ME, von Heimendahl M, Knutsen PM, Kleinfeld D, Ahissar E. “Where” and “what” in the whisker sensorimotor system. Nat Rev Neurosci. 2008; 9: 601–612. https://doi.org/10.1038/nrn2411 PMID:
18641667

21.

Kleinfeld D, Ahissar E, Diamond ME. Active sensation: insights from the rodent vibrissa sensorimotor
system. Curr Opin Neurobiol. 2006; 16: 435–444. https://doi.org/10.1016/j.conb.2006.06.009 PMID:
16837190

22.

Ahissar E, Kleinfeld D. Closed-loop neuronal computations: focus on vibrissa somatosensation in rat.
Cereb Cortex. 2003; 13: 53–62. PMID: 12466215

23.

Ahrens MB, Li JM, Orger MB, Robson DN, Schier AF, Engert F, et al. Brain-wide neuronal dynamics
during motor adaptation in zebrafish. Nature. 2012; 485: 471–477. https://doi.org/10.1038/nature11057
PMID: 22622571

24.

Crapse TB, Sommer MA. Corollary discharge across the animal kingdom. Nat Rev Neurosci. 2008; 9:
587–600. https://doi.org/10.1038/nrn2457 PMID: 18641666

25.

Goard M, Dan Y. Basal forebrain activation enhances cortical coding of natural scenes. Nat Neurosci.
2009; 12: 1444–1449. https://doi.org/10.1038/nn.2402 PMID: 19801988

26.

Schneider DM, Nelson A, Mooney R. A synaptic and circuit basis for corollary discharge in the auditory
cortex. Nature. 2014; 513: 189–194. https://doi.org/10.1038/nature13724 PMID: 25162524

27.

Szwed M, Bagdasarian K, Ahissar E. Encoding of vibrissal active touch. Neuron. 2003; 40: 621–630.
PMID: 14642284

28.

Lee S, SooHyun L, Carvell GE, Simons DJ. Motor modulation of afferent somatosensory circuits. Nat
Neurosci. 2008; 11: 1430–1438. https://doi.org/10.1038/nn.2227 PMID: 19011625

29.

Ahrens MB, Huang KH, Narayan S, Mensh BD, Engert F. Two-photon calcium imaging during fictive
navigation in virtual environments. Front Neural Circuits. 2013; 7: 104. https://doi.org/10.3389/fncir.
2013.00104 PMID: 23761738

30.

Scott SH. Optimal feedback control and the neural basis of volitional motor control. Nat Rev Neurosci.
2004; 5: 532–546. https://doi.org/10.1038/nrn1427 PMID: 15208695

31.

Kawashima T, Zwart MF, Yang C-T, Mensh BD, Ahrens MB. The Serotonergic System Tracks the Outcomes of Actions to Mediate Short-Term Motor Learning. Cell. 2016; 167: 933–946.e20. https://doi.org/
10.1016/j.cell.2016.09.055 PMID: 27881303

32.

Aström KJ, Murray RM. Feedback Systems: An Introduction for Scientists and Engineers. Princeton
University Press; 2010.

33.

Vlachos I, Deniz T, Aertsen A, Kumar A. Recovery of Dynamics and Function in Spiking Neural Networks with Closed-Loop Control. PLoS Comput Biol. 2016; 12: e1004720. https://doi.org/10.1371/
journal.pcbi.1004720 PMID: 26829673

34.

van Gelder T. The dynamical hypothesis in cognitive science. Behav Brain Sci. 1998; 21. https://doi.
org/10.1017/s0140525x98001733

35.

Spremberg A. Varela F., Thompson E., E., The Embodied Mind. Phenomenological Reviews. 2017; 3:
32–32.

36.

Ahissar E, Arieli A. Seeing via Miniature Eye Movements: A Dynamic Hypothesis for Vision. Front Comput Neurosci. 2012; 6: 89. https://doi.org/10.3389/fncom.2012.00089 PMID: 23162458

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201824 / 26

Gain modulation by closed-loop environmental feedback

37.

Murray L, Trevarthen C. The infant’s role in mother–infant communications. J Child Lang. 1986; 13.
https://doi.org/10.1017/s0305000900000271

38.

Fry SN, Rohrseitz N, Straw AD, Dickinson MH. Visual control of flight speed in Drosophila melanogaster. J Exp Biol. 2009; 212: 1120–1130. https://doi.org/10.1242/jeb.020768 PMID: 19329746

39.

Wolf R, Voss A, Hein S, Heisenberg M, Sullivan GD. Can a Fly Ride a Bicycle? [and Discussion]. Philos
Trans R Soc Lond B Biol Sci. 1992; 337: 261–269.

40.

Ito M. Neural design of the cerebellar motor control system. Brain Res. 1972; 40: 81–84. PMID:
4338265

41.

Lisberger SG, Morris EJ, Tychsen L. Visual motion processing and sensory-motor integration forsmooth pursuit eye movements. Annu Rev Neurosci. 1987; 10: 97–129. https://doi.org/10.1146/
annurev.ne.10.030187.000525 PMID: 3551767

42.

Kawato M. Internal models for motor control and trajectory planning. Curr Opin Neurobiol. 1999; 9: 718–
727. PMID: 10607637

43.

Pinto L, Goard MJ, Estandian D, Xu M, Kwan AC, Lee S-H, et al. Fast modulation of visual perception
by basal forebrain cholinergic neurons. Nat Neurosci. 2013; 16: 1857–1863. https://doi.org/10.1038/nn.
3552 PMID: 24162654

44.

Fu Y, Tucciarone JM, Espinosa JS, Sheng N, Darcy DP, Nicoll RA, et al. A cortical circuit for gain control
by behavioral state. Cell. 2014; 156: 1139–1152. https://doi.org/10.1016/j.cell.2014.01.050 PMID:
24630718

45.

Fee MS, Mitra PP, Kleinfeld D. Central versus peripheral determinants of patterned spike activity in rat
vibrissa cortex during whisking. J Neurophysiol. 1997; 78: 1144–1149. https://doi.org/10.1152/jn.1997.
78.2.1144 PMID: 9307141

46.

Vyazovskiy VV, Olcese U, Hanlon EC, Nir Y, Cirelli C, Tononi G. Local sleep in awake rats. Nature.
2011; 472: 443–447. https://doi.org/10.1038/nature10009 PMID: 21525926

47.

Schomer DL, da Silva FL. Niedermeyer’s Electroencephalography: Basic Principles, Clinical Applications, and Related Fields. Lippincott Williams & Wilkins; 2012.

48.

McGinley MJ, David SV, McCormick DA. Cortical Membrane Potential Signature of Optimal States for
Sensory Signal Detection. Neuron. 2015; 87: 179–192. https://doi.org/10.1016/j.neuron.2015.05.038
PMID: 26074005

49.

Otazu GH, Tai L-H, Yang Y, Zador AM. Engaging in an auditory task suppresses responses in auditory
cortex. Nat Neurosci. 2009; 12: 646–654. https://doi.org/10.1038/nn.2306 PMID: 19363491

50.

Ding X, Kong X, Dai J. Advances in Reconfigurable Mechanisms and Robots II. Springer; 2015.

51.

Feldman AG. Active sensing without efference copy: referent control of perception. J Neurophysiol.
2016; 116: 960–976. https://doi.org/10.1152/jn.00016.2016 PMID: 27306668

52.

Rao RP, Ballard DH. Predictive coding in the visual cortex: a functional interpretation of some extraclassical receptive-field effects. Nat Neurosci. 1999; 2: 79–87. https://doi.org/10.1038/4580 PMID:
10195184

53.

Friston K, FitzGerald T, Rigoli F, Schwartenbeck P, Pezzulo G. Active Inference: A Process Theory.
Neural Comput. 2017; 29: 1–49. https://doi.org/10.1162/NECO_a_00912 PMID: 27870614

54.

Buckley CL, Kim CS, McGregor S, Seth AK. The free energy principle for action and perception: A mathematical review. J Math Psychol. 2017; https://doi.org/10.1016/j.jmp.2017.09.004

55.

Hafed ZM, Lovejoy LP, Krauzlis RJ. Modulation of microsaccades in monkey during a covert visual
attention task. J Neurosci. 2011; 31: 15219–15230. https://doi.org/10.1523/JNEUROSCI.3106-11.2011
PMID: 22031868

56.

Ahissar E, Arieli A, Fried M, Bonneh Y. On the possible roles of microsaccades and drifts in visual perception. Vision Res. 2016; 118: 25–30. https://doi.org/10.1016/j.visres.2014.12.004 PMID: 25535005

57.

Kinomura S, Larsson J, Gulyás B, Roland PE. Activation by attention of the human reticular formationand thalamic intralaminar nuclei. Science. 1996; 271: 512–515. PMID: 8560267

58.

Felsen G, Dan Y. A natural approach to studying vision. Nat Neurosci. 2005; 8: 1643–1646. https://doi.
org/10.1038/nn1608 PMID: 16306891

59.

Compte A. Cellular and Network Mechanisms of Slow Oscillatory Activity (<1 Hz) and Wave Propagations in a Cortical Network Model. J Neurophysiol. 2003; 89: 2707–2725. https://doi.org/10.1152/jn.
00845.2002 PMID: 12612051

60.

Gentet LJ, Michael A, Ferenc M, Staiger JF, Petersen CCH. Membrane Potential Dynamics of GABAergic Neurons in the Barrel Cortex of Behaving Mice. Neuron. 2010; 65: 422–435. https://doi.org/10.1016/
j.neuron.2010.01.006 PMID: 20159454

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201825 / 26

Gain modulation by closed-loop environmental feedback

61.

Curto C, Sakata S, Marguet S, Itskov V, Harris KD. A simple model of cortical dynamics explains variability and state dependence of sensory responses in urethane-anesthetized auditory cortex. J Neurosci. 2009; 29: 10600–10612. https://doi.org/10.1523/JNEUROSCI.2053-09.2009 PMID: 19710313

62.

Scott SH, Korbel T, Kan S. Primary motor cortex and feedback control: long-loop reflexes reflect joint
mechanics and not joint motion. Proceedings of the 25th Annual International Conference of the IEEE
Engineering in Medicine and Biology Society (IEEE Cat No03CH37439). https://doi.org/10.1109/iembs.
2003.1281000

63.

Cover TM, Thomas JA. Elements of Information Theory. 2005.

64.

Jacob V, Mitani A, Toyoizumi T, Fox K. Whisker row deprivation affects the flow of sensory information
through rat barrel cortex. J Neurophysiol. 2017; 117: 4–17. https://doi.org/10.1152/jn.00289.2016
PMID: 27707809

65.

Kang K, Shapley RM, Sompolinsky H. Information tuning of populations of neurons in primary visualcortex. J Neurosci. 2004; 24: 3726–3735. https://doi.org/10.1523/JNEUROSCI.4272-03.2004 PMID:
15084652

66.

Akaike H, Hirotugu A. Factor analysis and AIC. Psychometrika. 1987; 52: 317–332.

PLOS Computational Biology | https://doi.org/10.1371/journal.pcbi.1005926 January 17, 201826 / 26