A deep learning classification tool for anomalous diffusion trajectories.
MSD against time for different fractional Brownian motion realizations (
Let's consider the motion a particle immersed in a medium. Since its dynamics is very complicated and depends on a large number of parameters, it is not straightforward to identify useful quantities to characterize it. Of fundamental importance is the mean squared displacement (MSD), which connects time to the average of the squared distance travelled. Given a continuous random variable X(t) describing the position of a particle at time t, MSD is defined as:
where
- Subdiffusion when
$\alpha < 1$ - Ordinary diffusion when
$\alpha = 1$ - Superdiffusion when
$\alpha > 1$
Whenever
There have been attemps to use deep learning techniques to overperform traditional methods to infer the
Methods based on fractional Brownian motion are a simple, though mathematically rigorous, way to simulate diffusion trajectories starting from the
Mean absolute error (MAE) as a function of the number of iterations. Vertical red dashed lines represent epochs.
pip install numpy, stochastic, torchThis script takes as input a vector containing the positions of the particle and returns the
from DeepBrownianMotion import DeepBrownianMotion
from stochastic.processes import FractionalBrownianMotion
import numpy as np
# Choose trajectory parameters
alpha = 0.7
trajectory_length = 100
# Instantiate simulator object
f = FractionalBrownianMotion(hurst=0.5*alpha, t=1)
trajectory = f.sample(trajectory_length-1).reshape(1, trajectory_length)
# Instantiate deep learning model
dpm = DeepBrownianMotion(device='cpu')
alpha_pred = np.around(dpm.inference(trajectory).item(), 3)
print('Real alpha {0}, predicted alpha {1}'.format(alpha, alpha_pred) )Output:
Real alpha 0.7, predicted alpha 0.746
I want to thank Marco Gherardi from the University of Milan for his support on a previous closely related project. This work was inspired by this paper from A. Argun, G. Volpe and S. Bo, and would not have been possible without the stochastic simulation tool. As always, I also want to thank the pytorch team for their amazing library.
Footnotes
-
Aykut Argun et al 2021 J. Phys. A: Math. Theor. 54 294003 ↩
-
stochastic by crflynn ↩