Icon

Image Classification Application

This workflow reads images of cats and dogs, performs some simple preprocessing, and trains and evaluates a Convolutional Neural Network (CNN) that is able to distinguish cat images from dog images.

Reference:
F. Villaroel Ordenes & R. Silipo, “Machine learning for marketing on the KNIME Hub: The development of a live repository for marketing applications”, Journal of Business Research 137(1):393-410, DOI: 10.1016/j.jbusres.2021.08.036.

URL: Dataset on Kaggle https://www.kaggle.com/c/dogs-vs-cats/data

The Conda Environment Propagation node ensures the existence of a Conda environment with all packages. Another option is to setup your Python integration to use a Conda environment with all packages as described here: https://docs.knime.com/2021-12/deep_learning_installation_guide/index.html#dl_python_setup
Read and preprocess images
Train and evaluate the CNN
Define CNN architecture
Find the data here!https://www.kaggle.com/datasets/jonathanoheix/face-expression-recognition-dataset
Emotion detection or classification happy or sadThis workflow reads images of cats and dogs, performs some image preprocessing, and trains and evaluates a Convolutional Neural Network (CNN) for image classification.
Table Partitioner
Remove superfluous columns
Column Filter
Set up condaenvironment
Conda Environment Propagation
Save model
Keras Network Writer
Train the model for 10 epochs (Adam) withloss function binary crossentropy
Keras Network Learner
Apply the modelon new data
Keras Network Executor
Encode classeswith 0 and 1
Rule Engine
Evaluate the modelaccuracy
Scorer
output >= 0.5 Happyoutput < 0.5 Sad
Rule Engine
shape: 150, 150, 1
Keras Input Layer
pool size: 2x2
Keras Max Pooling 2D Layer
units: 64kernel size: 3x3activation: ReLU
Keras Convolution 2D Layer
filters: 32kernel size: 3x3activation: ReLU
Keras Convolution 2D Layer
Visualize results
pool size: 2x2
Keras Max Pooling 2D Layer
units: 64kernel size: 3x3activation: ReLU
Keras Convolution 2D Layer
pool size: 2x2
Keras Max Pooling 2D Layer
Keras Flatten Layer
dropout: 0.5
Keras Dropout Layer
units: 64activation: ReLU
Keras Dense Layer
units: 1activation: sigmoid
Keras Dense Layer
Path to training images
Paths to images
Resize to 150x150
Image Resizer
Read images
Image Reader (Table)
Normalize between 0..1
Image Calculator

Nodes

Extensions

Links