Icon

DL 01 - Preprocess Images Cats and Dogs

<p>Preprocess image data<br><br>In this workflow we pre-process the image data, which we will use throughout the following example workflows.<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 Preprocess image data: In this workflow we pre-process the image data, which we will use throughout the following example workflows. You can download the data from https://www.kaggle.com/c/dogs-vs-cats/data (file train.zip) and unzip it to a desired location. <br><br>2. Workflow 02 Train simple CNN<br>3. Workflow 03 Fine-tune VGG16 Python<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>- KNIME Streaming Execution (Labs)<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: Kaggle - Dogs vs. Cats https://www.kaggle.com/c/dogs-vs-cats/overview
URL: Keras Cats & Dogs https://hub.knime.com/knime/spaces/Examples/latest/04_Analytics/14_Deep_Learning/02_Keras/04_Cats_and_Dogs~gEkDg2tB3SliwDgo/
URL: KNIME and Python — Setting up and managing Conda environments https://medium.com/@mlxl/knime-and-python-setting-up-and-managing-conda-environments-2ac217792539

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/

Read, normalize and resize the input images.
Load and preprocess images (Local Files)
Sort bypath name.
Sorter
../data/train/ from the downloaded file "dogs-vs-cats.zip" from Kaggle extract all the files from the "train.zip" to: to ../data/train/
List Files/Folders
Path to URI
We only work with 6.000 randomly selected images. You can adjust the number as desired.
Row Sampler
../data/preprocessed_150x150.table
Table Writer
10% just to get the setup running
Row Sampler
First 12500 rows are cats, rest dogs.$File name$ LIKE "*cat*" => "Cat"$File name$ LIKE "*dog*" => "Dog"
Rule Engine
URL to File Path
../data/preprocessed_150x150_sample.table
Table Writer

Nodes

Extensions

Links