OSCR

Progression-guided spatiotemporal memory transformers for accurate and consistent longitudinal brain tumor segmentation.

Code ↔ Paper

3 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 3 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
  1. [1] § Experimental results and discussion › Experimental setup ↔ PGSMT.ipynb, lines 186–190 · score 0.59 · weight decay, AdamW, setup, optimizer, model
  2. [2] § Experimental results and discussion › Experimental setup ↔ Configuration_Setup.ipynb, the whole file · a weak match · score 0.53 · weight decay, batch, patches, setup
  3. [3] § Experimental results and discussion › Experimental setup ↔ PGSMT.ipynb, lines 186–190 · score 0.52 · weight decay, AdamW, setup, optimization, model

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Jupyter notebook · 205 lines · 5.6 KB · no license · 2 matches

  1. # %%
  2. import torch
  3. import torch.nn as nn
  4. import torch.nn.functional as F
  5. # -----------------------------------
  6. # 1. Spatial Encoder
  7. # -----------------------------------
  8. class Encoder(nn.Module):
  9. def __init__(self, in_channels=4, base_channels=32):
  10. super().__init__()
  11. self.conv1 = nn.Conv3d(in_channels, base_channels, 3, padding=1)
  12. self.conv2 = nn.Conv3d(base_channels, base_channels*2, 3, padding=1)
  13. self.pool = nn.MaxPool3d(2)
  14. def forward(self, x):
  15. x = F.relu(self.conv1(x))
  16. x = self.pool(x)
  17. x = F.relu(self.conv2(x))
  18. return x
  19. # -----------------------------------
  20. # 2. Progression-Aware Temporal Memory
  21. # -----------------------------------
  22. class PATM(nn.Module):
  23. def __init__(self, dim, memory_slots=16):
  24. super().__init__()
  25. self.memory = nn.Parameter(torch.randn(memory_slots, dim))
  26. self.linear_q = nn.Linear(dim, dim)
  27. self.linear_k = nn.Linear(dim, dim)
  28. self.linear_v = nn.Linear(dim, dim)
  29. def forward(self, Ft, prev_memory):
  30. B, C, H, W, D = Ft.shape
  31. Ft_flat = Ft.view(B, C, -1).permute(0, 2, 1) # [B, N, C]
  32. Q = self.linear_q(Ft_flat)
  33. K = self.linear_k(prev_memory)
  34. V = self.linear_v(prev_memory)
  35. attn = torch.softmax(Q @ K.transpose(-1, -2) / (C**0.5), dim=-1)
  36. memory_update = attn @ V
  37. return memory_update
  38. # -----------------------------------
  39. # 3. Cross-Time Structural Alignment
  40. # -----------------------------------
  41. class CTSAM(nn.Module):
  42. def __init__(self, channels):
  43. super().__init__()
  44. self.offset_conv = nn.Conv3d(channels, 2, 3, padding=1)
  45. def forward(self, Ft, Ft_prev):
  46. offset = self.offset_conv(Ft)
  47. # simplified alignment (no grid_sample for brevity)
  48. aligned_prev = Ft_prev + offset.mean()
  49. loss_align = torch.mean((Ft - aligned_prev) ** 2)
  50. return aligned_prev, loss_align
  51. # -----------------------------------
  52. # 4. Boundary-Enhanced Transformer
  53. # -----------------------------------
  54. class BETE(nn.Module):
  55. def __init__(self, dim):
  56. super().__init__()
  57. self.q = nn.Linear(dim, dim)
  58. self.k = nn.Linear(dim, dim)
  59. self.v = nn.Linear(dim, dim)
  60. def forward(self, x):
  61. B, C, H, W, D = x.shape
  62. x_flat = x.view(B, C, -1).permute(0, 2, 1)
  63. Q = self.q(x_flat)
  64. K = self.k(x_flat)
  65. V = self.v(x_flat)
  66. attn = torch.softmax(Q @ K.transpose(-1, -2) / (C**0.5), dim=-1)
  67. out = attn @ V
  68. out = out.permute(0, 2, 1).view(B, C, H, W, D)
  69. return out
  70. # -----------------------------------
  71. # 5. Decoder
  72. # -----------------------------------
  73. class Decoder(nn.Module):
  74. def __init__(self, in_channels, num_classes=4):
  75. super().__init__()
  76. self.conv = nn.Conv3d(in_channels, num_classes, 1)
  77. def forward(self, x):
  78. return self.conv(x) # logits
  79. # -----------------------------------
  80. # 6. PGSMT Model
  81. # -----------------------------------
  82. class PGSMT(nn.Module):
  83. def __init__(self):
  84. super().__init__()
  85. self.encoder = Encoder()
  86. self.memory_module = PATM(dim=64)
  87. self.align = CTSAM(64)
  88. self.transformer = BETE(64)
  89. self.decoder = Decoder(64, num_classes=4)
  90. def forward(self, X_seq):
  91. memory = None
  92. outputs = []
  93. total_align_loss = 0
  94. for t in range(len(X_seq)):
  95. Ft = self.encoder(X_seq[t])
  96. if t == 0:
  97. memory = torch.zeros(1, 16, 64).to(Ft.device)
  98. aligned_prev = Ft
  99. else:
  100. aligned_prev, loss_align = self.align(Ft, prev_Ft)
  101. total_align_loss += loss_align
  102. memory = self.memory_module(Ft, memory)
  103. Zt = self.transformer(Ft)
  104. Yt = self.decoder(Zt)
  105. outputs.append(Yt)
  106. prev_Ft = Ft
  107. return outputs, total_align_loss
  108. # -----------------------------------
  109. # 7. Dice Loss
  110. # -----------------------------------
  111. def dice_loss(pred, target):
  112. pred = torch.softmax(pred, dim=1)
  113. intersection = (pred * target).sum()
  114. return 1 - (2. * intersection + 1e-5) / (pred.sum() + target.sum() + 1e-5)
  115. # -----------------------------------
  116. # 8. Total Loss
  117. # -----------------------------------
  118. def total_loss(outputs, targets, align_loss, lambda1=0.5, lambda2=0.3):
  119. loss = 0
  120. for t in range(len(outputs)):
  121. loss += dice_loss(outputs[t], targets[t])
  122. if t > 0:
  123. temp_loss = torch.mean(torch.abs(outputs[t] - outputs[t-1]))
  124. loss += lambda2 * temp_loss
  125. loss += lambda1 * align_loss
  126. return loss
  127. # -----------------------------------
  128. # 9. Training Step
  129. # -----------------------------------
  130. def train_step(model, data, optimizer):
  131. X_seq, Y_seq = data
  132. optimizer.zero_grad()
  133. outputs, align_loss = model(X_seq)
  134. loss = total_loss(outputs, Y_seq, align_loss)
  135. loss.backward()
  136. optimizer.step()
  137. return loss.item()
  138. # -----------------------------------
  139. # 10. Optimizer Setup
  140. # -----------------------------------
  141. def get_optimizer(model):
  142. return torch.optim.AdamW(model.parameters(), lr=1e-4, weight_decay=1e-5)
  143. # -----------------------------------
  144. # 11. Example Run
  145. # -----------------------------------
  146. if __name__ == "__main__":
  147. model = PGSMT().cuda()
  148. optimizer = get_optimizer(model)
  149. # dummy data: sequence of 3 time points
  150. X_seq = [torch.randn(1, 4, 64, 64, 64).cuda() for _ in range(3)]
  151. Y_seq = [torch.randn(1, 4, 64, 64, 64).cuda() for _ in range(3)]
  152. loss = train_step(model, (X_seq, Y_seq), optimizer)
  153. print("Loss:", loss)

PGSMT.ipynb at commit f6c67ff, no license · at the source

Overview

Authors: Sandeep Kumar Mathivanan1, Shamala K Subramaniam2, Dafik3, Sunder R1, Sangeetha SKB4, Siva Shankar S5
  1. School of Computing Science and Engineering, Galgotias University, Greater Noida, Uttar Pradesh 203201 India
  2. Department of Communication Technology and Network, Faculty of Computer Science and Information Technology, Universiti Putra Malaysia (UPM), Serdang, Selangor 43400 Malaysia
  3. Department of Mathematics, Faculty of Mathematics and Natural Sciences, University of Jember, Jember, Indonesia
  4. Manipal Institute of Technology Bengaluru, Manipal Academy of Higher Education, Manipal, India
  5. Department of Computer Science and Engineering, KG Reddy College of Engineering and Technology, Hyderabad, Telangana 501504 India
Institutions: Galgotias University (India); Universiti Putra Malaysia (Malaysia); Universitas Jember (Indonesia)
Journal: Scientific reports, volume 16, issue 1, article 23919
Dates: received 19 February 2026; accepted 12 May 2026; published online 25 May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41598-026-53337-2 · PMID 42185460 · PMCID PMC13434621 · OpenAlex W7162321760
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: structural MRI / diffusion (modality), human (organism), other condition (population), methods / tools (subfield)
Methods: Connectivity, Preprocessing, Machine learning
Keywords: Longitudinal brain tumor segmentation, Spatiotemporal memory, Progression-aware temporal modeling, Boundary-enhanced transformer, MRI, Tumor evolution dynamics, Cross-time structural alignment, Dice score, Temporal consistency, Deep learning, Cancer, Computational biology and bioinformatics, Mathematics and computing, Oncology
MeSH: Brain Neoplasms*, Image Processing, Computer-Assisted*, Algorithms, Convolutional Neural Networks, Deep Learning, Disease Progression, Humans, Magnetic Resonance Imaging (* major topic)
Topic: Brain Tumor Detection and Classification (Neurology, Neuroscience), according to OpenAlex
Funding: Manipal Academy of Higher Education, Manipal
Citations: not cited yet (Europe PMC); 25 references in the paper

