Skip to content

StefanKDS/Birds

Repository files navigation

Birds

This ML model learns to differentiate between bird species by means of mp3 recordings of the voices. The dataset are downloded from the website https://xeno-canto.org/.

What is what ?

main.py

The complete script to read the data, prepare it, create and fit the model.

DatasetEngine.py

Load and prepare the Dataset

helper_functions.py

Some small helpers

Models.py

Here you can find the different models like CNN or Dense model

Predictions.py

Make predictions with the prepared models

TensorboardView.py

Show the histories in Tensorboard

TextBox.py

Place for experiments

How to train the model

First you have to get and prepare the datasets. This can be done with the function 'download_bird_dataset'. As parameter you give him the name of the species in query form of the xeno API.

E.g.:
download_and_prepare_bird_dataset('northern%20cardinal', 5)
download_and_prepare_bird_dataset('Gaviidae', 5)

This can take a while...

Here you can see the way from the wavefile to the extracted features:

Alt text

This brings the data down to 1kb and garantues a fast model !

Now you can get the trainingdata with the function 'get_concat_dataframe'. As parameter you give him a list of the species you want him to learn.

E.g.:
train_df = get_concat_dataframe(['northern%20cardinal', 'Gaviidae'])

And then the magic starts.......

Here are the accuracy diagrams:

Alt text

How to make predictions

Man, it's so easy....

from tensorflow import keras
from DatasetEngine import perpare_mp3_for_prediction

model = keras.models.load_model('Auswertung/model')
data = perpare_mp3_for_prediction('Data/Gaviidae/mp3/120507-002lomB.mp3')

pred = model.predict(data)

That's all folks

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published