Comparison of three machine learning approaches on PathMNIST. We are given 28×28 RGB patches of haematoxylin and eosin–stained colorectal cancer histology, across 9 tissue classes.
Write-up: PathMNIST: a battle of classifiers. -> Describes how the three models were chosen, what the tuning turned up, and where they disagree.
| Model | Description |
|---|---|
| SVM (RBF) + PCA | StandardScaler -> PCA -> SVC(kernel="rbf"), tuned by grid search with 3-fold stratified CV |
| MLP | Two dense hidden layers with dropout, Keras |
| CNN | Small VGG-style network (2 conv blocks + dense head), Keras |
Each model follows the same pipeline: a baseline run, a hyper-parameter search selected on a held-out validation split, then a final tuned model evaluated once on the test set. The notebook closes with a cross-model comparison of test accuracy, macro-F1, runtime, confusion matrices and per-class F1.
The dataset/ folder holds the pre-split arrays:
X_train.npy—(32000, 28, 28, 3)uint8y_train.npy—(32000,)integer labels in{0, ..., 8}X_test.npy—(8000, 28, 28, 3)uint8y_test.npy—(8000,)
Classes: Adipose, Background, Debris, Lymphocytes, Mucus, Smooth muscle, Normal colon mucosa, Cancer-associated stroma, Colorectal adenocarcinoma epithelium.
PathMNIST is part of the MedMNIST collection (Yang et al., 2023).
pip install numpy pandas matplotlib seaborn scikit-learn tensorflow
jupyter lab pathmnist_image_classification.ipynbTested with Python 3.12, scikit-learn 1.3+ and TensorFlow/Keras 2.15+. Everything runs on CPU; the SVM is tuned on a 6000-image stratified subset and trained on 12000 images to keep the kernel computation tractable.