Abstract

For monitoring the progression of the disease and the efficacy of treatment, it is essential to segment the brain tumor. The majority of the available deep learning models in use today are based on discrete time points without considering the continuity of the process, which causes irregular shapes of the tumors in the subsequent images. In this study, a model called Progression-Guided Spatiotemporal Memory Transformer (PGSMT) has been proposed, which has a unique design to overcome the constraints. A progression-aware temporal memory module, where the latent tumor representation is built up across successive MRI scans, a cross-time structural alignment mechanism, where the consistency of tumor morphology is preserved with the ability to accommodate pathological changes, and a boundary-enhanced transformer encoder, where the spatial dependencies are captured and stored for precise boundary delineation, are the three major components of the proposed framework. PGSMT learns the temporal weighting, making it possible for the network to distinguish between noise and actual progression, unlike other temporal fusion methods. When compared with the Convolutional Neural Network (CNN), hybrid CNN-Transformer, and Transformer models, the proposed PGSMT outperforms these models in the BraTS longitudinal benchmark dataset. PGSMT shows statistically significant improvements (p < 0.05), with 88.1% Dice for the enhancing tumor, 90.2% Dice for the tumor core, and 93.0% Dice for the total tumor. while reducing inter-scan volumetric inconsistencies significantly. The relevant therapeutic interest in the dynamics of changing tumor volumes is substantiated by attention analysis. With respect to the empirical evaluation on the BraTS longitudinal data set, the results achieve 88.1% Dice for the enhancing tumor, 90.2% Dice for the tumor core, and 93.0% Dice for the total tumor, demonstrating statistically significant improvements (p < 0.05) compared to traditional methods, while the results indicate increased stability in terms of temporal variance.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.

