Cyclic 2.5D Perceptual Loss for Cross-Modal 3D Medical Image Synthesis: T1w MRI to Tau PET.
The 3 matches
- [1] § Methods › Experiment › Training Details ↔ Code/utils/dataset.py, lines 17–148 · score 0.79 · Gaussian noise, elastic, magnitude, trilinear, augmentation, flips
- [2] § Methods › Experiment › Training Details ↔ Code/train.py, lines 100–156 · score 0.69 · cosine annealing learning, Adam, dropout, channel, cycle, scheduler
- [3] § Methods › Experiment › Benchmark ↔ Code/train.py, lines 100–156 · score 0.66 · cosine annealing, combined loss function, min, max, cycle, scheduler
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
Python · 294 lines · 9.6 KB · no license · 2 matches
- # Run this code like python train.py --config example.yaml
- # If you have a checkpoint, run this code like python train.py --config example.yaml --checkpoint /path/to/the/chechpoint.pth
- import os
- import time
- import torch
- from torch import optim
- from torch.optim.lr_scheduler import CosineAnnealingLR
- from monai.networks.nets import UNet
- from utils.dataset import load_data
- from utils.cyclic_perceptual_loss import (
- CombinedLoss,
- update_plane_selection,
- calculate_cycle_epochs,
- )
- from utils.utils import (
- update_checkpoint_and_log,
- load_checkpoint,
- parse_arguments,
- load_config,
- seed_everything,
- )
- def train_one_epoch(
- model, train_loader, optimizer, loss_function, device, selection, grad_accum_steps
- ):
- """
- Train the model for one epoch on the given DataLoader and return the average loss.
- Args:
- model (nn.Module): The neural network model.
- train_loader (DataLoader): The DataLoader for the training set.
- optimizer (Optimizer): The optimizer.
- loss_function (callable): The loss function.
- device (torch.device): The device to use (CPU or GPU).
- selection (str): Which plane is currently selected ("axial", "coronal", or "sagittal").
- grad_accum_steps (int): Number of gradient accumulation steps.
- Returns:
- float: The average training loss for this epoch.
- """
- model.train()
- epoch_loss = 0.0
- for idx, batch_data in enumerate(train_loader):
- inputs = batch_data["image"].to(device)
- targets = batch_data["label"].to(device)
- outputs = model(inputs)
- loss = loss_function(outputs, targets, selection)
- # Gradient Accumulation
- (loss / grad_accum_steps).backward()
- if (idx + 1) % grad_accum_steps == 0 or idx == len(train_loader) - 1:
- optimizer.step()
- optimizer.zero_grad()
- epoch_loss += loss.item()
- # Clear memory for unused tensors
- del inputs, targets, outputs
- average_loss = epoch_loss / len(train_loader)
- return average_loss
- def validate_one_epoch(model, val_loader, loss_function, device, selection):
- """
- Run validation on the given DataLoader for one epoch and return the average validation loss.
- Args:
- model (nn.Module): The neural network model.
- val_loader (DataLoader): The DataLoader for the validation set.
- loss_function (callable): The loss function.
- device (torch.device): The device to use (CPU or GPU).
- selection (str): Which plane is currently selected ("axial", "coronal", or "sagittal").
- Returns:
- float: The average validation loss for this epoch.
- """
- model.eval()
- val_loss = 0.0
- with torch.no_grad():
- for val_data in val_loader:
- val_inputs = val_data["image"].to(device)
- val_targets = val_data["label"].to(device)
- val_outputs = model(val_inputs)
- loss = loss_function(val_outputs, val_targets, selection)
- val_loss += loss.item()
- del val_inputs, val_targets, val_outputs
- average_loss = val_loss / len(val_loader)
- return average_loss
- def train_model(train_loader, val_loader, config, device, checkpoint_path=None):
- """
- Train and validate the model on the provided data loaders. Manages checkpoints and logging.
- Args:
- train_loader (DataLoader): The DataLoader for the training set.
- val_loader (DataLoader): The DataLoader for the validation set.
- config (dict): Configuration dictionary loaded from YAML.
- device (torch.device): The device to use for training.
- checkpoint_path (str, optional): Path to an existing checkpoint to resume from.
- """
- # Prepare directories
- log_dir = config["LOG_DIR"]
- model_dir = config["MODEL_DIR"]
- os.makedirs(log_dir, exist_ok=True)
- os.makedirs(model_dir, exist_ok=True)
- # File for logging
- log_file = os.path.join(log_dir, "log.txt")
- # Load settings
- max_epochs = config["MAX_EPOCHS"]
- learning_rate = float(config["LEARNING_RATE"])
- use_dropout = config["USE_DROPOUT"]
- dropout = config["DROPOUT"]
- early_stopping_patience = config["EARLY_STOPPING_PATIENCE"]
- channels_setting = tuple(config["CHANNELS_SETTING"])
- cycle_duration = config["CYCLE_DURATION"]
- cycle_factor = config["CYCLE_FACTOR"]
- grad_accum_steps = config["GRAD_ACCUM_STEPS"]
- # Model creation
- if use_dropout:
- model = UNet(
- spatial_dims=3,
- in_channels=1,
- out_channels=1,
- channels=channels_setting,
- strides=(2, 2, 2, 2),
- dropout=dropout,
- ).to(device)
- else:
- model = UNet(
- spatial_dims=3,
- in_channels=1,
- out_channels=1,
- channels=channels_setting,
- strides=(2, 2, 2, 2),
- ).to(device)
- loss_function = CombinedLoss(config=config)
- optimizer = optim.Adam(model.parameters(), learning_rate)
- scheduler = CosineAnnealingLR(
- optimizer, T_max=int((cycle_duration + 0.5) / 2), eta_min=0
- )
- # Calculate the plane-switching epochs (Algorithm 2 in the paper)
- ax_epochs, co_epochs, sa_epochs = calculate_cycle_epochs(
- max_epochs, cycle_duration, cycle_factor
- )
- print("ax: ", ax_epochs)
- print("co: ", co_epochs)
- print("sa: ", sa_epochs)
- print("Max Epoch: ", max_epochs)
- # Initialize checkpoint-related variables
- best_val_loss = float("inf")
- no_improvement_epochs = 0
- selection = "axial" # Default plane
- start_epoch = 0
- early_stopping_trigger_epoch = (
- ax_epochs[2] if len(ax_epochs) > 2 else 0
- ) # Early stopping is activated in the late stages to prevent it from activating when the model is overfitted into a specific plane
- print(
- f"Early stopping will start to check after epoch: {early_stopping_trigger_epoch}"
- )
- best_checkpoint_path = None
- # Load checkpoint if provided
- if checkpoint_path:
- start_epoch, best_val_loss, selection, no_improvement_epochs = load_checkpoint(
- checkpoint_path, model, optimizer, scheduler
- )
- else:
- print("No checkpoint provided.")
- log_message = ""
- epoch_time_start = time.time()
- # Main training loop
- for epoch in range(start_epoch, max_epochs):
- # Print elapsed time every 50 epochs
- if epoch > 0 and epoch % 50 == 0:
- epoch_time_end = time.time()
- elapsed = epoch_time_end - epoch_time_start
- hours = int(elapsed // 3600)
- minutes = int((elapsed % 3600) // 60)
- seconds = int(elapsed % 60)
- print(f"{epoch} epochs done: {hours}h {minutes}m {seconds}s elapsed.")
- epoch_time_start = time.time()
- # Check if we need to switch planes
- new_selection, reset_best = update_plane_selection(
- epoch, ax_epochs, co_epochs, sa_epochs, selection
- )
- if new_selection != selection:
- selection = new_selection
- if selection == "axial":
- print("Perceptual Loss is now based on axial slices.")
- elif selection == "coronal":
- print("Perceptual Loss is now based on coronal slices.")
- elif selection == "sagittal":
- print("Perceptual Loss is now based on sagittal slices.")
- if reset_best:
- best_val_loss = float("inf")
- # Train for one epoch
- train_loss = train_one_epoch(
- model=model,
- train_loader=train_loader,
- optimizer=optimizer,
- loss_function=loss_function,
- device=device,
- selection=selection,
- grad_accum_steps=grad_accum_steps,
- )
- # Validate
- val_loss = validate_one_epoch(
- model=model,
- val_loader=val_loader,
- loss_function=loss_function,
- device=device,
- selection=selection,
- )
- print(
- f"Epoch {epoch+1}/{max_epochs} | Train Loss: {train_loss:.4f}, Validation Loss: {val_loss:.4f}"
- )
- log_message += (
- f"Epoch {epoch+1}, Train Loss: {train_loss}, Validation Loss: {val_loss}\n"
- )
- scheduler.step()
- # Update checkpoint and log
- best_val_loss, no_improvement_epochs, stop_training, best_checkpoint_path = (
- update_checkpoint_and_log(
- average_val_loss=val_loss,
- selection=selection,
- epoch=epoch,
- no_improvement_epochs=no_improvement_epochs,
- log_message=log_message,
- model=model,
- optimizer=optimizer,
- scheduler=scheduler,
- best_val_loss=best_val_loss,
- model_dir=model_dir,
- early_stopping_patience=early_stopping_patience,
- log_file=log_file,
- early_stopping_trigger_epoch=early_stopping_trigger_epoch,
- best_checkpoint_path=best_checkpoint_path,
- )
- )
- if stop_training:
- print(f"Early stopping at epoch {epoch+1}")
- break
- def main():
- seed_everything(deterministic=True) # Fix seed
- args = parse_arguments()
- config = load_config(args.config)
- if isinstance(config["CUDA_SETTING"], int):
- torch.cuda.set_device(config["CUDA_SETTING"])
- device = torch.device(
- config["CUDA_SETTING"] if torch.cuda.is_available() else "cpu"
- )
- train_loader, val_loader = load_data(config)
- train_model(
- train_loader=train_loader,
- val_loader=val_loader,
- config=config,
- device=device,
- checkpoint_path=args.checkpoint,
- )
- if __name__ == "__main__":
- main()
train.py at commit 1ff09cd, no license · at the source
Overview
- Department of Artificial Intelligence Semiconductor Engineering, Hanyang University, Seoul, South Korea
- Department of Artificial Intelligence, Hanyang University, Seoul, South Korea
- Department of Electronic Engineering, Hanyang University, Seoul, South Korea
- Division of Computer Engineering, Hankuk University of Foreign Studies, Yongin, South Korea
- Division of AI Data Convergence, Hankuk University of Foreign Studies, Yongin, South Korea
- Division of Language & AI, Hankuk University of Foreign Studies, Seoul, South Korea
Abstract
Positron emission tomography (PET) provides an in vivo molecular marker for various diseases, including Alzheimer's disease and related dementias (ADRD). PET has become increasingly integrated into diagnostic decision‐making, disease staging, and clinical trial enrichment. However, its widespread use remains constrained by high costs, government regulations, and the invasiveness of radiotracer injection. Modern diagnostic frameworks emphasize the importance of multimodal biomarker assessment, such as the “amyloid/
Reproduced under the paper's license (CC BY-NC), 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.
labhai/Cyclic-2.5D-Perceptual-Loss
1ff09cd443a70018b6ad45a4656495b6814caef2, 17 April 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
6 files
- Code/
test.py , Python, 139 lines - Code/
train.py , Python, 294 lines, 2 matches - Code/
utils/ , Python, 213 linescyclic_perceptual_loss.p y - Code/
utils/ , Python, 148 lines, 1 matchdataset.py - Code/
utils/ , Python, 206 linesutils.py - README.md, Text, 110 lines
The paper's code and data availability statement is in the Data section.
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;
- 5 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
No dataset and no data link were found in the paper.
Data Availability Statement
The code for the proposed method is available at https://
Reproduced under the paper's license (CC BY-NC), 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, 5 authors, 7 keywords, 9 MeSH terms, 12 funders, 124 references.
Cite
This paper
Moon, J., Kim, S., Chung, H., Jang, I., & Alzheimer's Disease Neuroimaging Initiative. (2026). Cyclic 2.5D Perceptual Loss for Cross-Modal 3D Medical Image Synthesis: T1w MRI to Tau PET. Human brain mapping, 47(5), e70508. https://
BibTeX
@article{moon2026cyclic,
author = {Moon, Junho and Kim, Symac and Chung, Haejun and Jang, Ikbeom and {Alzheimer's Disease Neuroimaging Initiative}},
title = {{Cyclic 2.5D Perceptual Loss for Cross-Modal 3D Medical Image Synthesis: T1w MRI to Tau PET}},
journal = {Human brain mapping},
year = {2026},
month = apr,
volume = {47},
number = {5},
pages = {e70508},
publisher = {Wiley},
issn = {1065-9471},
doi = {10.1002/
url = {https://
pmid = {41968275},
pmcid = {PMC13070738}
}
RIS
TY - JOUR
AU - Moon, Junho
AU - Kim, Symac
AU - Chung, Haejun
AU - Jang, Ikbeom
AU - Alzheimer's Disease Neuroimaging Initiative
TI - Cyclic 2.5D Perceptual Loss for Cross-Modal 3D Medical Image Synthesis: T1w MRI to Tau PET
T2 - Human brain mapping
J2 - Hum Brain Mapp
PY - 2026
DA - 2026/
VL - 47
IS - 5
SP - e70508
SN - 1065-9471
PB - Wiley
DO - 10.1002/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1002/
"type": "article-journal",
"title": "Cyclic 2.5D Perceptual Loss for Cross-Modal 3D Medical Image Synthesis: T1w MRI to Tau PET",
"container-title": "Human brain mapping",
"author": [
{
"family": "Moon",
"given": "Junho"
},
{
"family": "Kim",
"given": "Symac"
},
{
"family": "Chung",
"given": "Haejun"
},
{
"family": "Jang",
"given": "Ikbeom"
},
{
"literal": "Alzheimer's Disease Neuroimaging Initiative"
}
],
"container-title-short":
"volume": "47",
"issue": "5",
"page": "e70508",
"DOI": "10.1002/
"PMID": "41968275",
"PMCID": "PMC13070738",
"ISSN": "1065-9471",
"publisher": "Wiley",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
1
]
]
}
}
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.64898/2026.05.06.26352540 [code]
- Generating synthetic tau-PET scans in Alzheimer’s disease from MRI, blood biomarkers and demographics with deep learningJournal: medRxiv (preprint)In common: NiBabel, NumPy, PET / SPECT, Alzheimer's / dementia, structural MRI / diffusion, 11 references
- [2] doi:10.3389/frai.2026.1771088 [code]
- Few-shot deployment of pretrained MRI transformers in brain imaging tasks.Journal: Frontiers in artificial intelligenceIn common: MONAI, NiBabel, PyTorch, 1 other tool, structural MRI / diffusion, 5 references
- [3] doi:10.1002/alz.71571 [code]
- Vulnerability of anterior medial temporal lobe subregions to early tau-related neurodegeneration in Alzheimer's disease: Converging evidence from tau-PET and plasma p-tau217.Journal: Alzheimer's & dementia : the journal of the Alzheimer's AssociationIn common: PyTorch, NumPy, PET / SPECT, Alzheimer's / dementia, structural MRI / diffusion, 6 references
- [4] doi:10.1002/alz.71822 [code]
- SynthPET: A 3D generative AI approach for FDG-PET image synthesis from T1-weighted MRI and ASL CBF in Alzheimer's disease.Journal: Alzheimer's & dementia : the journal of the Alzheimer's AssociationIn common: PET / SPECT, Alzheimer's / dementia, structural MRI / diffusion, 7 references
- [5] doi:10.1126/sciadv.aee2305 [code]
- Prediction of mild cognitive impairment progression using time-sensitive multimodal biomarkers.Journal: Science advancesIn common: NiBabel, NumPy, PET / SPECT, Alzheimer's / dementia, structural MRI / diffusion, 6 references
- [6] doi:10.1093/brain/awaf375 [code]
- Reference proteins to improve Core 1 and Core 2 Alzheimer's disease CSF and plasma biomarkers.Journal: Brain : a journal of neurologyIn common: NumPy, PET / SPECT, Alzheimer's / dementia, 6 references
- [7] doi:10.3389/fnagi.2026.1847611 [code]
- APOE ε4-associated hippocampal atrophy trajectories across the Alzheimer's disease continuum: a systematic review, meta-analysis, and longitudinal validation.Journal: Frontiers in aging neuroscienceIn common: NumPy, Alzheimer's / dementia, structural MRI / diffusion, 7 references
- [8] doi:10.34133/research.1392 [code]
- Neuroimaging Epicenters as Vulnerable Nodes in Plasma p-tau217/
Aβ42-Positive Alzheimer's Disease. Journal: Research (Washington, D.C.)In common: NiBabel, NumPy, Alzheimer's / dementia, 6 references - [9] doi:10.3389/fnut.2026.1837406 [code]
- MIND diet moderates the associations between cerebrovascular and neurodegenerative disease burden and cognition.Journal: Frontiers in nutritionIn common: Alzheimer's / dementia, cognitive, structural MRI / diffusion, 7 references
- [10] doi:10.1038/s41598-026-54109-8
- A computational model to describe multi-regional brain architecture during neurodegeneration in Alzheimer's disease.Journal: Scientific reportsIn common: Alzheimer's / dementia, structural MRI / diffusion, 6 references
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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 5 scripts, and 3 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:6b77b28b197722c3…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
