---
title: 'PathMNIST: Colorectal Histopathology Benchmark'
url: https://www.emergentmind.com/topics/pathmnist
type: topic
---

# PathMNIST: Colorectal Histopathology Benchmark

Searching arXiv for recent PathMNIST-related papers to ground the article in current literature.
PathMNIST is a colorectal histopathology benchmark in the MedMNIST ecosystem, used primarily for 9-class tissue classification and, increasingly, for calibration, conformal prediction, generative synthesis, machine unlearning, multimodal fusion, compact Vision Transformers, and hybrid quantum-classical learning. Across multiple reports it is described as containing 107,180 images, and several studies use the split 89,996 training / 10,004 validation / 7,180 test; most MedMNIST-style classification pipelines treat it as a small RGB image benchmark, while task-specific systems often resize or otherwise reinterpret the patches for larger backbones or generative models [2605.12917][2507.12248][2508.18509].

## 1. Dataset identity and label space

PathMNIST is consistently described as a histopathology dataset of colon tissue. One report summarizes it as “Histopathology (colon tissue)” with \(K=9\) tissue types [2605.12917], while another describes “107,180 H\&E-stained colorectal histopathology patches” with nine medically distinct colorectal histology classes [2506.00786]. A separate multimodal pilot study similarly uses PathMNIST as the static histology branch of a colorectal diagnosis pipeline and reports “107,180 H\&E-stained RGB patches” [2509.06351].

The nine classes are stable at the task level, but nomenclature varies across papers. A detailed class list includes adipose tissue, background, debris, lymphocytes, mucus, smooth muscle, normal colon mucosa, cancer-associated stroma, and adenocarcinoma epithelium [2506.00786]. Another study names the nine classes as background, mucus, smooth muscle, epithelium, immune cells, debris, connective tissue, adipose, and cancerous tissue [2509.06351]. ZACH-ViT reports adipose, background, debris, lymphocytes, mucus, epithelium, normal stroma, cancer-associated stroma, and tumor cells [2602.17929]. This suggests that the underlying 9-class benchmark is fixed, while pathology terminology is sometimes normalized differently across application domains.

Several papers use the official MedMNIST-style split of 89,996 training, 10,004 validation, and 7,180 test samples [2507.12248][2508.18509][2509.14277]. However, not all works preserve that exact protocol. The generative synthesis study instead uses an 80\% training / 20\% testing split, stratified to keep approximately \(10\text{k}\) examples per class in train, with a small hold-out from the training fold for validation [2506.00786]. The few-shot ZACH-ViT study keeps validation and test intact but samples only 50 training examples per class, for 450 total training images [2602.17929]. PathMNIST therefore functions both as a standard benchmark and as a substrate for altered data-regime studies.

## 2. Representation, resolution, and preprocessing conventions

Most classification studies treat PathMNIST as a low-resolution RGB benchmark. Multiple reports specify 28\(\times\)28 images with 3 color channels [2507.12248][2603.27377][2602.17929]. In conformal prediction experiments, the 28\(\times\)28 RGB inputs were upsampled to 224\(\times\)224 for ResNet-18 [2605.12917]. The multimodal ResNet-50 study also resizes 28\(\times\)28 to 224\(\times\)224 by bilinear interpolation and applies channel-wise normalization using empirical \(\mu\) and \(\sigma\) from the training split [2509.06351]. In the machine unlearning study, all images were center-cropped if necessary and resized to 64\(\times\)64, with standard normalization to \([0,1]\) [2508.18509].

By contrast, the generative image-synthesis study states that PathMNIST contains 107,180 H\&E-stained colorectal histopathology patches “each 224\(\times\)224 pixels” and fine-tunes Stable Diffusion v1.5 with LoRA at that scale [2506.00786]. This suggests that PathMNIST is being operationalized in two different ways across the literature: as a canonical low-resolution MedMNIST benchmark and as a higher-resolution histology patch corpus for generation-oriented workflows. The papers themselves do not reconcile that discrepancy.

Preprocessing and augmentation are similarly heterogeneous. The framework-comparison paper scales pixel values to \([0,1]\), converts labels to one-hot vectors, and uses class-weighted categorical cross-entropy with weight proportional to inverse class frequency; it reports no augmentation beyond normalization and weighting [2507.12248]. That paper also quantifies distribution shift between splits, noting that Class 2 is under-represented in the test set at 4.72\% versus 11.51\% in training, while Class 0 is over-represented at 18.64\% versus 10.41\% [2507.12248]. The non-unitary quantum study uses only random horizontal and vertical flips “to preserve histopathological realism” [2603.27377]. HQCNN applies no augmentation “to preserve raw histological textures” [2509.14277]. Other full-data classifiers use stronger image-space transforms, including random flips, rotation, color jitter, random cropping, zoom, and contrast perturbation [2509.06351][2603.21377][2506.00786]. A plausible implication is that PathMNIST is often used to probe how architectural bias interacts with preprocessing, rather than to enforce a single canonical input pipeline.

