VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

Why Mathematics? | MILWRM Consensus Tissue Domains: Regional Smoothing, Adjusted Inertia, K-Means Centroids and Confidence Scores

Three learners review open books together at a classroom table, with stacks of textbooks, stationery and a whiteboard in the bright room.

WHY MATHEMATICS?

Why Mathematics? | MILWRM Consensus Tissue Domains: Regional Smoothing, Adjusted Inertia, K-Means Centroids and Confidence Scores

How MILWRM learns pixel- or spot-level consensus tissue domains across specimens and checks scale, clustering confidence and held-out transfer before biological interpretation.

Why mathematics is important becomes easier to see when a real decision depends on it. This guide follows the mechanism from definitions and dimensions to a worked calculation, validation, practical learning and responsible use. It keeps factual evidence separate from interpretation and treats every illustrative scenario as an example rather than a promise of results.

Choose a reading route

  • Normalize and smooth multiplex images or spatial counts
  • Pool comparable features across whole specimens
  • Select k with penalized inertia and fit shared centroids
  • Assign every pixel or spot and inspect confidence

Chapter map

  1. 1. Tissue mask
  2. 2. Image downsampling
  3. 3. Slide normalization
  4. 4. Gaussian smoothing
  5. 5. ST dimension reduction
  6. 6. Harmony adjustment
  7. 7. Neighbour-ring averaging
  8. 8. Uniform pixel sampling
  9. 9. Feature Z-normalization
  10. 10. K-means objective
  11. 11. Adjusted inertia
  12. 12. Shared centroids
  13. 13. Full-data assignment
  14. 14. Domain profiles
  15. 15. Confidence score
  16. 16. Cross-sample validation

Visit the How Mathematics Works hub for the wider series and its connections to education, reasoning, science, computing, design and careers.


1. Tissue mask

Here the geometry becomes operational. A binary mask separates tissue pixels from background.

A concrete situation

K-means with two groups helps construct an imaging mask.

What the mathematics does not license

Dust or weak signal can enter the mask. The habit of checking assumptions is one of the practical benefits of learning mathematics.

Try it, check it, transfer it

Overlay masks on every slide. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


2. Image downsampling

This step deserves a careful pause. A regular grid reduces pixel count and sets effective resolution.

A concrete situation

A factor of 16 produces coarser regional pixels.

What the mathematics does not license

Small structures may vanish. The same reasoning helps students move from an exercise to a real dataset.

Try it, check it, transfer it

Repeat at several resolutions. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


3. Slide normalization

The useful question is not only how to calculate, but what the calculation assumes. Marker intensity is scaled within a specimen.

A concrete situation

log10(x divided by nonzero mean plus one) reduces scale differences.

What the mathematics does not license

Nonzero means are sensitive to staining shifts. That distinction matters because a correct formula can still answer the wrong operational question.

Try it, check it, transfer it

Plot channel distributions by slide. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


4. Gaussian smoothing

A small example makes the mechanism visible. A kernel averages nearby pixel signals with distance weights.

A concrete situation

Sigma two spreads influence across a local region.

What the mathematics does not license

Blur erases narrow domains. The habit of checking assumptions is one of the practical benefits of learning mathematics.

Try it, check it, transfer it

Compare sigma and no-smoothing maps. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.

Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.


5. ST dimension reduction

This is where modelling choices begin to affect evidence. PCA or NMF compresses thousands of genes.

A concrete situation

Ten PCs summarize one DLPFC analysis.

What the mathematics does not license

Weak but important genes may be omitted. The same reasoning helps students move from an exercise to a real dataset.

Try it, check it, transfer it

Inspect variance and marker retention. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


6. Harmony adjustment

The central mathematical idea is concrete. A correction aligns technical variation across specimens.

A concrete situation

Slide labels inform batch adjustment.

What the mathematics does not license

Disease can be confounded with batch. That distinction matters because a correct formula can still answer the wrong operational question.

Try it, check it, transfer it

Design held-out and uncorrected checks. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


7. Neighbour-ring averaging

Here the geometry becomes operational. A spot receives the mean reduced features of nearby rings.

A concrete situation

n_rings one uses immediate neighbours in the study.

What the mathematics does not license

The mean crosses boundaries. The habit of checking assumptions is one of the practical benefits of learning mathematics.

Try it, check it, transfer it

Vary rings and map thin layers. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


8. Uniform pixel sampling

This step deserves a careful pause. A fixed fraction of tissue-mask pixels estimates the model.

A concrete situation

