maikherbig / AIDeveloper

GUI-based software for training, evaluating and applying deep neural nets for image classification
BSD 2-Clause "Simplified" License
109 stars 20 forks source link

Adding classes to model for Transfer learning on dataset with more classes #40

Closed maikherbig closed 3 years ago

maikherbig commented 3 years ago

Currently, it is not possible to load a model, which was trained on e.g. 10 classes and continue fitting using another dataset with more (e.g. 11) classes. AID tells that I could have less classes, but not more. By adjusting just the last layer of the loaded model it should be possible to customize any model to get a desired amount of output nodes (classes). Many thanks for reporting to https://twitter.com/KraterMartin

maikherbig commented 3 years ago

There is now a new function in aid_dl, called model_add_classes which takes a model and customizes the last dense layer to have as many nodes as desired. This function is used in main script to adjust loaded models to cope with data of many classes.