Skip to main content

Integrate image and tabular data for deep learning

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

image_tabular-0.0.5.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

image_tabular-0.0.5-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file image_tabular-0.0.5.tar.gz.

File metadata

  • Download URL: image_tabular-0.0.5.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for image_tabular-0.0.5.tar.gz
Algorithm Hash digest
SHA256 1c28961fee05ed94cf218b2e70eb00258adddb1e0c391421da00278f3834c518
MD5 c2cf9d82082dca0ccfcb30d4e2addcd0
BLAKE2b-256 622daa06d876ebbbb03ea97f0d2c5497bccccc1d65d2e41151e6859bbe49be64

See more details on using hashes here.

File details

Details for the file image_tabular-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: image_tabular-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for image_tabular-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 377710c857c85e2d015889c4e900e94fb6f98b3443483c431d7fca4324d2c38f
MD5 fb9dd78dd48e92228351c903724507f0
BLAKE2b-256 4767c74e930241a4631241b644932c5c17daaa4178f96b437ce2ea881a65085d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page