Imported from VectorSpaceLab/AREX-Skill (
skills/repositories/repo-skills/clam/sub-skills/heatmap-visualization/SKILL.md). Install upstream withnpx skills add VectorSpaceLab/AREX-Skill --skill heatmap-visualization. Copyright stays with the author (GPL 3.0).
CLAM Heatmap Visualization
Use this sub-skill when the task is to create CLAM attention heatmaps, validate a heatmap YAML/process list, configure ROI or top-k patch sampling, explain create_heatmaps.py outputs, or diagnose heatmap failures caused by checkpoint, encoder, model, or slide-input mismatches.
Route Tasks
- For heatmap YAML structure, process-list columns, model/encoder consistency, and safe preflight checks, read
references/configuration.mdand runscripts/validate_heatmap_config.py. - For end-to-end heatmap commands, the interactive
Continue?prompt, raw versus production outputs, ROI rendering, and sampled-patch outputs, readreferences/workflows.md. - For checkpoint shape errors, missing UNI/CONCH settings, absent slides, ROI column problems, GPU memory issues, and heatmap rendering options, read
references/troubleshooting.md. - For patch-coordinate generation before heatmaps, use
../wsi-preprocessing/SKILL.md. - For pretrained encoder setup and feature-dimension choices, use
../feature-extraction/SKILL.md. - For training checkpoints and evaluation-time model arguments, use
../training-evaluation/SKILL.md.
Key CLAM Facts
- CLAM heatmaps are produced by
create_heatmaps.py --config_file <yaml-name>, where the script resolves the config underheatmaps/configs/. - Heatmap inference initializes a CLAM checkpoint, loads a pretrained encoder, scans slides or ROI regions with OpenSlide, computes attention scores, and writes both raw HDF5 assets and rendered production images.
- ResNet50-truncated and UNI features are 1024-dimensional; CONCH v1 features are 512-dimensional, so
model_arguments.embed_dimmust match the checkpoint and encoder family. - The bundled validator is static and safe: it checks YAML/CSV shape and consistency without loading checkpoints, WSI files, OpenSlide, PyTorch, or encoders.