Icon

DL 03 - Finetune vgg16 Image Classification

<p>Fine-tune VGG16 (Python)<br><br>Instead of creating our own network architecture as in the previous workflow "Train simple CNN", in this workflow we use the pre-trained network architecture VGG16.<br><br>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.)<br><br>1. Workflow 01 Preprocessing<br>2. Workflow 02 Trains simple CNN<br><br>3. Workflow 03 Fine-tune VGG16 Python: Instead of creating our own network architecture as in the previous workflow "Train simple CNN", in this workflow we use the pre-trained network architecture VGG16. (https://keras.io/applications/#vgg16, released by VGG (http://www.robots.ox.ac.uk/~vgg/research/very_deep/) at Oxford under the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/).<br><br>In order to run the example, please make sure you have the following KNIME extensions installed:<br><br>- KNIME Deep Learning - Keras Integration (Labs)<br>- KNIME Image Processing (Community Contributions Trusted)<br>- KNIME Image Processing - Deep Learning Extension (Community Contributions Trusted)<br>- KNIME Image Processing - Python Extension (Community Contributions Trusted)<br><br>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.</p>

URL: 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/

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/overview


Adapted 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)

Python Conda environment propagation. Please read this article for more details:


KNIME and Python — Setting up and managing Conda environments
https://medium.com/p/2ac217792539


KNIME and Python — Setting up Deep Learning Environments for Keras and TensorFlow 

https://medium.com/p/4b66003858f4

Column Filter
>= 0.5 is dog (might have to adapt)
Rule Engine
../model/keras_fine_cats_dogs_model.zip
Model Reader
Activate Conda Environmentbased on Operating SystemWindows or macOSconfigure how to handle the environmentdefault = just check the names
knime_py_keras_win
Scorer
Fine-tune last convolutional.
DL Python Network Learner
Read in preprocessedimages from Workflow 01_Preprocessing../data/preprocessed_150x150_sample.table
Table Reader
Download network from Keras. Alternatively, you can also use the DL Keras Network Reader and load any other stored network.
DL Python Network Creator
../model/keras_fine_cats_dogs_model.zipSave for deployment
Model Writer
URL to File Path
Apply trained model on test data.
DL Python Network Executor
Replace layers.
DL Python Network Editor
Shuffle
Path to URI
Category to Number
Table Row to Variable
Table Partitioner
Unify RowIDs.
RowID
Joiner
../model/vgg16_weights_tf_dim_ordering_tf_kernels_notop.h5pre-trained weights
List Files/Folders
Merge Variables

Nodes

Extensions

Links