skinstression

Perform skin stress-strain curve regression on SHG images using deep learning

https://github.com/siemdejong/skinstression

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary

Keywords

optuna pytorch regression skin
Last synced: 6 months ago · JSON representation ·

Repository

Perform skin stress-strain curve regression on SHG images using deep learning

Basic Info
  • Host: GitHub
  • Owner: siemdejong
  • License: gpl-3.0
  • Language: Jupyter Notebook
  • Default Branch: v2
  • Homepage:
  • Size: 148 MB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 5
  • Releases: 1
Topics
optuna pytorch regression skin
Created over 3 years ago · Last pushed about 2 years ago
Metadata Files
Readme License Citation

README.md

Skinstression

Skin stretch regression using deep learning or Skinstression is a deep learning framework to predict the stress-strain curve of skin tissue. A convolutional neural network is trained on second harmonic generation images of skin tissue, matched with stretch measurements as targets.

Training data is not made publicly available.

Quick start

A common CLI workflow includes: | Task | Terminal | |------|----------| | Login to wandb | wandb login | | Initializing a sweep | wandb sweep sweep.yaml | | Running a wandb sweep agent | wandb agent | | Training a model | python train.py | | Predicting using a model | python predict.py |

For logging to wandb, it is required to login to wandb.

NOTE: please take a look at train.py or predict.py when training or predicting. They contain settings you may need to change before launching scripts. Some settings are consumed by Pytorch Lightning (docs).

Training

Training with python train.py will make a tmp directory containing the splits. Subsequent runs will reuse the splits. Users can modify the splits. Users can modify training parameters in train.py.

Predicting

Predict with python predict.py, will make use of the tmp directory containing the splits, or make the splits if they don't exist yet. Data is read sequentially. If save_plots=True, plots are save to the tmp directory. Lines are color coded by slice index (which is not necessarily depth first, depending on the scanning protocol).

Hyperparameter optimization

Running hyperparameter optimization can be done with Wandb Sweep. First initialize the orchestrator with wandb sweep sweep.yaml. Then, on agent devices, run wandb agent <sweep id>, where the sweep id given at initialization should be given. Hyperparameter ranges can be configured with sweep.yaml.

Data

stacks.zarr

The SkinstressionDataset and SkinstressionDataModule rely on the iamges to be written to a zarr store. Every 3D image should be saved separately in a zarr store. This allows for easy migration to 3D models, which are currently not implemented, because they require a lot of GPU memory, not always available. Use notebooks/13-sj-tozarr.ipynb as a starting point to achieve conversion to Zarr.

params.csv

This is the target file. The first column indicates the sample. Subsequent columns indicate the target parameters.

sampletoperson.csv

File mapping samples (sample_id) to person identifiers (person_id).

curves/

This directory contains curves with <sample_id>.csv and has columns strain and stress, making up the stress-strain curves. params.csv was calculated using these curves.

Extension possibilities

Any user can contribute their own models and datasets by modifying skinstression/dataset.py or skinstression/model.py.

Installation

Do below steps in a python environment. Skinstression is tested with python 3.11.

Install pytorch for your system. See pytorch.org.

Clone this repository and install the needed dependencies. sh git clone https://github.com/siemdejong/skinstression cd skinstression pip install .

If you would like to make changes, install as editable with pip install -e ..

Contributing

Contributions are welcome.

  1. Create an issue.
  2. Fork this repository.
  3. Clone the fork.
  4. Make a new branch.
  5. Commit changes.
  6. Push the new branch to the fork.
  7. Make a pull request to this repository.

Owner

  • Name: Siem de Jong
  • Login: siemdejong
  • Kind: user
  • Company: University of Amsterdam

MSc student Biophysics and Biophotonics

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "de Jong"
  given-names: "Siem"
  orcid: "https://orcid.org/0000-0002-5200-4519"
title: "Skinstression"
version: 2.0.0
doi: 10.5281/zenodo.10454096
date-released: 2024-01-03
url: "https://github.com/siemdejong/skinstression"

GitHub Events

Total
Last Year