Package: birdsong-recognition-dataset
This project is no longer actively maintained,
although the code uses core, stable functions from Python, Numpy, and SciPy, so it is likely to work.
There is an updated version of the core code in this package in crowsetta:https://crowsetta.readthedocs.ioIf you need to load the annotations from this dataset, please use that instead.birdsong-recognition-datasetPython utility for working with data from the following repository:Koumura, T. (2016). BirdsongRecognition (Version 1). figshare.https://doi.org/10.6084/m9.figshare.3470165.v1https://figshare.com/articles/BirdsongRecognition/3470165The repository contains .wav files of Bengalese finch song from ten birds
and annotation for the songs in .xml files.This repository provides a great resource, and was used to benchmark
a sliding window-based neural network for segmenting and labeling
the elements of birdsong, as described in the following paper:Koumura, Takuya, and Kazuo Okanoya."Automatic recognition of element classes and boundaries in the birdsong
with variable sequences."PloS one 11.7 (2016): e0159188.https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0159188The code for the network can be found here:https://github.com/cycentum/birdsong-recognitionThe original code was released under the GNU license:https://github.com/cycentum/birdsong-recognition/blob/master/LICENSEThebirdsongrecmodule is used with thecrowsettapackage to make the repository a dataset available in thehybrid-vocal-classifierandvaklibraries.Installationwithpip$pipinstallbirdsong-recognition-datasetwithconda$condainstallbirdsong-recognition-dataset-cconda-forgeUsageThe main thing thatbirdsongrecgives you is easy access to the
annotation, without having to deal with the .xml file format.This format is schematized inthis XML schema file,
adaptedfrom the originalunder theGNU license(file is unchanged except for formatting for readability).To access the annotation in theAnnotation.xmlfiles for each bird,
use theparse_xmlfunction.>>>frombirdsongrecimportparse_xml>>>seq_list=parse_xml(xml_file='./Bird0/Annotation.xml',concat_seqs_into_songs=False)>>>seq_list[0]Sequencefrom0.wavwithposition32000andlength43168>>>seq_list[0].syls[:3][Syllablelabeled0atposition2240withlength2688,Syllablelabeled0atposition8256withlength2784,Syllablelabeled0atposition14944withlength2816]Notice that this package preserves the abstraction of the original code,
where syllables and sequences of syllables are represented as objects.
This can be helpful if you are trying to replicate functionality from
that code.Importantly, each song is broken up into a number of "sequences".You can set the flagconcat_seqs_into_songstoTrueif you wantparse_xmlto concatenate sequences by song (.wav file), so that each
Sequence is actually all the sequences from one song.If you are using the annotation to work with the dataset for
some other purpose, you may find it more convenient to work with some
other format. For that, please check out thecrowsettatool, that helps with building datasets of annotated vocalizations
in a way that's annotation-format agnostic.Thebirdsongrecpackage also provides a convenience function to load the annotation
for an individual song,load_song_annot. This is basically a wrapper
aroundparse_xmlthat filters out the songs you don't want.>>>frombirdsongrecimportload_song_annot>>>wav1=load_song_annot(wav_file='1.wav')>>>print(wav1)Sequencefrom1.wavwithposition32000andlength214176Getting HelpPlease feel free to raise an issue here:https://github.com/NickleDave/birdsong-recognition-dataset/issuesLicenseBSD License.CitationIf you use this package, please cite the DOI: