A tool to convert tabular data into images for CNN. Inspired by the DeepInsight paper.
pip install tab2img
In the paper "DeepInsight: A methodology to transform a non-image data to an image for convolution neural network architecture" the autors propose a method to convert tabular data into images, in order to utilize the power of convolutional neural network (CNN) for non-image structured data.
The Figure illustrates the main idea: given a training dataset
There are numerous ways to choose
Vector
In this case, being
At this point,
Eventually, the final tensor
The mapping from
from sklearn.datasets import fetch_covtype
from tab2img.converter import Tab2Img
dataset = fetch_covtype()
train = dataset.data
target = dataset.target
model = Tab2Img()
images = model.fit_transform(train, target)