Skip to content
Back to skills

Medsegdiff

ASecurity

"Guide MedSegDiff medical-image segmentation workflows for dataset

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
datapythonbashapibackend

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill medsegdiff --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Medsegdiff?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Medsegdiff
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-medsegdiff/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-medsegdiff)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: medsegdiff
description: "Guide MedSegDiff medical-image segmentation workflows for dataset
  preparation, diffusion-model training, checkpoint sampling, ensemble
  aggregation, and evaluation."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# MedSegDiff

MedSegDiff is a repository-level PyTorch diffusion framework for medical-image
segmentation. Use this skill when a task mentions MedSegDiff, its ISIC or BRATS
examples, diffusion-based segmentation, the `guided_diffusion` modules, or the
repository's segmentation train/sample/evaluation workflows.

## First route

- **Prepare or validate data**: read
  [`sub-skills/data-preparation/SKILL.md`](sub-skills/data-preparation/SKILL.md).
  It covers ISIC CSV/image/mask trees, BRATS NIfTI modalities and slices, and
  custom 2D/3D layouts.
- **Configure or plan training**: read
  [`sub-skills/training/SKILL.md`](sub-skills/training/SKILL.md). It covers the
  training CLI contract, model/diffusion factories, schedules, checkpoints,
  mixed precision, and multi-GPU behavior.
- **Sample or score predictions**: read
  [`sub-skills/inference-evaluation/SKILL.md`](sub-skills/inference-evaluation/SKILL.md).
  It covers checkpoint compatibility, DDIM/DPM-Solver options, ensembles,
  STAPLE aggregation, output naming, IoU/Dice, and per-class metrics.

For a task spanning multiple routes, prepare and validate the data first, then
train or provide a compatible checkpoint, then sample and evaluate. Preserve
the dataset branch, effective input channels, image size, model `version`,
diffusion schedule, and checkpoint settings across every stage.

## Installation and runtime gate

The upstream repository has no `pyproject.toml`, `setup.py`, console entry
point, or formal package metadata. Its documented dependency source is
`requirement.txt`. In a fresh isolated environment, install the public runtime
dependencies and make the checkout importable before using its Python modules:

```bash
python -m pip install -r requirement.txt
PYTHONDONTWRITEBYTECODE=1 python -c "import guided_diffusion.script_util as s; print(s.model_and_diffusion_defaults())"
```

Use a CUDA-enabled PyTorch build for actual training or sampling. CPU checks are
appropriate for data loaders, metric helpers, and small factory/API smokes,
but CPU is not a truthful substitute for the full training/sampling path: the
runtime uses CUDA device placement and, during sampling, CUDA timing events and
synchronization.

Before a real run, use the bundled safe inspectors and environment reference:

- [`scripts/check_environment.py`](scripts/check_environment.py) checks Python,
  imports, and optional CUDA availability without downloading data or starting
  training.
- [`references/api-reference.md`](references/api-reference.md) records the
  verified module and factory contracts.
- [`references/troubleshooting.md`](references/troubleshooting.md) handles
  cross-cutting install, import, backend, checkpoint, and path failures.
- [`references/repo-provenance.md`](references/repo-provenance.md) tells you
  when the source baseline is stale and a refresh is warranted.

Keep medical data, checkpoints, predictions, and generated results outside the
skill directory. Do not assume the repository's example data is complete; use
the data-preparation validator and fetch data only through an approved,
user-controlled source.

## Shared invariants

- The model factory's default `image_size` is 64, while the documented example
  recipes commonly use 256; only 64, 128, 256, and 512 have automatic channel
  multipliers in the inspected source.
- Boolean options use an explicit value such as `True` or `False`, not a bare
  `store_true` switch.
- `data_name=ISIC` and `data_name=BRATS` select dedicated branches; other values
  select the custom branch, whose 2D/3D detection has source-specific behavior.
- Keep `batch_size=1` for the unpatched sampler because several output-ID paths
  use the first item of a batch.
- Treat `version`, effective input channels, architecture flags, diffusion
  steps/schedule, and checkpoint state as one compatibility tuple.

This skill is guidance for operating the public repository; it does not claim
medical validity, reproduce paper metrics without the required data/checkpoint,
or replace clinical review.

Files in this skill

  • SKILL.md4.2 KB
  • references/api-reference.md4.1 KB
  • references/repo-provenance.md2 KB
  • references/repo-routing-metadata.json325 B
  • references/troubleshooting.md4.1 KB
  • scripts/check_environment.py4.2 KB
  • sub-skills/data-preparation/SKILL.md2.1 KB
  • sub-skills/data-preparation/references/api-reference.md5.6 KB
  • sub-skills/data-preparation/references/data-formats.md9.1 KB
  • sub-skills/data-preparation/references/troubleshooting.md6.7 KB
  • sub-skills/data-preparation/scripts/validate_dataset_layout.py15.4 KB
  • sub-skills/inference-evaluation/SKILL.md2 KB
  • sub-skills/inference-evaluation/references/metrics-and-output.md5.9 KB
  • sub-skills/inference-evaluation/references/troubleshooting.md7.1 KB
  • sub-skills/inference-evaluation/references/workflows.md9.3 KB
  • sub-skills/inference-evaluation/scripts/evaluate_isic.py7.5 KB
  • sub-skills/inference-evaluation/scripts/evaluate_per_class.py8.4 KB
  • sub-skills/inference-evaluation/scripts/inspect_sample_cli.py6.1 KB
  • sub-skills/training/SKILL.md2.4 KB
  • sub-skills/training/references/api-reference.md10.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.