Default 0.2 samples one fifth per imaging specimen.

What the mathematics does not license

Rare regions can be undersampled. The same reasoning helps students move from an exercise to a real dataset.

Try it, check it, transfer it

Stratify or repeat subsamples. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.

Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.


9. Feature Z-normalization

The useful question is not only how to calculate, but what the calculation assumes. Every channel or component is centred and scaled.

A concrete situation

z equals x minus mean divided by SD.

What the mathematics does not license

Outliers distort mean and SD. That distinction matters because a correct formula can still answer the wrong operational question.

Try it, check it, transfer it

Inspect robust scaling. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


10. K-means objective

A small example makes the mechanism visible. Centroids minimize within-cluster squared Euclidean distance.

A concrete situation

A pixel joins its nearest centre.

What the mathematics does not license

Elongated or curved groups fit poorly. The habit of checking assumptions is one of the practical benefits of learning mathematics.

Try it, check it, transfer it

Inspect residual geometry. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


11. Adjusted inertia

This is where modelling choices begin to affect evidence. Cluster fit is combined with a penalty for model resolution.

A concrete situation

Smaller penalty can support more domains in the study.

What the mathematics does not license

The chosen k reflects a preference. The same reasoning helps students move from an exercise to a real dataset.

Try it, check it, transfer it

Publish the full k curve. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


12. Shared centroids

The central mathematical idea is concrete. One pooled model gives comparable domain labels across slides.

A concrete situation

Domain three has the same centroid definition for every specimen.

What the mathematics does not license

A global centre can miss local biology. That distinction matters because a correct formula can still answer the wrong operational question.

Try it, check it, transfer it

Inspect specimen-specific residuals. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.

Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.


13. Full-data assignment

Here the geometry becomes operational. Every pixel is labelled by the closest fitted centroid.

A concrete situation

The subsample mean and SD scale the full image.

What the mathematics does not license

Extrapolating beyond sampled support is risky. The habit of checking assumptions is one of the practical benefits of learning mathematics.

Try it, check it, transfer it

Flag large distances. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


14. Domain profiles

This step deserves a careful pause. Original marker or gene values describe each cluster.

A concrete situation

A centroid enriched in collagen suggests stroma.

What the mathematics does not license

A label is interpretive, not automatic. The same reasoning helps students move from an exercise to a real dataset.

Try it, check it, transfer it

Use independent markers and experts. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


15. Confidence score

The useful question is not only how to calculate, but what the calculation assumes. The nearest and second-nearest distances measure assignment margin.

A concrete situation

d1=2 and d2=5 gives (5-2)/5=0.6.

What the mathematics does not license

High confidence can occur for a wrong model. That distinction matters because a correct formula can still answer the wrong operational question.

Try it, check it, transfer it

Map low scores and slide MSE. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.


16. Cross-sample validation

A small example makes the mechanism visible. Whole-slide fit and independent anatomy test transfer.

A concrete situation

A held-out brain section receives existing centroids.

What the mathematics does not license

Random pixels leak specimen context. The habit of checking assumptions is one of the practical benefits of learning mathematics.

Try it, check it, transfer it

Reserve complete specimens. Then explain the result to someone who has not seen the formula. If the explanation needs a hidden assumption, add that assumption to the model record.

Did You Know? In this chapter, the most important number is useful only together with its construction rule. Changing scaling, sample membership or validation design can change the numerical answer without changing the arithmetic.


A seven-day practice lab

  1. Day 1: define the decision, observation unit, X variables and Y or reference condition.
  2. Day 2: reproduce the smallest worked example and check every dimension, unit and sign.
  3. Day 3: build a transparent baseline and write what it assumes.
  4. Day 4: fit the main method inside a training-only pipeline; record every parameter.
  5. Day 5: challenge one assumption with a deliberately difficult dataset or operating regime.
  6. Day 6: compare validation metrics with the practical workload created by errors.
  7. Day 7: present one supported conclusion, one unresolved uncertainty and one safe next experiment.

Questions for a student, parent or mentor

  • Which part of the model is a mathematical definition, and which part is a choice?
  • What small calculation would catch a sign, scale or dimension error?
  • What evidence comes from training, validation and the untouched test?
  • What benign condition could look like a fault or prediction failure?
  • How would the answer change for another response, asset, school project or time period?
  • What should a human review before acting on the score?

A method-specific audit before deployment

