Giter Club home page Giter Club logo

image_tabular's Introduction

image_tabular

Integrate image and tabular data for deep learning.

Install

pip install image_tabular

How to use

This library utilizes fastai and pytorch to integrate image and tabular data for deep learning and train a joint model using the integrated data.

title

Image source: N. Gessert, M. Nielsen and M. Shaikh et al. / MethodsX 7 (2020) 100864
  1. Please first prepare image and tabular data separately as fastai LabelLists, and then integrate them using the get_imagetabdatasets function as below:
integrate_train, integrate_valid, integrate_test = get_imagetabdatasets(image_data, tab_data)
  1. The train, validation, and optional test datasets can then be combined in a DataBunch:
db = DataBunch.create(integrate_train, integrate_valid, integrate_test,
                      path=data_path, bs=bs)
  1. Next, we create a joint model to train on both image and tabular data simultaneously:
integrate_model = CNNTabularModel(cnn_model,
                                  tabular_model,
                                  layers = [cnn_out_sz + tab_out_sz, 32],
                                  ps=0.2,
                                  out_sz=2).to(device)
  1. Finally, we pack everying into a fastai learner and train the joint model:
learn = Learner(db, integrate_model)
learn.fit_one_cycle(10, 1e-4)

The following notebook puts everything together and shows how to use the library for the SIIM-ISIC Melanoma Classification competition on Kaggle:

SIIM-ISIC Integrated Model

image_tabular's People

Contributors

naity avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.