Code Monkey home page Code Monkey logo

florencejt / fusilli Goto Github PK

View Code? Open in Web Editor NEW
150.0 5.0 13.0 1011.02 MB

A Python package housing a collection of deep-learning multi-modal data fusion method pipelines! From data loading, to training, to evaluation - fusilli's got you covered ๐ŸŒธ

Home Page: https://fusilli.readthedocs.io/en/latest/

License: GNU Affero General Public License v3.0

Python 100.00%
attention-mechanism cnn data-fusion graph-neural-network imaging machine-learning multi-view multi-view-learning multimodal multimodal-deep-learning

fusilli's Introduction

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.

fusilli's People

Contributors

florencejt avatar paddyroddy avatar phiphi0815 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fusilli's Issues

Extending and generalising to other modalities

Discussed in #20

Originally posted by mdkozlowski January 14, 2024
Hi,
For my usecases I'm interested in some additional modalities that aren't currently supported in fusili, such as graph-structured data (as inputs) and text data. Fusion of multiple modalities on a graph input (such as tabular + textual features, per-node) is specifically interesting. On the other hand, my usecase doesn't make use of images or image models.

If it makes sense and depending on interest, I'd be happy to contribute these kinds of models to the project.

At the moment the dataloaders and data classes are quite specific to combinations of tabular & images. Do you see any value in making the the data classes more generic? For example, removing dependencies on image_downsample_size in TrainTestDataModule, and using naming in the project like embedding or dense_representation - agnostic to the embedding modality.

IR and RGB image Fusion

I want to do a thermal and RGB image fusion to feed to another network, can I do it with this library? Kindly provide any examples

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.