| --- |
| license: mit |
| --- |
| |
| **CRISP** (Clinical-grade Robust Intraoperative Support for Pathology) is a universal foundation model designed for intraoperative frozen section analysis. Developed on over 100,000 frozen sections from eight medical centers, CRISP provides robust and generalizable diagnostic support across a wide range of tumor types, anatomical sites, and clinical scenarios. |
|
|
|
|
| [](https://arxiv.org/abs/2510.04861) [](https://github.com/FT-ZHOU-ZZZ/CRISP) [](#reference) |
|
|
| ## Quick Start |
|
|
| CRISP require following dependencies: |
| - Python >= 3.13.5 |
| - PyTorch >= 2.8.0 |
| - timm >= 1.0.16 |
| - torchvision >= 0.22.1 |
| - peft >= 0.15.2 |
| - numpy >= 2.2.6 |
| - pillow >= 11.3.0 |
|
|
| Then, the generalizable features for intraoperative pathology can be extracted as follows: |
| ```python |
| import numpy as np |
| from PIL import Image |
| from crisp import get_trans, get_model |
| |
| # build model and transforms |
| device = torch.device("cuda" if torch.cuda.is_available() else "cpu") |
| ckpt_path = "CRISP.pth" # please download the model weights first |
| trans = get_trans() |
| model = get_model(device, ckpt_path) |
| # dummy input |
| img = Image.fromarray((np.random.rand(224, 224, 3) * 255).astype(np.uint8)) |
| img = img.convert("RGB") |
| # feature extraction |
| img = trans(img).unsqueeze(0).to(device) |
| print('input image shape:', img.shape) |
| feature = model(img) |
| print('output feature shape:', feature.shape) |
| ``` |
|
|
| ```shell |
| >>> input image shape: torch.Size([1, 3, 224, 224]) |
| >>> output feature shape: torch.Size([1, 2560]) |
| ``` |
|
|
| ## <a id="reference"></a> Citation |
| ``` |
| @article{zhao2025clinical, |
| title={A Clinical-grade Universal Foundation Model for Intraoperative Pathology}, |
| author={Zhao, Zihan and Zhou, Fengtao and Li, Ronggang and Chu, Bing and Zhang, Xinke and Zheng, Xueyi and Zheng, Ke and Wen, Xiaobo and Ma, Jiabo and Wang, Yihui and others}, |
| journal={arXiv preprint arXiv:2510.04861}, |
| year={2025} |
| } |