A Diffusion Model That Paints What Your Glioma Will Look Like Next Year

Analysis by the aitrendblend editorial team · Medical imaging and healthcare · Reading time about 16 minutes
Diffusion models Glioma growth Longitudinal MRI Treatment aware AI Uncertainty maps Tumor segmentation
Sequence of brain MRI scans showing predicted glioma growth over time next to an uncertainty heat map from the TaDiff diffusion model
Ask an oncologist what a patient’s glioma will look like in four months and they will give you a range, built from experience, growth curves, and how the last scan compared with the one before it. A group at Oslo University Hospital, working with collaborators in Spain, Canada, and Lithuania, decided to see whether a generative model could do something closer to actually showing that answer, painting a synthetic future scan for a specific treatment and a specific date rather than only outputting a single growth number.

Key points

  • TaDiff is a diffusion model that takes three prior MRI scans plus treatment and timing information and generates both a synthetic future scan and a predicted tumor mask in one pass.
  • Trained on 225 longitudinal MRI exams from 23 high grade glioma patients, the model reached an average SSIM of 0.919 and a future tumor Dice score of 0.719 on held out local data.
  • Predictions stay reasonably reliable up to about four months ahead, with Dice dropping from 0.85 at half a month out to 0.46 beyond two years as uncertainty widens.
  • On an external cohort of 37 patients from the public LUMIERE dataset, image generation quality dropped only modestly, an SSIM decline of about 7 percent, suggesting some ability to generalize across scanners and sites.
  • Two atypical patients, one who had a second surgery and one with a rare secondary glioblastoma, accounted for most of the model’s worst predictions, a limitation the authors report openly rather than smoothing over.
  • This article explains a research prototype and is not a tool for predicting any individual patient’s actual prognosis.
This is a research explainer, not medical guidance. The model described below was trained on a small single center cohort plus one external dataset and has not been validated for clinical decision making. It does not replace an oncologist’s assessment, a radiologist’s read, or a treatment plan built by a patient’s care team. Nothing here should be used to predict an individual’s actual outcome.

The problem with predicting a moving, misbehaving tumor

Diffuse gliomas make up roughly 80 percent of malignant brain tumors and a large share of primary brain tumor deaths, and glioblastoma, the most aggressive subtype, still carries a median survival under 15 months after diagnosis despite decades of treatment research. Part of what makes these tumors so hard to manage is that they grow in ways that resist tidy modeling. A glioma does not expand as a neat sphere. It infiltrates along white matter tracts, responds unevenly to radiation and chemotherapy, sometimes shrinks in one region while growing in another, and occasionally behaves in ways that surprise the treating physician entirely.

The classical way to model that behavior mathematically is a reaction diffusion equation, which separates tumor cell movement into a diffusion term describing spread through tissue and a reaction term describing local proliferation. Researchers have coupled these equations to models of brain tissue mechanics to account for how a growing mass physically deforms surrounding structure, and extended them further with nonlinear elasticity. These physics grounded models are elegant, but they are also hard to calibrate, either because they are computationally expensive to solve or because they need more patient specific parameters than a typical imaging workup can supply.

Deep learning offered an alternative path, learning growth patterns directly from image data rather than from an explicit differential equation. Earlier work combined mechanistic reaction diffusion models with graph based machine learning to estimate cell density, used generative adversarial networks to project pre operative growth, and applied deep probabilistic models to capture the fact that a tumor’s future is not a single deterministic path but a distribution of plausible outcomes. What all of these approaches shared, according to the TaDiff authors, was a blind spot. None of them accounted for treatment. A tumor under radiation behaves differently than the same tumor left alone, and a model trained purely on imaging history has no way to represent that difference or to answer the more clinically useful question, namely how would this specific tumor look under this specific treatment plan.

What TaDiff actually is

TaDiff stands for treatment aware diffusion, and it is built on denoising diffusion probabilistic models, the same family of generative model behind much of the recent progress in image synthesis. The core idea of a diffusion model is deceptively simple. During training, an image is progressively corrupted with Gaussian noise over many steps until it becomes indistinguishable from pure static. A neural network is then trained to reverse that process, predicting the noise added at each step so that, starting from random noise, it can iteratively denoise its way back to a realistic image. Once trained, that same reverse process can be steered by conditioning information to generate specific kinds of images rather than arbitrary ones.

That conditioning step is where TaDiff earns its name. Rather than generating any plausible brain MRI, the model is steered by three prior scans from the same patient, each paired with the treatment the patient was receiving and the day that scan was taken, plus a target treatment and target day chosen by whoever is running the model. Feed it three historical T1 weighted, contrast enhanced T1, and FLAIR scans along with their treatment context, tell it you want to see day 225 under continued temozolomide, and the reverse diffusion process generates a synthetic scan representing the model’s best guess at what that future exam would show.

A hybrid model, not a pure image generator

Crucially, TaDiff does not stop at generating pixels. The same network simultaneously predicts tumor segmentation masks for both the source scans and the generated future scan, sharing an encoder between the diffusion branch and the segmentation branch. This joint design means the model is not just hallucinating a plausible looking brain, it is also committing to an explicit prediction of where the tumor boundary sits, which is the number a clinician actually needs for treatment planning rather than a picture to eyeball.

The treatment and timing information enters the network through a pair of learned embeddings, one for treatment type and one for the day, which are summed together into a single feature vector for each of the four time points involved, the three source scans and the target. The authors found empirically that feeding the raw difference between source and target treatment vectors, rather than the target vector alone, sped up and stabilized training, so the final architecture concatenates that difference vector with the target embedding everywhere in the network except the bottleneck layer, where only the summed target information is injected. It is a fairly specific architectural choice, and the paper is candid that it came from experimental observation rather than from first principles, which is a reasonable way to build these systems but worth flagging for anyone trying to reproduce the exact numbers.

Why generate an image at all, instead of just a growth curve

A number on a chart, like predicted tumor volume in four months, is easy to produce but hard to act on directly. A synthetic MRI scan, even an imperfect one, lets a clinician see where growth is expected, which structures are near the expanding margin, and whether the shape of progression looks like diffuse infiltration or a more contained mass. The authors are explicit that the underlying goal is not photorealism for its own sake but a clinically legible representation of a specific predicted outcome under a specific treatment choice.

How the model was trained and what data it saw

The local training data came from 225 MRI exams across 23 patients with histologically confirmed diffuse high grade glioma treated at Oslo University Hospital, each patient contributing between 3 and 19 longitudinal scans with a mean of 10. All patients received standard care, meaning surgery followed roughly four weeks later by fractionated radiotherapy with concurrent or adjuvant temozolomide. Every scan was skull stripped, registered into a common T1 based space, resampled to 1 millimeter isotropic resolution, and z score normalized per channel. Edema and enhancing tumor regions were manually segmented by experienced neuroradiologists to produce ground truth masks. Eighteen patients and 177 scans formed the training and validation set, while 5 patients spanning ages 32 through 65 and 48 scans were held out entirely for testing.

To stretch that modest patient count further, the authors used an unusually flexible training scheme. Rather than always predicting a future scan from past ones, each training example randomly cast an MRI slice as a future target with probability 0.5, a middle time point with probability 0.3, or a past reference with probability 0.2. That flexibility, combined with allowing repeated selection among candidate input scans, expanded a dataset that would otherwise support only a few thousand fixed input output pairs into roughly 8,190 possible training combinations from a single 10 scan patient timeline, functioning as a form of data augmentation layered on top of the noise injection that diffusion training already performs.

Training ran for 5 million iterations with a batch size of 32 and gradient accumulation of 2, using the Adam optimizer with a warm up phase and cosine decay, on 192 by 192 pixel patches, consuming 350 GPU hours on a single Nvidia V100. At inference time, the model draws on the three most recent historical scans to predict the next time point, duplicating the most recent scan if fewer than three are available. The diffusion process itself runs for 600 steps to synthesize an image, while the segmentation branch only uses the final 10 steps, since those late stage, low noise steps carry the clearest signal for producing an accurate mask. Those 10 candidate masks are then averaged with a weighting scheme the authors call dilated longitudinal tumor fusion, which prioritizes learning from the tumor region and its immediately surrounding tissue rather than letting the model simply copy static background anatomy from the source scans.

For external validation, the team pulled 37 additional high grade glioma patients, 18 men and 19 women, from the public LUMIERE dataset, all of whom had undergone surgical resection and temozolomide based chemoradiation at Inselspital in Bern, Switzerland, contributing 132 exams with a mean age at first resection of 58 years. That dataset lacked expert tumor mask annotations, which limited external testing to image generation quality rather than full segmentation accuracy.

What the numbers actually showed

On the local held out test set, spanning 3,352 tumor containing slices, the model averaged an SSIM of 0.919, a PSNR of 27.9 decibels, and an MSE of 0.174 for the multi parametric MRI generation task. For the harder job of predicting future tumor extent, it reached a Dice score of 0.719 with a relative volume difference close to zero on average, while segmenting the source, already visible tumors reached a stronger Dice of 0.849, which makes sense since that task does not require forecasting anything, only reading what is already on the scan.

