Icon

Mixing_DL_with_XGBoost

Mixing_DL_with_XGBoost
Annotations and comments
  • Mixing Deep Learning with XGBoost This workflow demonstrates how an XGBoost model (or any other machine learning model in KNIME) can be trained using the features extracted by a pretrained convolutional neural network. As a side note, the workflow also shows how these same features can be used to visualize an image dataset using the popular t-SNE algorithm. In order to run the workflow, you need to download the cat and dog dataset from Kaggle (https://www.kaggle.com/tongpython/cat-and-dog) and point the List Files node to the extracted directory. Note that you can also apply this approach to many other datasets consisting of natural images although you might have to slightly adjust the preprocessing.
  • Visualize in 2D with t-SNE
  • Acknowledgements: The provided data is the test set of the Cat and Dog dataset (https://www.kaggle.com/tongpython/cat-and-dog) hosted on kaggle.com and released under CC0 1.0 Public Domain (https://creativecommons.org/publicdomain/zero/1.0/) The pretrained network used in this exercise is MobileNet provided by Keras (https://keras.io/applications/#mobilenet)
  • Load and modify pretrained network
  • Train and evaluate shallow learner
  • Required Extensions: KNIME Labs Extensions: - KNIME Deep Learning - Keras Integration - KNIME Deep Learning - TensorFlow Integration - KNIME Statistics Nodes (Labs) - KNIME Streaming Execution (Beta) - KNIME XGBoost Integration KNIME Community Extensions - Image Processing and Analysis: - KNIME Image Processing - KNIME Image Processing - Deep Learning Extension
  • Load and prepare data
  • Investigate mistakes
  • color classes
  • Remove features
  • Load MobileNet from Keras
  • Split by '.'
  • Keep only Image and Name_Arr[0]
  • Rename Name_Arr[0] to Class
  • Extract the name
  • View incorrect classification
  • Convert to TensorFlow for speed
  • Point to directory of images
  • normalize pixel values to be in [-1, 1]
  • resize to (224, 224, 3)
  • Split train / validation 80 / 20
  • Wrong classifications
  • visualize embedding
  • Evaluate model accuracy
  • Exract feature vectors from images
  • Learn linear model on top of features
  • predict
  • Embed into 2D

Nodes

Extensions

Links