Icon

kn_​dl_​02_​train_​simple_​cnn

Train simple CNN

In this workflow we create a simple Convolutional Neural Network using the DL Python Network Creator. We train this network on our image data using the DL Python Network Learner and finally score it using the DL Python Network Executor. The DL Python Network Learner and Executor can be used to write custom training and execution code using Python.

Please note: The workflow series is heavily inspired by the great blog-post of François Chollet (see https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html.)

1. Workflow 01 Preprocess image data

2. Workflow 02 Train simple CNN: In this workflow we create a simple Convolutional Neural Network using the DL Python Network Creator. We train this network on our image data using the DL Python Network Learner and finally score it using the DL Python Network Executor. The DL Python Network Learner and Executor can be used to write custom training and execution code using Python.

3. Workflow 03 Fine-tune VGG16 Python
4. Workflow 04 Fine-tune VGG16

In order to run the example, please make sure you have the following KNIME extensions installed:

* KNIME Deep Learning - Keras Integration (Labs)
* KNIME Image Processing (Community Contributions Trusted)
* KNIME Image Processing - Deep Learning Extension (Community Contributions Trusted)
* KNIME Image Processing - Python Extension (Community Contributions Trusted)
* KNIME Streaming Execution (Labs)

You also need a local Python installation that includes Keras. Please refer to https://www.knime.com/deeplearning#keras for installation recommendations and further information.


KNIME Deep Learning - Classify Cats and Dogs In this series of workflows we want to demonstrate how to solve an image classification problem using KNIME Deep Learning - Keras integration.We want to train a model to distinguish cats and dogs on images. Data from:https://www.kaggle.com/c/dogs-vs-cats/overviewAdapted from:Keras - Cats vs. Dogs (christian.birkhold)https://hub.knime.com/knime/spaces/Examples/latest/04_Analytics/14_Deep_Learning/02_Keras/04_Cats_and_Dogs~gEkDg2tB3SliwDgo/ In order to run the example, please make sure you have the following KNIME extensions installed:https://docs.knime.com/latest/analytics_platform_installation_guide/index.html#_installing_extensions_and_integrations* KNIME Deep Learning - Keras Integration (Labs)* KNIME Image Processing (Community Contributions Trusted)* KNIME Image Processing - Deep Learning Extension (Community Contributions Trusted)* KNIME Image Processing - Python Extension (Community Contributions Trusted)* KNIME Streaming Execution (Labs) keras.conda.environmentknime_py_keras_macos=> for MacOS environmentTrain classification layer.Apply trainedmodelwith Keras.Create simple CNN.Partition the datainto training andtest set.Unify RowIDs.Turn probabilitiesto class labels.Turn 'Cat' into 0 and 'Dog' into 1.Read in preprocessedimages from kn_dl_01_preprocess_image_data.../data/preprocessed_150x150_sample.table../model/keras_cats_dogs_model.zipSave for deployment../model/keras_cats_dogs_model.zipkeras.conda.environmentknime_py_keras_win=> for Windows environmentknime_py_keras_macos DL PythonNetwork Learner DL Python NetworkExecutor DL PythonNetwork Creator Partitioning RowID Rule Engine Rule Engine Table Reader Model Writer Joiner Scorer Model Reader knime_py_keras_win KNIME Deep Learning - Classify Cats and Dogs In this series of workflows we want to demonstrate how to solve an image classification problem using KNIME Deep Learning - Keras integration.We want to train a model to distinguish cats and dogs on images. Data from:https://www.kaggle.com/c/dogs-vs-cats/overviewAdapted from:Keras - Cats vs. Dogs (christian.birkhold)https://hub.knime.com/knime/spaces/Examples/latest/04_Analytics/14_Deep_Learning/02_Keras/04_Cats_and_Dogs~gEkDg2tB3SliwDgo/ In order to run the example, please make sure you have the following KNIME extensions installed:https://docs.knime.com/latest/analytics_platform_installation_guide/index.html#_installing_extensions_and_integrations* KNIME Deep Learning - Keras Integration (Labs)* KNIME Image Processing (Community Contributions Trusted)* KNIME Image Processing - Deep Learning Extension (Community Contributions Trusted)* KNIME Image Processing - Python Extension (Community Contributions Trusted)* KNIME Streaming Execution (Labs) keras.conda.environmentknime_py_keras_macos=> for MacOS environmentTrain classification layer.Apply trainedmodelwith Keras.Create simple CNN.Partition the datainto training andtest set.Unify RowIDs.Turn probabilitiesto class labels.Turn 'Cat' into 0 and 'Dog' into 1.Read in preprocessedimages from kn_dl_01_preprocess_image_data.../data/preprocessed_150x150_sample.table../model/keras_cats_dogs_model.zipSave for deployment../model/keras_cats_dogs_model.zipkeras.conda.environmentknime_py_keras_win=> for Windows environmentknime_py_keras_macos DL PythonNetwork Learner DL Python NetworkExecutor DL PythonNetwork Creator Partitioning RowID Rule Engine Rule Engine Table Reader Model Writer Joiner Scorer Model Reader knime_py_keras_win

Nodes

Extensions

Links