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.


The Conda Environment Propagation node ensures theexistence of a Conda environment with all packages.Another option is to setup your Python integration to usea Conda environment with all packages as describedhere: 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. shape: 150, 150, 1filters: 32kernel size: 3x3activation: ReLUpool size: 2x2units: 64kernel size: 3x3activation: ReLUpool size: 2x2units: 64activation: ReLU dropout: 0.5units: 1activation: sigmoidTrain the model for 10 epochs (Adam) withloss function binary crossentropyApply the modelon new dataoutput >= 0.5 Happyoutput < 0.5 SadEvaluate the modelaccuracyResize to 150x150Path to training imagesNormalize between 0..1Read imagesRemove superfluous columnsSave modelSet up condaenvironmentEncode classeswith 0 and 1units: 64kernel size: 3x3activation: ReLUpool size: 2x2Keras Input Layer Keras Convolution2D Layer Keras Max Pooling2D Layer Keras Convolution2D Layer Keras Max Pooling2D Layer Keras Flatten Layer Keras Dense Layer Keras Dropout Layer Keras Dense Layer Keras NetworkLearner Keras NetworkExecutor Rule Engine Scorer Image Resizer Paths to images Image Calculator Image Reader(Table) Column Filter Partitioning Keras NetworkWriter Conda EnvironmentPropagation Rule Engine Visualize results Keras Convolution2D Layer Keras Max Pooling2D Layer The Conda Environment Propagation node ensures theexistence of a Conda environment with all packages.Another option is to setup your Python integration to usea Conda environment with all packages as describedhere: 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. shape: 150, 150, 1filters: 32kernel size: 3x3activation: ReLUpool size: 2x2units: 64kernel size: 3x3activation: ReLUpool size: 2x2units: 64activation: ReLU dropout: 0.5units: 1activation: sigmoidTrain the model for 10 epochs (Adam) withloss function binary crossentropyApply the modelon new dataoutput >= 0.5 Happyoutput < 0.5 SadEvaluate the modelaccuracyResize to 150x150Path to training imagesNormalize between 0..1Read imagesRemove superfluous columnsSave modelSet up condaenvironmentEncode classeswith 0 and 1units: 64kernel size: 3x3activation: ReLUpool size: 2x2Keras Input Layer Keras Convolution2D Layer Keras Max Pooling2D Layer Keras Convolution2D Layer Keras Max Pooling2D Layer Keras Flatten Layer Keras Dense Layer Keras Dropout Layer Keras Dense Layer Keras NetworkLearner Keras NetworkExecutor Rule Engine Scorer Image Resizer Paths to images Image Calculator Image Reader(Table) Column Filter Partitioning Keras NetworkWriter Conda EnvironmentPropagation Rule Engine Visualize results Keras Convolution2D Layer Keras Max Pooling2D Layer

Nodes

Extensions

Links