## 3. Classification, calibration, and uncertainty quantification

PathMNIST is widely used for conventional supervised classification. In a direct framework comparison, Keras, PyTorch, and JAX were given exactly the same CNN: two \(64\times(3\times3)\) convolutions, max-pooling, dropout; four \(128\times(3\times3)\) convolutions grouped into two additional pooling stages with dropout; then Flatten, Dense 256, Dense 128, and Dense 9 with Softmax. Training used Adam, learning rate \(2.7092\times10^{-4}\), weighted categorical cross-entropy, batch size 32, and 20 epochs over 10 independent runs. Reported test accuracies were 0.90 for Keras, 0.86 for PyTorch, and 0.76 for JAX; total inference time on 7,180 test images was 2.3036 s, 0.4980 s, and 0.2795 s respectively [2507.12248]. In that study, Keras gave the highest accuracy, while JAX gave the fastest training and inference.

A different full-data baseline uses an ImageNet-pretrained ResNet-50 whose final layer is replaced from \(2048\rightarrow1000\) to \(2048\rightarrow9\), with all layers unfrozen and the new fully connected layer initialized by Xavier uniform. Training used Adam with \(lr_0=10^{-4}\), weight decay \(10^{-4}\), batch size 128, at most 20 epochs, early stopping after 3 stagnant validation epochs, and ReduceLROnPlateau with factor 0.5 and patience 1. On the 7,180-image test set, after temperature calibration, this histology branch achieved 93.68\% accuracy, macro AUC 0.9958, macro F1-score 0.9083, and weighted one-vs-rest AUC 0.9958; expected calibration error fell from 0.057 before scaling to 0.030 after scaling [2509.06351]. This makes PathMNIST a calibration-sensitive benchmark as much as a pure accuracy benchmark.

The most explicit uncertainty analysis on PathMNIST is the adaptive conformal prediction study, which operates in the split-conformal setting. After fitting a base classifier \(f_\theta\), the validation set is split into tuning and calibration subsets; prediction sets \(\mathcal{C}(x)\) are then formed by RAPS. With sorted softmax scores \(\pi_{(1)}(x)\ge\cdots\ge\pi_{(K)}(x)\), the base conformal score for a true label at rank \(k\) is
\[
S_{\text{base}}(x,y)=\sum_{j=1}^{k}\pi_{(j)}(x),
\]
and RAPS adds the tail penalty
\[
S_{\text{RAPS}}(x,y)=S_{\text{base}}(x,y)+\lambda\cdot \max(0,k-k_{\text{reg}}).
\]
Instead of choosing \(\lambda\) to minimize average set size, the paper defines six disjoint strata \(G_1,\dots,G_6\) according to \(|\mathcal{C}(x)|\) and selects
\[
\lambda^*=\arg\min_{\lambda\in\Lambda_{\text{grid}}}\max_{m=1,\dots,M}\left|\mathrm{Cov}(G_m,\lambda)-(1-\alpha)\right|,
\]
with \(\alpha=0.1\) and \(\Lambda_{\text{grid}}=\{0,10^{-5},10^{-4},8\times10^{-4},9\times10^{-4},10^{-3},1.5\times10^{-3},2\times10^{-3}\}\) [2605.12917].

For PathMNIST, the paper reports the following test-set outcomes at \(\alpha=0.1\):

| Method | Coverage / Avg Size | Strat. Min |
|---|---:|---:|
| Naive | 0.9177 / 1.00 | 0.9177 |
| LAC | 0.7299 / 0.74 | 0.7299 |
| RAPS (Size) | 0.9182 / 1.00 | 0.750 |
| RAPS (Temp) | 0.9181 / 1.00 | 0.778 |
| RAPS (Adaptive) | 0.9500 / 1.12 | 0.881 |

The same study reports that RAPS(Size) and RAPS(Temp) collapse to almost all singletons at 99.9\%, with as few as eight multi-label sets whose coverage falls to 75–78\%, whereas RAPS(Adaptive) expands sets on 8.8\% of test images, i.e. 634 cases, yielding 91.2\% singleton sets, 0.0\% empty sets, global coverage 95.00\%, and at least 88.1\% coverage in every populated stratum [2605.12917]. The paper explicitly notes that no dedicated Grad-CAM visualizations on PathMNIST were included; all Grad-CAM analyses were performed on OrganAMNIST. A plausible implication is that the PathMNIST evidence in that work is numerical rather than directly visual.

## 4. Generative synthesis and self-validation workflows

