This repository contains the reference implementation accompanying the GJI submission:
"Towards Inference-Mode Ambient Noise Tomography: A Framework for Phase Velocity Field Reconstruction and Uncertainty Quantification."
It provides a fully reproducible synthetic experiment (regular station geometry) demonstrating Bayesian phase velocity reconstruction using:
- Whittle–Matérn Gaussian random field prior
- Karhunen–Loève (KL) dimensionality reduction
- Straight-ray line-integral forward operator
- Maximum a posteriori (MAP) estimation (L-BFGS)
- Full posterior sampling using NUTS
- Posterior post-processing and uncertainty visualization
The repository supports reproducible inference-mode imaging, where geological interpretation is grounded in posterior uncertainty quantification.
The recommended way to reproduce the results is via conda:
conda env create -f environment.yml
conda activate inference-mode-ant- Python: 3.12
- NumPy: < 2.0 (for PyTorch compatibility)
- SciPy
- Matplotlib
- PyTorch: 2.2
- Pyro: 1.9.1
- scikit-image
- ArviZ
Run the following command to verify the environment:
python -c "import torch, pyro, numpy; print('Environment OK')"The synthetic velocity field is located in:
make_synthetic_field/
If needed, regenerate it via:
python make_synthetic_field/generate_synthetic_field.pyThis produces:
synthetic_field.npy
True_field.png
The field defines two velocity levels representing geological structure.
Run:
python core/save_signal.pyThis:
Loads the synthetic velocity field
Computes straight-ray travel times
Saves observation data to:
obs/obs_data.pickleRun:
python core/MAP_estimate.py --device cpuThis computes the maximum a posteriori (MAP) estimate of the phase velocity field under:
-
Whittle–Matérn prior
-
KL parameterization
-
Straight-ray forward operator
Run:
python core/sampling.py --device cpuThis performs full Bayesian posterior sampling using:
-
Hamiltonian Monte Carlo (NUTS)
-
Pyro backend
-
Reduced KL parameterization
Samples are saved in:
stat/Run:
python core/post_process.pyThis generates:
-
Posterior mean field
-
Posterior standard deviation (UQ)
-
Sampling diagnostics (ESS, trace plots)
Implements the straight-ray forward operator used to compute travel times along station pairs.
Defines the Whittle–Matérn Gaussian prior and KL expansion used to parameterize the velocity field.
These two modules form the mathematical backbone of the inference engine.
All commands must be executed from the repository root:
inference-mode-ant/conda env create -f environment.yml
conda activate inference-mode-ant
python make_synthetic_field/generate_synthetic_field.py
python core/save_signal.py
python core/MAP_estimate.py --device cpu
python core/sampling.py --device cpu
python core/post_process.pyThe full pipeline produces:
- True synthetic field
- MAP reconstruction
- Posterior mean
- Posterior uncertainty maps
- Sampling diagnostics