Predicting how an ultrasound-driven microbubble's radius evolves over time normally means solving the stiff, nonlinear Rayleigh-Plesset ODE numerically. This project trains neural networks to learn that mapping directly, from the acoustic pressure signal ΔP(t) to the radius trajectory R(t), and compares recurrent sequence models against operator-learning models.
Result: the best model, an LSTM, reached 3.1% relative L2 error on held-out test trajectories.
Given an acoustic forcing signal sampled at m = 20 points, predict the bubble radius over the same time window. This is a function-to-function mapping, which motivates comparing two families of models:
- Sequence models (LSTM, GRU, Seq2Seq-GRU) that read the forcing as a time series
- Operator-learning models (DeepONet, and a physics-guided operator variant) designed specifically to learn maps between functions
Trajectories are generated by integrating the Rayleigh-Plesset equation with scipy.integrate.solve_ivp (RK45):
R R̈ + (3/2) Ṙ² = (1/ρ) [ P_B(R) − P∞(t) − 2σ/R − 4μṘ/R ], with P∞(t) = P₀ + Pₐ sin(2πft)
Each sample randomizes the physical parameters over biomedically realistic ranges:
| Parameter | Range |
|---|---|
| Viscosity μ | 0.001 – 0.004 Pa·s |
| Equilibrium radius R₀ | 0.8 – 3.0 µm |
| Acoustic amplitude Pₐ | 30 – 250 kPa |
| Ultrasound frequency f | 0.5 – 1.5 MHz |
Unstable or non-physical runs are rejected: solver failures, collapse below 0.25 R₀, and growth beyond 8 R₀. Train and test sets are generated with different random seeds, so test trajectories are never seen during training.
- Metric: relative L2 error, ‖R_pred − R_true‖ / ‖R_true‖, on the held-out test set
- Diagnostics: train vs. validation loss curves for every model, plus true-vs-predicted radius plots
- Inputs and outputs are normalized using training-set statistics only
- An LSTM trained for 10,000 epochs reached 3.1% relative L2 error on held-out test trajectories.
- In a smaller 200-sample experiment, validation loss rose while training loss fell for every model. All five models overfit, so the bottleneck at that scale was data size, not architecture.
| File | Contents |
|---|---|
bubble_dynamics.ipynb |
Data generation, all five models, training, evaluation and plots |
requirements.txt |
Python dependencies |
pip install -r requirements.txt
jupyter notebook bubble_dynamics.ipynbThe notebook also runs as-is in Google Colab.