The problem: telling a benign breast lesion from carcinoma in situ, or in situ from invasive cancer, changes treatment, and it depends on cell-level detail that busy pathology services can miss. PhytopathAI reads an H&E-stained microscopy image and sorts it into normal tissue, benign lesion, in situ carcinoma or invasive carcinoma, then shows exactly which parts of the image drove the answer.
Results on held-out images
Trained on 320 images from the BACH 2018 dataset and tested once on 80 images it had never seen, 20 per class.
| Measure | Result |
|---|---|
| Four-class accuracy | 85.0% (95% interval 76–92%) |
| Carcinomas detected (in situ or invasive) | 40 of 40 |
| Non-cancer images correctly cleared | 36 of 40 |
| Macro F1 | 0.85 |
| Cross-validated accuracy (320 images) | 81.6% |
What made the difference
I compared 20 designs fairly: five neural networks from 4 to 28 million parameters, each fed either the whole image shrunk to 224×224 pixels or 12 higher-resolution patches, with and without stain colour normalisation. Every design was scored by cross-validation, and only the winner touched the test images.
- Resolution beat size. Patches lifted every network, by 6 points on average. A bigger network did not reliably do better.
- Stain normalisation made no net difference on this single-site dataset.
- The winner: a frozen ResNet50 reading 12 patches, with a simple logistic regression on top.
Explanations you can trust
Because the final classifier is linear, its explanations are exact rather than approximate: an activation map shows where inside each patch the evidence sits, and a SHAP value for each of the 12 patches adds up exactly to the model's score. The app also refuses images that don't look like histology, because a classifier will otherwise label a photo of anything as cancer.
How I kept it honest
Auditing my own thesis: the original model reported 78.75%, but it had picked its best training epoch using the test images. Retrained correctly, it scored 68.75%. The rebuilt pipeline separates validation from test data and fixes the comparison rules before any result is seen.
Lesion grouping: an unsupervised grouping of lesion images mainly separates invasive from early lesions; I report it as that, not as new subtypes.
Plant compounds: each lesion group links to eight plant-derived compounds with published laboratory evidence, each with its mechanism, evidence tier and source. It's a literature map, not a treatment recommendation.
Research prototype from my BSc thesis. Not a medical device and not for diagnosis or treatment decisions.