---
title: 'PG-SAM: Parotid Segmentation Model'
url: https://www.emergentmind.com/topics/parotid-gland-segment-anything-model-pg-sam
type: topic
---

# PG-SAM: Parotid Segmentation Model

Searching arXiv for the cited PG-SAM and SAM-related papers to ground the article.
{"query":"2306.11730 Segment Anything Model (SAM) for Radiation Oncology", "max_results": 5}
{"query":"2508.09645 Multi-Sequence Parotid Gland Lesion Segmentation via Expert Text-Guided Segment Anything Model", "max_results": 5}
Parotid Gland Segment Anything Model (PG-SAM) denotes parotid-focused adaptations of Meta’s Segment Anything Model for segmentation tasks involving the parotid gland, especially parotid gland lesion segmentation on multi-sequence MRI and parotid delineation as an organ-at-risk on head-and-neck planning CT. In the literature, the name refers most specifically to an expert diagnosis text-guided, multi-sequence SAM variant that converts diagnostic report information into SAM-compatible prompts, fuses T1, T1C, T2, and ADC through cross-sequence attention, and produces lesion masks with a hierarchical decoder [2508.09645]. Related radiotherapy work provides an important counterpoint: although SAM generalizes zero-shot to many organs, it failed to recognize the parotid glands in head-and-neck planning CT without prompting, and manual box prompts raised performance only to moderate overlap levels that remained below commonly cited clinical acceptability thresholds [2306.11730].

## 1. Clinical setting and segmentation target

PG-SAM is situated in a clinically difficult regime. Salivary gland lesions comprise **2–6% of head and neck neoplasms**, and **about 70% arise in the parotid glands**. Accurate segmentation is relevant to diagnosis, surgical planning, and follow-up. The task is difficult because parotid lesions vary widely in size, are often unilateral, and frequently exhibit irregular, indistinct boundaries. In MRI, the use of **T1, T1C, T2, and ADC** provides complementary cues, but it also introduces cross-sequence inconsistencies. The result is a segmentation problem dominated by heterogeneity, subtle contrast changes, and ambiguous lesion borders [2508.09645].

The same difficulty appears in organ-at-risk delineation. On non-contrast planning CT, the parotid glands are described as **small-to-medium sized soft-tissue structures adjacent to the mandible, masseter, and parapharyngeal space**, with boundaries that are often subtle and variable relative to adjacent musculature and fat. This boundary ambiguity is compounded by dental hardware, beam-hardening artifacts, edema, prior surgery, tumor involvement, and the use of slice-wise inference. These observations place the parotid among the structures for which generic SAM behavior is weakest, particularly when prompting is absent [2306.11730].

A common misconception is that SAM’s broad zero-shot generalization automatically transfers to parotid segmentation. The available evidence does not support that interpretation. The radiotherapy study reports clinically acceptable performance for many large, well-defined organs, but not for the parotids, which remained undetected in automatic “segment everything” mode and required prompting even to reach moderate Dice values [2306.11730].

## 2. Core architecture of the expert text-guided PG-SAM

The parotid-specific PG-SAM introduced for lesion segmentation uses a **2D slice** comprising **four MRI sequences (T1, T1C, T2, ADC)** together with an associated **expert diagnosis report text**. Its image pathway is built on the **SAM ViT-L image encoder** augmented with **LoRA** for parameter-efficient fine-tuning. Each sequence is encoded independently, after which a **cross-sequence attention module** integrates complementary information. The text pathway uses **MedCLIP’s text encoder**, kept frozen, followed by an adapter that aligns the text representation to the parotid domain. A text-guided decoder then produces a coarse mask, constrains it with a **statistical spatial prior mask $M$**, and computes prompt points and bounding boxes from the resulting foreground. These prompts are passed through SAM’s prompt encoder, and a **hierarchical mask decoder (H-SAM)** produces the final lesion mask [2508.09645].