PatientAgeSurvival monthsMRI generation SSIMFuture tumor DiceSource tumor Dice
P-1, second surgery case32840.8860.6910.828
P-2, secondary glioblastoma44190.9260.5780.818
P-353110.9430.8120.893
P-464130.9030.7570.849
P-565400.9360.7550.857
Average across all five52330.9190.7190.849

That patient level table tells a more interesting story than the averages alone. The two weakest performers, P-1 and P-2, were not weak because the model failed randomly. P-1 underwent a second surgery on day 365, an event the model had no way to represent since it was trained on only two treatment categories, chemoradiation and temozolomide, with no notion of a repeat operation. P-2 was diagnosed with a secondary glioblastoma, a biologically distinct and comparatively rare entity that arises from lower grade precursor tumors rather than presenting as primary disease from the start, and the training set contained only two such cases. Patients P-3, P-4, and P-5, all with more typical primary glioblastoma on standard treatment, scored consistently better across every metric.

The model was not simply worse at hard cases in some vague sense. It was worse specifically where its own training data had almost nothing to learn from, a second surgery and a rare tumor subtype, which is a far more diagnosable and fixable kind of failure than an unexplained accuracy drop.Reading of the per patient results and the authors’ own discussion

Breaking results down by treatment day range reinforced the same pattern. Performance stayed strong through the first year, with the 0 to 50 day window, roughly the first six weeks of chemoradiation, and the 51 to 220 day window, covering the temozolomide cycles, both scoring well. The 221 to 365 day range was the roughest spot, with SSIM dipping to 0.877 and future tumor Dice falling to 0.604, exactly the window that contained P-1’s second surgery and much of P-2’s atypical progression. Performance actually recovered somewhat in the 366 to 720 day and beyond 721 day ranges, suggesting the dip was tied to those two specific patient stories rather than to time itself becoming harder to predict in a simple linear way.

Treatment day rangeSSIMFuture tumor DiceFuture tumor RVD
0 to 50, early chemoradiation0.9280.759-0.133
51 to 220, temozolomide cycles0.8960.7180.113
221 to 365, one year mark0.8770.6040.539
366 to 720, two year mark0.9260.697-0.024
721 and beyond0.9410.760-0.012

How far ahead can this model actually see with any confidence. The authors report a fairly specific answer. Dice score for future tumor prediction drops from about 0.85 at half a month ahead down to about 0.46 once the prediction horizon stretches past two years, while the standard deviation across repeated stochastic samplings, the model’s own measure of its uncertainty, widens from roughly 0.09 to 0.32 over that same span. Within a four month window specifically, mean Dice held at 0.75 with a standard deviation of 0.12, which the authors treat as the practical reliability horizon for the model as trained. Beyond four months the predictions do not become useless, but the honest reading is that confidence erodes steadily rather than holding steady.

The forward diffusion process gradually adds Gaussian noise to an image across a schedule of variances written as beta sub t. A useful shortcut lets you sample the noised image at any step directly from the original image, using the cumulative product of one minus beta, written as alpha bar sub t. \( x_t = \sqrt{\bar\alpha_t}\, x_0 + \sqrt{1-\bar\alpha_t}\, \epsilon \), where \( \epsilon \sim \mathcal{N}(0, I) \) Training minimizes the mean squared error between the true noise and the network’s predicted noise at a randomly sampled timestep. $$ \mathcal{L}_{\text{noise}} = \mathbb{E}_{t, x_0, \epsilon}\left[\lVert \epsilon – \tilde\epsilon_\theta(x_t, t) \rVert^2\right] $$ TaDiff adds a segmentation term built from the Dice loss, weighted by the same noise level factor so that segmentation of a heavily noised future image counts for less than segmentation of the clean source images. $$ \ell_{\text{seg}} = \ell_{\text{dice}}(\tilde m^S, m^S) + \sqrt{\bar\alpha_t}\, \ell_{\text{dice}}(\tilde m^f, m^f) $$ The full joint objective combines the weighted noise loss with the segmentation loss, scaled by a factor lambda set to 0.01 in this work. $$ \ell_{\text{TaDiff}} = \lVert \omega \odot (\epsilon – \tilde\epsilon) \rVert^2 + \lambda\, \ell_{\text{seg}} $$

Generalizing beyond the home institution

