Neural network models of chemotaxis in 
the nematode Caenorhabditis elegans 
Thomas C. Ferre, Ben A. Marcotte, Shawn It. Lockery 
Institute of Neuroscience, University of Oregon, Eugene, Oregon 97403 
Abstract 
We train recurrent networks to control chemotaxis in a computer 
model of the nematode C. elegant. The model presented is based 
closely on the body mechanics, behavioral analyses, neuroanatomy 
and neurophysiology of G. elegans, each imposing constraints rel- 
evant for information processing. Simulated worms moving au- 
tonomously in simulated chemical environments display a variety 
of chemotaxis strategies si_m_ilar to those of biological worms. 
1 INTRODUCTION 
The nematode C'. eleans provides a unique opportunity to study the neuronal ba- 
sis of neural computation in an animal capable of complex goal-oriented behaviors. 
The adult hermaphrodite is only 1 mm long, and has exactly 302 neurons and 95 
muscle cells. The morphology of every cell and the location of most electrical and 
chemical synapses are known precisely (White et aL, 1986), making C. elegans espe- 
cially attractive for study. Whole-cell recordings are now being made on identified 
neurons in the nerve ring of G. elegans to determine electrophysiological properties 
which underly information processing in this animal (Lockery and Goodman, un- 
published). However, the strengths and polarities of synaptic connections are not 
known, so we use neural network optimization to find sets of synaptic strengths 
which reproduce actual nematode behavior in a simulated worm. 
We focus on chemotaxis, the ability to move up (or down) a gradient of chemical 
attractants (or repellants). In the laboratory, flat Petri dishes (radius = 4.25 cm) 
are prepared with a Gaussian-shaped field of attractant at the center, and worms 
are allowed to move freely about. Worms propel themselves forward by generating 
an undulatory body wave, which produces sinusoidal movement. In chemotaxis, the 
nervous system generates motor commands which bias this movement and direct 
56 T. C. Ferrde, B. A. Marcotte and S. R. Lockery 
the animal toward higher attractant concentration. 
Anatomical constraints pose important problems for C. ele.qar during chemotaxis. 
In particular, the animal detects the presence of chemicals with a pair of sensory 
organs (ampbids) at the tip of the nose, each containing the processes of multiple 
chemosensory neurons. During normal locomotion, however, the animal moves on 
its side so that the two ampbids are perpendicular to the Petri dish. C. ele.qar can- 
not, therefore, sense the gradient directly. One possible strategy for cherootaxis, 
which has been suggested previously (Ward, 1973), is that the animal computes a 
temporal derivative of the local concentration during a single head sweep, and com- 
bines this with some form of proprioceptive feedback indicating muscle contraction 
and the direction of head sweep, to compute the spatial gradient for cherootaxis. 
The existence of this and other strategies is discussed later. 
In Section 2, we derive a simple model of the nematode body which produces realis- 
tic sinusoidal trajectories in response to motor commands from the nervous system. 
In Section 3, we give a simple model of the C'. ele.qar nervous system based on 
prelim_nary physiological data. In Section 4, we use a stochastic optimization algo- 
rithm to determine sets of synaptic weights which control chemotaxis, and discuss 
solutions. 
2 BIOMECHANICS OF NEMATODE ORIENTATION 
Nematode locomotion has been studied in detail (Niebur and ErdSs, 1991; Niebur 
and ErdSs, 1993). These authors derived NewtonJan force equations for each mus- 
cular segment of the body, which can be solved numerically to generate forward 
sinusoidal movement. Unfortunately, such a thorough treatment is computation- 
ally intensive and not practical to use with network optimization. To simplify the 
problem we first recognize that chemotaxis is a behavior more of orientation than of 
locomotion. We therefore derive a set of biomechanical equations which direct the 
head to generate sinusoidal movement, which can be biased by the network toward 
higher chemical concentrations. 
We focus our attention on the point (x, y) at the tip of the nose, since that is where 
the animal senses the chemical environment. As shown in Figure l(a), we assign 
a velocity vector t7 directed along the midline of the first body segment, i.e., the 
head. Assuming that the worm moves forward at constant speed v, we can write 
the velocity vector as 
(dx dy) = (vcosO(t),vsinO(t)) 
(t)---- ,  
(1) 
where x, y and 0 are measured relative to fixed coordinates in the Petri dish. 
Assuming that the worm moves without lateral slipping and that the undulatory 
wave of muscular contraction initiated in the neck travels posteriorally without 
modification, then each body segment simply follows the one previous (anterior) to 
it. In this way, the head directs the movement and the rest of the body simply 
follows. 
Figure l(b) shows an expanded view of the neck segment. As the worm moves 
forward, the posterior boundary of that segment assumes the position held by its 
anterior neighbor at a slightly earlier time. If L is the total body length and N is 
Neural Network Models of Chernotaxis 57 
the number of body segments, then this time delay is at _ L]Nv. (For L = 1 ram, 
v = 0.22 rnm/s and N = 10 we have at - 0.45 s, roughly an order of magnitude 
smaller than the relevant behavioral time scale: the head-sweep period T _ 4.2 s.) 
If we define the neck angle a(t) -- 01(t) - 02(t), then the above arguments imply 
a(t) = o(t) - o(t - at) ,,, ao2 at 
(2) 
where the second relation is essentially a backward-Euler algorithm for 
Since 0 -- 0, we have reached the intuitive result that the neck angle a determines 
the rate of turning dS]dr. Note that while 0 and 02 are defined relative to the 
fixed laboratory coordinates, their difference a is invariant under rotations of these 
coordinates, and can therefore be viewed as intrinsic to the body. This allows us 
to derive an expression for a in terms of muscle cell contraction, or motor neuron 
depolarization, as follows. 
(a) .o (b) 
Figure 1: Nematode body mechanics. (a) Segmented model of the nematode body, 
showing the direction of motion 6. (b) Expanded view of the neck segment, showing 
dorsal (D) and ventral (V) neck muscles. 
Nematodes maintain nearly constant volume during movement. To incorporate this 
constraint, albeit approximately, we assume that at all times the geometry of each 
segment is such that (/D --lo) -- --(/V- lo), where lo  L/N is the equilibrium length 
of a relaxed segment. For small angles a, we have a _ (/v - ID)/d, where d is the 
body diameter. The dashed lines in Figure l(b) indicate dorsal and ventral muscles, 
which are believed to develop tension nearly independent of length (Toida et 
1975). When contracting, these muscles must work ag_aJnst the elasticity of the 
cuticle, internal fluid pressure, and elasticity and developed tension of the opposing 
muscles. If these elastic forces act linearly, then To-Tv - k (/v--lb), where TD and 
Tv are dorsal and ventral muscle tensions, and k is an effective force constant. For 
simplicity, we further assume that each muscle develops tension linearly in response 
to the voltage of its corresponding motor neuron, i.e., TD,V --  VD,V, where  is a 
positive constant, and VD and Vv are dorsal and ventral motor neuron voltages. 
Combining these results, we have finally 
= 'y - 
58 T. C. Ferre, B. A. Marcotte and S. R. Lockery 
where 7 = (Nv/L). (/kd). With appropriate motor commands, equations (1) and 
(3) can be integrated numerically to generate sinusoidal worm trajectories like those 
of biological worms. This model embodies the main anatomical features that are 
likely to be important in C. elegans cherootaxis, yet is sufficiently compact to be 
embedded in a network optimization procedure. 
3 CHEMOTAXIS CONTROL CIRCUIT 
C. elegans neurons are tiny and have very simple morpologies: a typical neuron 
in the head has a spherical soma 1-2 /m in diameter, and a single cylindrical 
process 60-80/m in length and 0.1-0.2/m in diameter. Compartmental mod- 
els, based on this morphology and preliminary physiological recordings, indicate 
that C. elegans neurons are effectively isopotential (Lockery, 1995). Furthermore, 
C. elegans neurons do not fire classical all-or-none action potentials, but appear to 
rely primarily on graded signal propagation (Lockery and Goodman, unpublished). 
Thus, a reasonable starting point for a network model is to represent each neuron 
by a single isopotential compartment, in which voltage is the state variable, and the 
membrane conductance in purely ohmic. 
Anatomical data indicate that the C. elegans nervous system has both electrical and 
chemical synapses, but the synaptic transfer functions are not bnown. However, 
steady-state synaptic transfer functions for chemical synapses have been measured 
in Ascaris suurn, a related species of nematode, where it was found that postsynaptic 
voltage is a graded function of presynaptic voltage, due to tonic neurotransmitter 
release (Davis and Stretton, 1989). This voltage dependence is sigmoidal, i.e., 
Vpost  tanh(Vpre). A simple network model which captures all of these features is 
dl -14 + V=tanh ' w, (1 - ) + V?i(t) (4) 
rdt = 
j=l 
where If/ is the voltage of the i th neuron. Here all voltages are measured relative 
to a common resting potential, Vmax is an arbitrary voltage scale which sets the 
operational range of the neurons, and f] sets the voltage sensitivity of the synaptic 
transfer function. The weight wij represents the net strength and polarity of all 
synaptic connections from neuron j to neuron i, and the constants  determine the 
center of each transfer function. The membane time constant r is assumed to be 
the same for all cells, and will be discussed further later. Note that in (4), synap- 
tic transmission occurs instantaneously: the time constant r arises from capacitive 
current through the cell membrane, and is unrelated to synaptic transmission. Note 
also that the way in which (4) sums multiple inputs is not unique, i.e., other sig- 
moidal models which sum inputs differently are equally plausible, since no data on 
synaptic summation exists for either C. elegans or Ascaris suum. 
The stimulus term V/*tlm(t) is used to introduce chemosensation and sinusoidal 
locomotion to the network in (4). We use i = I to label a single chemosensory 
neuron at the tip of the nose, and i = n - 1 -- D and i = n -- V to label dorsal and 
ventral motor neurons. For simplicity we assume that the chemosensory neuron 
voltage responds linearly to the local chemical concentration: 
W"=(t) = (5) 
Neural Network Models of Chemotaxis 59 
where Vchem is a positive constant, and the local concentration C'(z, g) is always 
evaluated at the instantaneous nose position. 
In the previous section, we emphasized that locomotion is effectively independent of 
orientation. We therefore assume the existence of a central pattern generator (CPG) 
which is oatside the chemotaxis control circuit (4). Thus, in addition to synaptic 
input from other neurons, each motor neuron receives a sinusoidal stimulus 
Victim(t)---- -vtlm(t)= VCPG sin(ut) 
(6) 
where VcpG and u = 2r/T are positive constants. 
4 RESULTS AND DISCUSSION 
Equations (1), (3) and (4), together with (5) and (6), comprise a set of n + 3 
first-order nonlinear differential equations, which can be solved numerically given 
initial conditions and a specification of the chemical environment. We use a fourth- 
order Runge-Kutta algorithm and find favorable stability and convergence. The 
necessary body parsmeters have been measured by observing actual worms (Pierce 
and Lockcry, unpublished): v = 0.022 cm/s, T = 4.2 s and 7 = 0.8/(2Vcp). The 
chemical environment is also chosen to agree roughly with experimental values: 
C'(,y) = C'o exp(-( 2 + y2)/A), with C'o = 0.052/mol/cm 3 and Ac = 2.3 cm. 
To optimize networks to control chemotaxis, we use a simple simulated annealing 
algorithm which searches over the (n a + 3)-dimensional space of parsmeters 
/, Vchem and VcPc. In the results shown here, we used n = 12, and set  = 0. 
Each set of the resulting parsmeters represents a different nervous system for the 
model worm. At the beginning of each run, the worm is initialized by choosing an 
initial position (o, /o), an initial angle 80, and by setting V = O. Upon numerically 
integrating, simulated worms move autonomously in their environment for a prede- 
termined sm__ount of time, typically the real-time equivalent of 10-15 minutes. We 
quantify the performance, or fitness, of each worm during cherootaxis by computing 
the average chemical concentation at the tip of its nose over the duration of each 
run. To avoid lucky scores, the actual score for each worm is obtained by averaging 
over several initial conditions. 
In Figure 2, we show a comparison of tracks produced by (a) biological and (b) 
simulated worms during cherootaxis. In each case, three worms were placed in a 
dish with a radial gradient and allowed to move freely for the real-time equivalent 
of 15 minutes. In (b), the three worms have the ssme neural parsmeters (wq,/, 
Vchem, VCpC), but different initial angles 80. In both (a) and (b), all three worms 
make initial movements, then move toward the center of the dish and remain there. 
In other optimlzations, rather than orbit the center, the simulated worms may 
approach the center asymptotically from one side, make simple geometric patterns 
which pass through the center, or exhibit a variety of other distinct strategies for 
chemotaxis. This is similar to the situation with biological worms, which also have 
considerable variation in the details of their tracks. 
The behavior shown in Figure 2 was produced using r - 500 ms. However, prelimi_- 
nary electrophysiological recordings from C'. elegans neurons suggest that the actual 
value may be as much as an order of magnitude smaller, but not bigger (Lockcry and 
Goodman, unpublished). This presents a potential problem for cherootaxis corn- 
60 T. C. Ferrde, B. A. Marcotte and S. R. Lockery 
putation, since shorter time constants require greater sensitivity to small changes 
in C(z, It) in order to compute a temporal derivative, which is believed to be re- 
quired. During optimfzation, we have seen that for a fixed number of neurons n, 
finding optimal solutions becomes more difficult as r is decreased. This observation 
is very difficult to quantify, however, due to the existence of local maxima in the 
fitness function. Nevertheless, this suggests that additional mechanisms may need 
to be included to understand neural computation in C'. eleTar. First, time- and 
voltage-dependent conductances will modify the effective membrane time constant, 
and may increase the effective time scale for computation by individual neurons. 
Second, more neurons and synaptic delays will also move the effective neuronal time 
scale closer to that of the behavior. Either of these will allow comparisons of C(z, It) 
across greater distances, thereby requiring less sensitivity to compute the gradient, 
and potentially improving the ability of these networks to control chemotaxis. 
2 cm 
(b) 
Figure 2: Nematodes performing chemotaxis: (a) biological (Pierce and Lockery, 
unpublished), and (b) simulated. 
We also note, based on a variety of other results, not shown here, that the head- 
sweep strategy, described in the introduction, is by no means the only strategy for 
chemotaxis in this system. In particular, we have optimized networks without a 
CPG, i.e., with Vcpc = 0 in (6), and found parameter sets that successfully con- 
trol chemotaxis. This presents the possibility that even worms with a CPG do not 
necessarily compute the gradient based on lateral movement of the head, but may 
instead respond only to changes in concentration along their mean trajectory. Sim- 
ilar results have been reported previously, although based on a somewhat different 
biomechanical model (Beer and Callagher, 1992). 
Finally, we have also optimized discrete-time networks, obtained by setting r = 0 
in (4) and updating all units synchronously. As is well-known, on relatively short 
time scales (~ T) such a system tends to "overshoot" at each successive time step, 
leading to sporadic behavior of the network and the body. Knowing this, it is 
interesting that simulated worms with such a nervous system are capable of reliable 
behavior over longer time scales, i.e., they successfully perform chemotaxis. 
Neural Network Models of Chemotaxis 
5 CONCLUSIONS AND FUTURE WORK 
61 
The main result of this paper is that a small nervous system, based on graded- 
potential neurons, is capable of controlling chemotaxis in a worm-like physical body 
with the dimensions of C'. elegans. The model presented is based closely on the body 
mechanics, behavioral analyses, neuroanatomy and neurophysiology of C'. eleans, 
and is a reliable starting point for more realistic models to follow. Furthermore, we 
have established the existence of chemotaxis strategies that had not been anticipated 
based on behavioral experiments with real worms. 
Future work will involve both improvement of the model and analysis of the result- 
ing solutions. Improvements will include introducing voltage- and time-dependent 
membrane conductances, as this data becomes available, and more realistic models 
of synaptic transmission. Also, laser ablation experiments have been performed that 
suggest which interneurons and motor neurons in tY. ele?ans may be important for 
cherootaxis (Bargmann, unpublished), and these data can be used to constrain the 
synaptic connections during optimization. Analyses will be aimed at determining 
the role of individual physiological and anatomical features, and how they func- 
tion together to govern the collective properties of the network as a whole during 
chemotaxis. 
Acknowledgements 
The authors would like to thank Miriam Goodman and Jon Pierce for helpful dis- 
cussions. This work has been supported by NIMH MHl1373, NIMH MH51383, 
NSF IBN 9458102, ONR N00014-94-1-0642, the Sloan Foundation, and The Searle 
Scholars Program__. 
References 
Beer, R. D. and J. C. Gallagher (1992). Evolving dynamical neural networks for 
adaptive behavior, Adaptive Behavior 1(1):91-122. 
Davis, R. E. and A. O. W. Stretton (1989). Signaling properties of Ascaris mo- 
torneurons: Graded active responses, graded synaptic transmission, and tonic trans- 
mitter release, Y. Neurosci. 9:415-425. 
Lockery, S. R. (1995). Signal propagation in the nerve ring of C'. eleans, Soc. Neu- 
rosci. Abstr. 569.7:1454. 
Niebur, E. and P. ErdSs (1991). Theory of the locomotion of nematodes: Dynamics 
of undulatory progression on a surface, Biophgs. Y. 60:1132-1146. 
Niebur, E. and P. ErdSs (1993). Theory of the locomotion of nematodes: Control 
of the somatic motor neurons by interneurons, Math. Biosci. 118:51-82. 
Toida, N., H. Kuriyam__a, N. Tashiro and Y. Ito (1975). Obliquely striated muscle, 
Physiol. Rev. 55:700-756. 
Ward, S. (1973). Chemotaxis by the nematode C'aenorhabditis eleans: Iden- 
tification of attractants and analysis of the response by use of mutants, 
Proc. Nat. Acad. Sci. USA 70:817-821. 
White, J. G., E. Southgate, J. N. Thompson and S. Brenner (1986). The structure 
of the nervous system of C'. eleans, Phil. Trans. R. Soc. London 314:1-340. 
