[!TIP] 🚀 Contribute Your Foundation Model! We welcome submissions of new pathology foundation models to our benchmark. 👉 Submit Your Model Here — Help advance the field by adding your model to PrePATH!
PrePATH is a comprehensive preprocessing toolkit for whole slide images (WSI), built upon CLAM and ASlide.
openslide-tools (system dependency)The following instructions demonstrate installation for the GPFM model. For other foundation models, please refer to their respective repositories for environment-specific requirements.
git clone https://github.com/birkhoffkiki/PrePATH.git
cd PrePATH
conda create --name gpfm python=3.10
conda activate gpfm
pip install -r requirements/gpfm.txt
cd models/ckpts/
wget https://github.com/birkhoffkiki/GPFM/releases/download/ckpt/GPFM.pth
Notes:
requirements/gpfm.txt.Extract coordinates of foreground patches from whole slide images:
# Configure variables in the script before execution
bash scripts/get_coors/example.sh
Extract patch-level features using the selected foundation model:
# Refer to the script for detailed configuration options
bash scripts/extract_feature/one_gpu_example.sh
If you have multiple GPUs, you can use the exe.sh script for parallel processing:
bash scripts/extract_feature/exe.sh
This is useful for pretraining or if you meet the Corrupt JPEG data error during feature extraction.
This may happen for kfb or sdpc images due to limited support in multiprocessing.
# Refer to the script for detailed configuration options
bash scripts/crop_image/example_packed2h5.sh
If you have packed patches into HDF5 files in Step 3, you can extract features from them directly:
# Refer to the script for detailed configuration options
bash scripts/extract_feature/one_gpu_from_h5_example.sh
Extract coordinates of foreground patches from whole slide images:
# Configure variables in the script before execution
bash scripts/get_coors/example.sh
Extract patches based on the coordinates:
We strongly recommend packing all patches using the HDF5 method for efficient storage and retrieval.
# Refer to the script for detailed configuration options
bash scripts/crop_image/example_packed2h5.sh
Note: Each foundation model requires its corresponding Python environment to be properly configured.
| Model | Identifier | Reference |
|---|---|---|
| ResNet50 | resnet50 | Standard ImageNet pretrained model |
| GPFM | gpfm | GitHub |
| CTransPath | ctranspath | GitHub |
| PLIP | plip | GitHub |
| CONCH | conch | HuggingFace |
| CONCH-1.5 | conch15 | HuggingFace |
| UNI | uni | HuggingFace |
| UNI-2 | uni2 | HuggingFace |
| mSTAR | mstar | GitHub |
| Phikon | phikon | HuggingFace |
| Phikon2 | phikon2 | HuggingFace |
| Virchow-2 | virchow2 | HuggingFace |
| Prov-GigaPath | gigapath | HuggingFace |
| CHIEF | chief | GitHub |
| H-Optimus-0 | h-optimus-0 | HuggingFace |
| H0-mini | h0-mini | HuggingFace |
| H-Optimus-1 | h-optimus-1 | HuggingFace |
| OpenMidnight | openmidnight | HuggingFace |
| GenBio-PathFM | genbio-pathfm | HuggingFace |
| Lunit | lunit | GitHub |
| Hibou-L | hibou-l | GitHub |
| MUSK | musk | HuggingFace |
| OmiCLIP | omiclip | Github |
| PathoCLIP | pathoclip | Github |
PrePATH supports the following whole slide image formats:
Python
93.9%
Shell
6.1%
[!TIP] 🚀 Contribute Your Foundation Model! We welcome submissions of new pathology foundation models to our benchmark. 👉 Submit Your Model Here — Help advance the field by adding your model to PrePATH!
PrePATH is a comprehensive preprocessing toolkit for whole slide images (WSI), built upon CLAM and ASlide.
openslide-tools (system dependency)The following instructions demonstrate installation for the GPFM model. For other foundation models, please refer to their respective repositories for environment-specific requirements.
git clone https://github.com/birkhoffkiki/PrePATH.git
cd PrePATH
conda create --name gpfm python=3.10
conda activate gpfm
pip install -r requirements/gpfm.txt
cd models/ckpts/
wget https://github.com/birkhoffkiki/GPFM/releases/download/ckpt/GPFM.pth
Notes:
requirements/gpfm.txt.Extract coordinates of foreground patches from whole slide images:
# Configure variables in the script before execution
bash scripts/get_coors/example.sh
Extract patch-level features using the selected foundation model:
# Refer to the script for detailed configuration options
bash scripts/extract_feature/one_gpu_example.sh
If you have multiple GPUs, you can use the exe.sh script for parallel processing:
bash scripts/extract_feature/exe.sh
This is useful for pretraining or if you meet the Corrupt JPEG data error during feature extraction.
This may happen for kfb or sdpc images due to limited support in multiprocessing.
# Refer to the script for detailed configuration options
bash scripts/crop_image/example_packed2h5.sh
If you have packed patches into HDF5 files in Step 3, you can extract features from them directly:
# Refer to the script for detailed configuration options
bash scripts/extract_feature/one_gpu_from_h5_example.sh
Extract coordinates of foreground patches from whole slide images:
# Configure variables in the script before execution
bash scripts/get_coors/example.sh
Extract patches based on the coordinates:
We strongly recommend packing all patches using the HDF5 method for efficient storage and retrieval.
# Refer to the script for detailed configuration options
bash scripts/crop_image/example_packed2h5.sh
Note: Each foundation model requires its corresponding Python environment to be properly configured.
| Model | Identifier | Reference |
|---|---|---|
| ResNet50 | resnet50 | Standard ImageNet pretrained model |
| GPFM | gpfm | GitHub |
| CTransPath | ctranspath | GitHub |
| PLIP | plip | GitHub |
| CONCH | conch | HuggingFace |
| CONCH-1.5 | conch15 | HuggingFace |
| UNI | uni | HuggingFace |
| UNI-2 | uni2 | HuggingFace |
| mSTAR | mstar | GitHub |
| Phikon | phikon | HuggingFace |
| Phikon2 | phikon2 | HuggingFace |
| Virchow-2 | virchow2 | HuggingFace |
| Prov-GigaPath | gigapath | HuggingFace |
| CHIEF | chief | GitHub |
| H-Optimus-0 | h-optimus-0 | HuggingFace |
| H0-mini | h0-mini | HuggingFace |
| H-Optimus-1 | h-optimus-1 | HuggingFace |
| OpenMidnight | openmidnight | HuggingFace |
| GenBio-PathFM | genbio-pathfm | HuggingFace |
| Lunit | lunit | GitHub |
| Hibou-L | hibou-l | GitHub |
| MUSK | musk | HuggingFace |
| OmiCLIP | omiclip | Github |
| PathoCLIP | pathoclip | Github |
PrePATH supports the following whole slide image formats:
Python
93.9%
Shell
6.1%