Update repository references after rename
Browse filesPoint examples and documentation to mally-2000/saii-cldm-synthetic and clarify the synthetic-data evaluation scope.
- MODEL_CARD.md +119 -0
- README.md +5 -5
- codes/dataset.py +1 -1
MODEL_CARD.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: diffusers
|
| 3 |
+
pipeline_tag: image-to-image
|
| 4 |
+
tags:
|
| 5 |
+
- seismic-inversion
|
| 6 |
+
- impedance-inversion
|
| 7 |
+
- diffusion
|
| 8 |
+
- ddpm
|
| 9 |
+
- overthrust
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Seismic-LDDPM
|
| 13 |
+
|
| 14 |
+
Seismic-LDDPM is a latent DDPM pipeline for seismic impedance inversion. The
|
| 15 |
+
pipeline takes a low-frequency impedance image (`dipin`) and a synthetic seismic
|
| 16 |
+
record (`record`) and predicts the impedance image.
|
| 17 |
+
|
| 18 |
+
This repository includes:
|
| 19 |
+
|
| 20 |
+
- Diffusers-format model components: `vq_model`, `unet`, `scheduler`, and
|
| 21 |
+
`condition_encoder`.
|
| 22 |
+
- `SeismicImpInvLDDPMPipeline` in `codes/pipeline.py`.
|
| 23 |
+
- A complete Overthrust benchmark sample at `data/Overthrust_trueimp.mat`.
|
| 24 |
+
- Root `infer.py` and supporting inference code under `codes/`.
|
| 25 |
+
|
| 26 |
+
## Installation
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
git clone https://huggingface.co/mally-2000/saii-cldm-synthetic
|
| 30 |
+
cd saii-cldm-synthetic
|
| 31 |
+
pip install -r requirements.txt
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
## Overthrust Evaluation
|
| 35 |
+
|
| 36 |
+
The Overthrust evaluation script is intentionally fixed to the bundled
|
| 37 |
+
`data/Overthrust_trueimp.mat`. It cuts the full model into six `256 x 256`
|
| 38 |
+
patches, synthesizes the seismic records and low-frequency impedance inputs,
|
| 39 |
+
runs inference, stitches the six predictions back together, and computes the
|
| 40 |
+
metrics.
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
python codes/eval_overthrust.py \
|
| 44 |
+
--model . \
|
| 45 |
+
--output outputs/overthrust \
|
| 46 |
+
--num-inference-steps 1000
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
Outputs:
|
| 50 |
+
|
| 51 |
+
- `outputs/overthrust/full_target.npy`
|
| 52 |
+
- `outputs/overthrust/full_prediction.npy`
|
| 53 |
+
- `outputs/overthrust/full_reconstruction.npy`
|
| 54 |
+
- `outputs/overthrust/comparison_impedance.png`
|
| 55 |
+
- `outputs/overthrust/metrics_summary.json`
|
| 56 |
+
|
| 57 |
+
## Benchmark Result
|
| 58 |
+
|
| 59 |
+
Evaluated locally on the bundled Overthrust benchmark with 1000 DDPM steps,
|
| 60 |
+
`noise_snr=15`, `dipin_v=0.012`, `f0=30`, `phase=0`, `seed=1234`, and patch
|
| 61 |
+
indices `[0, 1, 2, 3, 4, 5]`.
|
| 62 |
+
|
| 63 |
+
| Space | PSNR | SSIM | PCC | RRE | NMSE |
|
| 64 |
+
|---|---:|---:|---:|---:|---:|
|
| 65 |
+
| Normalized | 30.7698 | 0.9339 | 0.9963 | 0.0435 | 0.001894 |
|
| 66 |
+
| Impedance | 33.4413 | 0.9554 | 0.9957 | 0.0324 | 0.001050 |
|
| 67 |
+
| VQ reconstruction | 37.7954 | 0.9677 | 0.9983 | 0.0209 | 0.000435 |
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
|
| 71 |
+
## Single-Sample Inference
|
| 72 |
+
|
| 73 |
+
For a single default Overthrust patch:
|
| 74 |
+
|
| 75 |
+
```bash
|
| 76 |
+
python infer.py
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
The script builds one Overthrust test sample internally, synthesizes the
|
| 80 |
+
low-frequency impedance and seismic record, and saves `prediction.npy`,
|
| 81 |
+
`target.npy`, and `comparison.png` under `outputs/infer_LDDPM`.
|
| 82 |
+
|
| 83 |
+
For SAII-CLDM model-driven sampling:
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
python infer.py CLDM
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
## Python Usage
|
| 90 |
+
|
| 91 |
+
```python
|
| 92 |
+
import torch
|
| 93 |
+
from codes.pipeline import SeismicImpInvLDDPMPipeline
|
| 94 |
+
|
| 95 |
+
pipe = SeismicImpInvLDDPMPipeline.from_pretrained(
|
| 96 |
+
"mally-2000/saii-cldm-synthetic",
|
| 97 |
+
torch_dtype=torch.float32,
|
| 98 |
+
trust_remote_code=True,
|
| 99 |
+
).to("cuda")
|
| 100 |
+
|
| 101 |
+
result = pipe(
|
| 102 |
+
dipin=dipin, # torch.Tensor, BCHW
|
| 103 |
+
record=record, # torch.Tensor, BCHW
|
| 104 |
+
num_inference_steps=1000,
|
| 105 |
+
seed=1234,
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
+
prediction = result.impedance_samples
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
## Notes
|
| 112 |
+
|
| 113 |
+
- `codes/dataset.py` contains a lightweight `SeismicBase` and
|
| 114 |
+
`OverthrustTrueimpDataset`; it does not depend on the original training
|
| 115 |
+
repository's `ldm.data.seisimic`.
|
| 116 |
+
- Synthetic record generation is seeded through the benchmark configuration so
|
| 117 |
+
the published Overthrust evaluation is reproducible.
|
| 118 |
+
- The bundled Overthrust file is used only as a compact benchmark input for
|
| 119 |
+
reproducing this model's inference pipeline.
|
README.md
CHANGED
|
@@ -29,8 +29,8 @@ import torch
|
|
| 29 |
from diffusers import DiffusionPipeline
|
| 30 |
|
| 31 |
pipe = DiffusionPipeline.from_pretrained(
|
| 32 |
-
"mally-2000/
|
| 33 |
-
custom_pipeline="mally-2000/
|
| 34 |
torch_dtype=torch.float32,
|
| 35 |
trust_remote_code=True,
|
| 36 |
).to("cuda")
|
|
@@ -40,7 +40,7 @@ SAII-CLDM:
|
|
| 40 |
|
| 41 |
```python
|
| 42 |
pipe = DiffusionPipeline.from_pretrained(
|
| 43 |
-
"mally-2000/
|
| 44 |
custom_pipeline="pipeline_cldm",
|
| 45 |
torch_dtype=torch.float32,
|
| 46 |
trust_remote_code=True,
|
|
@@ -54,8 +54,8 @@ Diffusers remote loading.
|
|
| 54 |
## Run The Bundled Demo
|
| 55 |
|
| 56 |
```bash
|
| 57 |
-
git clone https://huggingface.co/mally-2000/
|
| 58 |
-
cd
|
| 59 |
pip install -r requirements.txt
|
| 60 |
|
| 61 |
python infer.py # SAII-LDDPM
|
|
|
|
| 29 |
from diffusers import DiffusionPipeline
|
| 30 |
|
| 31 |
pipe = DiffusionPipeline.from_pretrained(
|
| 32 |
+
"mally-2000/saii-cldm-synthetic",
|
| 33 |
+
custom_pipeline="mally-2000/saii-cldm-synthetic",
|
| 34 |
torch_dtype=torch.float32,
|
| 35 |
trust_remote_code=True,
|
| 36 |
).to("cuda")
|
|
|
|
| 40 |
|
| 41 |
```python
|
| 42 |
pipe = DiffusionPipeline.from_pretrained(
|
| 43 |
+
"mally-2000/saii-cldm-synthetic",
|
| 44 |
custom_pipeline="pipeline_cldm",
|
| 45 |
torch_dtype=torch.float32,
|
| 46 |
trust_remote_code=True,
|
|
|
|
| 54 |
## Run The Bundled Demo
|
| 55 |
|
| 56 |
```bash
|
| 57 |
+
git clone https://huggingface.co/mally-2000/saii-cldm-synthetic
|
| 58 |
+
cd saii-cldm-synthetic
|
| 59 |
pip install -r requirements.txt
|
| 60 |
|
| 61 |
python infer.py # SAII-LDDPM
|
codes/dataset.py
CHANGED
|
@@ -67,7 +67,7 @@ class SeismicBase:
|
|
| 67 |
|
| 68 |
|
| 69 |
class OverthrustTrueimpDataset(SeismicBase, Dataset):
|
| 70 |
-
"""Overthrust benchmark dataset used by
|
| 71 |
|
| 72 |
def __init__(
|
| 73 |
self,
|
|
|
|
| 67 |
|
| 68 |
|
| 69 |
class OverthrustTrueimpDataset(SeismicBase, Dataset):
|
| 70 |
+
"""Overthrust benchmark dataset used by SAII-CLDM synthetic evaluation."""
|
| 71 |
|
| 72 |
def __init__(
|
| 73 |
self,
|