DigeApplication / README.md
xtxx's picture
Update README.md
7d877c7 verified
---
license: cc-by-nc-4.0
language:
- en
library_name: pytorch
pipeline_tag: image-classification
metrics:
- accuracy
- auc
- f1
---
# DigeApplication
`DigeApplication` is an open-source **tool-model zoo** for downstream gastrointestinal computational pathology tasks, providing unified configs and inference utilities for rapid deployment and reproducible evaluation.
- Foundation model: **Digepath** (ViT-L/16, DINOv2 pretraining)
- Digepath paper (arXiv): https://arxiv.org/abs/2505.21928
![](https://huggingface.co/xtxx/DigeApplication/resolve/main/Digepath.png)
## What is DigeApplication?
`DigeApplication` packages a collection of **task-specific tool-models** built on top of gastrointestinal pathology foundation model (Digepath). It aims to provide:
- **Model Zoo**: standardized, ready-to-use downstream tool-models
- **Unified Configs**: each tool is described by a lightweight `config.json`
- **Unified Inference**: consistent API to load and run a tool-model
## Repository Structure
```text
DigeApplication/
β”œβ”€β”€ Model_Zoo/
β”‚ β”œβ”€β”€ <tool_name_1>/
β”‚ β”‚ β”œβ”€β”€ config.json
β”‚ β”‚ β”œβ”€β”€ model.safetensors
β”‚ └── <tool_name_2>/
β”œβ”€β”€ Model_Factory/
β”‚ β”œβ”€β”€ digepath_model_factory.py
β”‚ └── digepath_modeling_wsi.py
β”‚ └── digepath_modeling_roi.py
β”œβ”€β”€ DigeApplication.py
└── README.md
```
## Usage Example
```python
from Model_Factory.digepath_model_factory import DigepathModelFactory
import os
import torch
model_zoo_dir = "./DigeApplication/Model_Zoo/"
device = "cuda:0"
dummy_num_patches = 100
model_dirs = [
os.path.join(model_zoo_dir, d)
for d in os.listdir(model_zoo_dir)
if os.path.isdir(os.path.join(model_zoo_dir, d))
]
for digemodel_dir in model_dirs:
print(f"Loading model from {digemodel_dir}...")
model_factory = DigepathModelFactory(digemodel_dir, device=device)
if model_factory.data_type == "ROI":
dummy_input = torch.randn(1, 1024, device=device)
elif model_factory.data_type == "WSI":
dummy_input = torch.randn(1, dummy_num_patches, 1024, device=device)
else:
raise ValueError(f"Unknown data_type: {model_factory.data_type}")
output = model_factory.infer(dummy_input)
print(f"Model output: {output}\n")
```
## Supported Tasks (Model Zoo)
Each tool-model in `DigeApplication` is described by a config containing fields such as:
`tool_name`, `data_type`, `task_type`, `organ_domain`, `num_classes`
| Tool / Model Name | Task Type | Data Type | Organ Domain | Classes | License |
|:--------------------------|:---------:|:---------:|:------------:|--------:|:-------------:|
| BOW_CAMEL_2CLS_ROI | CLS | ROI | BOW | 2 | cc_by_nc_4.0 |
| BOW_CENPL_5CLS_ROI | CLS | WSI | BOW | 5 | cc_by_nc_4.0 |
| BOW_COAD-MUC16_2CLS_WSI | CLS | WSI | BOW | 2 | cc_by_nc_4.0 |
| BOW_COAD-TTN_2CLS_WSI | CLS | WSI | BOW | 2 | cc_by_nc_4.0 |
| BOW_CRC100K_9CLS_ROI | CLS | ROI | BOW | 9 | cc_by_nc_4.0 |
| BOW_READ-NRAS_2CLS_WSI | CLS | WSI | BOW | 2 | cc_by_nc_4.0 |
| BOW_READ-TTN_2CLS_WSI | CLS | WSI | BOW | 2 | cc_by_nc_4.0 |
| BOW_TNM_4CLS_WSI | CLS | WSI | BOW | 4 | cc_by_nc_4.0 |
| DIGE_HER2_2CLS_WSI | CLS | WSI | DIGE | 2 | cc_by_nc_4.0 |
| DIGE_IMPCRS_3CLS_ROI | CLS | WSI | DIGE | 3 | cc_by_nc_4.0 |
| DIGE_MSI_2CLS_WSI | CLS | WSI | DIGE | 2 | cc_by_nc_4.0 |
| DIGE_P53_2CLS_WSI | CLS | WSI | DIGE | 2 | cc_by_nc_4.0 |
| DIGE_PDL1_2CLS_WSI | CLS | WSI | DIGE | 2 | cc_by_nc_4.0 |
| DIGE_POORAS_2CLS_WSI | CLS | WSI | DIGE | 2 | cc_by_nc_4.0 |
| DIGE_TUM_LHN_3CLS_WSI | CLS | WSI | DIGE | 3 | cc_by_nc_4.0 |
| DIGE_UNITOPATHO_6CLS_ROI | CLS | ROI | DIGE | 6 | cc_by_nc_4.0 |
| ESO_ADESQUA_2CLS_WSI | CLS | WSI | ESO | 2 | cc_by_nc_4.0 |
| ESO_EPILES_2CLS_WSI | CLS | WSI | ESO | 2 | cc_by_nc_4.0 |
| ESO_EPILES_4CLS_WSI | CLS | WSI | ESO | 4 | cc_by_nc_4.0 |
| ESO_KERATIN_2CLS_WSI | CLS | WSI | ESO | 2 | cc_by_nc_4.0 |
| GAST_ACT_3CLS_WSI | CLS | WSI | GAST | 3 | cc_by_nc_4.0 |
| GAST_ATR_2CLS_WSI | CLS | WSI | GAST | 2 | cc_by_nc_4.0 |
| GAST_GASTRITIS_3CLS_WSI | CLS | WSI | GAST | 3 | cc_by_nc_4.0 |
| GAST_IM_4CLS_WSI | CLS | WSI | GAST | 4 | cc_by_nc_4.0 |
| GAST_STLC_11CLS_ROI | CLS | ROI | GAST | 11 | cc_by_nc_4.0 |
| GAST_TNM_4CLS_WSI | CLS | WSI | GAST | 4 | cc_by_nc_4.0 |
| GAST_XANSRC_2CLS_WSI | CLS | WSI | GAST | 2 | cc_by_nc_4.0 |
## Citation
If `DigeApplication` is helpful to you, please cite our work.
```
@article{zhu2025subspecialty,
title={Subspecialty-specific foundation model for intelligent gastrointestinal pathology},
author={Zhu, Lianghui and Ling, Xitong and Ouyang, Minxi and Liu, Xiaoping and Guan, Tian and Fu, Mingxi and Cheng, Zhiqiang and Fu, Fanglei and Zeng, Maomao and Liu, Liming and others},
journal={arXiv preprint arXiv:2505.21928},
year={2025}
}
```