Git Product home page Git Product logo

physgnn's Introduction

PhysGNN

@article{salehi2021physgnn,
  title={PhysGNN: A Physics-Driven Graph Neural Network Based Model for Predicting Soft Tissue Deformation in Image-Guided Neurosurgery},\
  author={Salehi, Yasmin and Giannacopoulos, Dennis},\
  journal={arXiv preprint arXiv:2109.04352},\ 
  year={2021}
}

Data Generation

  1. Please download:

    1. FEBio 2.9.1 @ https://febio.org/febio/febio-downloads/

    2. export_fig-master @ https://www.mathworks.com/matlabcentral/fileexchange/23629-export_fig

    3. GIBBON @ https://www.gibboncode.org/Installation/

    and place all the downloaded files in the "code" folder.

  2. Please make the following installations:

    1. pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.12.0+cu113.html
    2. pip install tensorboardX
    3. pip install networkx
  3. Please run data_generator_1.m to generate Dataset 1, and data_generator_2.m to generate Dataset 2. Formatted data will be saved in dataset_1 and dataset_2 folders.

  4. Run dataset_full.py to generate the preprocessed data.

  5. Run pg_dataset.py to create 1/11 of dataset1/dataset2 and pickle them. Each run requires 22GB of RAM. Dataset 1 and Dataset 2 use up 16.79 GB of RAM each.

PhysGNN Training

  1. Select the desired configuration from training in main.py and simply run the code.

Reproducing Results

  1. Select the desired configuration from reproduce.py and simply run the code.

To run the code on Colab

(Requirement: A Google Colab Pro Account)

Training PhysGNN on Colab

  1. Upload dataset_1 and dataset_2 folders to your Google Drive.
  2. Upload Dataset_Generation.ipynb to your Google Drive.
  3. Set up the paths on your Colab notebook.
  4. Run all the cells consecutively. Ensure proper selection of the dataset to be configured as a pytorch geometric dataset and its corresponding pickle name.
  5. After one pytorch geometric dataset is created, restart the runtime to clear the RAM.
  6. Each section of Dataset 1 and Dataset 2 takes 1 hour and 15 minutes to be generated.
  7. After successful generation of the datasets, upload PhysGNN.ipynb to your Google Drive.
  8. Run all the cells in a consecutive order.
    1. In the cell "Final Run for Training" select the dataset you wish to use
    2. In the "Final Run" section select the configuration you want to train.

To reproduce the results on Colab

  1. Run all the cells until "Final Run for Training". Run the "Reproducing the Results" cell instead.
  2. Select the Dataset and the model you wish to reproduce their results in the "Final Run" under the Reproducibility cell.
  3. Results generated from the pickled configurations can be saved by setting the save parameter to 1.
  4. Setting mean_mag_results to 1 generates the mean Euclidean errors reported (Table 4).
  5. Setting max_error_results to 1 generates the max error results reported (Table 5).

physgnn's People

Contributors

yasminsalehi avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

kokbob usecapilot

physgnn's Issues

The code

In the data_generator_1.m,the code v=v+p in the block of Define boundary condition node sets is wrong!The woring is Matrix dimensions must be consistent.Can you tell me the resason? thank you very much!

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.