PathMNIST Histology Classification

The CNN reached 86.25% test accuracy, compared with 69.16% for Random Forest and 67.83% for the MLP. This coursework study used a 32,000-training / 8,000-test subset of 28 × 28 PathMNIST tissue patches.

Local PathMNIST samples exported from the included training split

Stroma remains difficult

The CNN's F1 is 0.678 for cancer-associated stroma, compared with 0.851 for normal colon mucosa. Inspect class scores and the confusion matrix to see where the aggregate result hides weaker performance.

Inspect stroma →

Spatial modelling is a plausible explanation for the CNN advantage, but architecture, preprocessing and training also differ. This comparison does not isolate the cause, report repeat-run variation, or establish clinical performance. The images below are labelled training examples, not identified test errors.

Best model CNN

Highest score among these three trained models.

Test accuracy 86.25%

Measured on the held out 8,000 image test set.

Macro F1 0.8607

Class balanced score across all nine categories.

Model Comparison

Final models were trained from the selected hyperparameters and evaluated on the same test split.

Accuracy and Macro F1

Same test set, different model families.

Training Cost

Accuracy came with a longer CPU run.

Interactive Results

Inspect confusion matrices, tuning results, and training histories.

Convolutional Neural Network Confusion matrices

Class Explorer

Review sample patches, class balance, and per class F1 scores for each tissue category.

Method Notes

The models used the same test split but different preprocessing and training procedures.

Dataset

The assignment subset contains 32,000 training images and 8,000 test images. Every patch is a 28 by 28 RGB crop from PathMNIST.

Training and test class distribution chart

Preprocessing

Random Forest used flattened pixels with PCA, MLP used flattened standardized vectors, and CNN kept the image tensor shape.

Example of image and preprocessing views

Interpretation

Flat pixel models struggled on glandular and stromal texture. The CNN improved scores for normal mucosa and adenocarcinoma. Clinical performance was not evaluated.