# Heatmap Visualization

> Configure, validate, run, and troubleshoot CLAM attention heatmap inference from trained checkpoints.

- Skill: `vectorspacelab/heatmap-visualization` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx get-skill add vectorspacelab/heatmap-visualization`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vectorspacelab/heatmap-visualization/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- License: GPL 3.0
- Author: VectorSpaceLab (https://skillmd.com/u/vectorspacelab)
- Updated: 2026-11-18
- Page: https://skillmd.com/skills/vectorspacelab/heatmap-visualization

---


# 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.md` and run `scripts/validate_heatmap_config.py`.
- For end-to-end heatmap commands, the interactive `Continue?` prompt, raw versus production outputs, ROI rendering, and sampled-patch outputs, read `references/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 under `heatmaps/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_dim` must 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.

