A brief exploration of open-source gradient-based numerical optimization Python libraries for full-waveform inversion
DOI:
https://doi.org/10.26443/seismica.v4i2.1475Keywords:
Open-source software, Python, Gradient-based optimization, FWIAbstract
Geoscientists favor Python for its user-friendly interface and scientific packages that support application implementation. Python's capabilities make it particularly useful for seismic full waveform inversion (FWI), which can see its implementation time reduced by making use of its extensive library collection. We compare four open-source gradient-based optimization Python packages - scipy.optimize, sotb-wrapper, NLopt, and PyROL - for solving the FWI optimization problem. The comparison is based on the packages' core features, documentation, and learning curves evaluated through the implementation of a 2D time-domain FWI application, built using the Devito modeling engine along with the aforementioned optimization packages. We detail how one can use a particular solver from each package for the solution of a bound-constrained optimization problem such as FWI. The open-source FWI template models used to obtain the numerical results are provided.References
Bonnans, J. F., Gilbert, J. C., Lemaréchal, C., & Sagastizábal, C. A. (2003). Numerical Optimization: Theoretical and Practical Aspects. In Universitext. Springer Berlin Heidelberg. https://doi.org/10.1007/978-3-662-05078-1 DOI: https://doi.org/10.1007/978-3-662-05078-1
Bunks, C., Saleck, F. M., Zaleski, S., & Chavent, G. (1995). Multiscale seismic waveform inversion. GEOPHYSICS, 60(5), 1457–1473. https://doi.org/10.1190/1.1443880 DOI: https://doi.org/10.1190/1.1443880
Byrd, R. H., Lu, P., Nocedal, J., & Zhu, C. (1995). A Limited Memory Algorithm for Bound Constrained Optimization. SIAM Journal on Scientific Computing, 16(5), 1190–1208. https://doi.org/10.1137/0916069 DOI: https://doi.org/10.1137/0916069
Fabien-Ouellet, G., Gloaguen, E., & Giroux, B. (2017). A stochastic L-BFGS approach for full-waveform inversion. SEG Technical Program Expanded Abstracts 2017, 1622–1627. https://doi.org/10.1190/segam2017-17783222.1 DOI: https://doi.org/10.1190/segam2017-17783222.1
Farris, S., Barnier, G., Biondi, E., & Clapp, R. (2023). Pyseis: A high-performance, user-friendly Python package for GPU-accelerated seismic modeling and subsurface imaging. In Third International Meeting for Applied Geoscience & Energy Expanded Abstracts. Society of Exploration Geophysicists. https://doi.org/10.1190/image2023-3916155.1 DOI: https://doi.org/10.1190/image2023-3916155.1
Gill, P. E., & Murray, W. (1979). Conjugate-Gradient Methods for Large-Scale Nonlinear Optimization. Defense Technical Information Center. https://doi.org/10.21236/ada078713 DOI: https://doi.org/10.21236/ADA078713
Hewett, R. J., & Demanet, L. (2017). PySIT: Seismic imaging toolbox for Python. Mass. Inst. Technol., Cambridge, MA, USA, Tech. Rep. http://pysit.org
Hu, W., Chen, J., Liu, J., & Abubakar, A. (2018). Retrieving Low Wavenumber Information in FWI: An Overview of the Cycle-Skipping Phenomenon and Solutions. IEEE Signal Processing Magazine, 35(2), 132–141. https://doi.org/10.1109/msp.2017.2779165 DOI: https://doi.org/10.1109/MSP.2017.2779165
Johnson, S. G. (2007). The NLopt nonlinear-optimization package. https://github.com/stevengj/nlopt. https://github.com/stevengj/nlopt
Kouri, D., Ridzal, D., von Winckel, G., & Javeed, A. (2022, July). Get ROL-ing: An Introduction to Sandia’s Rapid Optimization Library. Proposed for Presentation at the International Conference on Continuous Optimization Held July 24-28, 2022 in Bethlehem, PA United States of America. https://doi.org/10.2172/2004204 DOI: https://doi.org/10.2172/2004204
Lailly, P., & Bednar, J. (1983). The seismic inverse problem as a sequence of before stack migrations. Conference on Inverse Scattering: Theory and Application, 206–220.
Li, J., Rusmanugroho, H., Kalita, M., Xin, K., & Dzulkefli, F. S. (2023). 3D anisotropic full-waveform inversion for complex salt provinces. Frontiers in Earth Science, 11. https://doi.org/10.3389/feart.2023.1164975 DOI: https://doi.org/10.3389/feart.2023.1164975
Li, Y. E., & Demanet, L. (2016, March). Full Waveform Inversion With Extrapolated Low Frequency Data. Offshore Technology Conference Asia. https://doi.org/10.4043/26626-ms DOI: https://doi.org/10.4043/26626-MS
Liu, D. C., & Nocedal, J. (1989a). On the limited memory BFGS method for large scale optimization. Mathematical Programming, 45(1–3), 503–528. https://doi.org/10.1007/bf01589116
Liu, D. C., & Nocedal, J. (1989b). On the limited memory BFGS method for large scale optimization. Mathematical Programming, 45(1–3), 503–528. https://doi.org/10.1007/bf01589116 DOI: https://doi.org/10.1007/BF01589116
Louboutin, M., Lange, M., Luporini, F., Kukreja, N., Witte, P. A., Herrmann, F. J., Velesko, P., & Gorman, G. J. (2019). Devito (v3.1.0): an embedded domain-specific language for finite differences and geophysical exploration. Geoscientific Model Development, 12(3), 1165–1187. https://doi.org/10.5194/gmd-12-1165-2019 DOI: https://doi.org/10.5194/gmd-12-1165-2019
Luksan, L., Matonoha, C., & Vlček, J. (2007). New subroutines for large-scale optimization (Techreport Tech. Rep. V-999). ICS AS CR. https://asep.lib.cas.cz/arl-cav/en/detail/?&idx=cav_un_epca*0085718
Luo, J., Zhou, H., Wu, R.-S., & Huang, X. (2023). Salt and subsalt structure recovery–An envelope-based waveform inversion with local angle domain illumination compensation and L-BFGS. GEOPHYSICS, 88(4), R453–R467. https://doi.org/10.1190/geo2022-0550.1 DOI: https://doi.org/10.1190/geo2022-0550.1
Mardan, A., Giroux, B., & Fabien-Ouellet, G. (2023). Pyfwi: A Python Package for Full-Waveform Inversion and Reservoir Monitoring. Elsevier BV. https://doi.org/10.2139/ssrn.4330227 DOI: https://doi.org/10.2139/ssrn.4330227
Martin, G. S., Wiley, R., & Marfurt, K. J. (2006). Marmousi2: An elastic upgrade for Marmousi. The Leading Edge, 25(2), 156–166. https://doi.org/10.1190/1.2172306 DOI: https://doi.org/10.1190/1.2172306
Métivier, L., & Brossier, R. (2016). The SEISCOPE optimization toolbox: A large-scale nonlinear optimization library based on reverse communication. GEOPHYSICS, 81(2), F1–F15. https://doi.org/10.1190/geo2015-0031.1 DOI: https://doi.org/10.1190/geo2015-0031.1
Michell, S., Shen, X., Brenders, A., Dellinger, J., Ahmed, I., & Fu, K. (2017). Automatic velocity model building with complex salt: Can computers finally do an interpreter’s job? SEG Technical Program Expanded Abstracts 2017, 5250–5254. https://doi.org/10.1190/segam2017-17778443.1 DOI: https://doi.org/10.1190/segam2017-17778443.1
Modrak, R. T., Borisov, D., Lefebvre, M., & Tromp, J. (2018). SeisFlows–Flexible waveform inversion software. Computers & Geosciences, 115, 88–95. https://doi.org/10.1016/j.cageo.2018.02.004 DOI: https://doi.org/10.1016/j.cageo.2018.02.004
Mojica, O. F. (2022). sotb-wrapper. Zenodo. https://doi.org/10.5281/ZENODO.7117744
Moré, J. J., & Thuente, D. J. (1994). Line search algorithms with guaranteed sufficient decrease. ACM Transactions on Mathematical Software, 20(3), 286–307. https://doi.org/10.1145/192115.192132 DOI: https://doi.org/10.1145/192115.192132
Nash, S. G. (1985). Preconditioning of Truncated-Newton Methods. SIAM Journal on Scientific and Statistical Computing, 6(3), 599–616. https://doi.org/10.1137/0906042 DOI: https://doi.org/10.1137/0906042
Nocedal, J. (1980). Updating quasi-Newton matrices with limited storage. Mathematics of Computation, 35(151), 773–782. https://doi.org/10.1090/s0025-5718-1980-0572855-7 DOI: https://doi.org/10.1090/S0025-5718-1980-0572855-7
Nocedal, J., & Wright, S. J. (1999). Numerical optimization. Springer. https://doi.org/10.1007/978-0-387-40065-5 DOI: https://doi.org/10.1007/b98874
Pratt, R. G. (1999). Seismic waveform inversion in the frequency domain, Part 1: Theory and verification in a physical scale model. GEOPHYSICS, 64(3), 888–901. https://doi.org/10.1190/1.1444597 DOI: https://doi.org/10.1190/1.1444597
Rocklin, M. (2015). Dask: Parallel Computation with Blocked algorithms and Task Scheduling. Proceedings of the 14th Python in Science Conference, 126–132. https://doi.org/10.25080/majora-7b98e3ed-013 DOI: https://doi.org/10.25080/Majora-7b98e3ed-013
Shen, X., Ahmed, I., Brenders, A., Dellinger, J., Etgen, J., & Michell, S. (2017, August). Salt model building at Atlantis with full-waveform inversion. SEG Technical Program Expanded Abstracts 2017. https://doi.org/10.1190/segam2017-17738630.1 DOI: https://doi.org/10.1190/segam2017-17738630.1
Shin, C., Jang, S., & Min, D. (2001). Improved amplitude preservation for prestack depth migration by inverse scattering theory. Geophysical Prospecting, 49(5), 592–606. https://doi.org/10.1046/j.1365-2478.2001.00279.x DOI: https://doi.org/10.1046/j.1365-2478.2001.00279.x
Shoja, S. M. A., Abolhassani, S., & Amini, N. (2018, June). A Comparison between Time-Domain and Frequency-Domain Full Waveform Inversion. 80th EAGE Conference and Exhibition 2018. https://doi.org/10.3997/2214-4609.201801667 DOI: https://doi.org/10.3997/2214-4609.201801667
Tarantola, A. (1984). Inversion of seismic reflection data in the acoustic approximation. GEOPHYSICS, 49(8), 1259–1266. https://doi.org/10.1190/1.1441754 DOI: https://doi.org/10.1190/1.1441754
Thrastarson, S., van Herwaarden, D.-P., & Fichtner, A. (2022). Inversionson: Fully Automated Seismic Waveform Inversions. California Digital Library (CDL). https://doi.org/10.31223/x5f31v DOI: https://doi.org/10.31223/X5F31V
Virieux, J., & Operto, S. (2009). An overview of full-waveform inversion in exploration geophysics. GEOPHYSICS, 74(6), WCC1–WCC26. https://doi.org/10.1190/1.3238367 DOI: https://doi.org/10.1190/1.3238367
Virtanen, P., Gommers, R., Oliphant, T. E., Haberland, M., Reddy, T., Cournapeau, D., Burovski, E., Peterson, P., Weckesser, W., Bright, J., van der Walt, S. J., Brett, M., Wilson, J., Millman, K. J., Mayorov, N., Nelson, A. R. J., Jones, E., Kern, R., Larson, E., … Vázquez-Baeza, Y. (2020). SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods, 17(3), 261–272. https://doi.org/10.1038/s41592-019-0686-2 DOI: https://doi.org/10.1038/s41592-020-0772-5
Wang, P., Zhang, Z., Mei, J., Lin, F., & Huang, R. (2019). Full-waveform inversion for salt: A coming of age. The Leading Edge, 38(3), 204–213. https://doi.org/10.1190/tle38030204.1 DOI: https://doi.org/10.1190/tle38030204.1
Downloads
Additional Files
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Oscar Mojica

This work is licensed under a Creative Commons Attribution 4.0 International License.