Semi-Supervised Learning Explained: How AI Learns from 90% Unlabeled Medical Images
It was nearly midnight when Rohan received a message from Dr. Meera.
“We have the medical images you asked for. But there is one problem.”
Rohan was a machine learning engineer working with a hospital to build an AI system that could help identify signs of pneumonia in chest X-rays. For weeks, he had been waiting for the hospital’s imaging dataset.
He immediately opened the shared folder.
Inside it were thousands of chest X-ray images.
At first, this looked like a machine learning dream.
More data usually means a better model, right?
But when Rohan opened the accompanying spreadsheet, his excitement disappeared.
Out of every 1,000 X-ray images, only around 100 had been carefully reviewed and labeled by radiologists. The remaining 900 images had no confirmed label at all.
The labeled images clearly said things such as:
Normal
Possible pneumonia
Confirmed pneumonia
The other images were simply stored with patient IDs and scan dates. They contained useful visual information, but no answer telling the model what each image represented.
Rohan leaned back in his chair.
He had plenty of data, but very few labels.
This is exactly the kind of problem that semi-supervised learning is designed to solve.
What Is Semi-Supervised Learning?
Semi-supervised learning is a machine learning approach that trains a model using two types of data:
A small collection of labeled examples
A much larger collection of unlabeled examples
The labeled examples teach the model what the correct answers look like. The unlabeled examples help it understand the wider structure, patterns and variations present in real-world data.
In Rohan’s project, the dataset looked like this:
100 labeled chest X-rays
900 unlabeled chest X-rays
That means only 10% of the images had verified answers, while 90% were unlabeled.
This 90% split is our practical example, not a universal rule for every semi-supervised learning project. A real project might have 5%, 20% or 40% labeled data. The essential idea remains the same: use a limited amount of trusted labeled data while learning additional information from a larger unlabeled dataset.

A Simple Classroom Example
Imagine a teacher showing a child ten pictures of animals.
The teacher labels them carefully:
This is a dog.
This is a cat.
This is a horse.
After that, the child is given another ninety animal pictures without names.
The child does not suddenly forget everything because the new pictures are unlabeled. Instead, the child starts comparing them with what has already been learned.
An animal with pointed ears, whiskers and a small face may resemble the labeled cats. Another image with a long face, mane and large body may resemble the labeled horses.
The unlabeled pictures do not directly provide answers, but they expose the child to more shapes, sizes, backgrounds, angles and variations.
Semi-supervised learning works in a similar way.
A machine learning model first learns from a small number of trusted answers. It then examines unlabeled examples and looks for patterns that support or refine what it has already learned.
Why Medical Image Classification Has a Labeling Problem
Medical organizations can produce enormous quantities of X-rays, CT scans, MRI scans, ultrasound images and pathology slides.
However, storing an image and correctly labeling it are two completely different tasks.
A normal photograph can sometimes be labeled by almost anyone. Medical images usually require specialist knowledge. A radiologist may need to inspect subtle patterns, compare previous scans, review the patient’s history and consider laboratory results before confirming a diagnosis.
That makes high-quality medical annotation expensive and time-consuming. Research on medical imaging repeatedly identifies expert annotation scarcity as one of the main limitations of supervised deep learning systems.
expert annotation scarcity is one of the main limitations of supervised deep learning systems.
Why Not Ask Radiologists to Label Everything?
Dr. Meera explained the problem to Rohan the next morning.
“Suppose a radiologist needs only a few minutes to review one scan,” she said. “Now multiply that by tens of thousands of scans. Those are hours taken away from clinical work.”
And classification is often the simpler case.
For medical image segmentation, an expert may need to draw a precise boundary around a tumour, organ, lesion or abnormal tissue region. This requires much more effort than assigning a single label such as “normal” or “abnormal.”
Therefore, hospitals often possess large archives of potentially useful medical images, while only a small percentage have labels suitable for machine learning.
This creates an unusual situation:
The information exists inside the images, but the model has not been told how to interpret most of it.
Semi-supervised learning attempts to unlock that information without pretending that unlabeled data is automatically correct or safe.
Supervised vs Unsupervised vs Semi-Supervised Learning
Before following Rohan’s project, it helps to understand how semi-supervised learning differs from the two better-known learning approaches.

Supervised Learning Uses Labeled Data
In supervised learning, every training example is paired with a known answer.
For a chest X-ray classifier, the training data might look like this:
X-ray 001 → Normal
X-ray 002 → Pneumonia
X-ray 003 → Normal
The model makes a prediction, compares it with the correct answer and adjusts itself whenever the prediction is wrong.
This method can work extremely well when the dataset is large, representative and accurately labeled.
The problem is that obtaining enough reliable labels may be difficult, particularly in medicine.
If Rohan trained his model using only the 100 labeled images, the model might memorize patterns from that small sample instead of learning features that generalize across different patients, machines and imaging conditions.
Unsupervised Learning Uses No Human-Provided Labels
Unsupervised learning starts without known answers.
The model may group similar images, identify unusual samples or learn useful representations from recurring patterns. It might discover that certain X-rays appear visually similar, but it does not automatically know whether a group represents healthy lungs, pneumonia or an imaging artifact.
Unsupervised learning is useful for exploring data, but it does not directly provide the trusted clinical guidance required for Rohan’s classification task.
Semi-Supervised Learning Combines Both Worlds
Semi-supervised learning sits between these approaches.
It uses the 100 radiologist-labeled images as a reliable foundation and the 900 unlabeled images as additional learning material.
A simple way to remember the difference is:
Supervised learning: Learn from questions with answers.
Unsupervised learning: Search for patterns without an answer sheet.
Semi-supervised learning: Start with a small answer sheet, then learn carefully from the unanswered questions.
This combination can be valuable because unlabeled data may reveal variations that are missing from the small labeled set.
For example, the 100 labeled X-rays may contain images from only one scanner or a limited age group. The unlabeled collection might include different scanner settings, body positions, image contrast levels and patient characteristics.
The model is not simply receiving more images. It is being exposed to a broader version of the real world.
If your AI system needs to make sequential decisions through rewards instead of learning from static datasets, check out our guide on Reinforcement Learning with Real Examples."
How Can AI Learn When the Correct Label Is Missing?
This was the question bothering Rohan.
A supervised model learns by comparing its prediction with a verified answer. But for an unlabeled image, there is no verified answer available during training.
So what exactly can the model learn?
The answer becomes easier to understand through three basic assumptions.
Assumption 1: Similar Images Often Share Similar Labels
If two chest X-rays have highly similar medically relevant features, there is a reasonable possibility that they belong to the same class.
This does not mean visually similar images are always medically identical. It means similarity can provide a useful learning signal when applied carefully.
Researchers often describe this as the smoothness assumption: nearby examples in a meaningful feature space are likely to have similar outputs.
Assumption 2: Data Often Forms Natural Groups
Images with similar characteristics may appear close together, creating clusters using Unsupervised Learning techniques.
Imagine placing every X-ray on a giant invisible map.
Images with similar characteristics may appear close together, creating clusters. One region might contain mostly normal scans, while another contains scans with patterns associated with pneumonia.
The labeled images provide a few known points on this map. The unlabeled images help reveal the map’s full shape.
This is known as the cluster assumption.
Assumption 3: Small Safe Changes Should Not Reverse a Prediction
Suppose an X-ray is slightly cropped, brightened or viewed with minor noise.
Its medical meaning should not suddenly change.
A model that predicts “normal” for the original image and “pneumonia” after a harmless visual adjustment is behaving inconsistently.
Semi-supervised methods can train the model to produce stable predictions for multiple reasonable versions of the same image. This principle is called consistency regularization.
Modern approaches such as FixMatch combine consistency regularization with carefully filtered pseudo-labels, using only predictions that pass a confidence threshold.
At this point, Rohan finally saw a possible path forward.
He could train an initial model using the 100 radiologist-labeled X-rays. The model could then examine the remaining 900 images and generate tentative predictions.
But a dangerous question remained:
What happens when the model confidently gives an unlabeled image the wrong answer?
In medical AI, a confident mistake cannot simply be ignored.
That is where pseudo-labeling, confidence thresholds and teacher-student models enter the story.
How Semi-Supervised Learning Uses Unlabeled Medical Images
The next morning, Rohan entered Dr. Meera’s office carrying a notebook filled with diagrams.
“I understand how unlabeled images can expose the model to more real-world variation,” he said. “But we still have the same problem. Those 900 images do not contain verified answers.”
Dr. Meera looked at the first diagram.
“So the model will have to create its own answers?”
“Temporary answers,” Rohan replied. “And we should trust only the ones it is reasonably confident about.”
Those temporary answers are called pseudo-labels.
Step 1: Train an Initial Model on Labeled Medical Images
Rohan could not begin directly with the 900 unlabeled X-rays.
First, he needed a basic model capable of recognizing at least some meaningful patterns. He therefore trained an initial chest X-ray classifier using the 100 images labeled by radiologists.
During this supervised training stage, the model gradually learned visual features associated with the two classes:
Normal chest X-ray
Possible pneumonia
It might learn that certain patterns in the lungs frequently appear in positive pneumonia cases. However, the model does not understand lungs, infections or patients in the way a doctor does. It identifies statistical patterns that help separate one class from another.
After training, the model was not ready for clinical deployment. One hundred labeled images were far too limited for that.
Still, it now had enough basic knowledge to begin examining the unlabeled collection.

Step 2: Generate Pseudo-Labels for Unlabeled Data
Rohan passed the first unlabeled X-ray through the model.
The prediction appeared on his screen:
Normal: 97% confidence
For the next image, the model produced:
Pneumonia: 96% confidence
But the third prediction was less convincing:
Pneumonia: 54% confidence
A basic pseudo-labeling system converts a model’s prediction into a temporary training label. In this example, the first image could receive the pseudo-label “normal,” while the second could receive “pneumonia.”
The third image was different.
A 54% prediction meant the model was almost divided between the available classes. Treating that prediction as a reliable label could introduce an incorrect example into the training process.
That is why a practical pseudo-labeling workflow usually includes a confidence threshold.
What Is a Confidence Threshold in Pseudo-Labeling?
A confidence threshold is the minimum prediction confidence required before an automatically generated pseudo-label is accepted for training.
Suppose Rohan selected a confidence threshold of 95%.
The process would work like this:
A prediction with 98% confidence is accepted.
A prediction with 96% confidence is accepted.
A prediction with 82% confidence is temporarily ignored.
A prediction with 54% confidence is ignored.
The model does not permanently delete the uncertain images. It simply avoids learning from them at that stage.
As the model improves, some previously uncertain images may receive stronger predictions in a later training round.

Why High Confidence Does Not Guarantee a Correct Label
Rohan noticed something important while reviewing the predictions.
One image had been classified as pneumonia with 97% confidence. When Dr. Meera inspected it, she disagreed.
The model was highly confident—and still wrong.
Machine learning confidence does not represent medical certainty. It only indicates how strongly the model prefers one available class based on what it has learned.
A poorly trained or poorly calibrated model can make incorrect predictions with extremely high confidence.
This creates one of the biggest risks in pseudo-labeling: confirmation bias.
The Confirmation Bias Problem in Semi-Supervised Learning
In machine learning, confirmation bias occurs when a model makes an incorrect prediction, treats that prediction as a training label and then becomes even more confident in the same mistake.
Imagine the initial model incorrectly labels an X-ray as pneumonia.
That image is added to the training dataset with the wrong pseudo-label. During the next training cycle, the model is effectively told:
“Your previous prediction was correct. Learn this pattern more strongly.”
The model may then use that incorrect lesson when classifying other similar images.
One error can influence another error, creating a feedback loop.
Research on pseudo-labeling and teacher–student methods recognizes this reinforcement of incorrect predictions as a central challenge in semi-supervised learning.
How Rohan Reduced the Risk of Incorrect Pseudo-Labels
Rohan could not completely eliminate pseudo-label errors, but he could reduce their impact.
He decided to:
Accept only high-confidence pseudo-labels
Keep a separate radiologist-verified validation set
Prevent pseudo-labeled data from overpowering trusted labeled data
Review unusual and clinically important cases
Monitor performance separately for each class
Repeat training gradually instead of accepting every prediction at once
Most importantly, he treated pseudo-labels as provisional training signals, not medical ground truth.
This distinction matters.
A radiologist-approved label and a model-generated pseudo-label should not carry the same level of trust.
How Teacher–Student Models Improve Semi-Supervised Learning
Rohan’s first workflow used one model to predict pseudo-labels and then learn from those same predictions.
It worked, but it felt like asking a student to write an answer, mark it and then use that mark to prepare for the next exam.
He needed a more stable arrangement.
That led him to the teacher–student learning model.
The Teacher Model Creates Stable Training Targets
In a teacher–student framework, two related models perform different roles:
The teacher model produces targets or pseudo-labels.
The student model learns from those targets.
The student receives labeled and unlabeled medical images during training. The teacher observes the student’s progress and provides more stable predictions for the unlabeled examples.
In the Mean Teacher approach, the teacher’s parameters are updated using an exponential moving average of the student’s parameters. This generally makes the teacher change more smoothly than the student instead of copying every temporary fluctuation immediately.
Rohan explained it to Dr. Meera using a familiar example.
“Imagine a medical trainee who changes their opinion after every new case,” he said. “Now imagine a senior doctor whose judgement reflects experience across many cases. The senior doctor’s response is usually more stable.”
The comparison was not perfect, but it captured the central idea.

How the Teacher and Student Learn Together
Rohan’s teacher–student workflow followed a repeating cycle:
The teacher examined an unlabeled chest X-ray.
It generated a high-confidence pseudo-label.
The student received a modified version of the same image.
The student attempted to predict the teacher’s label.
The training system measured the difference between their predictions.
The student updated its parameters.
The teacher was gradually updated using the student’s newer parameters.
Over time, the student learned not only from the 100 verified labels but also from stable patterns found across the 900 unlabeled images.
Medical imaging research has explored similar consistency-based and self-ensembling approaches, including methods that compare relationships among medically similar cases rather than evaluating every image entirely in isolation.
Why the Same Medical Image Is Shown in Two Different Ways
One afternoon, Dr. Meera saw two versions of the same X-ray on Rohan’s screen.
One looked almost unchanged. The other had been cropped and adjusted slightly.
“Why are you duplicating the image?” she asked.
“I’m checking whether the model understands the medical pattern,” Rohan replied, “or whether it is depending on one exact presentation of the image.”
This technique is part of consistency regularization.
Weak and Strong Image Augmentation
A weakly augmented image contains only a small, safe transformation. A strongly augmented image receives more noticeable—but still clinically appropriate—changes.
A semi-supervised method can generate a pseudo-label from the weakly modified image and ask the model to produce the same class for the strongly modified version.
FixMatch, a widely studied semi-supervised method, combines this idea with confidence-based pseudo-labeling: a prediction from a weakly augmented image is retained only when confidence is high, and the model is then trained to reproduce that label from a strongly augmented version.
The underlying lesson is simple:
If the medically relevant information has not changed, the model’s conclusion should remain reasonably stable.
However, medical augmentation requires caution. Flipping, cropping or removing the wrong region could alter clinically meaningful information. Transformations suitable for everyday photographs are not automatically safe for X-rays, MRIs or pathology slides.
The augmentation policy must respect the imaging modality and the clinical task.
The Complete Semi-Supervised Medical Imaging Workflow
By the end of the week, Rohan had designed a complete training pipeline.

The workflow now looked like this:
Phase 1: Prepare the Dataset
The team separated the 100 radiologist-labeled images from the 900 unlabeled images.
They also created an independent validation dataset containing only expert-verified labels. This dataset would not be used to generate pseudo-labels or train the model.
Phase 2: Train the Baseline Model
The initial classifier learned only from the trusted labeled images.
Its performance became the baseline against which the semi-supervised model would later be compared.
Phase 3: Predict Unlabeled Images
The trained model examined the unlabeled X-rays and produced class probabilities.
Only predictions above the selected confidence threshold became pseudo-label candidates.
Phase 4: Apply Consistency Training
The model received different clinically appropriate versions of the same unlabeled image and learned to keep its prediction stable.
Phase 5: Retrain with Two Learning Signals
The model now learned from:
A supervised loss based on radiologist-verified labels
An unsupervised consistency loss based on accepted pseudo-labels
The trusted labels taught the model what the correct classes meant. The unlabeled images helped it learn a broader and more stable decision boundary.
Phase 6: Evaluate on Expert-Verified Data
Finally, Rohan evaluated the new model on the untouched validation set.
This was the moment that mattered.
The purpose of semi-supervised learning was not to generate the largest possible number of pseudo-labels. It was to build a model that performed better on real, expert-verified cases than the original supervised baseline.
But when Rohan opened the first evaluation report, he found another problem.
The overall accuracy looked impressive.
Yet the model was excellent at identifying normal scans and surprisingly weak at detecting the less common pneumonia cases.
The unlabeled data had helped—but the final accuracy score was hiding a dangerous imbalance.
Why Accuracy Can Be Misleading in Medical Image Classification
Rohan stared at the evaluation report again.
The model had achieved 92% accuracy.
At first glance, that looked excellent. A number above 90% was exactly the kind of result that could impress a presentation room.
But Dr. Meera did not celebrate.
“How many pneumonia cases did it miss?” she asked.
Rohan opened the class-wise results, and the problem became clear.
The test dataset contained:
90 normal chest X-rays
10 pneumonia chest X-rays
The model correctly classified 89 normal scans. However, it detected only three of the ten pneumonia cases.
Because normal images formed most of the dataset, the overall accuracy still looked high.
But seven patients with possible pneumonia had been missed.
In a medical setting, that was not a small statistical weakness. It was a serious clinical concern.

The Class Imbalance Problem
Class imbalance occurs when one category appears much more frequently than another.
In medical image classification, a dataset may contain thousands of normal scans but relatively few examples of a rare disease. A model can therefore achieve high accuracy by becoming very good at predicting the majority class.
Consider a dataset containing 990 normal scans and only 10 scans showing a rare condition.
A model that predicts “normal” for every image would achieve 99% accuracy.
Yet it would detect none of the patients who actually had the condition.
That is why a semi-supervised learning medical imaging model should never be judged using accuracy alone.
Which Metrics Should Be Used for Medical Image Classification?
Rohan rebuilt the evaluation dashboard so that the team could see more than one attractive number.
Sensitivity: How Many Positive Cases Were Detected?
Sensitivity, also called recall, measures how many actual positive cases the model successfully identifies.
In Rohan’s pneumonia example, the model detected only three out of ten positive cases. Its sensitivity was therefore low, even though its overall accuracy appeared strong.
High sensitivity is often important when missing a disease could delay further investigation or treatment.
However, maximizing sensitivity without considering other metrics may cause the model to flag too many normal scans as suspicious.
Specificity: How Well Does the Model Recognize Normal Cases?
Specificity measures how many actual negative cases are correctly identified.
A model with high specificity produces fewer false alarms among normal scans.
The balance between sensitivity and specificity depends on the intended clinical use. A preliminary screening system may prioritize sensitivity, while another workflow may require a different balance.
The correct threshold should be selected with clinicians, not chosen only because it produces the most impressive graph.
Precision: Can We Trust a Positive Prediction?
Precision measures how many images predicted as positive are actually positive.
If a model flags 100 scans as pneumonia but only 20 are confirmed, its positive predictions may create unnecessary reviews, anxiety and additional testing.
Precision helps reveal whether the model is generating too many false positives.
F1 Score: Balancing Precision and Recall
The F1 score combines precision and recall into a single measure.
It is useful when the positive class is less common and both missed cases and false alarms matter.
Still, Rohan knew that no single metric could describe every clinical consequence. The team needed to inspect multiple measures together.

How to Evaluate a Semi-Supervised Learning Model Safely
Rohan and Dr. Meera agreed on a stricter evaluation process.
Compare Against a Supervised Baseline
The semi-supervised model needed to outperform the original model trained only on labeled data.
Using more data did not automatically mean the new system was better.
If pseudo-label errors introduced noise and reduced sensitivity, the semi-supervised workflow could be worse than the simpler baseline.
Use Only Verified Labels for Final Testing
Pseudo-labeled images could support training, but they could not be treated as reliable ground truth during final evaluation.
The test dataset had to contain labels reviewed by qualified experts.
Otherwise, the model might be evaluated using answers it had indirectly created itself.
Test on Data from Different Sources
A model trained on images from one hospital may learn patterns associated with that hospital’s scanners, image-processing software or patient population.
It should therefore be tested on data from other hospitals or imaging systems whenever possible.
This process is known as external validation.
Without it, the model may perform well in the environment it already knows but fail when exposed to new real-world conditions.
Check Performance Across Patient Groups
Average performance can hide differences between patient groups.
The team examined whether the model behaved consistently across factors such as:
Age groups
Sex
Imaging devices
Scan quality
Patient position
Different clinical environments
The purpose was not merely to produce more charts. It was to identify whether the system worked well for some groups while repeatedly failing for others.
What Semi-Supervised Learning Cannot Solve Automatically
After several weeks, Rohan’s model showed meaningful improvement over the supervised baseline.
It learned from the broader variation present in the unlabeled X-rays, and it performed more consistently on the expert-verified validation set.
But semi-supervised learning had not magically solved every problem.
Unlabeled Data Must Still Be Relevant
More unlabeled data is useful only when it represents the problem the model is expected to solve.
A collection filled with corrupted scans, irrelevant body parts or images from an unrelated task may confuse the training process.
Biased Data Can Produce Biased Learning
If the labeled dataset underrepresents certain patients, the initial model may generate weaker pseudo-labels for those groups.
The resulting errors can then be reinforced during training.
Semi-supervised learning reduces dependence on manual labels, but it does not remove the need for representative data.
Pseudo-Labels Are Not Expert Diagnoses
A pseudo-label is a model-generated training signal.
It is not a radiologist’s conclusion, a clinical diagnosis or proof that an image belongs to a particular class.
This distinction should remain clear in both development and documentation.
Human Oversight Still Matters
Medical AI should support qualified professionals rather than silently replace clinical judgement.
Experts are needed to define the task, review difficult cases, select appropriate metrics, inspect failures and determine whether a model is safe for its intended use.
When Should You Use Semi-Supervised Learning?
Semi-supervised learning is worth considering when:
You have a small but trustworthy labeled dataset.
You possess a much larger collection of relevant unlabeled data.
Labeling requires expensive or specialized expertise.
The labeled and unlabeled datasets represent similar real-world conditions.
You can evaluate the model using a separate expert-verified test set.
The potential errors can be carefully monitored and reviewed.
It may not be suitable when the initial labeled dataset is extremely unreliable, the unlabeled data comes from a completely different distribution or incorrect predictions could be used without human review.
The Final Lesson from Rohan’s Medical Imaging Project
A month after receiving the original dataset, Rohan returned to Dr. Meera’s office.
The hospital still had the same 100 labeled X-rays and 900 unlabeled X-rays.
Nothing about the raw dataset had changed.
What changed was how the team used it.
The 100 labeled images provided trusted guidance. The 900 unlabeled images revealed additional variation and structure. Pseudo-labeling allowed the model to learn from confident predictions. Consistency training encouraged stable behaviour. The teacher–student approach reduced some of the noise caused by rapidly changing predictions.
And careful evaluation prevented a high accuracy score from hiding dangerous failures.
That is the real meaning of semi-supervised learning:
It does not teach AI to learn without answers. It teaches AI to use a small number of trusted answers more intelligently.
When applied carefully, semi-supervised learning can help build useful machine learning systems in fields where data is abundant but expert labels are scarce.
But its value does not come from blindly trusting 90% unlabeled data.
It comes from combining limited human knowledge, cautious machine-generated signals and rigorous evaluation.
The model may learn from unlabeled images.
The responsibility for deciding whether that learning is reliable still belongs to humans.
Explore more articles and tutorials in our Machine Learning Category