DAS Models

DAS features are experimental

The SeisBench DAS API is currently experimental and some features, such as more datasets and models, will be added in the future.

DASWaveformModelWrapper

class DASWaveformModelWrapper(model, component_strategy='clone', **kwargs)[source]

Bases: DASModel

This class is a wrapper to allow applying WaveformModels (trained for regular seismic data) to DAS datasets. The models are applied channel by channel.

Example usage:

base_model = PhaseNet.from_pretrained("instance")
model = DASWaveformModelWrapper(base_model)
Parameters:
  • model (WaveformModel) – The WaveformModel to apply to DAS data

  • component_strategy (str) – The strategy to transform the single-component DAS channels into three-component data for the model. Supports clone (provide same channel for each compoennt) and pad (provide channel as first component, zero-padding for second and third component).

property classify_callback: Type[DASAnnotateCallback]

Return the default callback for this model. For example, for picking models, this would be a DASPickingCallback. The class will then be instantiated and used to process the output of the annotate method. Constructor arguments will be extracted from the kwargs passed to classify.

property component_strategy
forward(x, argdict=None)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_patching_structure(data_shape, argdict)[source]

To enable dynamic window sizes, depending on the shape of the input record, this function can be overwritten. By default, returns the predefined patching structure. In addition, this function allows to overwrite the overlap dynamically.

The data_shape is provided for adaptive models. Note that the data shape can have float coordinates due to in-memory resampling of the data. The actual output shape can only be inferred once the patching structure has been defined, as the number of truncated samples depends on the patching structure. Therefore, models should be flexible towards the case of slightly smaller data shapes than the theoretical one.

Return type:

PatchingStructure

save(*args, **kwargs)[source]

This model does not provide a save function. Instead, save the underlying WaveformModel.

DeepSubDAS

class DeepSubDAS(deeplab_weights=None, deeplab_weights_backbone=None, deeplab_backbone='resnet101', remove_common_mode=False, transpose_for_model=False, **kwargs)[source]

Bases: DASModel

The DeepSubDAS model by Xiao et al. (2025).

The model supports loading pretrained weights for the underlying DeepLabV3 model. For available weights see the torchvision documentation at https://docs.pytorch.org/vision/main/models/deeplabv3.html. Note that this is different from the from_pretrained() method. While the former loads a generic segmentation model that might be a good starting point for training new models, the latter loads models specifically trained for seismic phase picking.

Parameters:
  • deeplab_weights (str | None) – The weights to use for the DeepLabV3 model.

  • deeplab_weights_backbone (str | None) – The weights to use for the DeepLabV3 backbone.

  • deeplab_backbone (str) – The DeepLabV3 backbone to use. Currently, supports resnet50` and resnet101.

  • remove_common_mode (bool) – If true, removes mean along the channel axis for each sample.

  • transpose_for_model (bool) – If true, transposes the input before passing it to the model. This is implemented for to ensure compatibility with the original model.

property classify_callback: Type[DASAnnotateCallback]

Return the default callback for this model. For example, for picking models, this would be a DASPickingCallback. The class will then be instantiated and used to process the output of the annotate method. Constructor arguments will be extracted from the kwargs passed to classify.

forward(x, logits=False, argdict=None)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_model_args()[source]

Obtain all model parameters for saving.

Returns:

Dictionary of all parameters for a model to store during saving.

Return type:

Dict

normalize_batch(x, eps=1e-10)[source]
Return type:

Tensor