runONNXAdditionalTraining

fun runONNXAdditionalTraining(modelType: ONNXModels.CV<out OnnxInferenceModel>, resizeTo: Pair<Int, Int> = Pair(224, 224))

This examples demonstrates the transfer learning concept on the Image Recognition model:

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

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

  • ONNX frozen model is used as a preprocessing stage via onnx stage of the Image Preprocessing DSL.

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

  • Model is re-trained on dogsCatsDatasetPath dataset.

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.