{"id":15700136,"url":"https://github.com/dermatologist/kedro-multimodal","last_synced_at":"2025-05-12T13:10:10.652Z","repository":{"id":88879577,"uuid":"497136621","full_name":"dermatologist/kedro-multimodal","owner":"dermatologist","description":"Template for multi-modal machine learning in healthcare using Kedro. Combine reports, tabular data and images using various fusion methods.","archived":false,"fork":false,"pushed_at":"2025-03-21T03:40:05.000Z","size":202,"stargazers_count":21,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-05-12T13:09:31.480Z","etag":null,"topics":["healthcare","jupyter","kedro","kubeflow","machine-learning","medical","multi-modal","pipeline","vertex-ai"],"latest_commit_sha":null,"homepage":"https://nuchange.ca","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dermatologist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-27T20:58:31.000Z","updated_at":"2025-05-12T09:13:23.000Z","dependencies_parsed_at":"2023-06-12T23:15:41.017Z","dependency_job_id":null,"html_url":"https://github.com/dermatologist/kedro-multimodal","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermatologist%2Fkedro-multimodal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermatologist%2Fkedro-multimodal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermatologist%2Fkedro-multimodal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dermatologist%2Fkedro-multimodal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dermatologist","download_url":"https://codeload.github.com/dermatologist/kedro-multimodal/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745161,"owners_count":21957317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["healthcare","jupyter","kedro","kubeflow","machine-learning","medical","multi-modal","pipeline","vertex-ai"],"created_at":"2024-10-03T19:46:18.589Z","updated_at":"2025-05-12T13:10:10.616Z","avatar_url":"https://github.com/dermatologist.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kedro TF Multimodal :hammer: [Template]\n\n[![kedro-tf-text](https://github.com/dermatologist/kedro-multimodal/blob/develop/notes/multimodal.drawio.svg)](https://github.com/dermatologist/kedro-multimodal/blob/develop/notes/multimodal.drawio.svg)\n\nThis is a *template* for **multi-modal machine learning in healthcare** using the [Kedro](https://kedro.org/) framework. You can combine reports, tabular data and images using various fusion methods (Early \u0026 Late fusion. Few other fusion methods and graph data are WIP). This project works with [Kubeflow](https://www.kubeflow.org) and [Vertex AI](https://cloud.google.com/vertex-ai).\n\n## Usage\n* If you are not familiar with the [Kedro](https://kedro.org/) platform, please read the [overview](#overview) :point_down:\n* This is a template repository. Generate a new repository with the same directory structure by clicking the **Use this template** button :point_up: and use it as a [Kedro project.](https://kedro.readthedocs.io/en/stable/get_started/new_project.html)\n* Install dependenties ``` pip install -r src/requirements.lock ```\n* Refer [default pipeline](src/kedro_tf_multimodal/pipelines/train/pipeline.py) for usage examples.\n* Refer [sample data](/data/01_raw/) for data format. Prefix model datasets with appropriate model type from image_ , text_ , tabular_ , and bert_. (text_ is for CNN text models)\n* Refer [catalogue](conf/base/catalog.yml) for inputs and outputs\n* See [parameters](conf/base/parameters/train.yml) that can be tweaked.\n\nThe required pipelines are in [requirements.txt](src/requirements.txt). More details on the components are in their respective repositories :point_down: (PR welcome. Read CONTRIBUTING.md in the repositories)\n* [kedro-tf-image](https://github.com/dermatologist/kedro-tf-image)\n* [kedro-tf-text](https://github.com/dermatologist/kedro-tf-text)\n* [kedro-tf-utils](https://github.com/dermatologist/kedro-tf-utils)\n* [kedro-dicom](https://github.com/dermatologist/kedro-dicom) (*optional*) for processing DICOM images\n* [kedro-graph](https://github.com/dermatologist/kedro-graph) (*optional*) for creating [DGL](https://www.dgl.ai/) graph from multimodal data.\n* [fhiry](https://github.com/dermatologist/fhiry) (*optional*) for flattening [FHIR resources](https://www.hl7.org/fhir/overview.html).\n\n## Features\n* Use any number/combination of data types.\n* Export trained fusion model for TF serving with an additional signatureDef for receiving image as b64 string. Use SERVING: path/to/save/model in [parameters](conf/base/parameters/train.yml). Also see [serving.py](serving.py) (example serving REST client) and [serving.sh](serving.sh) (start TF serving docker container with the model).\n* Experimental support for **BERT** models with some [caveats.](#troubleshoot)\n\n## You can visualize pipelines using [kedro-viz](https://github.com/kedro-org/kedro-viz). See the default pipeline below.\n* Please note that you can build any multi-modal architecture!\n\n\n[![kedro-viz](https://github.com/dermatologist/kedro-multimodal/blob/develop/notes/kedro-viz.png)](https://github.com/dermatologist/kedro-multimodal/blob/develop/notes/kedro-viz.png)\n\n## Give us a star ⭐️\nIf you find this project useful, give us a star. It helps others discover the project.\n\n\n## Troubleshoot\n* Downloaded BERT models will not copy vocab.txt in assets folder to the newly created fusion model. This has to be manually copied.\n* The class_num in TfModelWeights must be equal to to NCLASSES during training. Otherwise it throws an error:  Tensorflow estimator ValueError: logits and labels must have the same shape ((?, 1) vs (?,))\n* *import tensorflow_text as text* is required in pipeline_registry to avoid this error: Op type not registered 'CaseFoldUTF8' in binary running on xxxx\n* Inconsistent NCLASSES leads to **ValueError: `logits` and `labels` must have the same shape, received ((None, 3) vs (None, 1)).**\n\n## Contributors\n\n* [Bell Eapen](https://nuchange.ca) | [![Twitter Follow](https://img.shields.io/twitter/follow/beapen?style=social)](https://twitter.com/beapen)\n\n## Overview\n\nThis is your new Kedro project, which was generated using `Kedro 0.18.4`.\n\nTake a look at the [Kedro documentation](https://kedro.readthedocs.io) to get started.\n\n## Rules and guidelines\n\nIn order to get the best out of the template:\n\n* Don't remove any lines from the `.gitignore` file we provide\n* Make sure your results can be reproduced by following a [data engineering convention](https://kedro.readthedocs.io/en/stable/faq/faq.html#what-is-data-engineering-convention)\n* Don't commit data to your repository\n* Don't commit any credentials or your local configuration to your repository. Keep all your credentials and local configuration in `conf/local/`\n\n## How to install dependencies\n\nDeclare any dependencies in `src/requirements.txt` for `pip` installation and `src/environment.yml` for `conda` installation.\n\nTo install them, run:\n\n```\npip install -r src/requirements.txt\n```\n\n## How to run your Kedro pipeline\n\nYou can run your Kedro project with:\n\n```\nkedro run\n```\n\n## How to test your Kedro project\n\nHave a look at the file `src/tests/test_run.py` for instructions on how to write your tests. You can run your tests as follows:\n\n```\nkedro test\n```\n\nTo configure the coverage threshold, go to the `.coveragerc` file.\n\n## Project dependencies\n\nTo generate or update the dependency requirements for your project:\n\n```\nkedro build-reqs\n```\n\nThis will `pip-compile` the contents of `src/requirements.txt` into a new file `src/requirements.lock`. You can see the output of the resolution by opening `src/requirements.lock`.\n\nAfter this, if you'd like to update your project requirements, please update `src/requirements.txt` and re-run `kedro build-reqs`.\n\n[Further information about project dependencies](https://kedro.readthedocs.io/en/stable/kedro_project_setup/dependencies.html#project-specific-dependencies)\n\n## How to work with Kedro and notebooks\n\n\u003e Note: Using `kedro jupyter` or `kedro ipython` to run your notebook provides these variables in scope: `context`, `catalog`, and `startup_error`.\n\u003e\n\u003e Jupyter, JupyterLab, and IPython are already included in the project requirements by default, so once you have run `pip install -r src/requirements.txt` you will not need to take any extra steps before you use them.\n\n### Jupyter\nTo use Jupyter notebooks in your Kedro project, you need to install Jupyter:\n\n```\npip install jupyter\n```\n\nAfter installing Jupyter, you can start a local notebook server:\n\n```\nkedro jupyter notebook\n```\n\n### JupyterLab\nTo use JupyterLab, you need to install it:\n\n```\npip install jupyterlab\n```\n\nYou can also start JupyterLab:\n\n```\nkedro jupyter lab\n```\n\n### IPython\nAnd if you want to run an IPython session:\n\n```\nkedro ipython\n```\n\n### How to convert notebook cells to nodes in a Kedro project\nYou can move notebook code over into a Kedro project structure using a mixture of [cell tagging](https://jupyter-notebook.readthedocs.io/en/stable/changelog.html#release-5-0-0) and Kedro CLI commands.\n\nBy adding the `node` tag to a cell and running the command below, the cell's source code will be copied over to a Python file within `src/\u003cpackage_name\u003e/nodes/`:\n\n```\nkedro jupyter convert \u003cfilepath_to_my_notebook\u003e\n```\n\u003e *Note:* The name of the Python file matches the name of the original notebook.\n\nAlternatively, you may want to transform all your notebooks in one go. Run the following command to convert all notebook files found in the project root directory and under any of its sub-folders:\n\n```\nkedro jupyter convert --all\n```\n\n### How to ignore notebook output cells in `git`\nTo automatically strip out all output cell contents before committing to `git`, you can run `kedro activate-nbstripout`. This will add a hook in `.git/config` which will run `nbstripout` before anything is committed to `git`.\n\n\u003e *Note:* Your output cells will be retained locally.\n\n## Package your Kedro project\n\n[Further information about building project documentation and packaging your project](https://kedro.readthedocs.io/en/stable/tutorial/package_a_project.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdermatologist%2Fkedro-multimodal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdermatologist%2Fkedro-multimodal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdermatologist%2Fkedro-multimodal/lists"}