The external LUMIERE test is arguably the more important number for anyone wondering whether this kind of model could ever leave a single hospital’s data silo. Image generation quality on that Swiss cohort came in at an SSIM of 0.848 against 0.919 locally, a PSNR of 27.51 against 27.97, and an MSE of 0.242 against 0.174, translating to roughly a 7 percent relative drop in SSIM and under 5 percent in PSNR. The authors call this decline minor and well accepted given the well known challenges of cross site imaging, including differences in scanner hardware, acquisition protocol, contrast, and patient demographics. That characterization is reasonable but worth treating as directional rather than definitive, since 37 external patients from a single additional site is still a narrow test of true generalization, and the lack of tumor mask annotations in LUMIERE meant the segmentation half of the model could not be externally validated at all.

What the ablations reveal about why it works

Two ablation experiments help explain where TaDiff’s performance actually comes from rather than just how much of it there is. Removing treatment awareness entirely, so the model saw only imaging history with no information about chemoradiation or temozolomide, dropped SSIM from 0.919 to 0.882 and, more strikingly, dropped future tumor Dice from 0.719 down to 0.556, a relative fall of over 16 percent. That is a substantial chunk of the model’s segmentation accuracy tied directly to knowing what treatment the patient is on, which is exactly the gap the authors set out to close relative to earlier image only growth models.

ConfigurationMRI generation SSIMFuture tumor Dice
Baseline, no treatment awareness0.8820.556
Full TaDiff, with treatment awareness0.9190.719
Baseline, no joint task learning or fusion weighting0.8700.541
Joint task learning added, no fusion weighting0.8910.672
Joint task learning plus dilated fusion weighting0.9190.719

The second ablation isolated the effect of jointly training the diffusion and segmentation branches together, plus the dilated longitudinal tumor fusion weighting scheme that focuses the loss on the tumor and its immediate surroundings. Adding joint task learning alone, without the fusion weighting, improved SSIM by about 2 percent and Dice by about 13 percent over a bare baseline. Adding the fusion weighting on top pushed the gains to roughly 5 percent and 18 percent respectively. In plain terms, both architectural choices, sharing the encoder between generation and segmentation and weighting the loss toward the peritumoral region, are pulling real weight rather than being incidental design flourishes, and their effects appear to stack rather than substitute for each other.

Clinical translation gap

There is a meaningful distance between a model that reaches 0.719 Dice on future tumor prediction across a handful of patients and something a tumor board could actually rely on. A few gaps stand out clearly from the paper itself. The core training cohort is 23 patients, and the held out test set is 5, which is a small enough sample that two atypical patients, one with a second surgery and one with a rare tumor subtype, were able to single handedly drag down an entire treatment day range’s worth of aggregate statistics. The model currently recognizes exactly two treatment categories, chemoradiation and temozolomide, with no representation for surgery, targeted therapy, immunotherapy, or any combination beyond that pair, meaning any patient whose care deviates from that specific standard protocol sits outside what the model was built to represent. And while the four month reliability window the authors report is a genuinely useful, honestly stated boundary, it also means the model’s most confident predictions cover a shorter horizon than many of the treatment planning decisions clinicians actually need to make months or years out.

The uncertainty maps are a real strength here worth calling out specifically, since a model that can say not just what it predicts but how confident it is in different tumor subregions is more clinically usable than one that only outputs a single number. The authors are careful to note that what their sampling based approach captures is data uncertainty, meaning variability arising from noisy or ambiguous input data and the inherent randomness of the diffusion sampling process, not model uncertainty in the stricter Bayesian sense that would capture how much the model’s own learned parameters might be wrong given so little training data. They flag Bayesian approaches such as Monte Carlo dropout as a direction for future work precisely because model uncertainty matters more, not less, when a network has seen only 23 patients.

Reading the outlier cases like a clinician would

It is worth sitting with the P-1 and P-2 stories a bit longer, because they illustrate something useful about how to evaluate any growth prediction model rather than being just a footnote about two unlucky patients. P-1, at 32 years old, had a tumor grow at what the authors describe as a rapid, distribution exceeding rate captured in a 267 day exam, then underwent a second surgery on day 365 that the model had no category for, leading to substantial over prediction of tumor volume afterward since the network kept forecasting growth in tissue that had since been surgically removed. P-2, at 44, was diagnosed with secondary glioblastoma, a tumor entity that the paper notes, citing prior classification work, tends to arise from lower grade precursor lesions in younger patients, shows less necrosis, favors the frontal lobe, and generally carries a better prognosis than primary glioblastoma despite looking similar under a microscope. With only two such cases in the entire training set, the model had essentially no basis for learning that subtype’s distinct growth behavior and over predicted P-2’s tumor growth as a result.

