Code accompanying the arXiv preprint NuSPAN: A Proximal Average Network for Nonuniform Sparse Model -- Application to Seismic Reflectivity Inversion
The codes have been built on PyTorch (>=1.7) and Python (>=3.8), and tested on MacOS 10.13.6 and Ubuntu 18.04.
We recommend setting up a new conda environment (requires Anaconda or Miniconda installed on the system). Create a new environment using the following command:
conda env create -f nuspan.yml
[Optional] To run tests related to Basis Pursuit Inversion, an Octave installation is needed:
sudo apt install octave
To test any of the 4 datasets and reproduce results for our paper, simply run:
python {a}_test.py {b}
To test on either the Simulated 2-D Marmousi2 Model or the Real Data, please unzip the files marmousi2_reflectivity.npy.zip and penobscot_3d.npy.zip, respectively, before running the above commands.
The file marmousi2_reflectivity.npy.zip has been generated from the P-wave velocity and Density profiles provided for the Marmousi2 model.
Reference: https://wiki.seg.org/wiki/AGL_Elastic_Marmousi
To download, click the link or paste the line below into terminal:
wget https://s3.amazonaws.com/open.source.geoscience/open_data/elastic-marmousi/elastic-marmousi-model.tar.gz
The file penobscot_3d.npy.zip has been generated from the raw seismic data provided for the Penobscot 3D Survey. Reference: O. S. R., dGB Earth Sciences. Penobscot 3D - Survey, 2017). The raw data has been retrieved from https://terranubis.com/datainfo/Penobscot.
We also use the files las.py and L-30.las for our experiments on real data. Reference: Bianco, E. Geophysical tutorial: well-tie calculus. The Leading Edge, 33(6):674–677, 2014. Available in the original form at https://github.com/seg/tutorials-2014/tree/master/1406_Make_a_synthetic
-b, --bpi (Basis-Pursuit Inversion - BPI)
-f, --fista (Fast Iterative Shrinkage-Thresholding Algorithm - FISTA)
-s, -sblem (Expectation-Maximization-based Sparse Bayesian Learning- SBL-EM)
-n1, --nuspan1 (Nonuniform Sparse Proximal Averaging Network Type 1 - NuSPAN-1)
-n2, --nuspan2 (Nonuniform Sparse Proximal Averaging Network Type 2 - NuSPAN-2)
For help, run
python {a}_test.py -h
or
python {a}_test.py --help
python trace_test.py -n2
or
python trace_test.py --nuspan2
python wedge_test.py -n1
or
python wedge_test.py --nuspan1
To change the wedge model type, refer to wedge_test.py, Line 30. The default model_type is 'np'. It can be 'nn', 'pp', 'np', or 'pn' --> polarity of upper and lower interface (p=positive, n=negative).
python marmousi2_test.py -f
or
python marmousi2_test.py --fista
To train NuSPAN-1 or NuSPAN-1, follow a similar approach as above:
python train_nuspan.py -n1
or
python train_nuspan.py --nuspan1
python train_nuspan.py -n2
or
python train_nuspan.py --nuspan2
Run
python figure_real.py
to generate Figure 11 in our paper, i.e., for results from a real dataset. This will generate the file fig_real_xline_115.pdf. The figure is generated using output arrays saved in the folders real_bpi, real_fista, real_nuspan1, real_nuspan2, and real_sblem.
We provide both NuSPAN-1 and NuSPAN-2 trained models for all datasets. Different models are trained for different datasets mainly due to the variation of three model parameters, namely, the Ricker wavelet frequency, sampling interval, and the amplitude increment.
The models nuspan1_trace_wedge_10.pt, nuspan1_trace_wedge_15.pt, and nuspan2_trace_wedge.pt cater to the Synthetic 1-D Traces and 2-D Wedge Models. Parameters of the seismic traces:
30 Hz Ricker wavelet frequency
1 ms sampling interval
0.2 amplitude increment
The models nuspan1_marmousi2.pt and nuspan2_marmousi2.pt cater to the Simulated 2-D Marmousi2 Model.
30 Hz Ricker wavelet frequency
2 ms sampling interval
0.05 amplitude increment
The models nuspan1_real.pt and nuspan2_real.pt cater to the Real Data.
25 Hz Ricker wavelet frequency
4 ms sampling interval
0.05 amplitude increment
The files def_algorithms.py, def_figs.py, and def_models.py contain the definitions of all the methods (NuSPAN-1, NuSPAN-2, BPI, FISTA, and SBL-EM), figures, and models, respectively.