The architectural logic is to replace precise user interaction with report-derived priors. Diagnostic reports encode laterality, anatomical subregion, lesion size, and qualitative attributes. PG-SAM operationalizes this information into point and box prompts rather than asking a clinician to provide them manually. The text embedding is written as
$$
x'_{\text{text}}=\operatorname{Adapter}(\operatorname{Enc}_{\text{text}}(x_{\text{text}})).
$$
The prompt-generation stage then derives a centroid point $[x_{\text{mean}}, y_{\text{mean}}]$ and a bounding box $[x_{\min}, y_{\min}, x_{\max}, y_{\max}]$ from the gated coarse mask [2508.09645].

Cross-sequence fusion is implemented through attention. With frozen base weight $W_0$ and trainable low-rank factors $A$ and $B$, LoRA is defined as
$$
z = W_0 x + B A x.
$$
For cross-sequence attention, the paper uses
$$
\operatorname{Attn}(Q,K,V)=\operatorname{softmax}(QK^T/\sqrt{d_k})V,
$$
with
$$
A_i=\operatorname{softmax}\!\left(\frac{x_f W_q (x_i W_k)^T}{\sqrt{d_k}}\right)(x_i W_v), \qquad x_i \leftarrow x_i + A_i.
$$
This design preserves the identity of each modality while correcting sequence-specific biases through fused context [2508.09645].

The hierarchical decoder contains two refinement mechanisms. **Class-Balanced Mask-Guided Self-Attention (CMAttn)** perturbs features with Gaussian noise inversely proportional to class frequency,
$$
X(GT=i)\leftarrow X(GT=i)+N(0,\operatorname{var}(i)), \quad i=1,\ldots,n_c,
$$
and **Learnable Mask Cross-Attention (LMCA)** uses the unthresholded probability map to emphasize informative foreground regions,
$$
X \leftarrow M \odot \operatorname{softmax}(KQ^T)V + X.
$$
The final prediction averages the outputs of the two decoder stages [2508.09645].

## 3. Data, preprocessing, and optimization

The lesion-segmentation PG-SAM was trained and evaluated across **three independent clinical centers**. **Site1** was **Shantou Central Hospital** with **507 patients**, **Site2** was **Sun Yat-sen University Cancer Center** with **60 patients**, and **Site3** was **Sun Yat-sen Memorial Hospital** with **149 patients**. **Site1** was split into **70% train / 10% val / 20% test**, whereas **Site2** and **Site3** were used as external test sets. Each volume contained **~25 axial slices**, and valid lesion slices were filtered by a **pixel-count threshold (>25 pixels)**. The reported valid-slice counts were **5263** for Site1, **392** for Site2, and **882** for Site3. Lesion masks were produced by **two expert radiologists by consensus** [2508.09645].

Preprocessing was strictly 2D. Slices were **resized to $224\times224$** with bilinear interpolation and **min–max normalized to $[0,1]$**. The stated augmentations were **rotations and flips**. Cross-sequence registration was not explicitly specified; the paper states that cross-sequence registration is implicitly handled by per-sequence encoding and fusion [2508.09645].

The optimization setup was implemented in **PyTorch 2.4** on **8× NVIDIA TITAN XP (12 GB)**. The backbone was **SAM ViT-L**, with **LoRA rank = 5**. The optimizer was **AdamW** with **$\beta_1=0.9$**, **$\beta_2=0.999$**, and **weight decay = 0.1**. **Max epochs = 300**. The MedCLIP text encoder remained frozen while the adapter was trained [2508.09645].

The segmentation objective combines Dice and BCE:
$$
L_{\text{Dice}} = 1 - \frac{2\sum_i p_i g_i + \epsilon}{\sum_i p_i + \sum_i g_i + \epsilon},
$$
$$
L_{\text{BCE}} = -\frac{1}{N}\sum_i \big[g_i \log p_i + (1-g_i)\log(1-p_i)\big],
$$
$$
L_{\text{seg}} = \lambda L_{\text{Dice}} + (1-\lambda)L_{\text{BCE}}.
$$
The total loss is
$$
L_{\text{total}} = w L_{\text{dec1}} + (1-w)L_{\text{dec2}} + \beta L_{\text{text}},
$$
where each decoder loss is an instance of $L_{\text{seg}}$, and $L_{\text{text}}$ supervises the coarse mask from the prompt-generation decoder [2508.09645].

## 4. Empirical performance and ablation evidence