Both stories point toward the same practical fix, which the authors state plainly rather than hedge around. The path forward is more data covering more treatment types and more tumor subtypes, not a fundamentally different architecture. That is a refreshingly unglamorous but credible diagnosis of the model’s current limits.

Key takeaway

The most clinically relevant finding in this paper may not be the headline SSIM or Dice score at all. It is the demonstration that treatment information alone accounts for roughly a sixth of the model’s future tumor segmentation accuracy, which is a concrete, measured argument for why any longitudinal glioma model that ignores what treatment a patient actually received is leaving real predictive power on the table.

Clinical limitations

Beyond the translation gap already discussed, a few specific constraints bound how far these results should travel. The local dataset totals 23 patients and the external validation set 37, both modest by the standards of most deep learning imaging studies, and the test set of 5 local patients is small enough that individual patient outcomes, as shown above, can swing aggregate statistics considerably. The model works in two dimensions, processing 2D slices rather than full 3D volumes, a deliberate choice the authors made specifically because a 3D approach would have shrunk an already small number of training and test examples even further, though it does mean the model cannot directly reason about tumor shape and growth as a continuous 3D structure. Only two treatment types are represented, chemoradiation and temozolomide, with no accommodation for surgery, additional drug regimens, or treatment combinations, and diffusion models more broadly carry a real computational cost, needing 600 steps and a substantial GPU budget to generate a single prediction, which the authors flag as a target for future acceleration using faster solvers.

Where this sits relative to other approaches

TaDiff’s closest intellectual relatives are the deep probabilistic glioma growth models that treat future tumor state as a distribution rather than a fixed outcome, and the graph based work that fused mechanistic reaction diffusion equations with data driven cell density estimation. What distinguishes this paper is the combination of three things landing in one model at once, image generation rather than only mask prediction, explicit treatment and timing conditioning rather than imaging history alone, and a joint architecture that shares an encoder between the generative and segmentation tasks so that neither has to be trained and deployed separately. The authors also point toward a different research thread worth knowing about, hybrid methods that fold explicit computational tumor growth models into deep learning pipelines, such as TGM Nets and DL PDE, which the paper credits with strong biological interpretability and long term prediction performance on simulated data but which currently lack any treatment awareness of their own. The authors frame combining that biophysical grounding with TaDiff’s treatment conditioning as a promising, still unrealized direction.

Beyond glioma, in theory

The authors make a broader claim worth treating with appropriate caution, that TaDiff’s underlying principles, learning from longitudinal imaging plus treatment history, are not inherently specific to brain tumors and could in theory extend to other solid tumors such as breast cancer. They are candid about the catch. Brain imaging benefits enormously from the skull acting as a fixed, rigid anatomical reference frame that makes registering scans across time relatively straightforward. Soft tissue elsewhere in the body, breast tissue very much included, deforms and shifts between imaging sessions in ways that make consistent spatial alignment a much harder problem, and the paper offers no evidence that TaDiff has actually been tested outside the brain. This is a hypothesis about transferability stated honestly as a hypothesis, not a demonstrated result, and it is worth reading it that way.

Complete PyTorch reproduction of the pipeline

The implementation below follows the paper’s described treatment aware diffusion architecture as closely as a single script reasonably can. A small UNet style backbone predicts both the diffusion noise and a tumor segmentation mask from a concatenation of three source scans and the noised target scan, conditioned on learned treatment and day embeddings for all four time points. The joint loss combines a mean squared error noise term with a Dice based segmentation term weighted by the noise level, matching the equations described above. Comments mark where this mirrors the paper directly and where it simplifies for the sake of a runnable, self contained example.

# tadiff_pipeline.py
# Simplified reproduction of the TaDiff architecture from
# Liu et al., "Treatment Aware Diffusion Probabilistic Model for
# Longitudinal MRI Generation and Diffuse Glioma Growth Prediction",
# IEEE Transactions on Medical Imaging, 2025.
# This script uses a small 2D UNet rather than the full multi stage
# backbone described in the paper, and trains on synthetic data, so
# it will not reproduce the paper's reported numbers. It preserves
# the treatment aware conditioning, the joint diffusion and
# segmentation heads, and the weighted joint loss described in
# Section III of the paper.

import math
import torch
import torch.nn as nn
import torch.nn.functional as F


def sinusoidal_embedding(values, dim):
    # standard transformer style sinusoidal embedding, used here for
    # both diffusion timesteps and treatment days, matching the
    # paper's description of timestep and treatment day embeddings
    device = values.device
    half = dim // 2
    freqs = torch.exp(-math.log(10000) * torch.arange(half, device=device).float() / half)
    args = values.float().unsqueeze(-1) * freqs.unsqueeze(0)
    return torch.cat([torch.sin(args), torch.cos(args)], dim=-1)


class TreatmentDayEmbedding(nn.Module):
    # Embeds a treatment type and its associated day, then sums them,
    # as described for the four paired treatment day inputs in the
    # paper, three source points plus one target point
    def __init__(self, dim, n_treatments=2):
        super().__init__()
        self.dim = dim
        self.treatment_embed = nn.Embedding(n_treatments, dim)
        self.day_mlp = nn.Sequential(nn.Linear(dim, dim), nn.SiLU(), nn.Linear(dim, dim))

    def forward(self, treatment_id, day):
        # treatment_id shape batch, day shape batch
        t_emb = self.treatment_embed(treatment_id)
        d_emb = self.day_mlp(sinusoidal_embedding(day, self.dim))
        return t_emb + d_emb


class ConvBlock(nn.Module):
    def __init__(self, in_ch, out_ch, cond_dim):
        super().__init__()
        self.norm1 = nn.GroupNorm(8, in_ch)
        self.conv1 = nn.Conv2d(in_ch, out_ch, 3, padding=1)
        self.cond_proj = nn.Linear(cond_dim, out_ch)
        self.norm2 = nn.GroupNorm(8, out_ch)
        self.conv2 = nn.Conv2d(out_ch, out_ch, 3, padding=1)
        self.skip = nn.Conv2d(in_ch, out_ch, 1) if in_ch != out_ch else nn.Identity()

    def forward(self, x, cond):
        h = self.conv1(F.silu(self.norm1(x)))
        h = h + self.cond_proj(cond)[:, :, None, None]
        h = self.conv2(F.silu(self.norm2(h)))
        return h + self.skip(x)


class TaDiffUNet(nn.Module):
    # A compact stand in for the paper's UNet backbone with 64, 128,
    # 256, 512 channel stages. Takes concatenated source scans and
    # the noised target scan as input, outputs predicted noise and a
    # four channel mask stack, three source masks plus one future
    # mask, matching the paper's mS union f output.
    def __init__(self, in_ch_per_scan=3, base=64, cond_dim=128):
        super().__init__()
        # three source scans, each with C=3 channels (T1, T1c, FLAIR),
        # plus the noised target scan with the same three channels
        total_in = in_ch_per_scan * 4
        self.cond_dim = cond_dim
        self.time_mlp = nn.Sequential(nn.Linear(cond_dim, cond_dim), nn.SiLU(), nn.Linear(cond_dim, cond_dim))
        self.treat_embed = TreatmentDayEmbedding(cond_dim)

        self.in_conv = nn.Conv2d(total_in, base, 3, padding=1)
        self.down1 = ConvBlock(base, base * 2, cond_dim)
        self.down2 = ConvBlock(base * 2, base * 4, cond_dim)
        self.pool = nn.AvgPool2d(2)
        self.mid = ConvBlock(base * 4, base * 4, cond_dim)
        self.up2 = ConvBlock(base * 4 + base * 4, base * 2, cond_dim)
        self.up1 = ConvBlock(base * 2 + base * 2, base, cond_dim)
        self.upsample = nn.Upsample(scale_factor=2, mode="nearest")

        self.noise_head = nn.Conv2d(base, in_ch_per_scan, 3, padding=1)
        self.mask_head = nn.Conv2d(base, 4, 3, padding=1)  # three source masks + one future mask

    def forward(self, x_sources, x_t, t, treat_ids, treat_days):
        # x_sources shape batch, 3, C, H, W  (three source scans)
        # x_t shape batch, C, H, W          (noised target scan)
        # t shape batch                     (diffusion timestep)
        # treat_ids, treat_days shape batch, 4  (three source + one target)
        b = x_t.shape[0]
        x = torch.cat([x_sources.reshape(b, -1, *x_t.shape[-2:]), x_t], dim=1)

        t_emb = self.time_mlp(sinusoidal_embedding(t, self.cond_dim))
        treat_embs = [self.treat_embed(treat_ids[:, i], treat_days[:, i]) for i in range(4)]
        # sum of source embeddings, matching the paper's difference then
        # sum strategy in spirit, kept as a simple sum here for clarity
        source_sum = sum(treat_embs[:3])
        target_emb = treat_embs[3]
        diff_emb = target_emb - source_sum
        cond = t_emb + target_emb + diff_emb  # injected everywhere except the bottleneck
        cond_mid = t_emb + target_emb          # bottleneck only gets timestep plus target treatment

        h0 = self.in_conv(x)
        h1 = self.down1(h0, cond)
        h1p = self.pool(h1)
        h2 = self.down2(h1p, cond)
        h2p = self.pool(h2)

        m = self.mid(h2p, cond_mid)

        u2 = self.upsample(m)
        u2 = self.up2(torch.cat([u2, h2p], dim=1), cond)
        u1 = self.upsample(u2)
        u1 = self.up1(torch.cat([u1, h1p], dim=1), cond)
        out = self.upsample(u1)

        noise_pred = self.noise_head(out)
        mask_pred = torch.sigmoid(self.mask_head(out))
        return noise_pred, mask_pred


