Skip to content

DOC: Add vignette with segmenting algorithm from Ghaffari Devos 2023 + IR metrics #56

Closed

Description

@NickleDave

In the attached paper from FA2023, @houtan-ghaffari and Devos use a segmentation algorithm with the following steps. Would be nice to add that algorithm to facilitate reproducibility

Ghaffari and Devos - 2023 - CONSISTENT BIRDSONG SYLLABLE SEGMENTATION USING DE.pdf

Activity

  1. added
    ENH: enhancement
    Segmentation
    on Sep 21, 2023
  2. houtan-ghaffari commented on Sep 22, 2023

    @houtan-ghaffari

    Hello,

    Thank you very much for your work and for sharing the datasets that we used in our work. The purpose of that thresholding algorithm was only to showcase how much expertise is required to design a thresholding segmentation algorithm, which in the end, still has flaws, as you also showed in the TweetyNet paper before us. However, I will soon put a complete jupyter notebook on my GitHub for research and educational purposes. It's not an easy-to-use software for everyone, just a functional code, but it should be a breeze for you to adapt it :). I'll post the link here after I made the repo.

    Kind regards,
    Houtan

  3. NickleDave commented on Sep 23, 2023

    @NickleDave
    ContributorAuthor

    Here's the repo:
    https://github.com/houtan-ghaffari/bird_syllable_segmentation

    🙌 thank you @houtan-ghaffari for sharing this

    The purpose of that thresholding algorithm was only to showcase how much expertise is required to design a thresholding segmentation algorithm, which in the end, still has flaws, as you also showed in the TweetyNet paper before us.

    Very understood.
    I think you're exactly right, that it's helpful to have a "baseline" thresholding algorithm.
    See also different algorithms here from @theresekoch in https://github.com/theresekoch/avn and discussion in #5

    I also have to admit as an imposter in signal processing I wasn't aware of using the Hilbert transform to get the envelope. So I'm kind of thinking out loud about how we could provide functionality to "build" a segmenter that specifies each of the steps (get envelope, smooth, threshold, clean up). Something like a scikit-learn pipeline or set of PyTorch transforms, but just for segmentation.

    I'm in the middle of adding an implementation of information retrieval metrics (precision, recall, F1) here:
    https://github.com/vocalpy/vocalpy/tree/add-segment-metrics-fix-%2354
    We'll want a vignette that shows how to use those metrics, I can include your simple baseline and refs/links to the paper + repo in that

  4. houtan-ghaffari commented on Sep 25, 2023

    @houtan-ghaffari

    Thank you very much!
    I'm new to Bioacoustics and lack the expertise in many required areas. However, I experienced that using spectral power is the best automated way to segment the syllables when using thresholding algorithms. Taking the spectrogram, taking the mean (or max) along the frequency axis to get an envelope, and setting the threshold as the mean value of the whole envelope. Of course, I'm talking only about professionally recorded songs like the ones you published, without severe noise and environmental interference.

    We are working on large-scale and fully automated annotation methods to alleviate the annotation difficulties, but we are not there to publish anything. I hope to be able to share better methods with the community shortly, and they might be of interest to your software. Thank you again for your datasets and work!

  5. theresekoch commented on Sep 25, 2023

    @theresekoch

    I'm in the middle of adding an implementation of information retrieval metrics (precision, recall, F1) here: https://github.com/vocalpy/vocalpy/tree/add-segment-metrics-fix-%2354 We'll want a vignette that shows how to use those metrics, I can include your simple baseline and refs/links to the paper + repo in that

    Hi David and Houtan! Congratulations on the paper, Houtan! It seems like a really interesting segmentation approach. I don't have much to add to this convo except to say that AVN includes a metrics class in the segmentation module which can be used to get the precision, recall and F1 score for segmentation. I'm not sure that it's the most efficient code, but it does the job and might be a helpful reference as you add segmentation metrics to vocalpy, David. Let me know if you have any questions about it or if there is anything I can do to help out!

  6. changed the title [-]ENH: Add segmenting algorithm from Ghaffari Devos 2023[/-] [+]DOC: Add vignette with segmenting algorithm from Ghaffari Devos 2023 + IR metrics[/+] on Sep 28, 2023
  7. self-assigned this
    on Sep 28, 2023
  8. added
    DOC: documentation
    and removed
    ENH: enhancement
    on Sep 28, 2023
  9. NickleDave commented on Sep 28, 2023

    @NickleDave
    ContributorAuthor

    Thank you very much!
    I'm new to Bioacoustics and lack the expertise in many required areas. However, I experienced that using spectral power is the best automated way to segment the syllables when using thresholding algorithms. Taking the spectrogram, taking the mean (or max) along the frequency axis to get an envelope, and setting the threshold as the mean value of the whole envelope. Of course, I'm talking only about professionally recorded songs like the ones you published, without severe noise and environmental interference.

    Thank you @houtan-ghaffari, that's helpful to know.

    We are working on large-scale and fully automated annotation methods to alleviate the annotation difficulties, but we are not there to publish anything. I hope to be able to share better methods with the community shortly, and they might be of interest to your software. Thank you again for your datasets and work!

    Please feel free to also share your FA2023 paper and any future work in our forum here:
    https://forum.vocalpy.org/

    I have changed this issue to be a documentation issue--we need to add an example to our docs of using IR metrics like precision and recall that I just added in #57. I will be sure to reference your paper because I think your approach of dynamically choosing the mean as a threshold is fairly common, although AFAIK this hasn't been documented in the lit anywhere.

  10. NickleDave commented on Sep 28, 2023

    @NickleDave
    ContributorAuthor

    I don't have much to add to this convo except to say that AVN includes a metrics class in the segmentation module which can be used to get the precision, recall and F1 score for segmentation. I'm not sure that it's the most efficient code, but it does the job and might be a helpful reference as you add segmentation metrics to vocalpy, David. Let me know if you have any questions about it or if there is anything I can do to help out!

    Thank you @theresekoch -- Mostly I just want people to know about your work.

    I did add these metrics in #57, you can see all the gory details of the different implementations I tried in all the commits in that branch 😭 (if for some reason you want to)
    Basically after I tried to roll my own vectorized version, I started with what's in mir_eval, which seems like it would be fairly efficient but doesn't choose hits based on how close the estimated boundary is to the reference. So I used a more expensive approach that lets us do that.

    Would love to hear feedback in whatever way is convenient for you.

  11. NickleDave commented on May 23, 2024

    @NickleDave
    ContributorAuthor

    Added this vignette in #133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

DOC: documentationSegmentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions