Modeling Dynamics of Biological Systems with Deep Generative Neural Networks

1 INTRODUCTION . Many biological systems can be considered conceptually as stochastic dynamic processes . Examples include differentiation from stem cells to mature cellular lineages , responses to stimulation or drug perturbations , and responses to external stimulus or signaling . Such processes involve the slow and stochastic change in gene expression programs that alter over time , brain circuitry and neuronal communication where the firing of one set of neurons produces the firings of another set , or cancer progressions in which one subclone of cells out competes other clones . However , such biological systems are complex and in many cases , it is impossible to derive differential equations or analytical models for such processes in order to study them . In this paper , we propose to learn a generative neural network model of biological dynamic systems that we call a Dynamics Modeling Network , or DyMoN . First , DyMoN provides a representational advantage by serving as an embodiment of the dynamics in lieu of a predetermined model , such as stochastic differential equations . This representation is deep and factored , in the sense that the “ logic ” of the dynamic transition is broken down into many increasingly abstract steps , each of which can be visualized or examined . In the cell trajectory context , a neural network can learn complex features that correspond to modules of genes that operate together to create a change in the expression program for the next cellular state . Further , the saliency of these features can be inferred from the Jacobian matrices of the neural network . Secondly , DyMoN provides a generative advantage as it generates new trajectories that have not been seen previously in the system . These can augment data and potentially reveal new paths ( for instance novel differentiation paths in cellular development ) that lead to desired outcomes . Third , it provides a denoising advantage , thanks to the the dimensionality reduction offered in neural networks , which can naturally denoise the high degree of noise in biological data , and in particular in biological trajectories . Fourth , the utilization of a deep network model offers a multitasking advantage : while previous models , such as HMMs , can simulate trajectories , and one may use PCA ( or similar methods ) to visualize trajectory information , most previous methods are not designed or equipped to simultaneously learn multi-scale features ( i.e. , in many levels of abstraction ) , visualize the intrinsic underlying dynamics , and utilize them to generate new trajectories . Finally , the natural parallelizability of neural networks ( e.g. , with GPU-based implementations ) offers computational advantages to deep learning approaches , as they can be used to process large volumes of noisy data as they become available for training . Furthermore , once trained , DyMoN can quickly generate new trajectories faster than most existing methods . We have specifically designed DyMoN to learn a model of dynamics from the types of data available in biological systems : snapshot high dimensional data . By snapshot , we mean that biological data ( for instance single cell RNA-sequencing data ) is often collected only at one or a handful of time-points , thus the dynamics are either inferred from pseudotime ( an axis of time progression based on different states of cell differentiation or other cellular programs ) or from interpolation between discrete time points . Second , these types of trajectories are not a matter of sequence completion as is often done in a recurrent neural network , but rather the desired goal is to predict the near-future state of a cell given its current state . Thus , we propose a neural network framework which learns fixed-memory stochastic dynamics ( e.g. , memoryless or n-th order Markov process ) in an observed system , and train this network by providing a current state ( or n states ) along with a probability distribution of next states . We penalize the network using maximal mean discrepancy ( MMD ) as a probabilistic distance between the desired and generated outputs . Within this framework , we show three variations of architectures that can realize this framework within three vastly different biological systems . We train the DyMoN on three biological systems : dynamic calcium imaging data of neurons from a mouse visual cortex , mass cytometry of developing T cells in the mouse thymus , and single-cell RNA sequencing of human embryonic stem cells developing in an embryoid body . We interrogate the weights of the model as a ” transparent box ” to understand the dynamics of the system learned by the network in order to both verify known gene-gene interactions in T cells and to uncover novel network interactions in neurons . We further show that the DyMoN is able to generate trajectories in biological data originally measured in discrete snapshots , and use this generative capacity to develop novel hypotheses for cellular programming in embryonic stem cell differentiation . 2 DYNAMICS MODELING NETWORK ( DYMON ) . Let X ⊆ Rd be a finite dataset of d-dimensional states , and let T ⊆ X ×X be a ( finite ) collection of transitions between these states . Such transitions can either be observed by sampling a dynamical system , or constructed by geometry-revealing diffusion methods such as diffusion maps ( Coifman & Lafon , 2006 ) , Laplacian eigenmaps ( Belkin & Niyogi , 2002 ) , diffusion geometry methods ( e.g. , Wolf et al. , 2012 ; Wolf & Averbuch , 2013 ; Coifman & Hirn , 2014 ; Talmon & Coifman , 2015 ) , and PHATE ( Moon et al. , 2017 ) . We propose a deep learning approach for learning the dynamics in T and the geometry represented by them as a stochastic velocity vector field of a Markov process . To do this , we use a feed-forward neural network we call Dynamics Modeling Network ( DyMoN ) . DyMoN is formed by a cascade of linear operations and nonlinear activations . These are controlled by optimized network weights , which we collectively denote by θ ∈ Θ , where Θ represents the space of possible weight values determined by the fixed network architecture . To capture the dynamics in T , DyMoN learns a velocity vector ∆θ ( x ) ∈ Rd and uses it to define a transition function T : Rd ×Θ→ Rd that generates a Markov process xt = T ( xt−1 , θ ) = xt−1 + ∆θ ( xt−1 ) t = 1 , 2 , 3 , . . . , given an initial state x0 ∈ X and optimized weights θ ∈ Θ . Further , to introduce stochasticity , we treat the output ∆θ ( xt−1 ) as a random vector whose probability distribution determines the conditional probabilities P ( xt|xt−1 ) of the Markov process . We provide three possible implementations of this framework in Figure 10 . Given a fixed architecture , we now describe how DyMoN is trained using the data points in X . Consider a source state x ∈ X with multiple transitions from it leading to target states Yx = { y : ( x , y ) ∈ T } . Let Px ( y ) = P ( y | x ) , whose support is Yx , be the conditional probability of transitioning from x to y . For ease of notation , we allow repetitions in the set notation of Yx , and assume that data points in Yx are indeed distributed according to Px ( y ) and are sufficient for estimating Px ( y ) . Further , we assume that these transitions are smooth in the sense that if x is similar to x′ then P ( y | x ) is similar to P ( y | x′ ) . Therefore in practice we may replace Yx in the following Figure 1 : ( A ) Schema of DyMoN architecture where x represents the neural network input vector , ŷ represents the predicted network output in ( 1 ) , and is a random Gaussian noise vector . P ( y|x ) represents the distribution of outputs from many iterations of the stochastic dynamical process given x , and P ( ŷ|x ) represents the distribution of outputs of DyMoN given x and many different noise vectors . ( B ) Example input states . ( C ) Learned transition vectors ( arrows ) and output states from DyMoN . training procedure with ∪x′≈xYx′ , which includes target points from neighbors of x to increase the robustness of DyMoN . The stochastic output of DyMoN is enabled by a random input vector ε ∈ Rn sampled from a simple ( e.g. , normal or uniform ) distribution F with zero mean and unit variance . This input can be explicitly written into DyMoN function as Tε ( x , θ ) = x+ fθ ( x , ε ) , ( 1 ) where fθ : Rd ×Rn → Rd represents suitable feed forward layers for combining the training input x with the random input ε to provide an instantiation of the transition velocity vector ∆θ ( x ) . Given x ∈ X and θ ∈ Θ , one can consider the distribution P̂ ( θ ) x of the random variable Tε ( x , θ ) , ε ∼ F and estimate it by m i.i.d . instantiations = { εj ∼ F } mj=1 passed through the network to form Ŷ ( ) ( x , θ ) = { Tε1 ( x , θ ) , . . . , Tεm ( x , θ ) } . To conform with the training data , DyMoN is optimized so that this distribution approximates the distribution Px , as captured from the training data by Yx . This optimization is given by arg minθ E [ { Hx ( θ ) : x ∈ X ] with Hx ( θ ) = MMD ( P̂ ( θ ) x , Px ) ( see supplemental material for details on MMD ) . The MMD is computed using Ŷ ( ) ( x , θ ) and Yx . Given trained weights θ ∈ Θ and an initial state x0 ∈ X , a random walk is generated by xt = Tεt ( xt−1 , θ ) , where t = 1 , 2 , . . . , and ε1 , ε2 , . . . i.i.d.∼ F . We note that DyMoN can be used to learn deterministic time series by considering Dirac conditional probabilities in the Markov process , essentially ignoring the random input . Additionally , DyMoN can be extended to encode high-order Markov processes , which have fixed-size memory rather than being memoryless . To this end , an n-th order DyMoN takes n input states and have the distribution of ∆θ ( xt−1 , xt−2 , . . . , xt−n ) determine the conditional probability P ( xt|xt−1 , xt−2 , . . . , xt−n ) of an n-th order Markov process . The training and application of both a deterministic and a high-order DyMoN extend naturally from the stochastic memoryless ( i.e. , first-order ) DyMoN . 3 BIOLOGICAL CASE STUDIES . 3.1 BIOLOGICAL CASE STUDY 1 : CALCIUM IMAGING OF VISUAL CORTEX NEURONS . We apply DyMoN to dynamic calcium imaging data from 33 Somatostatin-expressing GABAergic ( SOM ) interneurons from a mouse visual cortex ( Urban-Ciecko & Barth , 2016 ) . SOM interneurons are a unique set of GABAergic cells and represent about 25 % of all cortical interneurons . and are characterized by high basal firing activity . They are also thought to be connected in dense networks , though the architecture of these networks is not well-known . The data consists of a total of 129,500 frames at 30Hz , lasting 72 minutes , each containing a recording of the change of fluorescence ( dF/F ) indicating calcium activity over time . We train DyMoN to predict the the next state ( which we define as 10 frames later ) given the current state of the 33 neurons . Surprisingly , though SOM cells are not connected to each other by chemical or electrical synapses and do not receive strong feedforward input , we see co-activation relationships in the data . We see in Figure 2A that neurons 9 and 18 are strongly affected by two large clusters of neurons in opposite directions . There is a group of nine neurons which activate 9 and 18 , with neuron 19 being the strongest activator . A second group of 9 neurons which inhibit neurons 9 and 18 , with neuron 4 being the strongest inhibitor . We speculate that these interactions are the result of either 1. co-activation by lateral excitatory inputs from superficial pyramidal neurons , 2. co-modulation by neuromodulators , or 3. top-down feedback input regulating the activity of a specific subset of SOM cells ( Yavorska & Wehr , 2016 ) . A subset of the SOM cells appear to function as hubs in an excitatory pattern ( see Figure 2B ) . Early in postnatal development , a subset of inhibitory neurons function as hub neurons and regulate the activity of surrounding neurons . Hub neurons have mainly been characterized in the hippocampus and entorhinal cortex , and a hub role for sensory cortical interneurons would be highly novel ( Bonifazi et al. , 2009 ) . Our future work involves examining whether these results hold in additional mouse samples .

Summary: > Even though the paper details the underlying Markovian setup in Section 2, it is unclear to the reader how this knits with the FFNN architecture, for example what are the Markovian functions at hidden layer and output layer. Are they all conditional probabilities? How do you prove that this is what occurs within each node?