mobilenetWithAdditionalTraining

fun mobilenetWithAdditionalTraining()

This examples demonstrates the transfer learning concept on MobileNet model:

  • Model configuration, model weights and labels are obtained from TFModelHub.

  • Weights are loaded from .h5 file, configuration is loaded from .json file.

  • All layers, excluding the last Dense, are added to the new Neural Network, its weights are frozen.

  • New Dense layers are added and initialized via defined initializers.

  • Model is re-trained on dogsCatsSmallDatasetPath dataset.

  • Special preprocessing (used in MobileNet during training on ImageNet dataset) is applied to images before prediction via Sharpen stage.

We use the Preprocessing DSL to describe the dataset generation pipeline. We demonstrate the workflow on the subset of Kaggle Cats vs Dogs binary classification dataset.