Deciphering anomalous heterogeneous intracellular transport with neural networks

Intracellular transport is predominantly heterogeneous in both time and space, exhibiting varying non-Brownian behavior. Characterization of this movement through averaging methods over an ensemble of trajectories or over the course of a single trajectory often fails to capture this heterogeneity. Here, we developed a deep learning feedforward neural network trained on fractional Brownian motion, providing a novel, accurate and efficient method for resolving heterogeneous behavior of intracellular transport in space and time. The neural network requires significantly fewer data points compared to established methods. This enables robust estimation of Hurst exponents for very short time series data, making possible direct, dynamic segmentation and analysis of experimental tracks of rapidly moving cellular structures such as endosomes and lysosomes. By using this analysis, fractional Brownian motion with a stochastic Hurst exponent was used to interpret, for the first time, anomalous intracellular dynamics, revealing unexpected differences in behavior between closely related endocytic organelles.


Introduction
The majority of transport inside cells on the mesoscale (nm-100mm) is now known to exhibit non-Brownian anomalous behavior (Metzler and Klafter, 2004;Barkai et al., 2012;Waigh, 2014). This has wide ranging implications for most of the biochemical reactions inside cells and thus cellular physiology. It is vitally important to be able to quantitatively characterize the dynamics of organelles and cellular responses to different biological conditions (van Bergeijk et al., 2015;Patwardhan et al., 2017;Moutaux et al., 2018). Classification of different non-Brownian dynamic behaviors at various time scales has been crucial to the analysis of intracellular dynamics (Fedotov et al., 2018;Bressloff and Newby, 2013), protein crowding in the cell (Banks and Fradin, 2005;Weiss et al., 2004), microrheology (Waigh, 2005;Waigh, 2016), entangled actin networks (Amblard et al., 1996), and the movement of lysosomes (Ba et al., 2018) and endosomes (Flores-Rodriguez et al., 2011). Anomalous transport is currently analyzed by statistical averaging methods and this has been a barrier to understanding the nature of its heterogeneity.
Spatiotemporal analysis of intracellular dynamics is often performed by acquiring and tracking microscopy movies of fluorescing membrane-bound organelles in a cell (Rogers et al., 2007;Flores-Rodriguez et al., 2011;Chenouard et al., 2014;Zajac et al., 2013). These tracks are then commonly interpreted using statistical tools such as the mean square displacement (MSD) averaged over the ensemble of tracks, hDr 2 ðtÞi. The MSD is a measure that is widely used in physics, chemistry and biology. In particular, MSDs serve to distinguish between anomalous and normal diffusion at different temporal scales by determining the anomalous exponent a through hDr 2 ðtÞi~t a (Metzler and Klafter, 2000). Diffusion is defined as a ¼ 1, sub-diffusion 0<a<1 and super-diffusion 1<a<2 (Klafter and Sokolov, 2011). To improve the statistics of MSDs, they are often averaged over different temporal scales, forming the time-averaged MSD (TAMSD), " Dr 2 ðt Þ~t a , where t is the lag time (Sokolov, 2012).
For stochastic processes with long-range time dependence such as fractional Brownian motion (fBm), other statistical averaging methods exist. For fBm, the MSD is hB 2 H ðtÞi~t 2H with the Hurst exponent, H varying between 0 and 1. One can use rescaled and sequential range analysis (Samorodnitsky, 2016;Peters, 1994) to estimate H. The advantage of modeling intracellular transport with fBm is that both sub-diffusion (0<H<1=2) and super-diffusion (1=2<H<1) can be explained in a unified manner using only the Hurst exponent. The essence of fBm is that long-range correlations result in random trajectories that are anti-persistent (0<H<1=2) or persistent (1=2<H<1). How can we understand persistence in the context of intracellular transport? The term persistence can be understood as the processive motor-protein transport of cargo in one direction, whether it be retrograde or anterograde. From a probabilistic viewpoint, persistence can be interpreted as the cargo being more likely to keep the same direction given it had been moving in this fashion before. Conversely, anti-persistence is interpreted as cargo being more likely to change its direction given it had been moving in that direction before. Anti-persistence can arise if cargo is confined to a local volume in the cytoplasm simply due to crowding or tethering biochemical interactions (Harrison et al., 2013), which in effect leads to sub-diffusion (Weiss et al., 2004;Ernst et al., 2012). By interpreting intracellular cargo transport as fBm, there are two main advantages: we can describe movement with the intuitive biological concepts of persistence and anti-persistence; and we can provide an immediate link to anomalous diffusion since a = 2H for constant H.
Cargo movement in vivo often exhibits random switching between persistent and anti-persistent movement, even in a single trajectory (Chen et al., 2015). Therefore, we can model this by a stochastic local Hurst exponent, HðtÞ, which jumps between persistent (1=2<HðtÞ<1) and anti-persistent (0<HðtÞ<1=2) states. Still, a major challenge exists: how can we estimate a local stochastic Hurst exponent from a trajectory?
Whilst exponent estimation using neural networks is an emerging field (Bondarenko et al., 2016), segmentation of single trajectories into persistent and anti-persistent sections based on instantaneous dynamic behavior has not been studied. Instead, hidden Markov models (Monnier et al., 2015;Persson et al., 2013) and windowed analyses (Getz and Saltz, 2008) are commonly used to segment local behavior along single trajectories (see Appendix A for comparisons). Even so, most methods neglect the microscopic processes which are often a feature of intracellular transport (e.g. alternation between 'runs' and 'rests') (Weiss et al., 2004;Chen et al., 2015;Fedotov et al., 2018) and the non-Markovian nature of their motion (Fuliński, 2017). fBm was chosen due to its self-similar properties that allow direct analysis at short time scales given by experimental systems; and the experimental evidence for fBm in the crowded cytoplasm (Weiss et al., 2004;Szymanski and Weiss, 2009;Krapf et al., 2019). Moreover, other anomalous diffusion models, such as scaled Brownian motion (Lim and Muniandy, 2002), subdiffusive continuous time random walks (Sokolov, 2012) and superdiffusive Lé vy walks (Fedotov et al., 2018) are not suitable to interpret anomalous trajectories on the microscopic level.
Here, we present a new method for characterizing anomalous transport inside cells based on a Deep Learning Feedforward Neural Network (DLFNN) that is trained on fBm. Neural networks are becoming a general tool in a wide range of fields, such as single-cell transcriptomics (Deng et al., 2019) and protein folding (Evans et al., 2018). We find the neural network is a much more sensitive method to characterise fBm than previous statistical tools, since it is an intrinsically non-linear regression method that accounts for correlated time series. In addition, it can estimate the Hurst exponent using as few as seven consecutive time points with good accuracy.
To test the ability of the DLFNN to segment real-world biological motility, we focused on organelles in the endocytic pathway. This pathway is essential for cell homeostasis, allowing nutrient uptake, the turnover of plasma membrane components, and uptake of growth factor receptors bound to their ligands. Early endosomes then sort components destined for degradation from material that needs to be recycled back to the cell surface or to the Trans-Golgi Network (TGN) Figure 1. Tests of exponent estimation for the DLFNN using N = 10 4 simulated fBm trajectories. (a) Plots showing the Hurst exponent estimates of fBm trajectories with n ¼ 10 2 data points by a triangular DLFNN with three hidden layers compared with conventional methods. Plots are vertically grouped by Hurst exponent estimation method: (left to right) rescaled range, MSD, sequential range and DLFNN. s H values are shown in the title. Top row: Scatter plots of estimated Hurst exponents H est and the true value of Hurst exponents from simulation H sim . The red line shows perfect estimation. Second row: Due to the density of points, a Gaussian kernel density estimation was made of the plots in the top row (see Materials and methods). Third row: Scatter plots of the difference between the true value of Hurst exponents from simulation and estimated Hurst exponent DH ¼ H sim À H est . Last row: Gaussian kernel density estimation of the plots in the third row. (b) s H as a function of the number of consecutive fBm trajectory data points n for different methods of exponent estimation. Example structures for two hidden layers and n ¼ 5 time series input points of the anti-triangular, rectangular and triangular DLFNN are shown in (c, d and e), respectively. (f) s H as a function of the number of hidden layers in the DLFNN for triangular, rectangular and anti-triangular structures. (g) s H as a function of the number of randomly sampled fBm trajectory data points n rand with different number of hidden layers in the DLFNN shown in the legend. (h) s H as a function of the noise-to-signal ratio ( Noise Signal ) (NSR) from Gaussian random numbers added to all n ¼ 10 2 data points in simulated fBm trajectories. (i) Plots of bias bðH sim Þ, variance VarðH sim Þ and mean square error (MSE) as functions of H sim . For each value of H sim , fBm trajectories with n ¼ 100 points were simulated and estimated by a triangular DLFNN. (Naslavsky and Caplan, 2018). Many aspects of endosome function are regulated by Rab5, a small GTPase that is localized to the cytosolic face of early endosomes (Stenmark and Olkkonen, 2001). Sorting nexin 1 (SNX1) also localises to early endosomes, where it works with the retromer complex to retrieve and recycle cargoes from early endosomes to the TGN (Simonetti and Cullen, 2019). SNX1 achieves this through regulating tubular membrane elements on early endosomes by associating with regions of high membrane curvature (Carlton et al., 2004). Early endosomes mature into late endosomes, which then fuse with lysosomes, delivering their contents for degradation (Huotari and Helenius, 2011). Endocytic pathway components are highly dynamic, with microtubule motors driving long-distance movement while short-range dynamics involve actin-based motility (Granger et al., 2014;Cabukusta and Neefjes, 2018), making them ideal test cases for DLFNN analysis. The new method enables the interpretation of experimental trajectories of lysosomes and endosomes as fBm with stochastic local Hurst exponent, H (t). This in turn allows us to unambiguously and directly classify endosomes and lysosomes to be in anti-persistent or persistent states of motion at different times. From experiments, we observe that the time spent within these two states both exhibit truncated heavy-tailed distributions.
To our knowledge, this is the first method which is capable of resolving heterogeneous behavior of anomalous transport in both time and space. We anticipate that this method will be useful in characterizing a wide range of systems that exhibit anomalous heterogeneous transport. We have therefore created a GUI computer application in which the DLFNN is implemented, so that the wider community can conveniently access this analysis method.

