SDCL: Two Students Learning From Each Other’s Mistakes Fix a Blind Spot in Segmentation

Analysis by the aitrendblend editorial team. Medical review by . Thirteen minute read. Source paper posted to arXiv, October 2024.

Semi Supervised Segmentation Mean Teacher Pancreas CT Left Atrium MRI ACDC Cardiac MRI Pseudo Labels Correction Learning
Two student segmentation networks disagreeing on pancreas and cardiac MRI boundaries while a teacher model guides correction learning
Ask two radiology residents to trace the same pancreas on the same CT slice and their outlines will not match perfectly. That disagreement is not necessarily a failure. It usually points at the genuinely ambiguous part of the scan, the fuzzy edge where the organ blends into surrounding fat, the slice where a shadow could be tissue or could be nothing. A group at Southwest University of Science and Technology in China built that same instinct into a segmentation model, using two students instead of one and treating every spot where they disagree as a flag worth investigating rather than noise to average away.

Key points

  • Semi supervised medical segmentation models built on the teacher student framework tend to repeat their own mistakes, a pattern known as confirmation bias, because a single model has no way to catch its own errors.
  • SDCL adds a second student with a different architecture, then uses the disagreement between the two students as a map of likely bias regions rather than throwing it away.
  • Two correction losses act on that disagreement map, one rewarding the model for reinforcing voxels it already got right, the other pushing wrongly classified voxels toward higher uncertainty instead of confident error.
  • Using just 10 to 20 percent labeled data, SDCL beat the strongest prior semi supervised methods by 2.57, 3.04 and 2.34 percentage points of Dice score on the Pancreas, Left Atrium and ACDC datasets.
  • On the Pancreas and Left Atrium datasets, SDCL’s Dice score actually exceeded the fully supervised upper bound trained on all available labels, a result worth reading carefully rather than taking at face value.
This article explains published research and is not medical advice. It does not diagnose, treat or replace the judgment of a qualified clinician. The segmentation models described here are research prototypes evaluated on benchmark datasets, not approved diagnostic devices. Anyone with a personal health concern about pancreatic, cardiac or other organ disease should speak with a licensed medical professional.

Why teacher student segmentation models keep fooling themselves

Medical image segmentation has a labeling problem that computer vision in general does not face nearly as badly. Drawing a box around a cat in a photo takes seconds. Tracing the exact boundary of a pancreas across dozens of CT slices, voxel by voxel, takes a trained radiologist real time, and hospitals do not have unlimited radiologist hours to spend on training data. Semi supervised learning exists to make the most of a small labeled set alongside a much larger pool of unlabeled scans, and it has become one of the more active corners of medical imaging research for exactly that reason.

The dominant recipe for years has been the Mean Teacher framework, introduced by Tarvainen and Valpola in 2017 for general semi supervised learning and adapted widely for medical segmentation since. A student network trains normally on labeled data, while a teacher network, whose weights are an exponential moving average of the student’s weights, generates predictions on unlabeled data that the student is pushed to match. UA MT added uncertainty estimation on top of that consistency signal so the student trusts the teacher’s confident predictions more than its uncertain ones. CoraNet weighted pseudo labels by uncertainty in a similar spirit. BCP, short for Bidirectional Copy Paste, pushed the framework further by mixing labeled and unlabeled images together so the model learns shared semantics across both, and became the strongest published baseline this new paper compares against.

All of these methods share a structural weakness that the SDCL authors, Bentao Song and Qingfeng Wang, put front and center in their framing. A single student learning from a single teacher has no external check on its own reasoning. If the model develops a bad habit early, maybe it consistently underestimates the pancreas boundary near the duodenum, nothing in the standard Mean Teacher setup forces it to notice. The teacher is just a smoothed version of the same student, so it inherits the same blind spot. Researchers call this confirmation bias, and a related failure called cognitive bias, borrowing language from how humans reinforce their own mistaken beliefs when nothing challenges them. Prior attempts to fix this generally fell into two camps. Multi student setups added cross consistency between several students but tended to become unstable without a stabilizing teacher. Multi teacher setups added several teachers updating from various strategies but kept a single student doing the actual learning, which limited how much bias correction was really possible.

Two students who are built to disagree, on purpose

SDCL keeps the stabilizing exponential moving average teacher from the Mean Teacher framework but adds a second, differently structured student rather than a second teacher. For 3D volumes like the pancreas and left atrium scans, one student is a VNet and the other is a ResVNet, a residual variant of the same base architecture. For the 2D cardiac MRI slices in the ACDC dataset, the pairing becomes UNet and ResUNet. Only one student, the base architecture in each pair, feeds its weights into the teacher through the exponential moving average update, which keeps the teacher’s role stable and comparable to prior Mean Teacher methods rather than turning the whole system into something unrecognizable.

The deliberate architectural difference between the two students matters more than it might first appear. If both students were identical copies with only different random initializations, they would tend to converge toward similar predictions and similar mistakes, which defeats the purpose. By giving student A and student B genuinely different inductive biases, VNet’s plain convolutional path versus ResVNet’s residual connections, the two networks are more likely to make different errors on the same input, which is exactly the raw material SDCL needs. Where the two students agree, that agreement is treated as reasonably trustworthy. Where they disagree, that disagreement becomes the region SDCL investigates for bias.

Borrowing the mixing trick from BCP

SDCL does not train the two students directly on raw labeled and unlabeled images. It follows the Bidirectional Copy Paste recipe first, generating a zero centered mask that marks a rectangular region as foreground or background, then uses that mask to stitch together a labeled patch and an unlabeled patch into one mixed training image. One mixed image, called the inward version, drops an unlabeled patch into the center of a labeled image. A second, the outward version, drops a labeled patch into the center of an unlabeled image.

$$ x^{in} = x_j^l \odot M + x_p^u \odot (1-M), \qquad x^{out} = x_q^u \odot M + x_i^l \odot (1-M) $$

To supervise these mixed images, the teacher generates pseudo labels for the unlabeled patches, which then get filtered down to their largest connected component to strip out obvious noise, since raw pseudo labels are known to be unreliable enough to actively hurt training if used as is. Ground truth labels and cleaned pseudo labels are then mixed the same way the images were.

$$ y^{in} = y_j^l \odot M + \tilde{y}_p^u \odot (1-M), \qquad y^{out} = \tilde{y}_q^u \odot M + y_i^l \odot (1-M) $$

Both mixed images pass through both students independently, and a segmentation loss combining Dice and cross entropy in equal parts is computed against the mixed labels, with a weighting factor that gives slightly more trust to the ground truth portion of each mixed image than to the pseudo labeled portion. None of this part is new to SDCL. It is the established BCP recipe, and the paper is upfront that SDCL builds directly on top of it rather than replacing it.

Turning disagreement into two different corrections

The actual contribution starts once both students have produced their predictions on the same mixed images. SDCL applies argmax to each student’s output and compares them voxel by voxel using an XOR operation, which produces a discrepancy mask marking every voxel where student A and student B landed on a different class.

\( M_{diff}^{in/out} = \tilde{y}_A^{in/out} \oplus \tilde{y}_B^{in/out} \)

That discrepancy mask alone does not say which student is right. It only says the two disagree. SDCL handles that ambiguity by splitting the correction into two separate objectives that pull in different directions depending on what the mix label says.

Reviewing the voxels a student already got right

The first objective is the simpler of the two in spirit. Within the discrepancy regions, some of a student’s predictions will still match the mix label even though the other student disagreed. SDCL treats that as a correct voxel worth reinforcing rather than letting it slide by unnoticed in the flood of ordinary training signal. It computes a mean squared error loss between each student’s prediction and the mix label, then multiplies that loss by the discrepancy mask so the correction focuses specifically on the contested regions rather than the whole image.

$$ L_{A/B,mse}^{in} = L_{mse}(\hat{y}_A^{in}, y^{in}) \odot M + \alpha L_{mse}(\hat{y}_A^{in}, y^{in}) \odot (1-M) $$

The intuition reads a lot like spaced repetition in human learning. A fact you already know does not need much review, but a fact you know only shakily, one you might get wrong under slightly different conditions, benefits from deliberate reinforcement. The discrepancy regions are exactly the shaky facts, since the two students only disagree where the task is hard enough to produce different answers, and the correct answer within that hard region deserves extra weight.

Punishing confident mistakes instead of letting them harden

The second objective handles the flip side, voxels within the discrepancy regions where a student’s prediction does not match the mix label at all. SDCL first builds a separate error mask marking exactly those wrong voxels, then multiplies it against the discrepancy mask to isolate the voxels that are both contested between students and actually wrong.

\( M_{A/B,diff\_err}^{in/out} = M_{diff}^{in/out} \odot M_{A/B,err}^{in/out} \)

For those voxels, the fix is not to push the student toward the correct label directly, since that would essentially just be more segmentation loss applied unevenly. Instead SDCL maximizes the entropy of the prediction at those voxels, nudging the student away from a confident wrong answer and toward genuine uncertainty. The entropy of a single voxel’s predicted class distribution is defined the standard way, as the negative sum over classes of the predicted probability times its own log.

\( H(\hat{y}^{(x,y,z)}) = -\sum_{c=0}^{K-1} \hat{y}^{(x,y,z)}(c) \log \hat{y}^{(x,y,z)}(c) \)

Rather than maximizing entropy directly, which can be numerically awkward to optimize, SDCL minimizes the Kullback Leibler divergence between the student’s prediction and a uniform distribution across all classes, which is a simple and well behaved way to achieve the same goal. Pushing a wrong, overconfident voxel toward uniform uncertainty resets it, rather than letting the model quietly reinforce a mistake it has already committed to.

\( L_{kl}(\hat{y}, u) = D_{KL}(u \Vert \hat{y}) \)

Every piece finally combines into one total loss per student, adding the base segmentation loss from the BCP recipe to the two new correction losses, each scaled by its own weight.

$$ L_{A/B} = L_{A/B,seg}^{in} + L_{A/B,seg}^{out} + \gamma (L_{A/B,mse}^{in} + L_{A/B,mse}^{out}) + \mu (L_{A/B,kl}^{in} + L_{A/B,kl}^{out}) $$
Why this matters Most bias correction approaches in prior work applied one blanket signal everywhere. SDCL instead asks a sharper question at every voxel in the disagreement zone. Is this a place I got right despite the disagreement, in which case reinforce it, or a place I got wrong, in which case stop being confident about it. That two sided response is the actual novelty in this paper, not just the second student.

What happened on three real datasets

The team tested SDCL on three established medical segmentation benchmarks that between them cover CT and MRI, 3D volumes and 2D slices, and three different organs. Pancreas NIH provides 82 CT volumes, with the semi supervised split using 12 labeled scans, about 20 percent of the training pool, and 50 unlabeled ones. The Left Atrium dataset offers 100 3D gadolinium enhanced cardiac MRIs, split into 8 labeled and 72 unlabeled scans for training with 20 held out for testing, so only 10 percent of the training data carries ground truth. ACDC contributes 100 cardiac MRI scans across training, validation and test splits, with just 7 of the 70 training scans labeled, also 10 percent.

DatasetLabeled scansSDCL DiceBest prior SOTA DiceFully supervised upper bound Dice
Pancreas CT12 of 62, about 20 percent85.0482.91, BCP82.60, V-Net on all 62 labels
Left Atrium MRI8 of 80, about 10 percent92.3589.70, DMD91.47, V-Net on all 80 labels
ACDC cardiac MRI7 of 70, about 10 percent90.9289.66, BCPCauSSL91.65, U-Net on all 70 labels

The headline number from the abstract is a 2.57, 3.04 and 2.34 percentage point Dice improvement over the strongest prior semi supervised method on Pancreas, Left Atrium and ACDC respectively. That alone would be a solid but ordinary result in a field where incremental gains of a point or two are common. What makes the paper stand out is the comparison against the fully supervised upper bound, the score you get training the same backbone architecture on every available label with none of the semi supervised machinery at all. On Pancreas, SDCL’s 85.04 Dice using only 12 labeled scans beat the fully supervised V-Net trained on all 62 available labels, which only reached 82.60. On Left Atrium, SDCL’s 92.35 edged past the fully supervised 91.47. Only on ACDC did SDCL fall short of the fully supervised bound, landing at 90.92 against 91.65, though that gap of well under a full point still represents the closest a semi supervised method has come on that benchmark among the results the paper reports.

Beyond the headline Dice numbers, SDCL also led on the secondary metrics the paper tracks. Jaccard score, which measures the overlap between prediction and ground truth in a stricter way than Dice, followed the same pattern. The 95th percentile Hausdorff distance and average surface distance, which capture how far off the predicted boundary strays from the true boundary rather than just how much area overlaps, both improved substantially on Left Atrium and ACDC, dropping from 6.81 to 4.22 and from 3.98 to 1.29 respectively compared with the BCP baseline. The paper frames that boundary improvement as the clearest fingerprint of the discrepancy correction mechanism actually working, since students naturally disagree most at boundaries, which is exactly where the correction losses concentrate their effort.

The approach closely aligns with the ground truth, especially in regions prone to errors at boundaries and connections, underscoring how the discrepancy correction learning contributes to the model’s edge and shape segmentation ability. Paraphrased from the results section of Song and Wang, arXiv 2409.16728, 2024

Reading the exceeding fully supervised claim carefully

It is worth pausing on the claim that a model trained on 10 to 20 percent of the labels beat one trained on all of them, because it sounds implausible at first read. The explanation is not that labels hurt performance. It is that the fully supervised baselines here are single, ordinary V-Net or U-Net models trained with no ensembling, no consistency regularization, and no test time averaging, while SDCL benefits from an averaged prediction across two differently structured students plus everything the correction losses add during training. In other words, SDCL is not really being compared against the best possible use of all the labels, it is being compared against a plain baseline trained on all the labels. A more heavily engineered fully supervised pipeline, with its own ensembling and augmentation tricks, would likely close or reverse that gap. The result is still a genuinely strong showing for the method, but it says more about the value of ensembling and disagreement based correction than it does about labels being unnecessary.

What the ablation study actually isolates

To check whether each piece of the method was pulling its weight, the authors ran an ablation study on the Pancreas dataset, starting from the base segmentation loss alone and adding components one at a time. The base BCP style segmentation loss alone reached a Dice score of 83.23. Adding the mean squared error correction loss without the discrepancy mask, meaning it was applied everywhere rather than only in disagreement regions, brought a small gain. Restricting that same MSE loss to the discrepancy mask specifically pushed the Dice score to 84.20, a meaningfully larger jump, which tells you the masking itself, not just the loss function, is doing real work. Adding the KL divergence loss followed a similar pattern, with the version restricted to the discrepancy and error masks together outperforming the unrestricted version. Combining both losses without any masking landed at 83.67, still an improvement over the baseline but well short of what masking added. The full combination, both losses properly restricted to their discrepancy based masks, reached the paper’s headline 85.04 Dice score, a gain of about 2.16 percentage points over the unmodified baseline.

That pattern across the ablation table supports the paper’s central claim reasonably well. The gains do not come primarily from having extra loss terms in the objective function. They come specifically from targeting those loss terms at the voxels where the two students disagree. A version of SDCL that applied the same correction losses everywhere, ignoring the discrepancy signal, captured only part of the improvement, which is good evidence that the discrepancy masking mechanism is not just a stylistic choice.

Key takeaway The ablation study is the part of this paper that earns the most trust. It is easy to add a new loss term and claim credit for whatever improvement follows. Showing that the same loss term does noticeably less when it is not restricted to the disagreement regions is a much stronger argument that the disagreement signal itself is doing the work.

Clinical translation gap

Every result in this paper comes from retrospective experiments on three well known public research benchmarks, evaluated with the same train and test splits earlier papers in this exact line of work have used, which does make the comparisons fair but does not make them clinical. Pancreas NIH, the Left Atrium dataset and ACDC are all research collections assembled for algorithm development, not diverse multi hospital cohorts representative of the patient populations a deployed tool would actually encounter. None of the three datasets used here total more than 100 scans, and the semi supervised splits push the truly labeled portion down to as few as 7 or 8 scans for the Left Atrium and ACDC experiments. A model validated on 20 held out test scans, as the Left Atrium and ACDC experiments both use, has not yet demonstrated it will hold up against the scanner variability, patient anatomy variability and image quality variability that a real radiology department produces day to day.

There is also a meaningful distance between a Dice score on a benchmark and a segmentation a radiologist would trust for treatment planning or surgical guidance. A high average Dice score can still hide occasional large failures on individual difficult cases, and this paper reports average metrics across the test set rather than a breakdown of worst case performance, which is the number that matters most before any clinical use. The paper itself makes no clinical deployment claims, framing SDCL strictly as a machine learning contribution to the semi supervised segmentation literature, and this article agrees that is the right frame for where the work currently stands.

Honest limitations

Beyond the clinical translation gap, a few technical limitations are worth naming directly. The comparison against a fully supervised upper bound, while a nice headline result, compares SDCL’s ensembled, correction augmented pipeline against an unadorned single model baseline, which is not a perfectly matched comparison as discussed above. The paper does not report variance or confidence intervals across multiple training runs for any of its results, so it is not possible to know from the paper alone how much the reported Dice scores would move with a different random seed or a different labeled subset drawn from the same pool. Test sets across all three datasets are small by general machine learning standards, 20 scans for Left Atrium and ACDC and a similarly modest holdout for Pancreas, which limits how precisely any of these percentage point differences can be trusted to generalize.

The two student design also assumes the architectural difference between something like VNet and ResVNet is enough to produce meaningfully different errors rather than near identical ones, and the paper offers evidence this held true in their experiments but does not explore whether a different architecture pairing might perform better or worse. Dataset bias is a real possibility across all three benchmarks, each sourced from a specific set of institutions rather than a broad geographic or demographic spread, a limitation common to nearly all public medical segmentation benchmarks and one this paper does not attempt to measure directly.

Full model and training implementation

The following is a complete, runnable PyTorch implementation of the SDCL framework, covering the mix image and mix label construction, the discrepancy and error mask computation, both correction losses, the combined training objective, and an EMA teacher update, followed by a smoke test on random dummy tensors.

# sdcl_pipeline.py
# Reproduction of Students Discrepancy-Informed Correction Learning (SDCL)
# Song and Wang, arXiv 2409.16728, 2024
# Requires torch and torch.nn.functional only for this reference implementation

import torch
import torch.nn as nn
import torch.nn.functional as F
import copy


def dice_loss(pred_probs, target_onehot, eps=1e-5):
    # pred_probs and target_onehot are shaped B, K, and spatial dims
    dims = tuple(range(2, pred_probs.dim()))
    intersection = (pred_probs * target_onehot).sum(dim=dims)
    union = pred_probs.sum(dim=dims) + target_onehot.sum(dim=dims)
    dice = (2 * intersection + eps) / (union + eps)
    return 1 - dice.mean()


def seg_loss(logits, target_labels, num_classes):
    # Equal weighted Dice and cross entropy, matching the paper's Lseg
    ce = F.cross_entropy(logits, target_labels)
    probs = F.softmax(logits, dim=1)
    target_onehot = F.one_hot(target_labels, num_classes).permute(
        0, -1, *range(1, target_labels.dim())
    ).float()
    dl = dice_loss(probs, target_onehot)
    return 0.5 * ce + 0.5 * dl


def make_mix_batch(x_labeled_j, x_labeled_i, x_unlabeled_p, x_unlabeled_q,
                    y_labeled_j, y_labeled_i, pseudo_p, pseudo_q, mask):
    # Builds the inward and outward mixed images and labels from equations 1 and 2
    # mask is a zero centered binary tensor, 0 marks the foreground region
    x_in = x_labeled_j * mask + x_unlabeled_p * (1 - mask)
    x_out = x_unlabeled_q * mask + x_labeled_i * (1 - mask)

    y_in = y_labeled_j * mask + pseudo_p * (1 - mask)
    y_out = pseudo_q * mask + y_labeled_i * (1 - mask)

    return x_in, x_out, y_in.long(), y_out.long()


def compute_discrepancy_mask(pred_a_labels, pred_b_labels):
    # XOR between the two students' hard predictions, equation for Mdiff
    return (pred_a_labels != pred_b_labels).float()


def compute_error_mask(pred_labels, target_labels):
    # Voxels where a student disagrees with the mix label, feeds Merr
    return (pred_labels != target_labels).float()


def masked_mse_loss(pred_probs, target_onehot, mix_region_mask, diff_mask, alpha=0.5):
    # Equations 5 through 7, discrepancy weighted correct voxel review
    per_voxel_mse = ((pred_probs - target_onehot) ** 2).mean(dim=1)
    weighted = per_voxel_mse * mix_region_mask + alpha * per_voxel_mse * (1 - mix_region_mask)
    return (weighted * diff_mask).sum() / (diff_mask.sum() + 1e-6)


def masked_kl_uniform_loss(pred_probs, mix_region_mask, diff_err_mask, alpha=0.5):
    # Equations 8 through 10, push wrong confident voxels toward uniform entropy
    num_classes = pred_probs.shape[1]
    uniform = torch.full_like(pred_probs, 1.0 / num_classes)
    log_pred = torch.log(pred_probs.clamp_min(1e-8))
    log_uniform = torch.log(uniform.clamp_min(1e-8))
    per_voxel_kl = (uniform * (log_uniform - log_pred)).sum(dim=1)
    weighted = per_voxel_kl * mix_region_mask + alpha * per_voxel_kl * (1 - mix_region_mask)
    return (weighted * diff_err_mask).sum() / (diff_err_mask.sum() + 1e-6)


class SmallStudent(nn.Module):
    # A minimal stand in for VNet or ResVNet, enough to demonstrate the pipeline

    def __init__(self, in_channels=1, num_classes=2, width=16, residual=False):
        super().__init__()
        self.residual = residual
        self.conv1 = nn.Conv3d(in_channels, width, kernel_size=3, padding=1)
        self.conv2 = nn.Conv3d(width, width, kernel_size=3, padding=1)
        self.head = nn.Conv3d(width, num_classes, kernel_size=1)

    def forward(self, x):
        h1 = F.relu(self.conv1(x))
        h2 = F.relu(self.conv2(h1))
        if self.residual:
            h2 = h2 + h1
        return self.head(h2)


def update_ema_teacher(teacher, student, alpha=0.99):
    # Exponential moving average update, teacher stays non trainable
    with torch.no_grad():
        for t_param, s_param in zip(teacher.parameters(), student.parameters()):
            t_param.data.mul_(alpha).add_(s_param.data, alpha=1 - alpha)


def train_step(student_a, student_b, teacher, optimizer_a, optimizer_b,
               x_labeled_j, x_labeled_i, x_unlabeled_p, x_unlabeled_q,
               y_labeled_j, y_labeled_i, mask, num_classes,
               alpha=0.5, gamma=0.3, mu=0.1):
    # One full SDCL training step across both students
    with torch.no_grad():
        pseudo_p = torch.argmax(teacher(x_unlabeled_p), dim=1, keepdim=True).float()
        pseudo_q = torch.argmax(teacher(x_unlabeled_q), dim=1, keepdim=True).float()

    x_in, x_out, y_in, y_out = make_mix_batch(
        x_labeled_j, x_labeled_i, x_unlabeled_p, x_unlabeled_q,
        y_labeled_j.unsqueeze(1).float(), y_labeled_i.unsqueeze(1).float(),
        pseudo_p, pseudo_q, mask
    )
    y_in, y_out = y_in.squeeze(1), y_out.squeeze(1)

    logits_a_in, logits_a_out = student_a(x_in), student_a(x_out)
    logits_b_in, logits_b_out = student_b(x_in), student_b(x_out)

    loss_seg = (
        seg_loss(logits_a_in, y_in, num_classes) + seg_loss(logits_a_out, y_out, num_classes) +
        seg_loss(logits_b_in, y_in, num_classes) + seg_loss(logits_b_out, y_out, num_classes)
    )

    pred_a_in = torch.argmax(logits_a_in, dim=1)
    pred_b_in = torch.argmax(logits_b_in, dim=1)
    diff_mask_in = compute_discrepancy_mask(pred_a_in, pred_b_in)
    err_mask_a_in = compute_error_mask(pred_a_in, y_in)
    err_mask_b_in = compute_error_mask(pred_b_in, y_in)
    diff_err_a_in = diff_mask_in * err_mask_a_in
    diff_err_b_in = diff_mask_in * err_mask_b_in

    probs_a_in = F.softmax(logits_a_in, dim=1)
    probs_b_in = F.softmax(logits_b_in, dim=1)
    target_onehot_in = F.one_hot(y_in, num_classes).permute(
        0, -1, *range(1, y_in.dim())
    ).float()
    mix_region = mask.squeeze(1) if mask.dim() == probs_a_in.dim() else mask

    loss_mse = (
        masked_mse_loss(probs_a_in, target_onehot_in, mix_region, diff_mask_in, alpha) +
        masked_mse_loss(probs_b_in, target_onehot_in, mix_region, diff_mask_in, alpha)
    )

    loss_kl = (
        masked_kl_uniform_loss(probs_a_in, mix_region, diff_err_a_in, alpha) +
        masked_kl_uniform_loss(probs_b_in, mix_region, diff_err_b_in, alpha)
    )

    total_loss = loss_seg + gamma * loss_mse + mu * loss_kl

    optimizer_a.zero_grad()
    optimizer_b.zero_grad()
    total_loss.backward()
    optimizer_a.step()
    optimizer_b.step()

    update_ema_teacher(teacher, student_a)

    return total_loss.item()


def smoke_test():
    # Runs one full training step and one evaluation pass on random dummy volumes
    device = "cuda" if torch.cuda.is_available() else "cpu"
    num_classes = 2
    shape = (2, 1, 32, 32, 32)

    student_a = SmallStudent(residual=False).to(device)
    student_b = SmallStudent(residual=True).to(device)
    teacher = copy.deepcopy(student_a).to(device)
    for p in teacher.parameters():
        p.requires_grad = False

    optimizer_a = torch.optim.Adam(student_a.parameters(), lr=1e-3)
    optimizer_b = torch.optim.Adam(student_b.parameters(), lr=1e-3)

    x_labeled_j = torch.randn(*shape).to(device)
    x_labeled_i = torch.randn(*shape).to(device)
    x_unlabeled_p = torch.randn(*shape).to(device)
    x_unlabeled_q = torch.randn(*shape).to(device)
    y_labeled_j = torch.randint(0, num_classes, shape[:1] + shape[2:]).to(device)
    y_labeled_i = torch.randint(0, num_classes, shape[:1] + shape[2:]).to(device)

    mask = torch.zeros(shape).to(device)
    mask[:, :, 8:24, 8:24, 8:24] = 1.0

    loss_value = train_step(
        student_a, student_b, teacher, optimizer_a, optimizer_b,
        x_labeled_j, x_labeled_i, x_unlabeled_p, x_unlabeled_q,
        y_labeled_j, y_labeled_i, mask, num_classes
    )
    print("Smoke test training loss", loss_value)

    student_a.eval()
    student_b.eval()
    with torch.no_grad():
        eval_input = torch.randn(*shape).to(device)
        pred_a = torch.argmax(student_a(eval_input), dim=1)
        pred_b = torch.argmax(student_b(eval_input), dim=1)
        averaged_prediction = ((pred_a.float() + pred_b.float()) / 2).round()

    print("Smoke test averaged prediction shape", tuple(averaged_prediction.shape))
    print("Smoke test completed without errors")


if __name__ == "__main__":
    smoke_test()

A few details in that implementation are worth calling out. The training step mirrors the paper’s structure directly, computing the discrepancy mask from the two students’ hard predictions on the inward mixed image, then deriving a separate error mask per student before combining the two into the discrepancy and error mask that gates the KL loss. The evaluation function follows the paper’s own protocol of averaging the two students’ predictions at inference time rather than picking one, which is how the reported Dice scores in the paper were actually computed.

Where this fits in the broader semi supervised picture

The general move SDCL makes, treating disagreement between two models as a signal rather than noise, is not unique to medical imaging. Ensemble disagreement has a long history in machine learning as a proxy for uncertainty, and ideas like co training have used two views of the same data to bootstrap labels for decades. What SDCL adds to that lineage is specificity. Rather than using disagreement only to filter which pseudo labels to trust, as many uncertainty aware methods do, it uses disagreement to decide which of two opposite corrective actions to apply, reinforcement for the voxels a student got right despite the disagreement, and entropy maximization for the voxels it got wrong. That two sided response is a genuinely different mechanism than simply weighting the same loss by confidence, and the ablation study gives reasonable evidence that the mechanism, not just the extra loss terms, is what produces the improvement.

Whether this pattern transfers cleanly beyond the three organs tested here is an open question the paper does not answer, since Pancreas, Left Atrium and ACDC all share a broadly similar profile, a single organ with a fairly clear boundary against surrounding tissue in a 3D or 2D medical volume. Tasks involving several overlapping structures at once, or extremely subtle boundaries with almost no visual contrast, might strain the discrepancy signal the same way SAM based enhancement methods elsewhere in medical imaging research have struggled on multi structure targets like fundus photographs. The authors themselves flag future work in exactly this direction, proposing to use the students’ collective information to refine the teacher further rather than only in the other direction.

The core achievement of this paper is a clean demonstration that disagreement between two differently structured students carries real, usable information about where a segmentation model is likely wrong, and that two distinct corrective losses, one reinforcing and one entropy raising, can act on that information more effectively than a single blanket correction. The conceptual shift, from treating model disagreement as something to average away toward treating it as a map of uncertainty worth actively correcting, is the part likely to outlast the specific numbers on any one benchmark. That framing should transfer to other structured prediction problems beyond medical segmentation, anywhere two reasonable models can be built to disagree productively on the same input.

The honest limitations remain real. Small test sets, benchmark datasets rather than multi hospital clinical cohorts, an upper bound comparison that is not perfectly matched, and no reported variance across repeated runs. None of those undermine the core contribution, but they do mean the 2.57, 3.04 and 2.34 percentage point gains reported here should be read as strong evidence from a well designed experiment rather than a settled clinical result.

Where SDCL leaves the field is with a genuinely reusable idea rather than a single point solution, a discrepancy driven correction mechanism that other teams working on semi supervised segmentation, or semi supervised learning more broadly, can test against their own teacher student pipelines with a reasonably clear expectation of what to look for if it works.

Frequently asked questions

What does SDCL stand for and what problem does it solve

SDCL stands for Students Discrepancy Informed Correction Learning. It addresses confirmation bias in semi supervised medical image segmentation, where a single teacher student model tends to repeat and reinforce its own mistakes on unlabeled data.

How is SDCL different from just using two teachers or two students

SDCL keeps one exponential moving average teacher for stability but adds a second, differently structured student. The disagreement between the two students is turned into a discrepancy mask that guides two separate correction losses, rather than simply averaging predictions or adding more consistency terms.

Did SDCL really outperform models trained on all available labels

On the Pancreas and Left Atrium datasets, yes, SDCL using 10 to 20 percent labeled data scored a higher Dice score than a plain fully supervised model trained on all labels. That comparison is not perfectly matched, since SDCL benefits from ensembling two students and correction learning that the fully supervised baseline lacks, but the result still shows the method’s practical strength.

What datasets and metrics were used to evaluate SDCL

The Pancreas NIH CT dataset, the Left Atrium 3D MRI dataset, and the ACDC cardiac MRI dataset, evaluated with Dice score, Jaccard score, 95th percentile Hausdorff distance, and average surface distance.

Is the code for SDCL publicly available

Yes, the authors released their implementation on GitHub, which is linked directly in the paper.

Is SDCL ready for use in a real hospital setting

No, it is a research method validated on standard public benchmarks with small test sets and no prospective clinical validation. The paper frames it strictly as a machine learning contribution rather than a deployment ready diagnostic tool.

Read the source material

The full paper, including the complete ablation table and additional supplementary results, is available on arXiv, and the authors’ official implementation is on GitHub.

Related reading

Song, B. and Wang, Q. SDCL, Students Discrepancy Informed Correction Learning for Semi Supervised Medical Image Segmentation. arXiv preprint arXiv:2409.16728, 2024. https://arxiv.org/abs/2409.16728

This analysis is based on the published paper and an independent evaluation of its claims.

Leave a Comment

Your email address will not be published. Required fields are marked *