medmnist
Use MedMNIST for standardized 2D and 3D biomedical image dataset loading, local NPZ inspection, safe export, and task-aware evaluation workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- medmnist
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use MedMNIST for standardized 2D and 3D biomedical image dataset loading, local NPZ inspection, safe export, and task-aware evaluation workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/api-overview.md2.3 KB
- 参考文档references/repo-provenance.md1.7 KB
- 参考文档references/repo-routing-metadata.json414 B
- 参考文档references/troubleshooting.md5.8 KB
- 脚本scripts/check_install.py2.0 KB
03 SKILL.md 正文
MedMNIST operating skill
Use this skill when a task names MedMNIST or asks for standardized biomedical
image benchmark datasets, MedMNIST+ resolutions, .npz split files, 2D/3D
PyTorch dataset classes, no-PyTorch array access, standard export, or AUC/ACC
evaluation. This is an operating guide for the public medmnist package, not
a clinical decision aid and not the external paper-experiment repository.
Start here
- Run the safe package diagnostic in the install overview
or use
scripts/check_install.py --helpandscripts/check_install.pybefore claiming the package or its dependencies are ready. - Identify the exact dataset flag, task type, split, image size, root, and
whether the input is an official NPZ or a local synthetic fixture. Inspect
medmnist.INFO[flag]before interpreting labels. - Follow exactly one focused route:
| User intent | Read next |
|---|---|
| Install/import, select a subset, inspect metadata, load 2D/3D data, use splits/sizes/transforms/mmap/RGB, or read NPZ without torch | dataset-loading |
Compute metrics, prepare score arrays, parse standard result CSVs, export PNG/GIF/CSV, create montages, or use save/evaluate |
evaluation-and-export |
- Keep a separate writable data root and output directory. Do not download all subsets, delete a default root, run the development-only broad test loop, or mix real medical data with a synthetic fixture without labeling the source.
- For a current-checkout question, read repository provenance first. If the commit, package metadata, or public entry points differ, request a repo-skill refresh rather than trusting stale details.
Installation and baseline check
The public package is installed with:
python -m pip install medmnist
python -c "import medmnist; print(medmnist.__version__)"
The inspected baseline is 3.0.2. Its documented runtime requirements include
NumPy, pandas, scikit-learn, scikit-image, tqdm, Pillow, Fire, PyTorch, and
torchvision. The selected MedMNIST workflows need only CPU behavior; no CUDA
device is required. For a read-only version/import/registry check, run:
python scripts/check_install.py
Read the shared API overview for package object relationships and the minimal environment contract. Read shared troubleshooting for import, dependency, root, network, data, and medical-use boundaries.
Operating boundaries
- Use the official Zenodo distribution when obtaining data and preserve the
published checksum when validating a download.
download=Trueis an intentional network action, not a harmless import check. rootmust exist before dataset/evaluator construction. Prefer an explicit project-local or temporary root instead of relying on~/.medmnist.- Always record the exact flag, split, size, task, label shape, and whether the file is official or synthetic in a handoff.
- MedMNIST is a benchmark/data API and is not intended for clinical use. Respect the per-dataset license; DermaMNIST is CC BY-NC 4.0 while the other listed subsets are documented as CC BY 4.0.
- Do not infer training, weights, or paper-reproduction workflows from this package. The external experiments repository is outside this skill's source contract.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).