Results and discussion
The DLFNN is more accurate than established methods We tested a DLFNN trained on fBm with three hidden layers of densely connected nodes on N = 10 4 computer-generated fBm trajectories each with n = 10 2 evenly spaced time points and constant Hurst exponent H sim , randomly chosen between 0 and 1. The DLFNN estimated the Hurst exponents H est based on the trajectories, and these were compared with those estimated from TAMSD, rescaled range, and sequential range methods (Figure 1a). The difference between the simulated and estimated values DH ¼ H sim À H est was much smaller for the DLFNN than for the other methods (Figure 1a), and the DLFNN was~3 times more accurate at estimating Hurst exponents with a mean absolute error (s H )~0:05. Also, the errors in estimation of the DLFNN are more stable across values of H sim .
Tracking of intracellular motion usually generates trajectories with a variable number of data points. We therefore compared the performance of the different exponent estimation methods when the number of evenly spaced, consecutive fBm time points in a trajectory varied over n ¼ 5; 6; :::; 10 2 points. The DLFNN maintained an accuracy of s H~0 :05 across n, whereas s H of other methods increase as n decreases (Figure 1b), and was always substantially worse than that of the DLFNN estimation. Different DLFNN structures (see Figure 1c,d and e) performed similarly, and introducing more hidden layers did not affect the accuracy of estimation (Figure 1f and g). Given that the structure of DLFNN does not significantly affect the accuracy of exponent estimation, a triangular densely connected DLFNN was used for all subsequent analyses.
The structure of a triangular DLFNN means that the input layer consists of n nodes, which are densely connected to n À 1 nodes in the first hidden layer, such that at the l th hidden layer, there would be n À l densely connected nodes. Then to estimate the Hurst exponent these nodes are connected to a single node using a Rectified Linear Unit (ReLU) activation function, which returns the exponent estimate. A triangular DLFNN therefore uses only P L l¼0 ðn À lÞ þ 1 nodes for L hidden layers and n input points, whereas the rectangular structure uses nL þ 1 nodes and the anti-triangular structure uses P L l¼0 ðn þ lÞ þ 1. The triangular structure results in a significant decrease in training parameters, and hence computational requirements, while maintaining good levels of accuracy. This demonstrates that a computationally inexpensive neural network can accurately estimate exponents.
The DLFNN's estimation capabilities were tested further by inputting n rand randomly sampled time points from the original fBm trajectories. Surprisingly, s H~0 :05 is regained even with just 40 out of 100 data points randomly sampled from the time series for any triangular DLFNN with more than one hidden layer ( Figure 1g). For this method to work with experimental systems, it must estimate Hurst exponents even when the trajectories are noisy. Figure 1h shows how the exponent estimation error increases when Gaussian noise with varying strength compared to the original signal is added to the fBm trajectories. Importantly, the DLFNN accuracy s H at 20% NSR is as good as the accuracy of other methods with no noise (compare 1a and h).
To characterize the accuracy of H sim estimation by the DLFNN, we calculated the bias, ; and mean square error, Figure 1i). To quantify the efficiency of the estimator the Fisher information of the neural network's estimation needs to be found and the Cramer-Rao lower bound calculated. The values of bias, variance and MSE were very low (Figure 1i), which taken together with the simplicity of calculation and the accuracy of estimation even with small number of data points, demonstrates the strength of the DLFNN method. Furthermore, once trained, the model can be saved and reloaded at any time. Saved DLFNN models, code and the DLFNN Exponent Estimator GUI are available to download (see Software and Code).

DLFNN allows analysis of simulated trajectories with local stochastic Hurst exponents
Estimating local Hurst exponents is fundamentally important because much research has focused on inferring active and passive states of transport within living cells using position-derived quantities such as windowed MSDs, directionality and velocity (Arcizet et al., 2008;Monnier et al., 2015). The trajectories are then segmented and Hurst exponents measured in an effort to characterize the behavior of different cargo when they are actively transported by motor proteins (Chen et al., 2015;Fedotov et al., 2018) or sub-diffusing in the cytoplasm (Jeon et al., 2011). However, conventional methods such as the MSD and TAMSD need trajectories with many time points (n~10 2 À 10 3 ) to calculate a single Hurst exponent value with high fidelity. In contrast, the DLFNN enables the Hurst exponent to be estimated, directly from positional data, for a small number of points. Furthermore, the DLFNN measures local Hurst exponents without averaging over time points and is able to characterize particle trajectories that may exhibit multi-fractional, heterogeneous dynamics.
To provide a synthetic data set that mimics particle motion in cells, we simulated fBm trajectories with Hurst exponents that varied in time, and applied a symmetric moving window to estimate the Hurst exponent using a small number of data points before and after each time point (Figure 2). The DLFNN was able to identify segments with different exponents, and provided a good running estimation of the Hurst exponent values. The DLFNN could also handle trajectories with different diffusion coefficients, and generally performed better than MSD analysis when a sliding window was used (see Appendix B).

