kahst / BirdNET-Analyzer

BirdNET analyzer for scientific audio data processing.
Other
765 stars 137 forks source link

Transfer Learning #274

Open safahafiz opened 4 months ago

safahafiz commented 4 months ago

Can I build a classifier on top of the existing one for all the species using new data. In other words, I want to add new species to the list that BirdNET already has. However, the custom classifier only tests the input with the species in the custom classifier.

Is it possible to do transfer learning to train BirdNET?

Josef-Haupt commented 4 months ago

Hey, you can indeed extend BirdNET with your own classes. If you're using the GUI check the "append" option under Model Save Mode. In the CLI the option is called --model_save_mode in train.py. This mode outputs the BirdNET classification and concats them to your custom classifier, so you get one long vector, with your new classes at the end. Does that answer your question?

nishantnnb commented 4 months ago

Hi @Josef-Haupt ,

Tried to create a custom model with "Append" option in the GUI installed in windows with exe file.
Observations: 1) Firstly, while training the model, error is received while saving. Only tflite model gets saved but the labels file not saved. 2) After may attempts, it saved the tflite model along with labels file. In the labels file, newly added birds are listed at the end of the file. 3) But while using this custom model (by choosing customer classifier), it always gives error. 4) Tried all above things after reinstalling Birdnet Analyzer with freshly downloaded exe file as well. Same issues. 5) If I use "replace", I can use the custom model successfully hence seems that there is no issue with input files/folders. But of course then it gives me results for the only the birds I trained for.

Regards, Nishant.

Josef-Haupt commented 4 months ago

Thanks, I can reproduce the error.

Josef-Haupt commented 4 months ago

Is what I thought, but turns out, I forgot to select a file in the "Single file" tab. Training works for me, as well as selecting the custom classifier (both replace and append). If this error still occurs for you, could you please detail all your steps?

nishantnnb commented 4 months ago

Is what I thought, but turns out, I forgot to select a file in the "Single file" tab. Training works for me, as well as selecting the custom classifier (both replace and append). If this error still occurs for you, could you please detail all your steps?

Hello @Josef-Haupt , recorded a quick video of the screen to demonstrate the issue I am facing while using a model trained with 'Append' option. Kindly have a look. Thank you.

https://github.com/kahst/BirdNET-Analyzer/assets/72615789/ba169c03-9309-409e-aca1-dfa107f3df33