PathMNIST has also been used for text-to-image generation. One system fine-tunes Stable Diffusion v1.5 with Low-Rank Adaptation on nine colorectal histopathology tissue classes, inserting trainable low-rank matrices into each attention layer such that
\[
W_\ell = W_{\ell,0} + \Delta W_\ell,\qquad \Delta W_\ell=A_\ell B_\ell,\qquad r\ll d.
\]
Training sweeps covered 1,000–3,000 diffusion steps, batch sizes 8, 16, or 32, learning rates from \(1\times10^{-5}\) to \(5\times10^{-5}\), linear warm-up, cosine decay, and a small noise offset for stability; model selection used classifier-based F1 on held-out prompts, with the best variant identified as Version 9 at 1,131 steps [2506.00786].

Prompt engineering is domain-specific and class consistent. Examples include “A 224×224 histopathology image of colorectal lymphocytes stained with hematoxylin and eosin” and “Microscopy of adenocarcinoma epithelium in colorectal tissue (H\&E stain)” [2506.00786]. The stated goal is tight text-to-image alignment at the tissue-type level rather than generic biomedical style transfer.

That generative pipeline is paired with a ResNet-18 validator trained on the same dataset. The classifier modifies only the final fully connected layer to output 9 logits, uses SGD with momentum 0.9 and weight decay \(10^{-4}\), learning rate 0.01 with step decay at epochs 30 and 60, batch size 64, 90 epochs, and early stopping if validation loss plateaus; on-the-fly augmentations include random rotation \(\pm15^\circ\), random zoom \(\pm10\%\), and random contrast \(\pm20\%\). The reported final held-out test accuracy is 99.76\% [2506.00786].

Generation and classification are linked in a self-validation loop. A generated image is classified; if the predicted label disagrees with the prompt label, the sample is discarded and regenerated. On a balanced set of 10 generated images per class, Version 9 achieved precision 0.6817, recall 0.7111, and macro F1 0.6727. Adipose tissue, lymphocytes, and debris reached near-perfect synthesis with \(F_1\approx0.90\)–1.00, while adenocarcinoma epithelium, normal colon mucosa, and mucus remained more difficult at \(F_1\approx0.45\)–0.60 [2506.00786]. The paper interprets simpler textures as easier for the diffusion model to reproduce, whereas classes with complex glandular structures or overlapping appearances remain challenging.

## 5. Unlearning, forgetting rates, and data-governance experiments

PathMNIST has been used to evaluate machine unlearning in medical imaging. The relevant study trains a ResNet-18 backbone with a final \(512\rightarrow9\) layer and cross-entropy loss, then applies SalUn, which selectively forgets a fraction \(\Delta_f\) of training samples \(\mathcal{D}_f\) by updating only the most salient weights. The saliency of a weight \(w\) is defined as
\[
s(w)=\left|\frac{\partial L(\mathcal{D}_f;\theta)}{\partial w}\right|,
\]
and the unlearned model is obtained from
\[
\min_\theta \; L(\mathcal{D}_r;\theta) + \lambda\cdot\sum_{w\in S_k}s(w),
\]
where \(S_k\) is the set of top-\(k\) weights by saliency [2508.18509].

The PathMNIST preprocessing in that study center-crops if necessary, resizes to 64\(\times\)64, and applies standard normalization to \([0,1]\). Full training uses 200 epochs, learning rate 0.1, batch size 256, weight decay \(5\times10^{-4}\), and momentum 0.9. SalUn itself runs for 10 epochs with the same learning rate, top-\(\tau=10\%\) of weights, and \(\lambda\) chosen per Fan et al. Default augmentation during both training and unlearning uses RandomResizedCrop with crop factor in \([0.8,1.0]\) and HorizontalFlip with probability 0.5; an extended setting adds RandomAugment with \(N=2\) operations and magnitude \(M=9\) [2508.18509].

Evaluation uses Unlearning Accuracy (UA), Remaining Accuracy (RA), Testing Accuracy (TA), Membership Inference Attack score (MIA), Average GAP (AG), and run-time efficiency (RTE). At a 10\% forgetting rate, full retraining gives UA 0.11, RA 100.00, TA 87.77, MIA 1.06, and RTE 160 min, whereas SalUn gives UA 1.09, RA 98.84, TA 77.49, MIA 4.43, AG 3.95, and RTE 7.6 min. At 50\%, retraining gives UA 0.20, RA 100.00, TA 91.80, MIA 1.93, and RTE 160 min, while SalUn gives UA 2.33, RA 97.82, TA 83.87, MIA 6.60, AG 4.91, and RTE 8.9 min [2508.18509]. The same paper summarizes these results as runtime reduction of approximately 95\% with Average GAP around 4 on PathMNIST.

Augmentation materially affects unlearning quality. The paper reports that NoAug yields the highest AG, Default augmentation reduces AG by approximately 5–10\%, and Default + RandomAugment yields the lowest AG with approximately 10–15\% further reduction for both 10\% and 50\% forgetting rates [2508.18509]. It also notes that higher forgetting rates and more complex histopathology lead to larger TA drops of approximately 7.9\%–10.3\%, underscoring the difficulty of forgetting intricate visual patterns in medical images.