def dice_loss(pred, target, eps=1e-6):
    # matches Eq. 13 in the paper, one minus the Dice coefficient
    pred = pred.reshape(pred.shape[0], -1)
    target = target.reshape(target.shape[0], -1)
    intersection = (pred * target).sum(dim=1)
    union = pred.sum(dim=1) + target.sum(dim=1)
    dice = (2 * intersection + eps) / (union + eps)
    return (1 - dice).mean()


class DiffusionSchedule:
    # linear beta schedule matching the paper, beta_1 = 1e-4 to
    # beta_T = 0.02
    def __init__(self, T=600, beta_start=1e-4, beta_end=0.02, device="cpu"):
        self.T = T
        self.betas = torch.linspace(beta_start, beta_end, T, device=device)
        self.alphas = 1.0 - self.betas
        self.alpha_bars = torch.cumprod(self.alphas, dim=0)

    def add_noise(self, x0, t, noise):
        # Eq. 2 and 3, samples x_t directly from x_0
        a_bar = self.alpha_bars[t].reshape(-1, 1, 1, 1)
        return torch.sqrt(a_bar) * x0 + torch.sqrt(1 - a_bar) * noise, a_bar


def joint_loss(noise_true, noise_pred, mask_pred, mask_source_true, mask_future_true, a_bar):
    # Eq. 14 and 16, dice on source masks plus noise weighted dice on
    # the future mask, combined with the diffusion noise loss
    mask_source_pred, mask_future_pred = mask_pred[:, :3], mask_pred[:, 3:]
    seg_loss = dice_loss(mask_source_pred, mask_source_true)
    seg_loss = seg_loss + torch.sqrt(a_bar.mean()) * dice_loss(mask_future_pred, mask_future_true)
    noise_loss = F.mse_loss(noise_pred, noise_true)
    lam = 0.01
    return noise_loss + lam * seg_loss, noise_loss.item(), seg_loss.item()


def smoke_test():
    # Runnable end to end check on synthetic data, confirming the
    # forward pass, loss computation, and a backward step all work.
    # This does not reproduce the paper's reported metrics.
    device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
    b, c, hw = 2, 3, 64  # small spatial size for a fast smoke test

    model = TaDiffUNet(in_ch_per_scan=c).to(device)
    schedule = DiffusionSchedule(T=600, device=device)
    optimizer = torch.optim.Adam(model.parameters(), lr=2.5e-4)

    x_sources = torch.randn(b, 3, c, hw, hw, device=device)
    x_future = torch.randn(b, c, hw, hw, device=device)
    mask_source_true = torch.randint(0, 2, (b, 3, hw, hw), device=device).float()
    mask_future_true = torch.randint(0, 2, (b, 1, hw, hw), device=device).float()
    treat_ids = torch.randint(0, 2, (b, 4), device=device)
    treat_days = torch.randint(0, 400, (b, 4), device=device)

    for step in range(5):
        model.train()
        optimizer.zero_grad()

        t = torch.randint(0, schedule.T, (b,), device=device)
        noise = torch.randn_like(x_future)
        x_t, a_bar = schedule.add_noise(x_future, t, noise)

        noise_pred, mask_pred = model(x_sources, x_t, t, treat_ids, treat_days)
        mask_true = torch.cat([mask_source_true, mask_future_true], dim=1)
        loss, noise_l, seg_l = joint_loss(noise, noise_pred, mask_pred, mask_source_true, mask_future_true, a_bar)

        loss.backward()
        optimizer.step()
        print(f"step {step} total {loss.item():.4f} noise {noise_l:.4f} seg {seg_l:.4f}")

    print("pipeline ran end to end without error")


if __name__ == "__main__":
    smoke_test()

