SkillAgentSearch skills...

ADFWI

An Automatic Differentiation-based Waveform Inversion Framework Implemented in PyTorch.

Install / Use

/learn @liufeng2317/ADFWI

README

<!-- * @Author: LiuFeng(USTC) : * liufeng2317@mail.ustc.edu.cn * liufeng1@pjlab.org.cn * @Date: 2023-07-03 11:16:43 * @LastEditors: LiuFeng * @LastEditTime: 2024-01-02 13:16:52 * @FilePath: /ADFWI/README.md * @Description: * Copyright (c) 2024 by liufeng2317 email: liufeng1@pjlab.org.cn, All Rights Reserved. --> <div align="center"> <img height="150" src="./docs/Md_img/ADFWI-logo.png" /> </div> <br/> <div align="center"> <img src="https://visitor-badge.laobi.icu/badge?page_id=liufeng2317.liufeng2317&" /> <img src="https://img.shields.io/github/stars/liufeng2317/ADFWI" /> <img src="https://img.shields.io/github/forks/liufeng2317/ADFWI" /> </div> <div align="center"> <img src="https://img.shields.io/github/license/liufeng2317/ADFWI" /> <img src="https://img.shields.io/github/repo-size/liufeng2317/ADFWI"/> <img src="https://img.shields.io/github/last-commit/liufeng2317/ADFWI"/> <img src="https://img.shields.io/badge/lauguage-python-%233572A5"/> <img src="https://img.shields.io/badge/lauguage-jupyter-%23F37626"/> <img src="https://img.shields.io/badge/lauguage-shell-%2389E051"/> </div> <h1 align="center">Automatic Differentiation-Based Full Waveform Inversion</h1>

:newspaper: Latest Update (April 2025)
Our new preprint "Deep Reparameterization for Full Waveform Inversion: Architecture Benchmarking, Robust Inversion, and Multiphysics Extension" is now available on arXiv.

:triangular_flag_on_post: News (March 2025)
The article titled "Automatic Differentiation-Based Full Waveform Inversion With Flexible Workflows" has been published in JGR: Machine Learning & Computation.

:triangular_flag_on_post: News (February 2025)
The detailed document can be found at http://www.adfwi.cn/.


👩‍💻 Introduction

  ADFWI is an open-source framework for high-resolution subsurface parameter estimation by minimizing discrepancies between observed and simulated waveform. Utilizing automatic differentiation (AD), ADFWI simplifies the derivation and implementation of full waveform inversion (FWI), enhancing the design and evaluation of methodologies. It supports wave propagation in various media, including isotropic acoustic, isotropic elastic, and both vertical transverse isotropy (VTI) and horizontal transverse isotropy (HTI) medias.

  In addition, ADFWI provides a comprehensive collection of Objective functions, regularization techniques, optimization algorithms, and deep neural networks. This rich set of tools facilitates researchers in conducting experiments and comparisons, enabling them to explore innovative approaches and refine their methodologies effectively.

ADFWI NNFWI


⚡️ Installation

To install ADFWI, please follow these steps:

  1. Ensure Prerequisites

  2. Create a Virtual Environment (Optional) It is recommended to create a virtual environment using conda:

    conda create --name adfwi-env python=3.8
    conda activate adfwi-env
    
  3. Install Required Packages

  • Method 1: Clone the github Repository This method provides the latest version, which may be more suitable for your research:
    git clone https://github.com/liufeng2317/ADFWI.git
    cd ADFWI
    
    Then, install the necessary packages:
    pip install -r requirements.txt
    
  • Method 2: Install via pip Alternatively, you can directly install ADFWI from PyPI:
      pip install ADFWI-Torch
    

👾 Examples

Details can be found at the codebook.

1. Gradient Comparation between AD & Central Difference

A comparative analysis of gradient calculations obtained through AD and the central difference method.

