Skip to main content

Comparing multi-modal data fusion methods. Don't be silly, use Fusilli!

Project description

drawing

fusilli

🌸 Don't be silly, use fusilli for all your multi-modal data fusion needs! 🌸

DOI Twitter Documentation Status version downloads

Introduction

🍝 Welcome to fusilli 🍝, the ultimate library for multi-modal data fusion in machine learning! Fusilli makes data fusion a piece of cake, providing a platform to combine different data types efficiently.

What can Fusilli do?

Multi-modal data fusion is the combination of different types of data (or data modalities) in the pursuit of some common goal. For example, using both blood test results and neuroimaging to predict whether somebody will develop a disease. There are many different ways to combine data modalities, and the aim of fusilli is to provide a platform for anybody to compare different methods against each other.

Fusilli is built using PyTorch Lightning and PyTorch Geometric, and it currently supports the following scenarios:

  1. Tabular-Tabular Fusion: Combine two different types of tabular data.
  2. Tabular-Image Fusion: Combine one type of tabular data with image data (2D or 3D).

Fusilli supports a range of prediction tasks, including regression, binary classification, and multi-class classification. Note that it does not currently support tasks such as clustering or segmentation.

Want to know more? Here is a link to Read the Docs

Installation

To savour the flavours of fusilli, you can install it using pip:

pip install fusilli

Quick Start

Here is a quick example of how to use fusilli to train a regression model and plot the real values vs. predicted values.

    from fusilli.data import prepare_fusion_data
    from fusilli.train import train_and_save_models
    from fusilli.eval import RealsVsPreds
    import matplotlib.pyplot as plt

    # Import the example fusion model
    from fusilli.fusionmodels.tabularfusion.example_model import ExampleModel

    data_paths = {
        "tabular1": "path/to/tabular_1.csv",  
        "tabular2": "path/to/tabular_2.csv",  
        "image": "path/to/image_file.pt",  
    }

    output_paths = {
        "checkpoints": "path/to/checkpoints/dir",  
        "losses": "path/to/losses/dir",  
        "figures": "path/to/figures/dir",  
    }

    # Get the data ready
    data_module = prepare_fusion_data(prediction_task="regression",
                                      fusion_model=ExampleModel,
                                      data_paths=data_paths,
                                      output_paths=output_paths)

    # Train the model
    trained_model = train_and_save_models(data_module=data_module,
                                          fusion_model=ExampleModel)

    # Evaluate the model by plotting the real values vs. predicted values
    RealsVsPreds_figure = RealsVsPreds.from_final_val_data(trained_model)
    plt.show()

How to Cite

Florence Townend, Patrick J. Roddy, & Philipp Goebl. (2024). florencejt/fusilli: Fusilli v1.1.0 (v1.1.0). Zenodo. https://doi.org/10.5281/zenodo.10463697

Contribute!

If you've developed new fusion methods or want to enhance Fusilli, check our contribution guidelines to get started. PyTorch templates and contribution guidance our in the contributions documentation.

Authors and Acknowledgements

fusilli is authored by Florence J Townend, James Chapman, and James H Cole.

Florence J Townend is supported by a UCL UKRI Centre for Doctoral Training in AI-enabled Healthcare studentship ( EP/S021612/1).

License

This project is licensed under AGPLv3. See the LICENSE file for details.

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

fusilli-1.2.3.tar.gz (18.0 MB view details)

Uploaded Source

Built Distribution

fusilli-1.2.3-py3-none-any.whl (125.9 kB view details)

Uploaded Python 3

File details

Details for the file fusilli-1.2.3.tar.gz.

File metadata

  • Download URL: fusilli-1.2.3.tar.gz
  • Upload date:
  • Size: 18.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for fusilli-1.2.3.tar.gz
Algorithm Hash digest
SHA256 3e58a918b613505e6ed09e6f904d519480e35e047ccbdf6398f3760fd192d523
MD5 81618630a41bd93f4bc1301c5e53f304
BLAKE2b-256 c6df2eebf036dab743b08e71886cc555bb29841641c45992f2a6fe3c08176068

See more details on using hashes here.

File details

Details for the file fusilli-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: fusilli-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 125.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for fusilli-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 613279aafc1f02ae3c38643ef6d51bccd92f8787a3f13b8b60f2b0016e4c547e
MD5 e565e9eda277b7ff052bc2950febafef
BLAKE2b-256 39e1ef067f48f5d27e2f02001858061ee9c481877bacb95e29cd8a2e770c58b4

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