3
$\begingroup$

What would be a beginner-friendly algorithm (in python) to classify bird song syllables that can vary in duration by two orders of magnitude, and which SNR is not that good?

I have a growing database of sound snippets containing bird song syllables. I have calculated "simple" acoustic parameters so far (peak frequency, min-max frequency, duration etc.) and I was hoping to also assign a syllable "type". I have looked at different things but got very confused with the many options... Any help would be welcome!

$\endgroup$
2
  • $\begingroup$ Hi - interesting question. "Two orders of magnitude" seems to be a challenging part of your question. So, for example, ranging from 0.1 seconds to 10 seconds? The longer recordings are really individual syllables, or are they maybe much longer sequences? I'm wondering whether you really want to classify the whole of the longest recordings into just one label each. $\endgroup$
    – Dan Stowell
    Commented Nov 26 at 9:54
  • $\begingroup$ Hi, thanks for your reply, yes the duration of the syllables vary from 7 to ~500 milliseconds. The long syllables are actual unique syllables (like a very long trill for example) but maybe we can label all trills the same I guess? $\endgroup$
    – lframond
    Commented Nov 27 at 13:33

2 Answers 2

3
$\begingroup$

By beginner-friendly, I'm assuming you mean straightforward to implement and get up and running with results using existing libraries. For better or worse, this is a bit different in my mind to having an underlying concept that is mathematically accessible and understandable to beginners (who may wish to try to implement it from scratch). Apologies if I've got this wrong.

To this end, I would suggest exploring decision trees and random forest classifier. These algorithms (and others with similar syntax) are in the Scikit-learn Python library. There is online documentation, and numerous online tutorials for applying these methods targeting all levels of understanding. For example:

$\endgroup$
2
  • $\begingroup$ Oh great, thanks! what about unsupervised classification methods? $\endgroup$
    – lframond
    Commented Nov 17 at 6:44
  • $\begingroup$ A bit of a stretch answer with my limited experience with unsupervised classification methods: I've found non-linear multi-dimensional scaling useful to cluster features measured from small data (n=10^4). T-SNE may also be used to cluster spectrograms directly (see for example Jamie Macaulay's SoundSort: wildlabs.net/discussion/…). UMAP is another similar concept with a different underlying implementation. And of course transformers are all the rage these days (e.g. arxiv.org/html/2406.01253v1) so maybe worth checking out animal2vec etc. $\endgroup$
    – Brian Miller
    Commented Nov 18 at 1:57
2
$\begingroup$

Since the duration of your syllables are highly variable (from 7 to ~500 milliseconds), and low SNR, I would suggest reducing the spectrogram representation down to just a spectrum representation for each audio clip -- i.e. reducing the time-frequency representation down to just frequency, by taking the mean or the sum across time.

I wouldn't normally recommend this, but the short durations and variable durations may make it a difficult task, and perhaps the spectrum alone is relatively robust and informative.

The spectrum would give you, for example, 512 magnitude values (one for each frequency bin) which you can then treat as "features" in the same way as your simple acoustic parameters. A random forest algorithm (try scikit-learn or XGBoost) might be able to handle these features well, and also to combine them with your simple features.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.