ODELIA Classification Baseline Model
For a comprehensive description of the model and its intended use, please refer to our paper: Read the paper
Setup
To run the code, we recommend creating a Python virtual environment.
Using venv
# Create a virtual environment
python -m venv venv
# Activate the environment
# On Linux/Mac:
source venv/bin/activate
# On Windows:
# venv\Scripts\activate
# Install dependencies
pip install torch torchvision numpy huggingface_hub torchio matplotlib transformers einops x_transformers
Using Conda
# Create a conda environment
conda create -n odelia_hf python=3.10
conda activate odelia_hf
# Install dependencies
pip install torch torchvision numpy huggingface_hub torchio matplotlib transformers einops x_transformers
Get Probabilities and Attention
To use this model, first download the required files from this repository:
from huggingface_hub import hf_hub_download
# Download model files to local directory
hf_hub_download(repo_id="ODELIA-AI/MST", filename="models.py", local_dir="./")
hf_hub_download(repo_id="ODELIA-AI/MST", filename="predict_attention.py", local_dir="./")
Then execute predict_attention.py --path_img path/to/Sub_1.nii.gz to get probabilities and attention maps.