Skip to content

A tool to convert tabular data into images, in order to be used by CNNs Inspired by the "DeepInsight" paper.

License

Notifications You must be signed in to change notification settings

nicomignoni/tab2img

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tab2Img: from tabular data to images

A tool to convert tabular data into images for CNN. Inspired by the DeepInsight paper.

Installation

pip install tab2img

Background

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 equation with equation samples and equation features, we are required to find a function equation, where equation.

There are numerous ways to choose equation. In this implementation, the features are organized with respect to the correlation vector equation, where equation is the target vector. Given equation and equation as

the vector equation express the Pearson correlation coefficient*

where

At this point equation is sorted from the greatest to the smallest, generating the vector of indices

Eventually, the final tensor equation is

The function that maps equation to the right row and column equation of equation is

In this case, being equation a sample, the coefficient is implemented as

Example

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)

About

A tool to convert tabular data into images, in order to be used by CNNs Inspired by the "DeepInsight" paper.

Topics

Resources

License

Stars

Watchers

Forks

Languages