Skip to content

AbrightWay/ldm_2d_geomodel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latent Diffusion for Geomodel Parameterization

Code example for "Latent diffusion models for parameterization and data assimilation of facies-based geomodels"[https://arxiv.org/abs/2406.14815]

Summary

We present a deep-learning geological parameterization for complex facies-based geomodels, using recently developed generative latent diffusion models (LDMs), first published by Rombach et al. (2022). Diffusion models are trained to ''denoise'', which enables them to generate new geological realizations from input fields characterized by random noise. Based on Denoising Probabilstic Diffusion Models (DDPMs), introduced by Ho et al. (2020), the LDM representation reduces the number of variables to be determined during history matching, while preserving realistic geological features in posterior models. The model developed in this work includes a variational autoencoder (VAE) for dimension reduction, a U-net for the denoising process, and a Denoising Diffusion Implicit Model (DDIM, Song et al. (2021)) noise scheduling for inference.

Our application involves conditional 2D three-facies (channel-levee-mud) systems. The LDM can provide realizations that are visually consistent with samples from geomodeling software. General agreement between the diffusion-generated models and reference realizations can be observed through quantitative metrics involving spatial and flow-response statistics. The smoothness of the parameterization method can be assessed through latent-space interpolation tests. The LDM can then used for ensemble-based data assimilation. Significant uncertainty reduction, posterior P10-P90 forecasts that generally bracket observed data, and consistent posterior geomodels, can be achieved.

Contents

  • scripts/ - Directory to store dataset for data preparation, variational autoencoder (VAE) training and U-net training .py scripts.
  • data/ - Directory to store training dataset used in this study (2D, three-facies channelized geomodels). Dataset is stored as datasets.Dataset folder (diffusers_dataset/)
  • testing/ - Directory to store reference (geomodeling software-generated) m_petrel_200.npy and LDM-generated m_ldm_200.npy ensembles used for flow simulations and history matching. Synthetic "true" models used in history matching are saved as m_true_1.npy and m_true_2.npy. Both are stored as .npy files.

Code implementations are based on the following repositories:

Software requirements

Running the scripts requires the libraries datasets, diffusers, monai or monai-generative.
This workflow is tested with Python 3.9 and PyTorch 1.8 (CPU/GPU).

Contact

Guido Di Federico, Louis J. Durlofsky
Department of Energy Science & Engineering, Stanford University
Contact: gdifede@stanford.edu

Examples

Alt text

Noising and denoising process on a geomodel

Alt text

VAE component of the diffusion model

Alt text

Denoising U-net component of the diffusion model

Alt text

Interpolation test on a geomodel using LDM

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.1%
  • Python 0.9%