DLFNN analysis reveals differences in motile behavior of organelles in the endocytic pathway
Early endosomes labeled with green fluorescent protein (GFP)-Rab5 undergo bursts of rapid cytoplasmic dynein-driven motility interspersed with periods of rest (Flores-Rodriguez et al., 2011;Zajac et al., 2013). We therefore applied the DLFNN method to experimental trajectories obtained from automated tracking (Newby et al., 2018) data of GFP-Rab5-labeled endosomes in an MRC-5 cell line that stably expressed GFP-Rab5 at low levels ( Figure 3). A moving window of 15 points identified persistent (green) and anti-persistent (magenta) segments, which corresponded well to  the moving window velocity plots ( Figure 3, lower panel), confirming that the neural network is indeed distinguishing passive states from active transport states with non-zero average velocity. We then used it to analyze the motility of two other endocytic compartments: SNX1-positive endosomes (Allison et al., 2017;Hunt et al., 2013) and lysosomes (Cabukusta and Neefjes, 2018;Hendricks et al., 2010). It successfully segmented tracks of GFP-SNX1 endosomes (Figure 3-figure supplement 1) in a stable MRC-5 cell line (Allison et al., 2017) and lysosomes visualized using lysobrite dye (Figure 3-figure supplement 2). A total of 63-71 MRC-5 cells were analyzed, giving 40,800 (GFP-Rab5 endosome), 11,273 (GFP-SNX1 endosome) and 38,039 (lysosome) tracks that were segmented into 277,926 (GFP-Rab5), 215,087 (GFP-SNX1) and 474,473 (lysosome) persistent or anti-persistent sections, each yielding a displacement, duration and average H.
These data revealed intriguing similarities and differences in behavior between the three endocytic components. Analysis of the duration and displacement of segments (Appendix C) revealed that all organelles spent longer in anti-persistent than persistent states (Figure 4) but moved much further when persistent (Appendix 3-figure 1), as expected. However, GFP-SNX1 endosomes spent much less time than GFP-Rab5 endosomes or lysosomes in an anti-persistent state (Figure 4). This difference in behavior was also seen when histograms of the Hurst exponents were plotted (Figure 5), as SNX1 endosomes were much less likely to exhibit anti-persistent behavior, particularly with H<0:3, than Rab5 endosomes or lysosomes. This was confirmed by fitting the histograms of the Hurst exponent with a six component Gaussian mixture model (Figure 5b-d; Appendix D). In contrast, all three organelle classes exhibited a similar range of Hurst exponents when they underwent directionally persistent motion.
To understand organelle motility in the context of cell behavior, an additional layer of complexity needs to be considered -the location of the moving structure within the cell itself. Such information would reveal zones that favor anti-persistent or persistent movement (Bálint et al., 2013). Using the neural network, trajectories of GFP-Rab5, GFP-SNX1 endosomes and lysosomes from MRC-5 cells were plotted with colors depicting the changing Hurst exponent at different points in each trajectory ( Figure 6). For Rab5-and SNX1-positive endosomes, anti-persistent organelles were enriched in the cell periphery, but occasionally underwent long-range persistent movement towards the nucleus ( Figure 6-video 1; Figure 6-video 2), as expected (Flores-Rodriguez et al., 2011;Zajac et al., 2013;Hunt et al., 2013;Allison et al., 2017). Lysosomes displayed completely different behavior, with most trajectories being anti-persistent, while the persistent trajectories were not obviously organized spatially ( Figure 6; Figure 6-video 3). The location information together with classification of anti-persistent and persistent trajectories qualitatively shows the regions of high motor-driven activity within the cell for different endocytic organelles.
Many cargos that move along microtubules can switch their direction of motility, between dyneindriven inward (retrograde) motion toward the microtubule minus ends at the cell centre and plusend-directed outward (anterograde) movement driven by kinesin family members (Hancock, 2014). To investigate the characteristics of anterograde and retrograde motility of endocytic organelles, we adapted our method to subdivide persistent segments according to whether the movement occurred towards or away from the user-defined centrosomal region (see Materials and methods). Only tracks with displacement of >0.5mm from their start point were selected, which yielded 2369 Rab5, 2099 SNX1 and 7645 lysosome persistent segments that were then analyzed to give the duration, displacement and velocity of anterograde and retrograde excursions ( Figure 7; Table 1). The anti-persistent segments contained within these tracks were also analyzed.
These statistics revealed that each endocytic organelle moved with different characteristics. GFP-Rab5 endosomes moved much faster than GFP-SNX1 endosomes or lysosomes, particularly in the retrograde direction (Figure 7, upper panel). Strikingly, although the GFP-SNX1 endosomes were slowest in both directions, they moved furthest and for longest in each segment, in keeping with the longer duration of persistent segments seen in the global analysis of tracks ( Figure 4) and higher H values ( Figure 5). The differences in behavior between Rab5 and SNX1 endosomes is intriguing, since both are recruited to the early endosome by the lipid phosphoinositol-3-phosphate (Christoforidis et al., 1999;Carlton et al., 2004;Behnia and Munro, 2005;Huotari and Helenius, 2011). However, SNX1 also senses membrane curvature (Carlton et al., 2004), and immunofluorescence labeling of MRC-5 cells with antibodies to Rab5 and SNX1 demonstrated that they reside on distinct domains of larger early endosomes ( Figure 6-  was a significant population of Rab5 endosomes that lacked SNX1, especially smaller early endosomes that were often located in the cell periphery. It is likely that this population of Rab5-positive, SNX1-negative endosomes is particularly motile. The high retrograde velocity of these endosomes might be explained by the recruitment of dynein to Rab5 endosomes via Hook family members (Bielska et al., 2014;Zhang et al., 2014;Schroeder and Vale, 2016;Guo et al., 2016). These dynein adaptors have the intriguing property of recruiting two dyneins per dynactin (Urnavicius et al., 2018;Grotjahn et al., 2018), leading to faster rates of movement in motility assays using purified protein than adaptors that only recruit one dynein per dynactin. Perhaps, SNX1 endosomes move more slowly than Rab5 endosomes because they use a 'single-dynein' adaptor. An alternative explanation could be that SNX1 endosomes are slowed down by interactions with the actin cytoskeleton, since SNX1 domains are enriched in the WASH complex, which in turn controls localized actin assembly (Gomez and Billadeau, 2009;Simonetti and Cullen, 2019). Actin might also contribute to the slow, steady motion of SNX1 endosomes via myosin motors or the formation of actin comets (Simonetti and Cullen, 2019). These interesting possibilities remain to be tested experimentally.
The analysis of anterograde and retrograde segments revealed that lysosomes moved at moderate speed, and were equally fast in both directions, but each burst of movement was short (Figure 7, upper panels). In addition, pauses were ! 4 times longer for lysosomes than either early endosome type (Figure 7, lower panels). Lysosomes also often changed direction of movement (e.g. Figure 3figure supplement 2), as previously reported (Hendricks et al., 2010). So far, no activating dynein adaptor has been identified on lysosomes (Reck-Peterson et al., 2018), although several potential  dynein interactors have been identified, such as RILP (Rab7 interacting lysosomal protein (Cabukusta and Neefjes, 2018). Whether this underlies the difference in motile behavior between lysosomes and early endosomes remains to be tested: however, a less active dynein could well contribute to frequent reversals in direction (Hancock, 2014).
fBm with a stochastic Hurst exponent is a new possible intracellular transport model fBm is a Gaussian process B H ðtÞ with zero mean and covariance hB H ðtÞB H ðsÞi~t 2H þ s 2H À ðt À sÞ 2H , where the Hurst exponent, H is a constant between 0 and 1. With the DLFNN providing local estimates of the Hurst exponent, the motion of endosomes and lysosomes can be described as fBm with a stochastic Hurst exponent, HðtÞ. This is different to multifractional Brownian motion (Peltier and Lévy Véhel, 1995) where HðtÞ is a function of time. In our case, HðtÞ is itself a stochastic process and such a process has been considered theoretically (Ayache and Taqqu, 2005). This is the first application of such a theory to intracellular transport and opens a new method for characterizing vesicular movement. Furthermore, Figure 3 shows that the motion of a vesicle, B H ðtÞ, exhibits regime switching behavior between persistent and anti-persistent states. We found that the times that lysosomes and endosomes spend in a persistent and anti-persistent state are heavy-tailed (Figure 4). These times are characterized by the probability densities ðtÞ~t ÀÀ1 , where anti-persistent states have 0 < m < 1 and persistent states have 1 < m < 2. Extensive plots and fittings are shown in Figure 4 and Appendix C. In fact, the residence time probability density has an infinite mean to remain in an anti-persistent state (0<HðtÞ<1=2) but in persistent states (1=2<HðtÞ<1) the mean of the residence time probability density is finite and the second moment is infinite. This implies that the vesicles may have a biological mechanism to prioritize certain interactions within the complex cytoplasm, similar to ecological searching patterns (Reynolds and Rhodes, 2009), mRNPs (Song et al., 2018), swarming bacteria (Ariel et al., 2015) and how human dynamics are often heavy tailed and bursty (Barabási, 2005).

Conclusions
We developed a Deep Learning Feedforward Neural Network trained on fBm that estimates accurately the Hurst exponent for heterogeneous trajectories. Estimating the Hurst exponent using a DLFNN is not only more accurate than conventional methods but also enables direct trajectory  segmentation without a drastic increase in computational cost. We package this DLFNN analysis code into a user-friendly application, which can predict the Hurst exponent with consistent accuracy for as few as seven consecutive data points. This is useful to biologists since major limitations to trajectory analysis are: the brevity of tracks due to the fact that particles may rapidly switch between motile states or move out of the plane of focus; the rapid nature of some biochemical reactions; and the bleaching of fluorescent probes (with non-bleaching probes often being bulky or cytotoxic). This method can be used to detect persistent and anti-persistent states of motion purely from the positional data of trajectories and removes the prerequisite of time or ensemble averaging for effective heterogeneous transport characterization.
The DLFNN enabled us to discover regime switching in lysosome and endosome movement that can be modeled by fBm with a stochastic Hurst exponent. This interpretation is a unified approach to describe motion with anti-persistence and persistence varying over time. Furthermore, the residence time of vesicles in a persistent or anti-persistent state is found to be heavy tailed, which implies that endosomes and lysosomes possess biological mechanisms to prioritize varying biological processes similar to ecological searching patterns (Reynolds and Rhodes, 2009), mRNPs (Song et al., 2018), swarming bacteria (Ariel et al., 2015) and even human dynamics ( Barabási, 2005). Importantly, applying this method to identify and analyze the anterograde and retrograde motility reveals unexpected differences in behavior between closely-related organelles. Finally, in addition to providing a new segmentation method of active and passive transport, this new technique distinguishes the difference in motility between lysosomes, Rab5-positive endosomes and SNX1 positive endosomes. The results suggest that the manner in which these vesicles move is dependent on their identity within the endocytic pathway, especially when the motion is anti-persistent. This implies that directionality and the correlation between consecutive steps is important to measure in addition to the displacement, velocity and duration of movement. There is considerable scope for using these methods to identify changes in motility of different organelles caused by disease. We hope that this type of analysis will allow discoveries in particle motility of a more refined nature and make applying anomalous transport theory more accessible to researchers in a wide variety of disciplines.

Hurst exponent estimation methods
Time averaged MSDs were calculated using where xðndtÞ is the track displacement at time ndt and a track contains N coordinates spaced at regular time intervals of dt. From now on, hxi will denote the time average of x unless explicitly specified otherwise. The total time is T ¼ ðN À 1Þdt and n ¼ 1; 2; :::; N À 1. Lag-times are the set of possible ndt within the data set and hx 2 ðndtÞi was then fit to a power-law~t 2H using the 'scipy.optimize' package in Python3 to estimate the exponent H. Rescaled ranges were calculated by creating a mean adjusted cumulative deviate series zðndtÞ ¼ P n m¼0 xðmdtÞ À hxi from original displacements xðndtÞ and mean displacement hxi. Then the rescaled range is calculated by where z f g n ¼ zð0Þ; zðdtÞ; zð2dtÞ; :::; zðndtÞ. The rescaled range is then fitted to a power law R=S ½ ðndtÞ~ðndtÞ H where H is the Hurst (1951). The 'compute_Hc' function in the 'hurst' package in Python3 estimates the Hurst exponent in this way.
Sequential ranges are defined as where supðxÞ is the supremum and infðxÞ is the infimum for the set x of real numbers. Then Feller (1951). The persistent and anti-persistent segments in this table are: from trajectories that travelled over 0.5 mm at any point from their initial starting positions; contained more points than the window size; and switched behavior more than twice in the trajectory. Note that these conditions are much stricter than those to generate Figures 4 and 5. Each persistent segment was then further subdivided into retrograde and anterograde segments (see Materials and methods).

DLFNN structure and training
The fractional Brownian trajectories were generated using the Hosking method within the 'FBM' function available from the 'fbm' package in Python3. The DLFNN was built using Tensorflow Abadi et al. (2016) and Keras Chollet (2015) in Python3 and trained by using the simulated fractional Brownian trajectories. The training and testing of the neural network were performed on a workstation PC equipped with 2 CPUs with 32 cores (Intel(R) Xeon CPU E5-2640 v3) and 1 GPU (NVI-DIA Tesla V100 with 16 GB memory). The structure of the neural network was a multilayer, feedforward neural network where all nodes of the previous layer were densely connected to nodes of the next layer. Each node had a ReLU activation function and the parameters were optimized using the RMSprop optimizer (see Keras documentation Chollet, 2015). Three separate structures were explored and examples of these structures for two hidden layers and five time point inputs are shown in Figure 1g,h and i. The triangular structure was predominantly used since this was the least computationally expensive and accuracy between different structures were similar. To compare the accuracy of different methods, the mean absolute error (s H ) of N trajectories, Before inputting values into the neural network, the time series was differenced to make it stationary. The input values of a fBm trajectory x f g ¼ x 0 ; x 1 ; :::; x n were differenced and normalized so that x input È É ¼ ðx 1 À x 0 Þ=rangeðxÞ; ðx 2 À x 1 Þ=rangeðxÞ; :::; ðx n À x nÀ1 Þ=rangeðxÞ. Since the model requires differenced and normalized input values, in theory it should be applicable to a wide range of datasets. However, further testing must be done in order to confirm this expectation.

Gaussian kernel density estimation
Kernel density estimation (KDE) is a non-parametric method to estimate the probability density function (PDF) of random variables. If N random variables x n are distributed by an unknown density function PðxÞ, then the kernel density estimate PðxÞ iŝ where KðÁÞ is the kernel function and l is the bandwidth. In this paper, we have used a Gaussian KDE, KðyÞ ¼ 1 ffiffiffiffi 2p p e Ày 2 =2 , to estimate the two dimensional PDFs of the second and bottom row in Figure 1a. This was performed in Python3 using 'scipy.stats.gaussian_kde' and Scott's rule of thumb for bandwidth selection.

Segmenting trajectories into persistent and anti-persistent segments
From the estimates of Hurst exponent from the DLFNN, trajectories were segmented into persistent and anti-persistent segments. Given an experimental trajectory x ¼ x 0 ; x 1 ; :::; x n and window of length N w (an odd number) starting at x i , we obtain the H estimate for the position at x j , where j ¼ i þ ðN w À 1Þ=2. This will give us a series of H t values, H ðNwÀ1Þ=2 ; H ðNwÀ1Þ=2þ1 ; :::; H nÀðNwÀ1Þ=2 , which correspond to the positions, x ðNwÀ1Þ=2 ; x ðNwÀ1Þ=2þ1 ; :::; x nÀðNwÀ1Þ=2 . Then, the values H t can be segmented into consecutive points of persistence H t >0:55 and anti-persistence H t <0:45. The bounding values, 0.55 and 0.45, were used since the mean error of the DLFNN estimation method was s H~0 :05. Any segment less than the length of N w was discarded as a precaution against spurious detection.

Directional segmentation of persistent segments
Once segments of persistence and anti-persistence were defined, we measured the displacement, time and velocity of these segments, shown in the bottom row of Figure 7 and Table 1. The persistent segments were filtered to be only from trajectories that travelled over 0.5 mm; contained more points than the window size; and switched behaviour more than twice in the trajectory. In addition, we assessed if persistent segments were anterograde or retrograde in direction. In order to do this, the centrosomal region was defined by the user as the point where the lysosomes, Rab5 and SNX1 organelles were the largest, brightest, or the most clustered. Image contrast enhancements, such as histogram equalization, were used to locate the centrosomes. By locating the centrosomal region and the cell boundary from user input, the persistent segments can then be classified as anterograde or retrograde. This was done by finding the cosine of the angles, cosðÞ, between the vector,r 0;i , from the centrosome to the current particle position x i and the vector,r i;iþ1 , from the current particle position to the next particle position x iþ1 . The exact formula is cosðÞ ¼r 0;i Ár i;iþ1 =jr 0;i jjr i;iþ1 j. Using windows in a similar fashion as determining persistent and anti-persistent segments, cosð i Þ corresponding to position x i was found for the points within a persistent segment. If cosð i Þ>s cosðÞ , then the motion was deemed to be anterograde and if cosð i Þ< À s cosðÞ , retrograde. Sweeping through the points of x i , consecutive retrograde or anterograde points formed segments from the persistent segments. A threshold of s cosðÞ ¼ 0:3 was used.

Cell lines
The MRC-5 SV1 TG1 Lung fibroblast cell line was purchased from ECACC. MRC-5 cell lines stably expressing GFP-Rab5C and GFP-SNX1 were kindly provided by Drs. Guy Pearson and Evan Reid (Cambridge Institute for Medical Research, University of Cambridge). The GFP-SNX1 cell line has been previously described in Allison et al. (2017). Cell lines were routinely tested for mycoplasma infection. To generate the MRC-5 GFP-Rab5C stable cell line, GFP-Rab5C was PCRed from pIRES GFP-Rab5C Seaman (2004) using 'Hpa1 GFP Forward' (TAGGGAGTTAACATGGTGAGCAAGGGC-GAGGA) and 'Not1 Rab5C Reverse' (ATCCCTGCGGCCGCTCAGTTGCTGCAGCACTGGC) oligonucleotide primers. The GFP-Rab5C PCR product and a pLXIN-I-NeoR plasmid were digested using Hpa1 (New England Biolabs -R0105) and Not1 (New England Biolabs -R3189) restriction enzymes. The GFP-Rab5C PCR product was then ligated into the digested pLXIN-I-NeoR using T4 DNA Ligase (New England Biolabs -M0202). The ligated plasmid was amplified in bacteria selected with ampicillin and verified using Sanger Sequencing. To generate the GFP-Rab5C MRC-5 cell line, Phoenix retrovirus producer HEK293T cells were transfected with the pLXIN-GFP-Rab5C-I-NeoR plasmid to generate retrovirus containing GFP-Rab5C. MRC-5 cells were inoculated with the virus, and successfully transduced cells were selected using 200 mg/mL Geneticin (G418 -Sigma-Aldrich G1397). Cells used for imaging were not clonally selected.

Live-imaging and tracking
Stably expressing MRC-5 cells were co-stained with LysoBrite Red (AAT Bioquest), imaged live using fluorescence microscopy and tracked with NNT aitracker.net; Newby et al. (2018). The cells were grown in MEM (Sigma Life Science) and 10% FBS (HyClone) and incubated for 48 hr at 37 in 5% CO 2 on 35 mm glass-bottomed dishes (m-Dish, Ibidi, Cat. No. 81150). For LysoBrite staining, LysoBrite was diluted 1 in 500 with Hank's Balanced Salt solution (Sigma Life Science). Then 0.5 mL of this solution was added to cells on a 35 mm dish containing 2 mL of growing media and incubated at 37 for at least 1 hr. Cells were then washed with sterile PBS and the media replaced with growing media. After at least 6 hr incubation, the growing media was replaced with live-imaging media composed of Hank's Balanced Salt solution (Sigma Life Science, Cat. No. H8264) with added essential and non-essential amino acids, glutamine, penicillin/streptomycin, 25 mM HEPES (pH 7.0) and 10% FBS (HyClone). Live-cell imaging was performed on an inverted Olympus IX71 microscope with an Olympus 100 Â 1.35 oil PH3 objective. Samples were illuminated using an OptoLED (Cairn Research) light source with 470 nm and white LEDs. For GFP, a 470 nm LED and Chroma ET470/40 excitation filter was used in combination with a Semrock FITC-3540C filter set. For Lysobrite-Red, a white light LED, Chroma ET573/35 was used with a dualband GFP/mCherry dichroic and an mCherry emission filter (ET632/60). GFP-Rab5-labeled endosomes were imaged in a total of 65 cells, from three independent experiments. GFP-SNX1-labeled endosomes were imaged in a total of 63 cells from four independent experiments. Lysosomes were imaged in separate experiments, with 71 cells imaged from three independent repeats. A stream of 20 ms exposures was collected with a Prime 95B sCMOS Camera (Photometrics) for 17 s using Metamorph software while the cells were kept at 37 (in atmospheric CO2 levels). The endosomes and lysosomes in the videos were then tracked using an automated tracking software (AITracker) Newby et al. (2018).

Confocal imaging
To compare the localization of SNX1 and Rab5, GFP-Rab5-MRC-5 cells were grown on #1.5 coverslips and then fixed in 3% (w/v) formaldehyde in PBS for 20 min at room temperature (RT). Coverslips were washed twice in PBS, quenched in PBS with glycine, then permeabilized by incubation for 5 min in 0.1% Triton X-100. After another wash in PBS, coverslips were labeled with antibodies to SNX1 and Rab5 for 1 h at RT, washed three times in PBS, then labeled with Alexa488-donkey antirabbit and Alexa594-donkey anti-mouse antibodies in 1 mg/mL DAPI in PBS for 30 min. After three PBS washes, coverslips were dipped in deionized water, air-dried and mounted on slides using Prolong Gold.
Images were collected on a Leica TCS SP8 AOBS inverted confocal using a 100x/1.40 NA PL apo objective. The confocal settings were as follows: pinhole, one airy unit; scan speed 400 Hz unidirectional; format 2048 Â 2048. Images were collected using hybrid detectors (A488 and A594) or a PMT (DAPI) with these detection mirror settings; [Alexa488, 498 nm-577 nm; Alexa594, 602 nm-667 nm; DAPI, 420 nm-466 nm] using the SuperK Extreme supercontinuum white light laser for 488 nm (10.5%) and 594 nm (5%) excitation, and a 405 nm laser (5%) for DAPI. Images were collected sequentially to eliminate cross-talk between channels. When acquiring 3D optical stacks the confocal software was used to determine the optimal number of Z sections. The data were deconvolved using Huygens software before generating maximum intensity projections of 3D stacks using FIJI.