# Xai Clip Medical Seg Eval

> Evaluates the computational efficiency and explanation fidelity of an ROI-guided perturbation framework for medical image segmentation. It measures how effectively the method reduces computation while preserving segmentation accuracy and explanation quality compared to full occlusion baselines. Use when the user wants to benchmark on FLARE22, SAROS, CHAOS, or asks about evaluating this task. Reports Dice coefficient.

- Skill: `qhjqhj00/xai-clip-medical-seg-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/xai-clip-medical-seg-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/xai-clip-medical-seg-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/xai-clip-medical-seg-eval

---


# xai-clip-medical-seg-eval

> XAI-CLIP: ROI-Guided Perturbation Framework for Explainable Medical Image Segmentation in Multimodal Vision-Language Models — Alzubaidi et al. (2026) (arXiv:2602.07017, 2026)

## What this evaluates

Evaluates the computational efficiency and explanation fidelity of an ROI-guided perturbation framework for medical image segmentation. It measures how effectively the method reduces computation while preserving segmentation accuracy and explanation quality compared to full occlusion baselines.

## Datasets

- **FLARE22** — total ?; splits: train (-1), val (-1)
- **SAROS** — total ?; splits: test (-1)
- **CHAOS** — total ?; splits: test (-1)

## Metrics

- `Wall-clock latency ($T$)` — range: seconds
  - Elapsed time required to process a single 2D slice end to end.
- `FLOPs` — range: other
  - Floating-point operations per slice, computed using ptflops by aggregating operations from ROI extraction and the N_patch MedSAM forward passes.
- `ROI-reduction ratio ($\rho$)` — range: [0, 1]
  - Fraction of the full patch grid that requires computation, defined as $\rho = N_{\text{patch}}/N_{\text{patch}}^{\text{full}}$, where lower values indicate more effective pruning.
- `Dice coefficient` **(primary)** — range: [0, 1]
  - Overlap between the baseline MedSAM segmentation and the segmentation obtained under selective occlusion, serving as a fidelity measure.
- `Intersection-over-Union (IoU)` — range: [0, 1]
  - Overlap between the baseline MedSAM segmentation and the segmentation obtained under selective occlusion, serving as a fidelity measure.

## Input / output format

**Input**: 2D axial CT or MRI slices extracted from NIfTI volumes (middle slices selected).

**Output**: Segmentation mask and explanation/saliency map generated via ROI-guided occlusion perturbation.

## Scoring recipe

```python
# predictions: pred_mask, explanation_map
# gold: ground_truth_mask
# N_patch: dynamically counted occlusion patches evaluated
# N_patch_full: total patches in full grid

dice = 2 * np.sum(pred_mask & gold_mask) / (np.sum(pred_mask) + np.sum(gold_mask))
iou = np.sum(pred_mask & gold_mask) / np.sum(pred_mask | gold_mask)
reduction_ratio = N_patch / N_patch_full
latency = end_time - start_time
flops = ptflops.compute_flops(model, input_slice)
```

## Common pitfalls

- Processing full 3D volumes instead of extracting 2D middle axial slices as specified.
- Using a static patch count for the ROI-reduction ratio instead of dynamically recording N_patch within the perturbation loop.
- Comparing perturbed segmentation against ground truth instead of against the baseline MedSAM segmentation for fidelity metrics.

## Evidence (verbatim from paper)

> We assess computational efficiency and explanation fidelity using five complementary metrics. Wall-clock latency ($T$) measures the elapsed time required to process a single 2D slice end to end. Floating-point operations (FLOPs) quantify the computational cost per slice and are computed using ptflops by aggregating the operations incurred during ROI extraction and the $N_{\text{patch}}$ MedSAM forward passes executed as part of the perturbation process. Here, $N_{\text{patch}}$ denotes the number of occlusion patches actually evaluated and is recorded dynamically within the perturbation loop. The ROI-reduction ratio, defined as $\rho\=N_{\text{patch}}/N_{\text{patch}}^{\text{full}}$, captures the fraction of the full patch grid that requires computation, with lower values indicating more effective pruning. Finally, dice coefficient and Intersection-over-Union (IoU) are used to quantify the overlap between the baseline MedSAM segmentation and the segmentation obtained under selective occlusion, serving as fidelity measures to ensure that computational gains do not compromise explanatory reliability.

## Citation

```bibtex
@misc{alzubaidi2026xai_clip,
  title={XAI-CLIP: ROI-Guided Perturbation Framework for Explainable Medical Image Segmentation in Multimodal Vision-Language Models},
  author={Alzubaidi et al. (2026)},
  year={2026},
  note={arXiv:2602.07017}
}
```

- arXiv: 2602.07017

