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
π₯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