BirdNET-Analyzer icon indicating copy to clipboard operation
BirdNET-Analyzer copied to clipboard

Clarification on the --model_save_mode (“replace” and “append”) Functions for Transfer Learning

Open bjh03205 opened this issue 2 months ago • 1 comments

Hello, First of all, thank you very much for your hard work in developing and maintaining such an excellent model.

I have a question regarding the --model_save_mode function. I would like to use this feature for transfer learning to improve the performance of my custom model. As far as I understand, there are two modes available:

replace – This mode seems to retain the characteristics of the previously trained model (for example, a model trained on thousands of bird species) and uses those features when training the custom model.

append – This mode appears to connect or extend the previously trained model (e.g., a model trained on thousands of bird species) to the new custom model, as if adding new knowledge to the existing model.

However, I believe these approaches might differ somewhat from the conventional transfer learning methods. Could you please clarify the exact difference between the “replace” and “append” functions in terms of how the model weights and learned features are handled internally?

Finally, i would like to know where the pre-trained model used in the “append” mode is stored or referenced within the training process.

If I have two custom models that I have trained myself, would it be possible to apply the “replace” and “append” functions between those two models in the future?

Thank you very much for your time and assistance. I sincerely appreciate your efforts in advancing this work and for helping the community understand these details more clearly.

bjh03205 avatar Oct 10 '25 11:10 bjh03205

@bjh03205

I have a question regarding the --model_save_mode function. I would like to use this feature for transfer learning to improve the performance of my custom model.

In BirdNET Analyzer, training can only use the original BirdNET model for transfer learning.

Regardless of --model_save_mode , training uses the "Embedding Model" for transfer learning. This is BirdNET without its classifier head. Its outputs are embeddings - a vector that encapsulates what BirdNET has learned about the significant features of spectrogram images.

When you train a new model, a new classifier head is added to the Embedding Model, this classifier takes the embeddings output from the Embedding Model as its input. During training, only the weights of the new classifier are updated, the weights of the Embedding model are frozen.

The model save options differ in this way:

Replace: Saves the Embeddings Model with the new classifier head attached. The outputs are predictions for your new classes. Append: Also saves the Embeddings Model with a new classifier head, only this classifier head is the new classifier head appended to the original classifier head from BirdNET, so you have outputs predicting all the BirdNET classes as well as your new ones.

Mattk70 avatar Oct 10 '25 15:10 Mattk70