MILWRM takes a top-down view of tissue. It works at the pixel or assay-spot level so consensus domains can be learned across many specimens without requiring every cell to be segmented first. For multiplex imaging, slide normalization, Gaussian smoothing and optional downsampling create regional marker features. For spatial transcriptomics, dimension reduction, Harmony adjustment and neighbourhood averaging play analogous roles.

The method standardizes features and fits k-means to pooled data. For imaging, it can uniformly sample a default fraction of 0.2 of tissue-mask pixels per specimen to estimate centroids efficiently, then assign every pixel to its nearest centroid. For spatial transcriptomics, the paper fits k-means to all spots. Candidate k can be guided by adjusted inertia, whose penalty controls domain resolution.

MILWRM turns cluster geometry into useful diagnostics. Domain profiles show molecular features at each centroid. Whole-slide variance explained and mean-squared error flag poor fits. A pixel confidence score is (d2 minus d1) divided by d2, where d1 is distance to the assigned centroid and d2 distance to the next closest centroid. If d1 is 2 and d2 is 5, confidence is 0.6.

Smoothing supplies spatial context but lowers effective resolution. A broad kernel or large neighbourhood can erase a thin, real compartment; k-means also favours roughly spherical groups in standardized feature space. The primary study demonstrated colon, lymph-node, kidney and brain analyses across mIF and spatial transcriptomics. Responsible use varies scale and penalty, reserves whole specimens, checks low-confidence regions and asks pathologists or independent markers to validate labels.


Frequently asked questions

What is MILWRM?

MILWRM is a Python framework for rapid, multi-scale pixel- or spot-level tissue-domain detection across multiple multiplex-imaging or spatial-transcriptomics specimens.

Why use a top-down method?

Pixel- or spot-level analysis can identify regional structures without first depending on error-prone single-cell segmentation.

How does MILWRM add spatial context?

It applies Gaussian smoothing to imaging channels or averages reduced ST features over spatial-neighbourhood rings.

Why use k-means?

Shared centroids scale efficiently across many specimens and can be applied from a subsample to full-resolution pixels.

What is adjusted inertia?

It penalizes within-cluster inertia to guide the choice of k, with a user parameter controlling the preferred domain resolution.

What does confidence 0.6 mean?

Under the paper score, the assigned centroid is meaningfully closer than the second-best centroid; it is a geometric fit measure, not a probability of biological truth.


Primary source and fact-check note

Harsimran Kaur, Cody N. Heiser, Eliot T. McKinley et al., “Consensus tissue domain detection in spatial omics data using multiplex image labeling with regional morphology (MILWRM),” Communications Biology 7, 1295 (2024), DOI 10.1038/s42003-024-06281-8. Definitions and core claims in this article were checked against this primary publication. Calculations shown here were independently recomputed. Examples are educational illustrations; they are not reported industrial performance results.

Useful next reading

Keep the options open. Mathematics education supports clearer questions, transferable problem-solving skills and informed choices across science, engineering, computing, AI, statistics, design and many other careers. It does not guarantee intelligence, income, admission or employment; those outcomes depend on far more than one subject or model.

Extended laboratory: topic-specific validation and responsible use

Mask audit

Overlay tissue masks and excluded background.

Scale audit

Repeat downsampling, sigma and ring settings.

Batch audit

Compare Harmony-adjusted and raw representations.

Sampling audit

Repeat pixel subsamples and protect rare regions.

Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.

K audit

Publish inertia, penalty and domain count curves.

Fit audit

Map confidence, variance explained and slide MSE.

Transfer audit

Apply fixed centroids to whole held-out specimens.

Final claim

A confident domain remains a geometric cluster label.

Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.

Mechanism workshop: calculate, challenge and transfer

Workshop 1: Tissue mask

Begin with this mechanism: A binary mask separates tissue pixels from background. Recreate the concrete case: K-means with two groups helps construct an imaging mask. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: Dust or weak signal can enter the mask. Complete the transfer step: Overlay masks on every slide. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 2: Image downsampling

Begin with this mechanism: A regular grid reduces pixel count and sets effective resolution. Recreate the concrete case: A factor of 16 produces coarser regional pixels. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: Small structures may vanish. Complete the transfer step: Repeat at several resolutions. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 3: Slide normalization

Begin with this mechanism: Marker intensity is scaled within a specimen. Recreate the concrete case: log10(x divided by nonzero mean plus one) reduces scale differences. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: Nonzero means are sensitive to staining shifts. Complete the transfer step: Plot channel distributions by slide. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 4: Gaussian smoothing

