with one click
add-magnification
// Calculate and add the effective magnification for a pathology foundation model already listed in the README. Use when the user asks to add magnification for a model that is already in the table.
// Calculate and add the effective magnification for a pathology foundation model already listed in the README. Use when the user asks to add magnification for a model that is already in the table.
Add a new pathology foundation model to the README (excluding magnification). Use when the user asks to add a model, paper, or feature extractor to the list, or mentions a new paper in the papers/ directory.
Find and thoroughly read a pathology foundation model paper from the papers/ directory. Use as a prerequisite before adding model information or magnification to the README.
| name | add-magnification |
| description | Calculate and add the effective magnification for a pathology foundation model already listed in the README. Use when the user asks to add magnification for a model that is already in the table. |
Calculate and add the effective magnification for a pathology foundation model that is already listed in README.md. The magnification column should currently be blank for this model.
First, follow the read-paper skill (.claude/skills/read-paper/SKILL.md) to find and thoroughly read the paper. Pay special attention to:
RandomResizedCrop parameters (scale range)Then return here to calculate and add the magnification.
Magnification is the effective magnification at which the model sees tissue during pretraining. This is often not directly stated and must be calculated. The README explains:
If patches are obtained at 20x with patch size 1024 but resized to 224 before being fed to the model, the effective magnification is 20x × (224/1024) ≈ 4.4x.
Critical: Before attempting to calculate magnification, verify that the training data comes from standardized WSI patches at known magnifications. Magnification cannot be meaningfully calculated when:
Example: CONCH is trained on 1.17M image-caption pairs from educational resources and PubMed Central figures—these are published images at unknown/variable magnifications, not WSI patches extracted at controlled magnifications. Even though the model uses iBOT with known crop scales, the source image magnifications are undocumented, making effective magnification impossible to calculate.
If magnification cannot be determined:
Magnification can only be calculated when all of the following are known:
Important: Be thorough when investigating augmentations. Check the underlying SSL framework's repository, not just the model's paper:
RandomResizedCrop parametersarea_rangescale=(0.2, 1.0), SimCLR uses scale=(0.08, 1.0)Also check:
Important: Do not perform calculations mentally. Use bash Python or another tool to perform the calculations.
For models without random crops (or where patches are simply resized):
effective_mag = base_mag × (input_size / patch_size)
For models with random crops, the effective magnification is a range:
scale=1.0 (full image): base_mag × (input_size / patch_size)scale=S_min: base_mag × (input_size / (√S_min × patch_size))Example for 1024px patches at 20x with MoCo v2 augmentation (scale=(0.2, 1.0)) to 224px input:
Find the model's existing row in README.md and fill in the magnification column with the calculated value.
Add a magnification note to NOTES.md under the model's section. The order of models in NOTES.md should match their order in README.md (chronological by release date).
Keep the note concise. Example:
## ModelName
- **Magnification (~4-10x)**: Patches are 1024×1024 at 20x. Built on MoCo v2 which uses `RandomResizedCrop(224, scale=(0.2, 1.0))`. At scale=1.0: 20x × (224/1024) ≈ 4.4x; at scale=0.2: 20x × (224/458) ≈ 9.8x.
If magnification could not be determined, document why:
## ModelName
- **Magnification (N/A)**: Training data consists of image-caption pairs from PubMed and educational resources. Source image magnifications are unknown/variable, so effective magnification cannot be calculated.
Provide the user with a detailed explanation of the magnification calculation:
Format like this:
**Magnification**: [value]
- Patch extraction: [mag/MPP] — "[quote]" (source)
- Patch size: [size] — "[quote]" (source)
- Input size: [size] — "[quote]" (source)
- Augmentation: [details] — "[quote or code reference]" (source)
- Calculation: [show work]