## 6. Inductive bias, few-shot learning, and hybrid classical-quantum use

PathMNIST has become a testbed for inductive-bias arguments. In HamVision, the classification model HamCls uses a Hamiltonian oscillator bottleneck to decompose features into position \(q\), momentum \(p\), and energy \(\mathcal{H}=\tfrac12|z|^2\). At bottleneck resolution \(28\times28\) and depth \(D=384\), four directional scans produce merged \(q\) and \(p\) maps, from which a single-channel energy map \(H_{\mathrm{map}}\) is derived by squeeze-and-excitation weighting. Global pooling yields \(\bar f\in\mathbb{R}^{384}\), \(\bar p\in\mathbb{R}^{384}\), and \(\bar h\in\mathbb{R}^{16}\), which are concatenated into the 784-dimensional phase-space vector
\[
v_{\mathrm{ps}}=[\bar f;\bar p;\bar h].
\]
With AdamW, initial learning rate \(5\times10^{-4}\), weight decay \(10^{-2}\), cosine annealing, batch size 64, 100 epochs, and standard augmentation, HamCls reaches AUC 99.36 and accuracy 96.65 on PathMNIST, compared with MedViT-S at AUC 99.3 / ACC 94.2 and MedMamba-B at AUC 99.9 / ACC 96.4 [2603.21377]. The paper further states that adding the pooled energy vector improves PathMNIST accuracy by +0.25\% relative to the best SSM baseline.

A different compact hybrid system, HQCNN, combines a five-layer Conv–BatchNorm–ReLU backbone with a 4-qubit variational quantum circuit. The classical path maps \(3\times28\times28\) images to a 576-dimensional feature vector, then to 4 values feeding the quantum circuit; the quantum outputs are 8 expectation values, which are passed through \(8\rightarrow128\rightarrow9\) linear layers. The reported parameter count is approximately 90,973. Using categorical cross-entropy, Adam with learning rate \(10^{-3}\), batch size 32, and 10 epochs with early stopping, HQCNN achieves 99.59\% AUC and 93.40\% accuracy on the 9-class task, and 100.00\% AUC with 99.91\% accuracy on a binary 0-vs-1 PathMNIST subtask [2509.14277].

PathMNIST is also used to study more speculative quantum advantages. In a non-unitary quantum machine learning benchmark, a hybrid CNN–LCU model projects PathMNIST features to \(N\in\{8,10,12\}\) qubits and applies a four-layer ancilla-controlled variational circuit with post-selection. Test accuracy improves over structurally matched unitary baselines from 61.71 \(\pm\) 0.31 to 61.39 \(\pm\) 0.36 at 8 qubits, 62.02 \(\pm\) 0.43 to 61.56 \(\pm\) 0.63 at 10 qubits, and 62.65 \(\pm\) 0.48 to 61.91 \(\pm\) 0.73 at 12 qubits. Relative to a pure-classical CNN baseline at 62.10\%, the Fisher efficiency \(\eta_F\) shifts from \(-0.08\%\) at 8 qubits and \(-0.02\%\) at 10 qubits to \(+0.12\%\) at 12 qubits, which the paper interprets as a threshold-dependent “Fisher efficiency transition” [2603.27377].

At the opposite end of the data regime, ZACH-ViT studies PathMNIST under a strict few-shot protocol with only 50 training samples per class. The model removes both positional embeddings and the \([CLS]\) token, patchifies each 28\(\times\)28 image into non-overlapping \(16\times16\) patches, uses \(L=2\) transformer blocks with 8 attention heads and 0.25M parameters, and aggregates final patch embeddings via
\[
h=\frac{1}{N}\sum_{i=1}^{N} Z_L^{(i)}.
\]
With AdamW, learning rate \(10^{-4}\), batch size 16, 23 epochs, and five random seeds, it achieves Macro-F1 \(=0.578\pm0.041\), essentially matching TransMIL at \(0.577\pm0.048\) under the same 50-shot scratch-trained protocol [2602.17929]. That paper explicitly places PathMNIST in a “weak spatial-structure” regime and argues that histology patches behave more like unordered collections of cells than anatomically anchored photographs.

Taken together, these studies indicate that PathMNIST is not merely a high-accuracy colorectal tissue benchmark. It is also a regime-sensitive probe for calibration, prediction-set reliability, generative fidelity, unlearning quality, permutation-invariant inductive bias, and hybrid classical-quantum parameter efficiency. A plausible implication is that its scientific value lies less in any single leaderboard number than in the way it exposes methodological differences under controlled but highly variable experimental assumptions.

Source: https://www.emergentmind.com/topics/pathmnist