Begin with this mechanism: A kernel averages nearby pixel signals with distance weights. Recreate the concrete case: Sigma two spreads influence across a local region. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: Blur erases narrow domains. Complete the transfer step: Compare sigma and no-smoothing maps. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.

Workshop 5: ST dimension reduction

Begin with this mechanism: PCA or NMF compresses thousands of genes. Recreate the concrete case: Ten PCs summarize one DLPFC analysis. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: Weak but important genes may be omitted. Complete the transfer step: Inspect variance and marker retention. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 6: Harmony adjustment

Begin with this mechanism: A correction aligns technical variation across specimens. Recreate the concrete case: Slide labels inform batch adjustment. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: Disease can be confounded with batch. Complete the transfer step: Design held-out and uncorrected checks. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 7: Neighbour-ring averaging

Begin with this mechanism: A spot receives the mean reduced features of nearby rings. Recreate the concrete case: n_rings one uses immediate neighbours in the study. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: The mean crosses boundaries. Complete the transfer step: Vary rings and map thin layers. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 8: Uniform pixel sampling

Begin with this mechanism: A fixed fraction of tissue-mask pixels estimates the model. Recreate the concrete case: Default 0.2 samples one fifth per imaging specimen. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: Rare regions can be undersampled. Complete the transfer step: Stratify or repeat subsamples. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.

Workshop 9: Feature Z-normalization

Begin with this mechanism: Every channel or component is centred and scaled. Recreate the concrete case: z equals x minus mean divided by SD. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: Outliers distort mean and SD. Complete the transfer step: Inspect robust scaling. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 10: K-means objective

Begin with this mechanism: Centroids minimize within-cluster squared Euclidean distance. Recreate the concrete case: A pixel joins its nearest centre. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: Elongated or curved groups fit poorly. Complete the transfer step: Inspect residual geometry. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 11: Adjusted inertia

Begin with this mechanism: Cluster fit is combined with a penalty for model resolution. Recreate the concrete case: Smaller penalty can support more domains in the study. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: The chosen k reflects a preference. Complete the transfer step: Publish the full k curve. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 12: Shared centroids

Begin with this mechanism: One pooled model gives comparable domain labels across slides. Recreate the concrete case: Domain three has the same centroid definition for every specimen. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: A global centre can miss local biology. Complete the transfer step: Inspect specimen-specific residuals. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Did You Know? A sophisticated adjustment can be algebraically correct and still answer the wrong scientific question when samples, labels, batches or validation boundaries are wrong.

Workshop 13: Full-data assignment

Begin with this mechanism: Every pixel is labelled by the closest fitted centroid. Recreate the concrete case: The subsample mean and SD scale the full image. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: Extrapolating beyond sampled support is risky. Complete the transfer step: Flag large distances. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 14: Domain profiles

Begin with this mechanism: Original marker or gene values describe each cluster. Recreate the concrete case: A centroid enriched in collagen suggests stroma. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: A label is interpretive, not automatic. Complete the transfer step: Use independent markers and experts. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 15: Confidence score

Begin with this mechanism: The nearest and second-nearest distances measure assignment margin. Recreate the concrete case: d1=2 and d2=5 gives (5-2)/5=0.6. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: High confidence can occur for a wrong model. Complete the transfer step: Map low scores and slide MSE. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.

Workshop 16: Cross-sample validation

Begin with this mechanism: Whole-slide fit and independent anatomy test transfer. Recreate the concrete case: A held-out brain section receives existing centroids. Write mask pixels, resolution, normalized intensities, Gaussian weights, PCs, Harmony coordinates, ring averages, sample fractions, z scores, squared distances, inertia values, centroids, margins, confidence scores and slide residuals with shapes, units, denominators and assumptions. Calculate the smallest non-trivial example by hand and reproduce it in a spreadsheet or short program. Challenge this limitation: Random pixels leak specimen context. Complete the transfer step: Reserve complete specimens. Change exactly one filter, image crop, feature scale, graph rule, radius, correlation threshold, neighbour count, encoder depth, latent width, reconstruction weight, KL weight, DEC target update, mixture covariance, consensus view, linkage rule, downsampling factor, smoothing sigma, neighbourhood ring, batch correction, subsample fraction, cluster penalty, number of domains, tissue section, specimen, patient group or random seed. Explain which mathematical object changes, which conclusion survives and which claim must weaken. Keep observation, preprocessing, representation, graph, probability model, objective, optimization, cluster label, interpretation and independent validation on separate notebook lines. Reserve complete slides, tissues, patients or platforms outside tuning when testing transfer.