The Labeling Problem in Skin Cancer: Rethinking Melanoma Detection with Semi-Supervised Learning
A pathologist can diagnose melanoma from a single glance at a stained slide. Teaching a model to do the same runs into a much older problem: there's never enough labeled data. Notes from an active research project at NCAI.

Most people picture melanoma as a mole that looks a little wrong — asymmetric, oddly bordered, too many colors. That picture isn't false, but it's the easy 5% of the problem. The diagnosis that actually decides treatment doesn't happen on skin. It happens under a microscope, on a slide of tissue stained pink and purple, where a pathologist reads patterns that took years to learn to see. Teaching a model to read those same slides is the project I'm currently working on at NCAI, and it's forced me to think hard about a problem that has nothing to do with model architecture: where do the labels come from, and what do you do when there aren't enough of them?
What melanoma actually looks like

The clinical picture above is a real melanoma, and it shows exactly what dermatologists are trained to look for: asymmetry, an irregular border, more than one shade of brown or black, a diameter that's grown past what a normal mole should be. This is the ABCDE rule, and it's genuinely useful as a first screen. But it's also where the easy part of the problem ends. A visual exam can tell a clinician "this looks suspicious." It can't tell them how deep the tumor has grown, whether it's ulcerated, or what subtype it is — and all three of those drive the treatment plan. For that, the lesion has to be biopsied and read under a microscope.
Where the real diagnosis happens: the slide, not the photo

This is what a pathologist actually reads: a hematoxylin-and-eosin (H&E) stained tissue section, viewed at multiple magnifications. At low power, the concern is architecture — has the normal layered structure of the skin broken down, is there an asymmetric nest of cells pushing into the dermis. At high power, it's cellular detail — enlarged, hyperchromatic nuclei, prominent nucleoli, irregular chromatin, the loss of the orderly single-file arrangement melanocytes normally keep. A 2025 study by Akbarpour, Fazlollahiaghamalek, Barati, Hashemi Kamangar, and Mandal, working out of the University of Alberta, applied an enhanced CNN architecture with test-time augmentation and an ensemble strategy to exactly this task — nuclei segmentation and melanoma-region detection — and reported Dice scores above 91% for nuclei and just under 88% for melanoma regions. That's a strong supervised result, and it's a useful reference point. But it also raises the question that actually matters for anyone trying to build on top of it: what did it take to get there, and does that scale?
The core problem: melanoma histopathology doesn't come with enough labels
A whole-slide image is enormous — often billions of pixels — so no model reads it in one pass. The standard approach breaks it into a pipeline: detect tissue, cut it into patches, learn features from those patches, classify each one, then stitch the patch-level predictions back into a slide-level call.
Whole-slide image → tissue detection, discarding empty background
Patch extraction — thousands of candidate regions per slide
Feature learning on each patch
Patch-level prediction, aggregated into a slide-level melanoma call
Every one of those patches is a training example a model could learn from — but only if it's labeled, and labeling a patch reliably requires a pathologist's time and judgment, not a crowdworker's. In practice, a realistic dataset ends up looking like a small labeled core surrounded by a much larger unlabeled majority: a few hundred carefully annotated images, and thousands more that exist but say nothing on their own. A conventional supervised pipeline trains on the labeled core and simply ignores the rest. That's the part that bothered me enough to build a project around it — those unlabeled images still encode real information about tissue structure, staining variation, and cellular morphology. Throwing them away isn't a neutral choice; it's giving up signal that's sitting right there.
What semi-supervised learning actually buys you
Semi-supervised learning sits between the two extremes: it doesn't need every image labeled, and it doesn't ignore labels either. The labeled set defines the task; the unlabeled set teaches the model about the structure of the data itself — texture, morphology, staining variation — often more of it than any labeled set could show on its own. Several techniques fall under this umbrella, and they earn their keep in different ways.
| Technique | How it uses unlabeled data | Main risk |
|---|---|---|
| Autoencoders | Compress and reconstruct images to learn features without needing a class label at all | Learned features may capture staining artifacts rather than biologically meaningful structure |
| GANs | Generate synthetic tissue images for augmentation or representation learning | A visually convincing synthetic slide can still be biologically meaningless |
| Pseudo-labeling | Use the model's own confident predictions on unlabeled patches as temporary training labels | A confidently wrong prediction becomes a confidently wrong label, and the model reinforces its own mistake |
| Consistency regularization | Require stable predictions when the same patch is lightly augmented or transformed | Not every augmentation that's harmless for natural images is harmless for stained tissue |
For this project I'm leaning toward a Mean Teacher-style setup — a student model trained on labeled data with a standard classification loss, plus a consistency objective that pulls its predictions on unlabeled data toward those of a slower-moving teacher version of itself. It's a reasonably well-tested design in other imaging domains, which matters, because histopathology is not a place to debut an untested idea and hope.
Why the baseline matters more than the fancy model
It's tempting to skip straight to the interesting architecture. I think that's usually a mistake, and it's the first thing I locked in for this project: a fully supervised CNN, trained on the labeled data alone, has to exist and be measured before any semi-supervised claim means anything. The question that actually matters isn't "did the semi-supervised model hit 90% accuracy" — it's "can it match or beat the supervised baseline while using substantially fewer labels than that baseline needed." Only the second question tells you whether the unlabeled data did real work.
Evaluation: accuracy is the wrong first question
Melanoma datasets are typically dominated by benign cases, which makes accuracy a genuinely misleading headline metric — a model that predicts "benign" almost every time can post a high accuracy score while missing most of the melanomas it exists to catch. Sensitivity, specificity, and ROC-AUC matter more here, because in a diagnostic context a missed melanoma and an unnecessary follow-up biopsy are not remotely equivalent costs. That asymmetry has to be built into the evaluation plan before a single experiment runs, not bolted on afterward to explain a disappointing accuracy number.
The one mistake that invalidates everything: data leakage
There's a failure mode in histopathology evaluation that's easy to miss and expensive when you do: splitting patches randomly into train and test sets, when multiple patches from the same patient — or the same slide — end up on both sides of the split. The model ends up being tested on tissue that's practically a neighbor of something it trained on, and the reported performance describes memorization dressed up as generalization. The fix is unglamorous but non-negotiable: split at the patient or slide level, so an entire patient's tissue lives entirely in train, validation, or test, never spread across more than one.
Where this project stands right now
I want to be direct about this rather than let a polished write-up imply more than is true: this project is active, not finished. Right now the work is in dataset curation and experimental design — confirming that the labeled melanoma corpus and the candidate public unlabeled datasets are actually compatible in staining protocol, resolution, and tissue characteristics, and locking in the supervised baseline before touching semi-supervised training. There are no accuracy, sensitivity, or AUC numbers to report yet, and I'd rather say that plainly than round up. What is settled is the question the project is built to answer: how much of a pathologist's labeling effort can be recovered by making better use of the data that was never labeled in the first place. I'll be updating this page as the baseline and subsequent experiments land.
Key takeaways
- A clinical photo can flag a suspicious lesion, but the diagnosis that drives treatment happens on a stained tissue slide under a microscope.
- Most realistic histopathology datasets are a small labeled core surrounded by a much larger unlabeled majority — semi-supervised learning is about not discarding that majority.
- A supervised baseline has to exist before a semi-supervised claim means anything; the real question is how few labels the unlabeled data lets you get away with.
- Accuracy is the wrong headline metric for an imbalanced diagnostic task — sensitivity, specificity, and ROC-AUC reflect the actual cost of a missed melanoma.
- Patient- or slide-level data splitting isn't optional — patch-level random splitting quietly turns memorization into what looks like generalization.

