Skip to content

Add U-Net project for seismic data interpolation and reconstruction - #1

Draft
babyyein with Copilot wants to merge 2 commits into
mainfrom
copilot/find-unet-project-seismic-data
Draft

Add U-Net project for seismic data interpolation and reconstruction#1
babyyein with Copilot wants to merge 2 commits into
mainfrom
copilot/find-unet-project-seismic-data

Conversation

Copilot AI commented May 6, 2026

Copy link
Copy Markdown

Implements a complete PyTorch U-Net pipeline for reconstructing missing traces in 2-D seismic sections from scratch on an otherwise empty repository.

Architecture

  • unet_model.py — Standard encoder-decoder U-Net with skip connections. 2-channel input (masked data + binary acquisition mask); 1-channel output (reconstructed section).
  • dataset.pySeismicDataset supporting .npy and SEG-Y inputs, random/regular subsampling masks, patch extraction, and per-section normalisation.
  • utils.pyReconstructionLoss (weighted L1 + MSE with configurable up-weighting on missing-trace locations), SNR/PSNR metrics, checkpoint helpers, visualisation.
  • train.py — AdamW + cosine LR schedule training loop. Bundles a synthetic seismic data generator (dipping plane-wave events) so the pipeline runs end-to-end without real data.
  • predict.py — Inference script with arbitrary-size input handling (reflect-pad → infer → crop), per-sample SNR/PSNR reporting, and optional side-by-side comparison figures.

Quick usage

# Zero-setup demo — generates synthetic data automatically
python train.py --epochs 50 --batch_size 8

# Train on real data
python train.py --train_data data/train.npy --val_data data/val.npy --missing_ratio 0.5

# Reconstruct
python predict.py --checkpoint outputs/best_model.pth --input data/incomplete.npy --output data/reconstructed.npy --plot

Tests

38 unit tests in tests/test_seismic_unet.py covering model shapes, gradient flow, mask generators, dataset I/O, loss behaviour, metrics, and padding round-trips.

Copilot AI changed the title [WIP] Find U-Net project for seismic data interpolation and reconstruction Add U-Net project for seismic data interpolation and reconstruction May 6, 2026
Copilot AI requested a review from babyyein May 6, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants