README.md

February 10, 2026 Β· View on GitHub

Coherence-Based Segmentation Quality Evaluator Trained on a Large Collection of Annotated Medical Image

Framework | Dataset | Getting Started | Page Main

Model Try Download EvanySeg checkpoints Build License

πŸ”₯Accepted at PRCV 2025!

Our paper is available here.

Framework

EvanySeg is a companion model to SAM and its variants, designed to enhance reliability and trustworthiness in the deployment of SAM (and its variants) on medical images.

Dataset

The EvanySeg model was trained based on 2D images, accompanied by object-level ground truth masks. Segmentation predictions for training the EvanySeg model were generated using SAM, MedSAM, and SAM-Med2D.

The filesystem hierarchy of the dataset is as follows:

πŸ“ EvanySeg
β”œβ”€β”€ πŸ“ checkpoints
β”œβ”€β”€ πŸ“ result
β”œβ”€β”€ πŸ“ datasets
β”‚   β”œβ”€β”€ πŸ“ preprocess
β”‚   β”‚   └── πŸ“ train_sam_Polyp
β”‚   β”‚       β”œβ”€β”€ πŸ“ crop_image
β”‚   β”‚       β”‚       0_SAM_Polyp_train_175.png
β”‚   β”‚       β”œβ”€β”€ πŸ“ crop_mask
β”‚   β”‚       β”‚       0_SAM_Polyp_train_175.png
β”‚   β”‚       └── πŸ“ crop_predict
β”‚   β”‚       β”‚       0_SAM_Polyp_train_175.png
β”‚   └── πŸ“ raw          
β”‚       └── πŸ“ Polyp
β”‚           └── πŸ“ train
β”‚               β”œβ”€β”€ πŸ“ images
β”‚               β”‚       175.png
β”‚               └── πŸ“ masks
β”‚                       175.png

The processed data naming rules are as follows:

β”œβ”€crop_images
       {i}_{model_name}_{directory}_{part}_{sample_name}

Note: "i" represents the index of the connected domain being processed in the current iteration, "model_name" indicates the model SAM and its variants, "directory" represents the directory name of the dataset such as Polyp, "part" indicates the subdirectory, sample_name, "sample_name" indicates the original name of the image

Getting Started

Download the datasets and pre-trained models to the corresponding folders, and configure the environment.If you plan to train your own dataset,please preprocess it first using the preprocessing.py file.

Download

Please download the EvanySeg result checkpoints to the result directory from ResNet101_Bbox_Dice、ViT-B_Bbox_Dice and ViT-B_Bbox_Dice_HD. (Currently, only part of the models have been open-sourced, and we will continue to open-source the remaining models in the future.)

The example datasets are provided Train.zip and Test.zip

Other required model download Offical links (models related to ViT and SAM) : SAM:SAM model , MedSAM:MedSAM , SAM-Med2D:SAM-Med2D , ViT-Base: ViT-Base , ViT-Large: ViT-Large .

Installation

Recommendation: Python version around 3.9, please do not use a version that is too high.

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
pip install -r requirements.txt

Test

python test.py

Train

python train.py