Cold Diffusion Model for Seismic Signal Denoising
July 2, 2026 ยท View on GitHub
Some Results
We apply diffusion models for denoising seismograms. Utilizing the STEAD Dataset, we demonstrate the distinct performance of various denoising models:
Example 1: Qualitative Picker Analysis
Example 2: Qualitative Amplitude Analysis
Some Possible Applications
Enhance Automatic Picking Performance
Dataset
Distribution of STEAD Dataset
Data Loader Usage
To create a DataLoader, use the following parameters:
feature_columns: List of feature columns (e.g.,'Z_channel', 'E_channel', 'N_channel').target_columns: List of target columns (e.g.,'p_arrival_sample', 's_arrival_sample').trace_name_column: Column containing trace names.
The DataLoader has three elements:
- Index for mapping to trace names.
- Normalized or non-normalized channels (
'Z_channel', 'E_channel', 'N_channel') based on the normalize flag. 'p_arrival_sample'(P-wave arrival) and's_arrival_sample'(S-wave arrival) for target columns.
This DataLoader setup allows us to train our model using the prepared data.
Example of how to use utils.create_data_loader:
import pandas as pd
import utils.utils_diff as u
df_path = your_path + 'df_train.csv'
df_path_noise = your_path + 'df_noise_train.csv'
df = pd.read_pickle(df_path)
df_noise = pd.read_pickle(df_path_noise)
feature_columns = ['Z_channel', 'E_channel', 'N_channel']
target_columns = ['p_arrival_sample', 's_arrival_sample']
trace_name_column = 'trace_name'
train_loader, val_loader, test_loader, index_to_trace_name = u.create_data_loader(df, feature_columns, target_columns, trace_name_column, batch_size= ... , shuffle=True)
train_noise_loader, val_noise_loader, test_noise_loader,index_to_trace_name = u.create_data_loader(df_noise, feature_columns, target_columns, trace_name_column,is_noise = True, batch_size= ..., shuffle=True)
How to Start Training
To replicate the results and start training the model, follow these steps:
-
Setup the Environment:
- Ensure you have conda installed. If not, download and install it from Conda's official website.
- Download the
environment.yamlfile from this repository.
conda env create -f environment.yaml conda activate cold-diffusion -
Download the Dataset:
- Download the STEAD dataset from Zenodo.
-
Run the Training Script:
- Ensure the dataset is placed in the correct directory as expected by the script.
- Execute the training script with the following command:
python train.py --dataset_path path/to/STEAD_dataset -
Monitor Training:
- Training logs and checkpoints will be saved in the specified directory. Monitor the training process using these logs.
Configuration Details
To start training, you need to configure the arguments in the config_parser.py file. Here are some important settings:
- Set
training=Truefor training mode ortraining=Falsefor testing mode. - Specify the model path using
path_modelif you want to use a pre-trained model for testing. - Set the channel type using
channel_type=0for E,channel_type=1for N, andchannel_type=2for Z. - During training, you can set
tuning=Trueto enable hyperparameter tuning, ortuning=Falseto disable it. - Adjust the
Tparameter to set the number of timesteps for the model.
Denoising ObsPy Waveforms
The denoise_obspy_waveform folder contains a script to denoise seismic waveforms loaded via ObsPy. Usage:
- Download the checkpoint from Zenodo and place it in the appropriate directory.
- Load your ObsPy waveform and run the denoising script.
- Adjust the T parameter in the script to control the number of denoising steps (fewer steps may work better for high SNR signals).
Related Paper
- Seismic Signal Denoising and Decomposition Using Deep Neural Networks
- Cold Diffusion: Inverting Arbitrary Image Transforms Without Noise
- Seismic Signal Denoising and Decomposition Using Deep Neural Networks
Citation
If you use this code or dataset in your research, please cite our paper:
@article{trappolini2024cold,
title={Cold diffusion model for seismic denoising},
author={Trappolini, Daniele and Laurenti, Laura and Poggiali, Giulio and Tinti, Elisa and Galasso, Fabio and Michelini, Alberto and Marone, Chris},
journal={Journal of Geophysical Research: Machine Learning and Computation},
volume={1},
number={2},
pages={e2024JH000179},
year={2024},
publisher={Wiley Online Library}
}