This repository trains a LoRA-based MobileSAM model for nuclei instance segmentation on the NuInsSeg dataset. It uses ground-truth bounding-box prompts derived from instance annotations and evaluates performance with five-fold cross-validation using Dice, AJI, and PQ.
chmod +x download_data.sh
./download_data.shconda env create -f env.yml
conda activate ml_med_imaging
pip install tifffile opencv-python scikit-image scikit-learn timm
pip install git+https://github.com/ChaoningZhang/MobileSAM.gitmkdir -p checkpoints
wget -O checkpoints/mobile_sam.pt https://github.com/ChaoningZhang/MobileSAM/raw/master/weights/mobile_sam.ptconda activate ml_med_imaging
python train_mobilesam_lora_nuinsseg.py