Icon

Mixing_​DL_​with_​XGBoost

Mixing Deep Learning with XGBoost

This workflow shows how to train an XGBoost based image classifier that uses a pretrained convolutional neural network to extract features from images.
It also contains shows how the extracted features can be used to visualize an image dataset with t-SNE.

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 IntegrationKNIME Community Extensions - Image Processing and Analysis:- KNIME Image Processing- KNIME Image Processing - Deep Learning Extension Visualize in 2D with t-SNE Load and prepare data Train and evaluate shallow learner Investigate mistakes Load and modify pretrained network 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.comand released under CC0 1.0 Public Domain(https://creativecommons.org/publicdomain/zero/1.0/)The pretrained network used in this exercise is MobileNetprovided by Keras (https://keras.io/applications/#mobilenet) Mixing Deep Learning with XGBoostThis workflow demonstrates how an XGBoost model (or any other machine learning model in KNIME) can be trained using the features extracted by a pretrainedconvolutional 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 nodeto 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. Point to directory of imagesSplittrain / validation80 / 20Ctrl + double clickto openLoad MobileNetfrom KerasConvert to TensorFlowfor speedExract feature vectorsfrom imagesLearn linearmodel on topof featurespredictEvaluate modelaccuracyEmbed into2DcolorclassesWrong classificationsView incorrectclassificationRemovefeaturesvisualizeembedding List Files Partitioning Extract Class Load andPreprocess Images DL PythonNetwork Creator Keras Global AveragePooling 2D Layer Keras to TensorFlowNetwork Converter TensorFlowNetwork Executor XGBoost LinearEnsemble Learner XGBoost Predictor Scorer t-SNE (L. Jonsson) Color Manager Rule-basedRow Filter Image Viewer Column Filter Scatter Plot 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 IntegrationKNIME Community Extensions - Image Processing and Analysis:- KNIME Image Processing- KNIME Image Processing - Deep Learning Extension Visualize in 2D with t-SNE Load and prepare data Train and evaluate shallow learner Investigate mistakes Load and modify pretrained network 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.comand released under CC0 1.0 Public Domain(https://creativecommons.org/publicdomain/zero/1.0/)The pretrained network used in this exercise is MobileNetprovided by Keras (https://keras.io/applications/#mobilenet) Mixing Deep Learning with XGBoostThis workflow demonstrates how an XGBoost model (or any other machine learning model in KNIME) can be trained using the features extracted by a pretrainedconvolutional 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 nodeto 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. Point to directory of imagesSplittrain / validation80 / 20Ctrl + double clickto openLoad MobileNetfrom KerasConvert to TensorFlowfor speedExract feature vectorsfrom imagesLearn linearmodel on topof featurespredictEvaluate modelaccuracyEmbed into2DcolorclassesWrong classificationsView incorrectclassificationRemovefeaturesvisualizeembedding List Files Partitioning Extract Class Load andPreprocess Images DL PythonNetwork Creator Keras Global AveragePooling 2D Layer Keras to TensorFlowNetwork Converter TensorFlowNetwork Executor XGBoost LinearEnsemble Learner XGBoost Predictor Scorer t-SNE (L. Jonsson) Color Manager Rule-basedRow Filter Image Viewer Column Filter Scatter Plot

Nodes

Extensions

Links