skbsangeetha/Progression-Guided-Spatiotemporal-Memory-Transformers-for-Brain-Tumor-Segmentation

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: f6c67ffeaff7fb038bad74c6563eeba1060906b8, 25 April 2026
Languages: Jupyter (15)
Size: 15 files, 15 scripts
Software Heritage: not archived
Found in: “Appendix A: Implementation details and reproduci”
Holds: 15 notebooks
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (6 files), NumPy (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
15 files

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 15 scripts, each with its path and the digest of its content;
  • 3 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data availability

The datasets used during the current study are available from the corresponding author on reasonable request.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 28 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 14 keywords, 8 MeSH terms, 1 funder, 11 references.

Cite

This paper

Mathivanan, S. K., Subramaniam, S. K., Dafik, R, S., SKB, S., & S, S. S. (2026). Progression-guided spatiotemporal memory transformers for accurate and consistent longitudinal brain tumor segmentation. Scientific reports, 16(1), 23919. https://doi.org/10.1038/s41598-026-53337-2

BibTeX

@article{mathivanan2026progression,
author = {Mathivanan, Sandeep Kumar and Subramaniam, Shamala K and Dafik and R, Sunder and SKB, Sangeetha and S, Siva Shankar},
title = {{Progression-guided spatiotemporal memory transformers for accurate and consistent longitudinal brain tumor segmentation}},
journal = {Scientific reports},
year = {2026},
month = may,
volume = {16},
number = {1},
pages = {23919},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-53337-2},
url = {https://doi.org/10.1038/s41598-026-53337-2},
pmid = {42185460},
pmcid = {PMC13434621}
}

RIS

TY - JOUR
AU - Mathivanan, Sandeep Kumar
AU - Subramaniam, Shamala K
AU - Dafik
AU - R, Sunder
AU - SKB, Sangeetha
AU - S, Siva Shankar
TI - Progression-guided spatiotemporal memory transformers for accurate and consistent longitudinal brain tumor segmentation
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/05/25
VL - 16
IS - 1
SP - 23919
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-53337-2
UR - https://doi.org/10.1038/s41598-026-53337-2
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-53337-2",
"type": "article-journal",
"title": "Progression-guided spatiotemporal memory transformers for accurate and consistent longitudinal brain tumor segmentation",
"container-title": "Scientific reports",
"author": [
{
"family": "Mathivanan",
"given": "Sandeep Kumar"
},
{
"family": "Subramaniam",
"given": "Shamala K"
},
{
"family": "Dafik"
},
{
"family": "R",
"given": "Sunder"
},
{
"family": "SKB",
"given": "Sangeetha"
},
{
"family": "S",
"given": "Siva Shankar"
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "23919",
"DOI": "10.1038/s41598-026-53337-2",
"PMID": "42185460",
"PMCID": "PMC13434621",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-53337-2",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
25
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.3389/frai.2026.1807248 [code]
Federated learning framework for medical image analysis with perspective-aware contrastive and mixture of experts.
Journal: Frontiers in artificial intelligence
In common: PyTorch, NumPy, kaggle.com/datasets/awsaf49, methods / tools, 1 reference
[2] doi:10.1038/s41467-026-71267-5 [code]
Human-like cognitive generalization for large models via mental representation-guided supervision.
Journal: Nature communications
In common: PyTorch, NumPy, kaggle.com/datasets/awsaf49
[3] doi:10.3389/fradi.2026.1847193
Image-conditioned latent rectified flow models for 3D medical anomaly localisation.
Journal: Frontiers in radiology
In common: kaggle.com/datasets/awsaf49, methods / tools, 1 reference
[4] doi:10.1371/journal.pone.0351667
MamNet-PT: A Mamba-enhanced hybrid architecture with selective state-space modeling for uncertainty-aware brain tumor segmentation.
Journal: PloS one
In common: kaggle.com/datasets/awsaf49, methods / tools, structural MRI / diffusion, other condition
[5] doi:10.1038/s41598-026-50240-8
High-precision brain tumor segmentation with switchable normalization in faster R-CNN architecture.
Journal: Scientific reports
In common: kaggle.com/datasets/awsaf49, methods / tools, structural MRI / diffusion, other condition
[6] doi:10.3390/jimaging12060251
3D Deep Learning for Brain Tumor Segmentation and Survival Prediction: A Comprehensive Multi-Modal Analysis Using the BraTS2020 Dataset.
Journal: Journal of imaging
In common: kaggle.com/datasets/awsaf49, other condition, 1 reference
[7] doi:10.1038/s41598-026-45697-6
Real-time medical images enhancement technique using Adaptive Histogram Equalization model.
Journal: Scientific reports
In common: kaggle.com/datasets/awsaf49, methods / tools, structural MRI / diffusion, other condition
[8] doi:10.3389/frai.2026.1812932
Bridging global context and local precision using a disagreement-based region specific ensemble of Swin UNETR and SegResNet for 3D glioma segmentation.
Journal: Frontiers in artificial intelligence
In common: kaggle.com/datasets/awsaf49, methods / tools, other condition
[9] doi:10.1186/s12911-026-03551-9
A multi-sequence MRI integration framework using SwinUNETR-v2 for multiple sclerosis lesion segmentation.
Journal: BMC medical informatics and decision making
In common: kaggle.com/datasets/awsaf49, structural MRI / diffusion
[10] doi:10.1371/journal.pone.0351405 [code]
Unimodal vs. multimodal deep learning for non-invasive MGMT promoter methylation prediction in glioblastoma: A systematic evaluation on the BraTS 2021 dataset.
Journal: PloS one
In common: PyTorch, NumPy, methods / tools, structural MRI / diffusion, other condition, 1 reference

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.