{"id":22073425,"url":"https://github.com/slimgroup/fno4co2","last_synced_at":"2025-07-24T11:31:18.710Z","repository":{"id":41153997,"uuid":"372868079","full_name":"slimgroup/FNO4CO2","owner":"slimgroup","description":"Learned coupled inversion with Fourier neural operators","archived":false,"fork":false,"pushed_at":"2024-03-14T18:39:24.000Z","size":121753,"stargazers_count":19,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-03-15T06:29:45.822Z","etag":null,"topics":["carbon","ccs","deep-learning","fno","inversion","julia","machine-learning","time-lapse"],"latest_commit_sha":null,"homepage":"https://library.seg.org/doi/10.1190/image2022-3722848.1","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slimgroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.bib","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-06-01T14:57:02.000Z","updated_at":"2024-03-06T08:25:20.000Z","dependencies_parsed_at":"2023-10-16T10:53:54.243Z","dependency_job_id":"41abe4ef-7ceb-43c8-a47e-cafd71c622b2","html_url":"https://github.com/slimgroup/FNO4CO2","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slimgroup%2FFNO4CO2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slimgroup%2FFNO4CO2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slimgroup%2FFNO4CO2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slimgroup%2FFNO4CO2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slimgroup","download_url":"https://codeload.github.com/slimgroup/FNO4CO2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227432759,"owners_count":17775975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carbon","ccs","deep-learning","fno","inversion","julia","machine-learning","time-lapse"],"created_at":"2024-11-30T21:18:37.369Z","updated_at":"2024-11-30T21:18:39.164Z","avatar_url":"https://github.com/slimgroup.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FNO4CO2\n\n[![][license-img]][license-status] [![][zenodo-img]][zenodo-status]\n\nThis repository contains the implementation of learned coupled inversion framework and the numerical experiments in [Learned coupled inversion for carbon sequestration monitoring and forecasting with Fourier neural operators](https://arxiv.org/abs/2203.14396), accepted by the International Meeting for Applied Geoscience \u0026 Energy 2022.\n\nThe aforementioned framework entails a re-implementation of Fourier neural operators from [Fourier Neural Operator for Parameter Partial Differential Equations](https://arxiv.org/abs/2010.08895) authored by Zongyi Li et al. The [original repository](https://github.com/zongyi-li/fourier_neural_operator) is in python.\n\nThis code is based on the Julia Language and the package [DrWatson](https://juliadynamics.github.io/DrWatson.jl/stable/) to make a reproducible scientific project named\n\u003e FNO4CO2\n\nTo (locally) reproduce this project, do the following:\n\n1. Download this code base. Notice that raw data are typically not included in the\n   git-history and may need to be downloaded independently.\n2. Download [python](https://www.python.org/) and [Julia](https://julialang.org/). The numerical experiments are reproducible by python 3.7 and Julia 1.7.\n3. Install [Devito](https://www.devitoproject.org/), a python package used for wave simulation.\n4. Open a Julia console and do:\n   ```\n   julia\u003e using Pkg\n   julia\u003e Pkg.activate(\"path/to/this/project\")\n   julia\u003e Pkg.instantiate()\n   ```\n\nThis will install all necessary Julia packages for you to be able to run the scripts and\neverything should work out of the box.\n\n## Examples\n\nThe repository currently includes several scripts.\n\n`gen_perm.jl` generates random permeability samples and `gen_conc.jl` generates time-varying CO2 concentration for each of them using the numerical simulator from [FwiFlow.jl](https://github.com/lidongzh/FwiFlow.jl). To save you some time to reproduce our examples, we've also provided the dataset through a dropbox link -- when you run the network training script, the dataset will be downloaded automatically.\n\n`fourier_3d.jl` trains a 3D FNO which maps the permeability to time-varying CO2 concentration governed by two-phase flow equations, with the dataset generated by `gen_perm.jl` and `gen_conc.jl`. You can train the FNO on GPU if available by setting the env variable ``export FNO4CO2GPU=1`` in your environment (e.g. in `~/.zshrc` on my mac, or just do `FNO4CO2GPU=1 julia`). The trained 3D network for the two-phase flow example is provided in the repository under `data/3D-FNO`.\n\n`fourier_3d_grad.jl` script shows how to conduct a learned inversion to estimate the permeability (input of FNO) from the CO2 concentration snapshots. It uses gradient descent with back-tracking line search to iteratively invert the FNO.\n\n`learned_coupled_inversion.jl` script shows how to conduct a learned coupled inversion, i.e. we invert for the permeability from time-lapse seismic datasets. The process involves inverting multiple physics as shown in [Coupled Time-Lapse Full-Waveform Inversion for Subsurface Flow Problems Using Intrusive Automatic Differentiation](https://agupubs.onlinelibrary.wiley.com/doi/abs/10.1029/2019WR027032), while it uses a pre-trained FNO as a surrogate for the fluid-flow solver.\n\n## Citation\n\nIf you use our software for your research, we appreciate it if you cite us following the bibtex in [CITATION.bib](CITATION.bib).\n\n## Acknowledgements\n\nWe thank the developers from several software packages in the open-source software community, which we based our implementation on. The FNO is re-implemented following Zongyi Li et al's work in [https://github.com/zongyi-li/fourier_neural_operator](https://github.com/zongyi-li/fourier_neural_operator). The two-phase flow dataset is generated by [FwiFlow.jl](https://github.com/lidongzh/FwiFlow.jl). We use [Devito](https://www.devitoproject.org/) and [JUDI.jl](https://github.com/slimgroup/JUDI.jl) for wave simulations. We use [SetIntersectionProjection](https://github.com/slimgroup/SetIntersectionProjection.jl) for constrained optimization.\n\nThis research was carried out with the support of Georgia Research Alliance and partners of the ML4Seismic Center.\n\n## Author\n\nZiyi (Francis) Yin, [ziyi.yin@gatech.edu](mailto:ziyi.yin@gatech.edu)\n\n[license-status]:LICENSE\n[zenodo-status]:https://doi.org/10.5281/zenodo.6799258\n[license-img]:http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat?style=plastic\n[zenodo-img]:https://zenodo.org/badge/DOI/10.5281/zenodo.3878711.svg?style=plastic","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslimgroup%2Ffno4co2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslimgroup%2Ffno4co2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslimgroup%2Ffno4co2/lists"}