Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Sanofi-Public/DDS-RoFormerMIL
https://github.com/Sanofi-Public/DDS-RoFormerMIL
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/Sanofi-Public/DDS-RoFormerMIL
- Owner: Sanofi-Public
- License: other
- Created: 2023-08-24T16:16:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-13T15:53:20.000Z (about 1 year ago)
- Last Synced: 2023-11-13T20:33:06.173Z (about 1 year ago)
- Language: Python
- Size: 47 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- top-pharma-fr - **Sanofi-Public/DDS-RoFormerMIL** - 11-13 15:53:20 | (Ranked by starred repositories)
README
# Code for RoFormer-MIL
MICCAI - MLMI 2023: "RoFormer for Position Aware Multiple Instance Learning in Whole Slide Image Classification"[Arxiv](https://arxiv.org/abs/2310.01924)
![alt text](imgs/Poster.png)
## Setup
```sh
source setup.sh
```To install `miniconda`, `torch==2.0` and other packages.
## Pre-processing
Data should be stored according to their classes```
└- data
|
|- Class 1
| |- Image1.svs
| |- Image2.svs
| └ ...
|
└- Class 2
|- Image1.svs
|- Image2.svs
└- ...
```Pre-processing can be run with
```sh
python scripts/preprocessing_pipeline.py
python scripts/new_create_splits.py
```- `scripts/preprocessing_pipeline.py` will run the CLAM preprocessing to tile the slides and extract resnet50 features. Data folder and some parameters can be set in `conf/preprocessing.yaml`.
- `scripts/new_create_splits.py` will run stratified train/test splitting. Parameters can be set in `conf/create_splits.yaml`.## Training
### Code relies on
[PyTorch Lightning](https://lightning.ai/docs/pytorch/stable/) - for boilerplate deep learning code/metrics
[Hydra](https://hydra.cc/docs/intro/) - for configuration files management
[xFormers](https://github.com/facebookresearch/xformers) - memory efficient attention
### Modeling code
- Model parameters can be set in `conf/model_dict.yaml`
- Training hyperparameters can be set in `conf/training.yaml`
- Modeling code is found in `romil/models````sh
python scripts/train.py
```
Will trigger a training run on the K folds, leveraging pytorch-lightning for boilerplate code, and mlflow for experiment tracking (easily configurable in `conf/training.yaml`:`training_args.trainer.logger`)## Reference
If you find our work useful in your research please consider citing our [paper]([https://www.nature.com/articles/s41551-020-00682-w](https://link.springer.com/chapter/10.1007/978-3-031-45676-3_44)):Pochet, E., Maroun, R., Trullo, R. RoFormer for Position Aware Multiple Instance Learning in Whole Slide Image Classification. Machine Learning in Medical Imaging. MLMI 2023.
```
@InProceedings{pochetroformer23,
author="Pochet, Etienne
and Maroun, Rami
and Trullo, Roger",
title="RoFormer for Position Aware Multiple Instance Learning in Whole Slide Image Classification",
booktitle="Machine Learning in Medical Imaging",
year="2024",
}
```