Colorectal Cancer Tissue Classification (Deep Learning)
A custom CNN that beat VGG16 transfer learning at classifying eight histopathology tissue types.

- Role
- Solo project / independent build
- Stack
- TensorFlow/Keras, scikit-learn, NumPy
- Scope
- 5,000 histology images · 8 tissue types
- Source
- View on GitHub
5,000
Histology images
8
Tissue classes
0.94
Custom CNN accuracy & macro-F1
0.89
VGG16 transfer-learning baseline
How it came together.
- 01
The problem
Colorectal cancer diagnosis leans heavily on manual histopathology, which is slow, expertise-driven, and prone to variability between readers. I wanted to see how far a from-scratch deep-learning model could go at automating tissue classification, working with the TensorFlow colorectal_histology dataset: 5,000 images at 150×150 resolution across 8 tissue types (tumour, debris, stroma, lymphocytes, complex, mucosa, adipose, empty).
- 02
The model
I designed a custom CNN with convolutional blocks scaling from 32 to 256 filters, using batch normalisation, max-pooling, and dropout to keep it stable and regularised. On held-out data it reached 0.94 accuracy and 0.94 macro-F1, which was strong and, importantly, even across all eight classes rather than carried by the easy ones.
- 03
The benchmark
To know whether that was actually good, I benchmarked it against the standard move: VGG16 transfer learning with ImageNet weights and fine-tuning. That reached 0.89 accuracy and 0.89 macro-F1, respectable but below my custom network. The takeaway I drew is the interesting part: on this task, domain-specific feature learning outperformed generic pretrained features. Transfer learning isn't automatically the right answer.
What it produced.
03 figures

- Fig. 02

Training curves: custom CNN (Model 1) against VGG16 transfer learning (Model 2). - Fig. 03

VGG16 confusion matrix: 0.89 accuracy, trailing the custom CNN's 0.94.
- TensorFlow/Keras
- scikit-learn
- NumPy
Have a similar problem to solve?Let's talk it through.
I'm looking for a junior data analyst or analytics engineer role in Sydney. If something here looks like the work you need doing, get in touch.
Open to opportunitiesSydney, Australia

