Skip to content

Order of operations for ROI: upsample vs threshold #32

@brettviren

Description

@brettviren

Intro

We are presented with a choice in the order of operations in how we apply DNNROI output.

The operations:

  1. Threshold DNNROI output to convert from real-value to Boolean-value to form the ROI mask.

  2. Apply the ROI mask to zero out samples outside ROIs and to rebaseline waveform fragments inside ROIs.

  3. Upsample from the "rebin-4" basis to the original sample period (eg 2MHz).

We are free to change different ordering of these three operations. The problem to solve is which order is "best". Ultimately we may need to simply try different orders and evaluate but we can say some things a'priroi.

Threshold-Apply-Upsample

We apply the threshold to form ROIs and then apply them in the downsampled basis, then upsample the rebaselined image.

Cons:

  • fewer ROI-edge samples for rebasline (per unit time)
  • must downsample Gauss

Pros:

  • no concern of ringing because no upsampled DNNROI image.

Upsample-Threshold-Apply

We upsample DNNROI image prior to thresholding and application.

Cons:

  • Upsampling DNNROI via FFT method may lead to ringing which may impact values near the threshold.

Pros:

  • More precise ROIs as not forced to be integer-multiple-4 in size.
  • Rebaseline in the upsampled basis gives more ROI-edge samples (per unit time).
  • Gauss is never downsampled

Threshold-Upsample-Apply

We threshold the downsampled DNNROI image, then upsample and apply.

Cons:

  • Results in sample-mod-4 aligned ROIs of integer-multiple-4 sizes (less precise)

Pros:

  • Upsample the ROIs in interval space avoids any ringing
  • Rebaseline in upsampled basis gives more ROI-edge samples (per unit time).
  • Gauss is never downsampled

Comments

Avoiding any downsampling of Gauss avoids a potential statistical problem in
using the signals. If a down/up sample cycle is applied to Gauss, it leaves the
result with a strong, local correlation between samples. In particular, a naive
RMS calculation on these signals will by wrong by a factor of 4 as there are 4x
fewer degrees of freedom than naively apparent.

This makes me prefer the last two options.

These two are then a trade-off between better ROI precision and potential
ringing. If there is no ringing, or there is but it does not impact results,
then Upsample-Threshold-Apply is a clear winner.

If ringing would cause a problem then Threshold-Upsample-Apply would be a
safe fallback. OSP is close to this scheme. It perhaps provides a good first
try.

This ticket

To close this ticket, someone would produce studies to demonstrate which choice is best. Until then, it can serve to remind us of this lurking issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions