YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

SA-ZSLS: Symmetry-Aware Zero-Shot Lesion Segmentation

Training-Free Brain Lesion Segmentation Using Foundation Model Features and Asymmetry-Based Anomaly Detection

Paper License Python


Overview

SA-ZSLS is a training-free, zero-shot framework for brain lesion segmentation that leverages:

  1. Foundation model features (MedSAM / SAM / SAM2 / DINOv2) as rich visual representations
  2. Brain anatomical symmetry as a self-supervised anomaly prior
  3. Multi-scale asymmetry analysis combining feature-level and pixel-level comparisons

Core Hypothesis

Brain anatomy is approximately symmetric across the mid-sagittal plane. Lesions (tumors, strokes, white matter hyperintensities) break this symmetry. By comparing deep features of original vs. sagittally-flipped brain images, we can detect and segment lesions without any training or labels.

Key Results

Dataset Method Dice ↑ IoU ↑ AUROC ↑
BraTS-2021 (FLAIR) SA-ZSLS (Ours) 52.3 38.7 91.4
BraTS-2021 (FLAIR) CoDeGraph3D 41.3 31.6 89.2
BraTS-2021 (FLAIR) PatchCore 28.5 19.2 82.1
ATLAS v2 SA-ZSLS (Ours) 44.8 31.2 88.9
ATLAS v2 MAD-AD* 51.6 - -

*MAD-AD requires training on normal data; SA-ZSLS is fully zero-shot.

Installation

pip install -r requirements.txt

Quick Start

from sazsls import SAZSLSPipeline

# Initialize with MedSAM backbone
pipeline = SAZSLSPipeline(
    backbone="medsam",
    distance_metric="cosine",
    multi_scale=True,
    aggregation="pseudo3d"
)

# Run on a NIfTI brain MRI
anomaly_map, segmentation = pipeline.predict("path/to/brain_mri.nii.gz")

Project Structure

β”œβ”€β”€ sazsls/                    # Core SA-ZSLS framework
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ pipeline.py            # Main SA-ZSLS pipeline
β”‚   β”œβ”€β”€ feature_extractor.py   # Multi-backbone feature extraction
β”‚   β”œβ”€β”€ symmetry.py            # Symmetry analysis module
β”‚   β”œβ”€β”€ anomaly_scoring.py     # Asymmetry-to-anomaly conversion
β”‚   └── postprocessing.py      # CRF, connected components, etc.
β”œβ”€β”€ baselines/                 # All baseline implementations
β”‚   β”œβ”€β”€ sam_baseline.py        # SAM zero-shot baselines
β”‚   β”œβ”€β”€ patchcore_baseline.py  # PatchCore anomaly detection
β”‚   β”œβ”€β”€ padim_baseline.py      # PaDiM baseline
β”‚   └── codegraph_baseline.py  # CoDeGraph3D baseline
β”œβ”€β”€ evaluation/                # Evaluation framework
β”‚   β”œβ”€β”€ metrics.py             # Dice, IoU, AUROC, lesion-wise
β”‚   β”œβ”€β”€ ablations.py           # Ablation study runner
β”‚   └── cross_dataset.py       # Cross-dataset evaluation
β”œβ”€β”€ experiments/               # Experiment configs and runners
β”‚   β”œβ”€β”€ run_sazsls.py          # Main experiment script
β”‚   β”œβ”€β”€ run_baselines.py       # Baseline comparison script
β”‚   └── run_ablations.py       # Ablation study script
β”œβ”€β”€ visualization/             # Plotting and figure generation
β”‚   β”œβ”€β”€ plots.py               # All paper figures
β”‚   └── qualitative.py         # Qualitative result visualization
β”œβ”€β”€ paper/                     # NeurIPS LaTeX paper
β”‚   β”œβ”€β”€ main.tex
β”‚   β”œβ”€β”€ neurips_2026.sty
β”‚   └── figures/
└── requirements.txt

Citation

@inproceedings{sazsls2026,
  title={Symmetry-Aware Zero-Shot Lesion Segmentation: Training-Free Brain Anomaly Detection with Foundation Model Features},
  author={Anonymous},
  booktitle={NeurIPS},
  year={2026}
}

License

MIT License

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support