<div style="text-align: center;"> <table> <tr> <th style="text-align: center;">Test Name</th> <th style="text-align: center;">Status</th> <th style="text-align: center;">Path</th> <th style="text-align: center;">Figure</th> </tr> <tr> <td style="text-align: center; vertical-align: middle;">Acoustic (vp)</td> <td style="text-align: center; vertical-align: middle;">✅</td> <td style="text-align: center; vertical-align: middle;"> <a href="./examples/gradient_checking/Acoustic-Marmousi2/03_1_compare_gradient.ipynb">Codes</a> </td> <td style="text-align: center; vertical-align: middle;"> <!-- <details> <summary>Gradient Comparation</summary> --> <img src="./examples/gradient_checking/Acoustic-Marmousi2/data/Figure_S1_acoustic_Gradient_Cmp.png" alt="Marmousi2GradientCmp" style="max-width: 120px; height: auto; max-height: 120px;" /> <!-- </details> --> </td> </tr> <tr> <td style="text-align: center; vertical-align: middle;">Elastic (vp/vs/rho)</td> <td style="text-align: center; vertical-align: middle;">✅</td> <td style="text-align: center; vertical-align: middle;"> <a href="./examples/gradient_checking/Elastic-Marmousi2/03_1_compare_gradient.ipynb">Codes</a> </td> <td style="text-align: center; vertical-align: middle;"> <details> <summary>Gradient Comparation</summary> <img src="./examples/gradient_checking/Elastic-Marmousi2/data/Elastic_vp_grad.png" alt="Marmousi2GradientCmp" style="max-width: 120px; height: auto; max-height: 120px;" /> <img src="./examples/gradient_checking/Elastic-Marmousi2/data/Elastic_vs_grad.png" alt="Marmousi2GradientCmp" style="max-width: 120px; height: auto; max-height: 120px;" /> <img src="./examples/gradient_checking/Elastic-Marmousi2/data/Elastic_rho_grad.png" alt="Marmousi2GradientCmp" style="max-width: 120px; height: auto; max-height: 120px;" /> </details> </td> </tr> </table> </div>

2. Iso-acoustic Model Tests

<div style="text-align: center;"> <table> <tr> <th style="text-align: center;">Test Name</th> <th style="text-align: center;">Status</th> <th style="text-align: center;">Example's Path</th> <th style="text-align: center;">Example's Figure</th> </tr> <tr> <td style="text-align: center; vertical-align: middle;">Marmousi2 (low resulotion)</td> <td style="text-align: center; vertical-align: middle;">✅</td> <td style="text-align: center; vertical-align: middle;"><a href="./examples/acoustic/01-model-test/01-Marmousi2/02_inversion.ipynb">Example-Marmousi2 (low)</a></td> <td style="text-align: center; vertical-align: middle;"> <details> <summary>Inversion Process</summary> <img src="./examples/acoustic/01-model-test/01-Marmousi2/data/inversion/inversion_process.gif" alt="Marmousi2" style="max-width: 300px; height: auto;"/> </details> </td> </tr> <tr> <td style="text-align: center; vertical-align: middle;">Marmousi2 (high resulotion)</td> <td style="text-align: center; vertical-align: middle;">✅</td> <td style="text-align: center; vertical-align: middle;"><a href="./examples/acoustic/01-model-test/06-LargeScaleTest-Marmousi2/02_inversion.ipynb">Example-Marmousi2 (high)</a></td> <td style="text-align: center; vertical-align: middle;"> <details> <summary>Inversion Process</summary> <img src="./examples/acoustic/01-model-test/06-LargeScaleTest-Marmousi2/data/inversion/inversion_process.gif" alt="Marmousi2" style="max-width: 300px; height: auto;"/> </details> </td> </tr> <tr> <td style="text-align: center; vertical-align: middle;">Marmousi2 (vp and rho)</td> <td style="text-align: center; vertical-align: middle;">✅</td> <td style="text-align: center; vertical-align: middle;"><a href="./examples/acoustic/01-model-test/08-Marmousi2-vp-rho/02_inversion.ipynb">Example-vp & rho</a></td> <td style="text-align: center; vertical-align: middle;"> <details> <summary>Inversion Process</summary> <img src="./examples/acoustic/01-model-test/08-Marmousi2-vp-rho/data/inversion/inversion_process.gif" alt="Anomaly" style="max-width: 300px; height: auto;"/> </details> </td> </tr> <tr> <td style="text-align: center; vertical-align: mid
View on GitHub
GitHub Stars182
CategoryEducation
Updated8d ago
Forks25

Languages

Python

Security Score

100/100

Audited on Apr 1, 2026

No findings