Conclusion

What TaDiff demonstrates, stripped of the diffusion model machinery, is a fairly direct point that turns out to matter a great deal in practice, namely that a glioma growth model which knows what treatment a patient received predicts that patient’s future meaningfully better than one that does not. The ablation showing future tumor Dice climbing from 0.556 to 0.719 once treatment awareness is added is the paper’s clearest piece of evidence, and it is a more convincing argument for treatment conditioning than any amount of architectural description could be on its own.

The conceptual shift worth carrying forward is the choice to generate an image rather than only a number. Most growth prediction work in this space outputs a segmentation mask, a volume estimate, or a probability, all useful but all somewhat abstract to a clinician trying to picture what a patient’s next scan might actually show. By generating a synthetic multi parametric MRI alongside the mask and an uncertainty map, TaDiff produces something closer to what a radiologist already knows how to read, which matters for adoption even before it matters for accuracy.

On transferability, the authors’ own framing is the right one to borrow, cautious optimism bounded by a real caveat. The recipe of conditioning a generative model on treatment history and timing is not conceptually tied to brain tumors, and could plausibly extend to other cancers with enough longitudinal imaging and treatment data. But the brain’s rigid skull is doing real, underappreciated work in making registration and normalization tractable here, and nothing in this paper demonstrates the method holding up in a domain without that anatomical anchor. Anyone excited about applying this to breast or lung imaging should treat that as an open research question, not a settled extension.

The honest remaining limitations are substantial and the authors do not minimize them. Twenty three training patients and five test patients is a small foundation for a model meant to inform treatment planning, only two treatment categories are represented, the four month reliability window is shorter than many of the decisions clinicians actually need to make, and the uncertainty estimates capture data variability rather than the deeper model uncertainty that matters most with a dataset this size. The P-1 and P-2 cases are not embarrassing footnotes, they are the clearest demonstration in the whole paper of exactly what more data would need to cover before a model like this earns real clinical trust.

Where this goes next depends less on a cleverer architecture and more on the unglamorous work the authors point toward themselves, gathering more longitudinal data across more treatment types and more glioma subtypes, testing faster diffusion sampling methods so the model becomes practical to run routinely, and eventually pairing this generative, treatment aware approach with the biophysical grounding of mechanistic tumor growth models. None of that is a small undertaking, but the direction is a clear and credible one, and this paper reads as a genuine first step along it rather than a finished product overselling its readiness.

Frequently asked questions

What does TaDiff actually generate. Given three prior MRI scans, their treatment history, and a chosen future treatment and date, TaDiff generates a synthetic multi parametric MRI for that future date along with a predicted tumor segmentation mask and an uncertainty map.

Can this model predict what will happen to a specific patient. No. It is a research prototype trained on 23 patients locally and validated on 37 external patients. It has not been clinically validated and should not be used to predict any individual’s actual outcome or guide real treatment decisions.

How far into the future can the model predict reliably. The authors report reasonably reliable predictions up to about four months ahead, with a mean Dice score of 0.75. Beyond that, accuracy declines steadily, dropping to a Dice score of about 0.46 for predictions more than two years out.

Why did the model perform worse for two specific patients. One patient underwent a second surgery that fell outside the two treatment categories the model was trained on, and another had a rare secondary glioblastoma subtype with only two similar cases in the training data. Both gaps point to a data coverage problem rather than a flaw in the modeling approach itself.

What treatments does the model currently understand. Two, chemoradiation and temozolomide based chemotherapy, which reflects the standard treatment protocol received by the patients in the training cohort. Surgery, other drug regimens, and combination treatments are not currently represented.

Could this approach work for cancers outside the brain. The authors suggest it could in principle, given enough longitudinal imaging and treatment data, but they note the brain’s rigid skull makes image registration considerably easier than in soft tissue elsewhere in the body, and the paper does not test the method outside glioma.

Read the full peer reviewed paper for the complete architecture details, additional figures, and reference list.

Read the paper

Related reading on aitrendblend

Liu, Q., Fuster Garcia, E., Hovden, I.T., MacIntosh, B.J., Grodem, E.O.S., Brandal, P., Lopez Mateu, C., Sedericius, D., Skogen, K., Schellhorn, T., Bjornerud, A., Emblem, K.E. Treatment aware diffusion probabilistic model for longitudinal MRI generation and diffuse glioma growth prediction. IEEE Transactions on Medical Imaging, volume 44, number 6, June 2025, pages 2449 through 2462. https://doi.org/10.1109/TMI.2025.3533038

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 *