Skip to content
Back to skills

Seg Preflight

ASecurity

Ten-point checklist that catches common segmentation-pipeline bugs (checkpoint keys, shared dataset refs, split leakage, nodata, class balance). Apply before any training run or when predictions are garbage.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 19, 2026
ai-agentsgit

Works with

  • cli

Security analysis

A100/100

Scanned September 19, 2026

npx -y skills add Adilmunawar/ZD-claude-plugin --skill seg-preflight --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Seg Preflight?

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

Security grade badge for Seg Preflight
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adilmunawar-seg-preflight/badge)](https://www.skillsdirectory.com/skills/adilmunawar-seg-preflight)

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: seg-preflight
description: Ten-point checklist that catches common segmentation-pipeline bugs (checkpoint keys, shared dataset refs, split leakage, nodata, class balance). Apply before any training run or when predictions are garbage.
---

# Segmentation pre-flight

| # | Check | How |
|---|---|---|
| 1 | Checkpoint format | `torch.load(..., map_location='cpu')` → is it a dict with `model_state_dict` or a bare state_dict? Strip `module.` prefixes from DataParallel; match `smp`/`timm` key names; print missing/unexpected keys with `strict=False` and fail if > 0 unexpected |
| 2 | Dataset object sharing | Assert `id(train_ds.transform) != id(val_ds.transform)` and that split lists are copies (`list(...)` / `copy.deepcopy`) — shared references leak train augmentation into val |
| 3 | Split leakage | Split by parcel/tile ID; `assert not set(train_ids) & set(val_ids)`; check spatial overlap of tile bounds across splits with a GeoDataFrame `sjoin` |
| 4 | Label alignment | Image and mask share CRS, transform, shape; nodata pixels masked out of the loss (`ignore_index`) |
| 5 | Class balance | Print pixel share per class; use weighted CE / Dice+CE / focal when minority class < 5 % |
| 6 | Normalisation | Per-band mean/std computed on train only; Sentinel-2 reflectance scaled 0–1 (÷10000); SAR dB clipped (-25..0) |
| 7 | Patch extraction | Stride < patch size for training only; inference uses overlap + centre-crop blending |
| 8 | Reproducibility | Seed torch/numpy/random; `cudnn.deterministic` for eval; log git SHA and config |
| 9 | Resume path | Kill the run after 1 epoch, resume, assert epoch counter and LR continue |
| 10 | Eval metric | Per-class IoU/F1 on the *full* val set at native resolution, not on patches |

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…