Abstract
To navigate in spatial fields of sensory cues, bacterial cells employ gradient sensing by temporal comparison for run-and-tumble chemotaxis. Sensing and motility noise imply trade-off choices between precision and accuracy. To gain insight into these trade-offs, we learn optimal chemotactic decision filters using supervised machine learning, applying support vector machines to a biologically motivated training dataset. We discuss how the optimal filter depends on the level of sensing and motility noise, and derive an empirical power law for the optimal measurement time with as a function of the rotational diffusion coefficient Drot characterizing motility noise. A weak amount of motility noise slightly increases chemotactic performance.
Export citation and abstract BibTeX RIS
Published by the EPLA under the terms of the Creative Commons Attribution 4.0 International License (CC-BY). Further distribution of this work must maintain attribution to the author(s) and the published article's title, journal citation, and DOI.
Introduction
Motile biological cells can steer their swimming paths upwards a concentration gradient of chemoattractant molecules in a process termed chemotaxis [1–6]. At the microscopic scale of cells, sensing and motility noise severely limit the precision of chemotaxis [7–14]. Biological cells measure chemoattractant concentration by registering binding events of diffusing chemoattractant molecules to receptors on the cell surface. The number of molecules registered in a short time interval is thus a random variable, resulting in inevitable sensing noise. Brownian motion as well as active fluctuations of cell motility randomize the orientation of the cell, resulting in motility noise [15,16]. In a seminal paper, Berg and Purcell argued that the relative error in sensing a concentration c due to molecular shot noise scales as , where is the detection rate of chemoattractant molecules, which depends on the diffusivity D of these molecules and the size L of the cell, while T is measurement time [7]. The choice of optimal measurement time implies a trade-off between precision and accuracy: longer measurement times increase the precision of concentration measurements, as measurement noise can be effectively averaged out, but reduce the accuracy as the true concentration dynamically changes in time [17]. For a concentration that fluctuates on a characteristic time-scale τ, the optimal choice of measurement time results in the modified scaling [18]. An analogous scaling was later found for optimal gradient sensing by spatial comparison, where a stationary cell determines the direction of a spatial concentration gradient by comparing local concentration across its diameter [19].
To determine not only a concentration, but a spatial concentration gradient, biological cells use different strategies [3,20]. Possibly the most natural strategy, spatial comparison, compares concentrations across the diameter of the cell, and is employed, e.g., by crawling immune cells [4]. Intriguingly, many smaller cells such as the bacterium E. coli do not use spatial comparison, but instead determine concentration gradients by temporal comparison, i.e., by estimating the time derivative of the local concentration signal , while the cell actively moves along a path in a concentration gradient [1]. Generally, small and comparatively fast cells employ temporal comparison for gradient sensing, while larger and slower cells often employ spatial comparison [20]. In fact, the signal-to-noise ratio of spatial comparison depends strongly on agent size L. Moreover, the measurement time T is ultimately limited by the persistence time , which is set by the rotational diffusion coefficient of Brownian motion for small cells [15]. For micrometer-sized bacteria, gradient sensing by spatial comparison would be simply too noisy. Instead, these cells employ a chemotaxis strategy known as run-and-tumble, where short episodes of approximately straight swimming (runs) are interrupted by random reorientation events (tumbles), during which the cell picks a new swimming direction at random [1]. By estimating the time derivative of the chemoattractant concentration signal during a run, and extending the duration of runs if this temporal change is positive, these cells realize a biased random walk with net motion up the concentration gradient. Several works investigated optimal gradient-sensing strategies in the presence of noise [21,22]. A key question concerns the optimal measurement time Teff for taking the binary decision whether to tumble or not.
Here, we employ supervised machine learning to determine kernels for optimal decision filters for run-and-tumble chemotaxis using support vector machines. Time-continuous decision filters are effectively represented by finite weight vectors that can be learned efficiently. The learned navigation strategy enables search agents to find a target with a chemotactic index close to that of an ideal run-and-tumble agent, demonstrating that machine learning can identify near-optimal functional behavior. We empirically show that the optimal measurement time follows a power law with exponent .
Model
To describe a minimal chemotactic agent, we extend the popular model of an Active Brownian Particle (ABP) [23] by introducing tumbles as random re-orientation events, which are triggered by a decision rule that takes noisy concentration measurements of the ABP along its trajectory as input. Specifically, we consider a point-like agent moving along a trajectory in two-dimensional space in a spatial concentration field of chemoattractant molecules released by a hidden target at the origin, see fig. 1(a). The diffusion of molecules to an absorbing surface, here the circumference of the agent, is well described by a Poisson point process of arriving molecule with rate (see footnote 1 ). Here, λ is a binding rate constant (that depends as on the diffusion coefficient D of the chemoattractant molecules, and the size L of the agent and its surface coverage with chemoattractant receptors [15]). We write for the train of stochastic binding events occurring at times tk ; s(t) represents an (inhomogeneous) Poisson point process with rate r(t): .
For the sake of explicitness, we assume a radially symmetric concentration profile with exponential decay 2 . The agent performs runs interrupted by tumbling events that randomize its swimming direction; specifically, the swimming path obeys , where v0 is a constant swimming speed and the local tangent vector. The agent is subject to motility noise modeled as rotational diffusion with rotational diffusion coefficient Drot, i.e., the direction angle ψ characterizing the direction of the tangent undergoes Brownian motion as , where ξ (t) is Gaussian white noise with zero mean and unit variance . Thus, the agent moves like an Active Brownian Particle (ABP) [23] during runs. Tumbling events are assumed to be instantaneous and cause a randomization of swimming direction with uniformly distributed new swimming direction angle . After tumbling, agents exhibit a refractory period of Tmax before they may tumble again.
Supervised learning of memory kernels using support vector machines
Run-and-tumble chemotaxis relies on dynamically adjusting the length of runs, by triggering tumbling events earlier or later, depending on whether the agent is moving down-gradient or up-gradient, respectively. For this, the Machine-Learning (ML) agent needs to decide whether the concentration signal measured during its current run is decreasing or increasing with time. This is a non-trivial decision task, as concentration measurements are corrupted by both sensing and motility noise. As a result, run-and-tumble chemotaxis is highly stochastic on time-scales of a single run, but, if tuned correctly, can give robust net motion up-gradient on longer time-scales.
Deciding whether a train of binding events s(t) represents a time-dependent concentration that decreases or increases with time t, can be efficiently addressed by a linear decision filter with memory kernel and bias b
where the integral represents a weighted sum of the recent past of the input s(t) up to a maximal measurement time T. We use supervised machine learning to learn optimal memory kernels using an appropriate discretization of time, and systematically explore how these memory kernels depend on noise levels.
For efficient learning, we use training datasets consisting of a large number of short trajectories that were evenly distributed over the search domain to ensure unbiased learning, see fig. 1(b). Specifically, we constructed training datasets consisting of short trajectories of duration Tmax = 1 s representing uninterrupted runs with rotational diffusion coefficient Drot. Start points of training trajectories were uniformly distributed in a disk-like search domain with isotropically distributed initial tangent directions. For each training trajectory, we simulated time-discrete realizations of the train of stochastic binding events s(t), see fig. 1(c). Specifically, we represent s(t) as a vector with components , , which are determined as Poissonian random variables with mean and variance , while with , where m is the number of temporal bins (here, m = 100).
Next, we implemented supervised learning by first assigning each realization an m-dimensional input vector u with components , where we normalized by , see fig. 1(c). Second, we assign a class label , where y = 1 if the tangent vector at the end of run is pointing up-gradient, and otherwise. The rational behind this is that it would be favorable for a ML agent to continue its run beyond along its currently favorable direction if the class label is , but it would be more favorable to tumble if . Our goal is now to find out an m-dimensional weight vector w and scalar bias b, such that the predicted class label given by the sign of matches the true label y as often as possible.
We used a training dataset consisting of short training trajectories, with corresponding input vectors and class labels yi for .
To find the optimal weight vector w and bias b, we used LinearSVC to solve the optimization problem [24]
where C acts as an inverse regularization parameter (here C = 10). The learned weight vector w represents a time-discrete representation of a memory kernel with , see fig. 1(d) for a typical example. Memory kernels for additional values of λ and Drot are shown in fig. S1 in the Supplementary Material Supplementarymaterial.pdf (SM).
On a technical note, we expect to vary smoothly with τ. This could be achieved by using very large training datasets, or, more efficiently, by averaging learned for 103 learning sessions each using 104 input vectors (economically constructed from 10 sets of short trajectories, for which 100 different realizations of noisy concentration measurements were simulated). Additional technical details on the learning of memory kernels is provided in the SM, sect. 1.
We tested the accuracy of the trained machine-learning (ML) agent on a different, analogously defined test dataset comprising short trajectories, see fig. S2 in the SM.
Learning from short trajectories is sufficient to build functional run-and-tumble navigation
Although the memory kernel was learned on short trajectory segments only, agents can use this kernel perpetually in time to find a hidden target, see fig. 1(e). Specifically, these agents record local concentrations while performing runs as ABP with rotational diffusion coefficient Drot, and execute a tumbling reorientation event, whenever , where the memory kernel is applied to the most recent past of noisy concentration measurements up to a maximum delay of Tmax = 1 s.
Chemotactic performance
We can characterize the performance of chemotactic agents in terms of the distribution p(t) of first-passage times (FPT) to find a target at the origin, see fig. 2(a). As expected, increasing motility noise increases typical FPTs, and reduces the probability to find the target within the simulation time tsim = 200 s. We imposed absorbing boundary conditions both at the target boundary at radius Rtarget = 10 μm and at the domain boundary Rmax = 500 μm. For comparison, we consider an ideal agent that has perfect knowledge whether it swims up- or down-gradient at any point in time. Remarkably, the chemotactic performance of the ML agent subject to sensing noise (with λ = 105 μM−1 s−1), albeit smaller than that of the ideal agent, is still comparatively high.
Download figure:
Standard imageThe chemotactic index characterizes the ensemble-averaged net motion up-gradient at different radial distances R, see fig. 2(b). A value of 1 would correspond to agents that head straight to the target, whereas unbiased random walks with isotropically distributed swimming direction correspond to . In fig. 2(b), the CI decreases and even becomes negative close to the domain boundary, reflecting the net flux of agents to this absorbing boundary. The CI also decreases close to the target, presumably due to geometric nonlinearities of the radial concentration field, which are not sufficiently represented in the training. Results are comparable for ML agents and ideal agents, reaching maximal values of . We find because run-and-tumble agents cannot head directly to the target, but execute a biased random walk at best. The observed values are typical for E. coli bacteria at optimal conditions [25]. Consistent with the mostly positive CI, we find that the mean residence time tres of agents as a function of the distance from the target is maximal in the vicinity of the target (and drops near the absorbing boundaries right at the target and the domain boundary, respectively), see fig. 2(c).
Binary decision making to tumble or not implies decision errors in the presence of noise: false-negative (FN) decisions to wrongly continue a down-gradient run, and false-positive (FP) decisions to wrongly tumble during an up-gradient run. For the training data, due to its symmetry, FN and FP errors have equal probability. But for the long trajectories of chemotactic agents, the positivity of their CI implies a class imbalance between up-gradient and down-gradient swimming. The result are strikingly different dependencies of FN and FP errors as a function of target distance, see fig. 2(d). The relative frequency of FP errors among all tumbling events is maximal far from the target, because chemoattractant concentrations are low there, implying a strong impact of sensing noise. The relative frequency of FN errors is high both close to the target and close to the domain boundary, where it even exceeds the chance level of 0.5. This can be understood from the fact that close to the outer absorbing boundary, which implies that only few trajectories point up-gradient, i.e., the prevalence of true negative decisions (TN) is low. Similarly, the relative frequency of FN decisions increases again close to the target, because agents spend more time there, see the spatial distribution of residence times in fig. 2(c).
Optimal memory kernels depend on sensing and motility noise, revealing a novel power law for effective measurement time
To assess the impact of sensing and motility noise, we computed memory kernels for different values of the binding rate constant λ and the rotational diffusion coefficient Drot, see fig. 3(a) (as well as fig. S3 in the SM for the corresponding test scores). All kernels display a characteristic shape comprising a lobe of positive values followed by a lobe with negative values, with total integral close to zero, ideally suited to compute a smoothed time derivative [22]. This characteristic shape of the kernel is markedly different from the optimal kernel with approximately linear shape that one would obtain in the limit of zero motility noise .
Download figure:
Standard imageWe define an effective measurement time Teff by the simple condition , where wmin is the minimum of the kernel. Figure 3(b) shows that Teff follows an empirical power law with exponent α:
The exponent α depends weakly on λ and approaches for . We can simulate this limit case of zero sensing noise, corresponding to the limit , directly, by letting . A different definition of Teff, e.g., gave similar results. Likewise, a larger initial radial distance R0 gave virtually the same power law, see fig. S4 in the SM.
The empirical power law reported in eq. (3) formalizes the trade-off choice between precision (requiring long Teff to average out sensing noise), and accuracy (requiring short Teff to reflect the current value of the rapidly changing swimming direction).
Weak motility noise can be beneficial
We quantified chemotactic performance as a function of both sensing and motility noise, see fig. 4. Remarkably, a small amount of motility noise can increase the chemotactic index, presumably because it facilitates course corrections for agents moving almost perpendicular to the gradient. This parallels the observation in fig. 2(a) that for ideal agents typical FPTs are shorter for Drot = 0.1 s−1 compared to the case .
Download figure:
Standard imageDiscussion
We used supervised machine learning, applying support vector machines to a suitable training dataset comprising short trajectories, to determine optimal memory kernels for run-and-tumble chemotaxis in the presence of sensing and motility noise. Chemotactic agents employing these learned kernels for binary decision making in continuous time can find hidden targets releasing chemoattractant molecules efficiently. The chemotactic performance of these machine-learning agents is close to that of an ideal agent without sensing noise. The corresponding positive chemotactic index implies a class imbalance between swimming directions pointing up-gradient or down-gradient, which breaks a symmetry between false-positive and false-negative decisions. By computing memory kernels for sub-ensembles with homogeneous levels of sensing noise, we can dissect the dependence of an effective measurement time Teff of gradient sensing by temporal comparison on sensing and motility noise, which revealed an empirical power law with α in a tight range . In contrast, in a limit of high sensing noise, Strong et al. previously predicted the different power law [21]. Our empirical power law for gradient sensing by temporal comparison is also different from the analytical result previously obtained for tracking a time-varying concentration [18], or estimating a time-varying concentration gradient by spatial comparison [19]. Lastly, we showed that chemotactic performance becomes maximal at a small, but non-zero level of motility noise.
Previous experiments estimated the rotational diffusion coefficient of E. coli bacteria during runs as [26], which matches the predicted value for a Brownian particle of same size [21]. Although, this value is close to the optimal rotational diffusion coefficient that maximizes the time-averaged chemotactic index in our simulations, it seems unlikely that bacteria would optimize Drot by adjusting their size.
Using a diffusion coefficient of chemoattractant D = 103 μm2/s [27], we estimate a maximal binding rate constant λ = 107 μM−1 s for the idealized case that every molecule diffusing to the surface of spherical bacterial cell of radius a = 1 μm becomes absorbed. Previous experiments showed that chemotactic performance is maximal at a concentration gradient c ∼ 0.1 μM/μm [25], which corresponds to the gradient strength right at the target in our simulations. Our choice of radial concentration profile probes concentrations in a range of to , spanning from a gradient strength close to the source that gave maximal chemotactic performance in previous experiments [26], to a concentration just below the presumed sensitivity threshold for bacterial chemotaxis [28].
Experimentally measured chemotactic response kernels to the chemoattractant aspartate have a shape very similar to the optimal memory kernels predicted here [29]; a similar result was previously obtained using a minmax-strategy for an ensemble of different concentration gradients [22].
While we assumed a total randomization of swimming direction after instantaneous tumbling events, random re-orientations are only partial for E. coli and tumbling takes about 0.15 s. Biological cells performing chemotaxis exhibit sensory adaption, i.e., respond to relative changes of concentration [30]. In our case, the symmetry of the training problem implies symmetric memory kernels with total integral approximately zero; thus, decisions are insensitive to any constant offset of the concentration signal, see also [22]. In future work, one could envision more sophisticated navigation strategies, with agents that estimate local signal-to-noise ratios and adapt their decision kernels appropriately [31], with different costs for false-positive and false-negative decision errors.
Our work contributes to a recent interest to employ machine learning to theoretically understand optimal navigation strategies in the presence of noise using various learning algorithms [31–35]. Insights from these studies are already been put to use to improve navigation capabilities of artificial microswimmers [32].
Acknowledgments
We thank Julian Rode and all members of the Biological Algorithms group, as well as Marc Timme for stimulating discussions. ROR was supported by the Ministry of Science and Art of the Federal State of Saxony, Germany through grant 100400118 to Marc Timme and BMF, financed with tax funds on the basis of the budget adopted by the Saxon State Parliament (Forschungsprojektförderung Titelgruppe 70 des Sächsischen Staatsministerium für Wissenschaft und Kunst). BMF is supported by the DFG through FR3429/4-1 (Heisenberg grant), and under Germany's Excellence Strategy - EXC-2068 - 390729961. ROR and BMF acknowledge support through the Center for Advancing Electronics Dresden (cfaed).
Data availability statement: The data that support the findings of this study are openly available at the following URL/DOI: https://doi.org/10.5281/zendo.7540545
Footnotes
- 1
At typical chemoattractant concentrations, we can ignore perturbation of the absorbing agent on the concentration field.
- 2
Such exponential decay is an excellent approximation to the solution of the diffusion-degradation equation in two space dimensions , with point source at the origin in terms of modified Bessel functions.