Icon

kn_​dl_​01_​preprocess_​image_​data

Preprocess image data

In this workflow we pre-process the image data, which we will use throughout the following example workflows.


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: 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.

2. Workflow 02 Train simple CNN
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/ Read, normalize and resizethe input images.First 12500 rowsare cats, rest dogs.$File name$ LIKE "*cat*" =>"Cat"$File name$ LIKE "*dog*" =>"Dog"We only work with 6.000 randomly selected images.You can adjust the numberas desired.Sort bypath name.../data/train/from the downloaded file"dogs-vs-cats.zip"from Kaggle extract all the files fromthe "train.zip" to:to ../data/train/../data/preprocessed_150x150.table10%just to get thesetup running../data/preprocessed_150x150_sample.table Load and preprocessimages (Local Files) Rule Engine Row Sampling Sorter List Files/Folders Path to URI URL to File Path Table Writer Row Sampling Table Writer 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/ Read, normalize and resizethe input images.First 12500 rowsare cats, rest dogs.$File name$ LIKE "*cat*" =>"Cat"$File name$ LIKE "*dog*" =>"Dog"We only work with 6.000 randomly selected images.You can adjust the numberas desired.Sort bypath name.../data/train/from the downloaded file"dogs-vs-cats.zip"from Kaggle extract all the files fromthe "train.zip" to:to ../data/train/../data/preprocessed_150x150.table10%just to get thesetup running../data/preprocessed_150x150_sample.table Load and preprocessimages (Local Files) Rule Engine Row Sampling Sorter List Files/Folders Path to URI URL to File Path Table Writer Row Sampling Table Writer

Nodes

Extensions

Links