The paper reports **state-of-the-art performance** for parotid gland lesion segmentation across the three centers and emphasizes both internal accuracy and cross-center generalization. Internally, PG-SAM improved Dice and HD95 across all reported sequences relative to a SAM-adapter baseline, **Med-SA**. Externally, it remained competitive or better across sequences, with notably improved HD95 on several modalities [2508.09645].

| Setting | Sequence | PG-SAM result |
|---|---|---|
| Site1 internal | T1 | 0.836 / 4.943 |
| Site1 internal | T1C | 0.812 / 5.539 |
| Site1 internal | T2 | 0.798 / 4.807 |
| Site1 internal | ADC | 0.774 / 5.439 |
| Site2 external | T1 | 0.676 |
| Site2 external | T1C | 0.665 |
| Site2 external | T2 | 0.678 |
| Site2 external | ADC | 0.532 |
| Site3 external | T1 | 0.717 |
| Site3 external | T1C | 0.727 |
| Site3 external | T2 | 0.682 |
| Site3 external | ADC | 0.609 |

The internal comparison to Med-SA was reported as follows: **T1 0.797/6.597**, **T1C 0.756/6.854**, **T2 0.756/7.574**, and **ADC 0.729/9.502**, where each pair denotes **DSC/HD95**. This establishes a consistent advantage for PG-SAM on Site1 [2508.09645].

The ablations isolate the value of the **cross-sequence attention module (CAM)** and the **text-prompt module (TPM)**. On **Site1 T1**, the reported DSC values were **0.765 with both**, **0.760 with TPM alone**, **0.761 with CAM alone**, and **0.709 with neither**. The paper also states that using **structured expert text (laterality and size)** outperforms generic textual prompts, and that expert text yields the best DSC across sites [2508.09645].

Formal significance testing was not reported. The evidence offered is consistency across sequences and centers. This suggests that the gains are not tied narrowly to one scanner or one hospital, although the paper itself stops short of a statistical significance claim [2508.09645].

## 5. Relation to radiotherapy parotid contouring

A second important line of evidence comes from radiotherapy planning CT, where SAM was tested across **prostate, lung, gastrointestinal, and head-and-neck** disease sites using **Mayo Clinic** cases, **80 patients total**, and **20 patients** in the head-and-neck cohort. Organ sets followed **RTOG recommendations**, and manual delineations were performed by **highly experienced radiation oncologists**. Because SAM currently supports only **2D**, evaluation used **five representative axial slices per patient** [2306.11730].

In that setting, the parotids constitute a hard negative result for generic zero-shot SAM. In **segment everything mode**, **Parotid_L Dice = 0 and Jaccard = 0** and **Parotid_R Dice = 0 and Jaccard = 0**. In **box prompt mode**, performance rose to **Parotid_L Dice = 0.573 ± 0.026; Jaccard = 0.401 ± 0.023** and **Parotid_R Dice = 0.570 ± 0.036; Jaccard = 0.399 ± 0.031**. The approximate gain from prompting was therefore **+0.57 Dice** and **+0.40 Jaccard**, unusually large because the unprompted baseline was zero [2306.11730].

| Mode | Parotid_L | Parotid_R |
|---|---|---|
| Segment everything | Dice 0; Jaccard 0 | Dice 0; Jaccard 0 |
| Box prompt | Dice 0.573 ± 0.026; Jaccard 0.401 ± 0.023 | Dice 0.570 ± 0.036; Jaccard 0.399 ± 0.031 |

These numbers remain below the **Dice > 0.7** threshold frequently cited in radiotherapy for clinical acceptability of organs-at-risk. The radiotherapy study therefore implies that parotid contouring with off-the-shelf SAM remains a clinician-in-the-loop task, even when prompting is used. The reported behavior is also consistent with the paper’s broader rule of thumb: SAM works better on **large organs with clear boundaries** and worse on **smaller organs with unclear boundaries**, such as the parotids and cochleae [2306.11730].

The metrics used in that evaluation were Dice and Jaccard:
$$
D = \frac{2|A \cap B|}{|A| + |B|}, \qquad
J = \frac{|A \cap B|}{|A \cup B|}.
$$
The paper did not report ASSD or HD95 in the radiotherapy experiments, although formulas were provided for completeness [2306.11730].

## 6. Related methodological lineages and uses of the acronym

