buzzdetect is a machine learning based python tool for automated biacoustic surveys of honey bees. buzzdetect is capable of processing arbitrarily large audio files of virtually any type and producing second-by-second annotations of the sounds identified in the files. It outputs results as CSV files for easy transfer into other data processing software.
The accuracy of buzzdetect varies between models. Our current best model has a true positive rate for honey bees of ~87% within the test set of the training data, but we are still addressing issues with false-positives when the model encounters sounds outside of its training set.
The speed of buzzdetect varies between models and the machine running the computation. Per-process performance is roughly 20x–40x realtime. An average laptop with a solid state hard drive processing on 8 logical CPUs will probably process an hour of audio in about 15 seconds.
The models that buzzdetect applies to data are still rapidly evolving. We will publicly host a selection of models that we believe to be production-ready, as well as performance metrics to aid in the interpretation of their results.
buzzdetect is based on the machine learning strategy of transfer learning. In brief, this means we do not feed our bespoke models audio data directly, but instead preprocess the data using an existing audio classification model. This allows us to create a highly performant model on a relatively small dataset. The first model extracts relevant features from the audio data and represents them in a lower-dimensional space called the "embedding space." Our models are trained on those smaller and more information-dense embeddings.
Currently, we are training our models on embeddings from the Google Tensorflow model YAMNet.
Full documentation here.
conda env create -f environment.yml -p ./environment
You are now ready to run your first analysis!
Full documentation here.
./audio_in
directory. Place the audio you want to analyze in this directory.
./audio_in
directory. You can have them stored in any structure you like. buzzdetect will clone the input directory structure to the output folder. For example, the results of the audio file ./audio_in/visitation_experiment/block 1/recorder4.wav
would be written to ./models/[model used in analysis]/output/visitation_experiment/block 1/recorder4_buzzdetect.csv
conda activate ./environment
python buzzdetect.py analyze --modelname [model to use]
--cpus
option with the number of CPU cores you want to employ./output
subdirectory of the model's directory.Full documentation here.
You may want to train a model for your specific environment. For example, you may find that one of your sites is producing false positives due to a source of sound not in the buzzdetect training set. Or else, you may want to tinker with the existing metadata and train a new model on the modified result. You could even train a buzzdetect model on an entirely new dataset to try to monitor different sounds such as frog calls, traffic density, or weather events (though we can't promise performance for these tasks). Following is a bare-bones guide to training a new model:
./training/audio
and the metadata in ./training/metadata
./training/weights
conda activate ./environment
python buzzdetect.py train --modelname [any model name you like] --metadata [name of your metadata csv]
--weights [name of your weights csv]
./models/[your chosen model name]