Skip to main content
QUICK REVIEW

[Paper Review] HMCLab: a framework for solving diverse geophysical inverse problems using the Hamiltonian Monte Carlo method

Andrea Zunino, Lars Gebraad|arXiv (Cornell University)|Mar 17, 2023
Geophysical and Geoelectrical MethodsEarth and Planetary Sciences69 references1 citations
TL;DR

HMCLab is an open-source, multi-language framework in Python and Julia that enables probabilistic geophysical inverse problems using Hamiltonian Monte Carlo (HMC) and adjoint methods. It provides a unified platform for solving diverse problems—such as seismic tomography, source location, and potential field inversion—by efficiently sampling high-dimensional posterior distributions with gradient-based sampling, enabling uncertainty quantification and statistical inference on subsurface properties.

ABSTRACT

The use of the probabilistic approach to solve inverse problems is becoming more popular in the geophysical community, thanks to its ability to address nonlinear forward problems and to provide uncertainty quantification. However, such strategy is often tailored to specific applications and therefore there is a lack of a common platform for solving a range of different geophysical inverse problems and showing potential and pitfalls. We demonstrate a common framework to solve such inverse problems ranging from, e.g, earthquake source location to potential field data inversion and seismic tomography. Within this approach, we can provide probabilities related to certain properties or structures of the subsurface. Thanks to its ability to address high-dimensional problems, the Hamiltonian Monte Carlo (HMC) algorithm has emerged as the state-of-the-art tool for solving geophysical inverse problems within the probabilistic framework. HMC requires the computation of gradients, which can be obtained by adjoint methods, making the solution of tomographic problems ultimately feasible. These results can be obtained with "HMCLab", a tool for solving a range of different geophysical inverse problems using sampling methods, focusing in particular on the HMC algorithm. HMCLab consists of a set of samplers and a set of geophysical forward problems. For each problem its misfit function and gradient computation are provided and, in addition, a set of prior models can be combined to inject additional information into the inverse problem. This allows users to experiment with probabilistic inverse problems and also address real-world studies. We show how to solve a selected set of problems within this framework using variants of the HMC algorithm and analyze the results. HMCLab is provided as an open source package written both in Python and Julia, welcoming contributions from the community.

Motivation & Objective

  • To address the lack of a common, extensible platform for solving diverse geophysical inverse problems within a probabilistic framework.
  • To enable uncertainty quantification in nonlinear geophysical inverse problems, such as those involving seismic tomography, source location, and potential field data.
  • To provide a flexible, extensible software environment that supports both sampling-based inference (e.g., HMC) and deterministic optimization (e.g., gradient descent).
  • To facilitate community contributions by offering modular, well-documented code with support for user-defined forward models, priors, and gradient computations.
  • To bridge the gap between theoretical probabilistic inversion and practical application by offering out-of-the-box examples and interactive notebooks.

Proposed method

  • Employs Hamiltonian Monte Carlo (HMC) as the primary sampling algorithm, leveraging gradient information from the posterior distribution to efficiently explore high-dimensional model spaces.
  • Integrates adjoint methods to compute gradients of the misfit functional with respect to model parameters, enabling scalable and accurate HMC sampling in large-scale inverse problems.
  • Provides a modular software architecture with pluggable samplers (HMC, Metropolis-Hastings, SVGD) and forward problem modules (e.g., full-waveform inversion, traveltime tomography).
  • Supports user-defined forward models, priors, and gradient functions through standardized interfaces, allowing customization of inverse problems without modifying core code.
  • Includes built-in tools for gradient computation, deterministic optimization (e.g., L-BFGS, Newton-CG), and probabilistic inference via MCMC and variational inference (SVGD).
  • Delivers interactive Jupyter notebooks and Dockerized environments to enable reproducible, accessible experimentation with minimal setup.

Experimental results

Research questions

  • RQ1Can a unified software framework effectively support a wide range of geophysical inverse problems within a probabilistic inference framework?
  • RQ2How does HMC with adjoint-based gradients improve sampling efficiency and convergence in high-dimensional geophysical inverse problems compared to traditional MCMC methods?
  • RQ3To what extent can HMCLab enable uncertainty quantification for complex subsurface properties such as volume, boundary locations, and permeability layers?
  • RQ4How can a modular, open-source framework facilitate community contributions and integration of new inverse problem types and sampling algorithms?
  • RQ5Can the combination of HMC and adjoint methods make full-waveform inversion and other nonlinear inverse problems computationally feasible and statistically robust?

Key findings

  • HMCLab successfully solves a diverse set of geophysical inverse problems—including full-waveform acoustic inversion, hypocenter location, traveltime tomography, and magnetic anomaly inversion—using HMC with adjoint gradients.
  • The HMC algorithm, enhanced by gradient information from adjoint methods, enables efficient exploration of high-dimensional posterior distributions, significantly reducing random walk behavior common in traditional MCMC.
  • The framework allows users to compute posterior statistics such as expected model values, histograms of physical properties, and probabilities of geological body volumes or layer boundaries.
  • HMCLab supports both probabilistic sampling (e.g., HMC, Metropolis-Hastings) and deterministic optimization (e.g., gradient descent), enabling users to explore both Bayesian and maximum a posteriori solutions.
  • The inclusion of pre-implemented forward models, priors, and gradient computation functions allows users to rapidly prototype and test inverse problems without low-level coding.
  • The framework is actively maintained and extensible, with community contributions welcomed, and is accessible via Docker and interactive notebooks in both Python and Julia.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.