Parotid-focused SAM development intersects with several adjacent research directions. One is **topological data analysis guided prompt optimization**, which replaces SAM’s default equidistant grid search with TDA-ranked points chosen by topological significance. That work argues that persistent features are better suited for **small objects** and can reduce computational complexity relative to dense grids. Although its experiments were in biological imaging, the relevance to parotid segmentation is explicit in the technical discussion: the parotid occupies a small fraction of a head-and-neck field of view and often has weak contrast relative to adjacent tissues [2306.17400].

Another related direction uses **cancer grade as a prompt** for gland segmentation. In that framework, a **ViT classifier** predicts benign versus malignant status, **Grad-CAM++** produces a heat map, and the heat map is passed to SAM as a **grade prompt**. The original evaluation was on **colon histology (GlaS)** rather than parotid data, but the method is presented as naturally extensible to salivary and parotid gland pathology, including a dual-decoder design for gland masks and contours [2501.14718].

The acronym **PG-SAM** is also used in a different paper to denote **“Prior-Guided SAM with Medical for Multi-organ Segmentation.”** That work is not parotid-specific; it focuses on the **Synapse** multi-organ CT benchmark and introduces a **fine-grained modality prior aligner**, **multi-level feature fusion**, and an **iterative mask optimizer** for prompt-free segmentation. Its relevance to parotid research is methodological rather than nominal: it formalizes how medical-LLM text priors and LoRA-tuned CLIP/SAM can reduce domain gap and improve small-structure boundary recovery [2503.18227].

This multiplicity of usages means that “PG-SAM” is not a uniquely standardized label across the literature. In parotid research, the most specific and direct usage is the **expert text-guided parotid gland lesion segmentation model** on multi-sequence MRI [2508.09645].

## 7. Limitations, failure modes, and likely research directions

The current parotid-specific PG-SAM remains constrained by several factors. First, its implementation is **2D slice-wise**, and the paper explicitly identifies this as a limitation when discussing future **efficient 3D fine-tuning** and **SAM2-style volumetric decoding**. Second, report quality matters: incomplete or inconsistent diagnostic reports can degrade prompt generation. Third, missing modalities such as **ADC** or **T1C** can disrupt the intended complementary fusion, although the paper identifies **modality dropout training** and **attention reweighting** as mitigations. Fourth, domain shift across scanners and protocols remains an issue, with **robust normalization**, **cross-site training**, and **domain adaptation** named as responses [2508.09645].

For radiotherapy CT, the limitations are somewhat different. The main problem is not only prompt quality but also intrinsic boundary ambiguity: low tissue contrast, artifacts from dental work, anatomical distortion, and slice-wise inconsistency. The radiotherapy study states that box prompts help by constraining SAM to anatomically plausible regions, but that **soft-tissue ambiguity and 2D processing limit performance**, so **post-processing and human refinement** are needed for clinical use [2306.11730].

Several future directions recur across the cited work. For lesion segmentation, the paper proposes **structured reporting and ontology-driven text**, **uncertainty-aware prompt confidence**, **multimodal LLMs**, and **semi-supervised** learning with weak report supervision. For parotid contouring in radiotherapy, the technical report suggests **refined box generators**, **additional point prompts**, **lightweight fine-tuning or adapters**, **multi-modal inputs** such as MRI or contrast-enhanced CT, and **3D consistency layers**. A plausible implication is that clinically reliable parotid SAM systems will converge on hybrid designs: report-derived or detector-derived priors for initialization, parameter-efficient adaptation for domain specificity, and human oversight for quality assurance [2508.09645].

In summary, PG-SAM marks a shift from generic promptable segmentation toward parotid-aware SAM systems that encode clinical priors explicitly. The available evidence supports three conclusions. First, unguided zero-shot SAM is insufficient for the parotid in demanding clinical settings. Second, automated prompt generation from expert text and multi-sequence fusion materially improve lesion segmentation. Third, boundary ambiguity, modality variation, and 2D inference remain the main technical bottlenecks, making parotid segmentation a revealing stress test for medical adaptations of foundation segmentation models [2508.09645].

Source: https://www.emergentmind.com/topics/parotid-gland-segment-anything-model-pg-sam