Skip to content

ENH: Add vocalypy.segment module #40

Closed

Description

@NickleDave
  • As discussed in discussion: segmenting algorithms #5
  • I think we want to have an explicit module vocalpy.segment that further contains methods grouped by the schema of Kemp et al 2000: energy-based methods, metric-based methods, and model-based methods
  • Energy-based methods can be further split into audio and spectrogram
    • audio will be: amplitude threshold + audio method from Koe
      • endpoint_detection, AKA Rabiner-Sambur algorithm
      • whatever evsonganaly uses -- is there a name? amplitude_threshold
      • Harma
    • spectrogram will be:
  • We will want a segment.metrics module too; this should start out with precision and recall with a tolerance/collar parameter

Activity

  1. NickleDave commented on Aug 20, 2023

    @NickleDave
    ContributorAuthor

    The thing is that no schema for categorizing segmenting methods works perfectly, since people often use some sort of "hybrid" approach.

    I wonder if we could have a sklearn-like pipeline API where you build a segmenting pipeline, to allow this hybrid approach.
    I'm thinking of this block diagram from Lamel et al. 76 (Rabiner is one of the authors)
    Screenshot from 2023-08-20 16-54-45
    Here their "implicit" is what I think Kemp et al 2000 would call "model-based".

  2. NickleDave commented on Sep 3, 2023

    @NickleDave
    ContributorAuthor

    Note that we already did have vocalpy.signal.segment and I plan to use that module, just convert it into a sub-package in the code base

  3. added
    ENH: enhancement
    on Sep 12, 2023
  4. pinned this issue on Sep 12, 2023
  5. NickleDave commented on Sep 18, 2023

    @NickleDave
    ContributorAuthor

    Another follow up:

    • I wonder if we should group by the output of the segmenting algorithm, instead of or in addition to the method/model

    We basically have two possible outputs:

    1. line segments, as used in analyses of sequences
    2. bounding boxes, as typically used in bioacoustics applications like Passive Acoustic Monitoring

    At least internal to vocalpy, it feels like we should group the code into line_segment and bounding_box sub-packages. So you'd have vocalpy.segment.line_segment and vocalpy.segment.bounding_box. Then we should import all algorithms at the segment level for easy access, and to avoid the need to write
    voc.segment.segment.audio_amplitude or voc.segment.line_segment.audio_amplitude

    Those names are already pretty verbose even before you add the algorithm names to them, and they'd get even more verbose if you added another level of the hierarchy for method/model type.

    I also want to just call the sub-package segment for brevity but then this ends up duplicating the word segment (used as a verb) and the word segment (used as a noun).

    Ok, how about this:
    voc.segment.line.algorithm_name, and voc.segment.box.algorithm_name.
    Then the algorithm should either return a LineSegment or a Box; we will be fiercely pedantic geometers when we segment.
    I'm gonna go with this for now.

  6. unpinned this issue on Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ENH: enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions