Transient Elevation and Subsequent Normalization of Brain Age Gap During the Postpartum Period.
The 3 matches
- [1] § Methods › Brain Age Prediction Model Development ↔ postpartum_brain_age_model.py, lines 158–280 · score 0.80 · healthy women, 22–36, Transfer learning, brain age predictions, freezing, convolutional
- [2] § Methods › Brain Age Prediction Model Development ↔ postpartum_brain_age_model.py, lines 1–25 · score 0.68 · attention module, convolutional feature, probability maps, brain age prediction, model, channel
- [3] § Methods › Brain Age Prediction Model Development ↔ postpartum_brain_age_model.py, lines 287–309 · score 0.58 · bias corrected, chronological age, Predicted brain age, errors
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 · 340 lines · 13 KB · MIT · 3 matches
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- Postpartum Brain Age Prediction Model
- =====================================
- Conceptual PyTorch implementation of the brain age prediction model described in:
- "A biphasic brain aging trajectory during the postpartum period: Longitudinal evidence for initial advancement and subsequent normalization"
- The model:
- - Uses three tissue probability maps (grey matter, white matter, CSF) as input channels
- - Applies a channel-wise attention module (Squeeze-and-Excitation style)
- - Extracts 3D convolutional features
- - Predicts brain age via a fully connected regression head
- - Is designed for pre-training on HCP women (HCP-YA + < 40y HCP-A) and fine-tuning on
- postpartum and nulliparous control women
- """
- from dataclasses import dataclass
- from typing import Optional
- import torch
- import torch.nn as nn
- import torch.nn.functional as F
- # -------------------------------------------------------------------------
- # Configuration dataclasses
- # -------------------------------------------------------------------------
- @dataclass
- class BrainAgeModelConfig:
- """Configuration for the 3D brain age prediction network."""
- in_channels: int = 3 # GM / WM / CSF tissue probability maps
- num_filters: tuple = (32, 64, 128, 256)
- se_reduction: int = 4 # Reduction ratio for Squeeze-and-Excitation
- dropout_prob: float = 0.3
- use_channel_attention: bool = True
- n_additional_features: int = 0 # e.g., could be site or health covariates; *sex is NOT used*
- fc_dims: tuple = (256, 128, 64) # Fully-connected layer sizes
- @dataclass
- class TransferLearningConfig:
- """Configuration for transfer learning / fine-tuning strategy."""
- freeze_backbone: bool = True # Freeze 3D conv feature extractor
- train_regressor_only: bool = True # Train only FC regression head
- learning_rate_backbone: float = 1e-4
- learning_rate_regressor: float = 1e-3
- # -------------------------------------------------------------------------
- # Core building blocks
- # -------------------------------------------------------------------------
- class ChannelSE3D(nn.Module):
- """
- Channel-wise Squeeze-and-Excitation module for 3D feature maps.
- Intended to operate on the tissue-channel dimension of the input:
- (B, C, D, H, W) where C = 3 for GM / WM / CSF probability maps.
- """
- def __init__(self, channels: int, reduction: int = 4):
- super().__init__()
- if channels <= reduction:
- reduction = max(1, channels // 2) or 1
- self.avg_pool = nn.AdaptiveAvgPool3d(1)
- self.fc = nn.Sequential(
- nn.Linear(channels, channels // reduction, bias=True),
- nn.ReLU(inplace=True),
- nn.Linear(channels // reduction, channels, bias=True),
- nn.Sigmoid(),
- )
- def forward(self, x: torch.Tensor) -> torch.Tensor:
- b, c, _, _, _ = x.shape
- # Global average pooling over spatial dimensions
- y = self.avg_pool(x).view(b, c)
- # Channel-wise excitation weights
- y = self.fc(y).view(b, c, 1, 1, 1)
- return x * y
- class ConvBlock3D(nn.Module):
- """3D Conv -> BatchNorm -> ReLU -> (optional) MaxPool."""
- def __init__(self, in_ch: int, out_ch: int, use_pool: bool = True):
- super().__init__()
- self.conv = nn.Conv3d(in_ch, out_ch, kernel_size=3, padding=1, bias=False)
- self.bn = nn.BatchNorm3d(out_ch)
- self.relu = nn.ReLU(inplace=True)
- self.pool = nn.MaxPool3d(kernel_size=2, stride=2) if use_pool else None
- def forward(self, x: torch.Tensor) -> torch.Tensor:
- x = self.conv(x)
- x = self.bn(x)
- x = self.relu(x)
- if self.pool is not None:
- x = self.pool(x)
- return x
- class BrainAgeBackbone3D(nn.Module):
- """
- 3D convolutional feature extractor.
- Stacks ConvBlock3D layers with progressively increasing filters:
- 32 -> 64 -> 128 -> 256, followed by global average pooling to obtain
- a compact feature representation.
- """
- def __init__(self, in_channels: int, num_filters: tuple):
- super().__init__()
- assert len(num_filters) >= 2, "num_filters should have at least two elements."
- layers = []
- prev_ch = in_channels
- for i, f in enumerate(num_filters):
- use_pool = True # pool after every block; can be adjusted if desired
- layers.append(ConvBlock3D(prev_ch, f, use_pool=use_pool))
- prev_ch = f
- self.conv_blocks = nn.Sequential(*layers)
- self.global_pool = nn.AdaptiveAvgPool3d(1)
- self.out_channels = num_filters[-1]
- def forward(self, x: torch.Tensor) -> torch.Tensor:
- x = self.conv_blocks(x)
- x = self.global_pool(x) # (B, C, 1, 1, 1)
- x = x.view(x.size(0), -1) # (B, C)
- return x
- class RegressionHead(nn.Module):
- """Fully connected regression module for brain age prediction."""
- def __init__(self, in_features: int, fc_dims: tuple, dropout_prob: float = 0.3):
- super().__init__()
- layers = []
- prev = in_features
- for i, h in enumerate(fc_dims):
- layers.append(nn.Linear(prev, h))
- layers.append(nn.ReLU(inplace=True))
- if dropout_prob > 0:
- layers.append(nn.Dropout(dropout_prob))
- prev = h
- # Final scalar output: predicted brain age
- layers.append(nn.Linear(prev, 1))
- self.net = nn.Sequential(*layers)
- def forward(self, x: torch.Tensor) -> torch.Tensor:
- return self.net(x)
- # -------------------------------------------------------------------------
- # Full model
- # -------------------------------------------------------------------------
- class PostpartumBrainAgeModel(nn.Module):
- """
- 3D multi-channel brain age prediction model for postpartum and control women.
- - Input: three tissue probability maps (GM, WM, CSF) preprocessed with CAT12
- and normalized to MNI space (1.0mm^3, 157 x 189 x 156 voxels, or equivalent).
- - Channel-wise SE attention emphasizes tissue-specific information.
- - 3D CNN backbone extracts compact brain features.
- - Regression head outputs predicted brain age (in years).
- - Designed for:
- * Pre-training on 639 healthy women (HCP-YA 22–36y, HCP-A 36–39y)
- * Fine-tuning on postpartum and nulliparous control women using minimal
- transfer learning (regression head only; backbone frozen).
- NOTE: The model is *sex-specific* (women only) and **does not use sex as an input
- covariate**. If you need additional covariates (e.g., site), pass them via
- `n_additional_features` and the `additional_features` argument in `forward`.
- """
- def __init__(self, config: Optional[BrainAgeModelConfig] = None):
- super().__init__()
- if config is None:
- config = BrainAgeModelConfig()
- self.config = config
- # Optional channel-wise attention on GM/WM/CSF input channels
- self.use_channel_attention = config.use_channel_attention
- if self.use_channel_attention:
- self.channel_attention = ChannelSE3D(
- channels=config.in_channels,
- reduction=config.se_reduction,
- )
- else:
- self.channel_attention = nn.Identity()
- # 3D convolutional backbone
- self.backbone = BrainAgeBackbone3D(
- in_channels=config.in_channels,
- num_filters=config.num_filters,
- )
- # Regression head (optionally includes non-imaging covariates, NOT sex)
- in_features = self.backbone.out_channels
- if config.n_additional_features > 0:
- in_features += config.n_additional_features
- self.regressor = RegressionHead(
- in_features=in_features,
- fc_dims=config.fc_dims,
- dropout_prob=config.dropout_prob,
- )
- # ------------------------------------------------------------------
- # Transfer learning utilities
- # ------------------------------------------------------------------
- def freeze_backbone(self) -> None:
- """Freeze convolutional backbone parameters."""
- for p in self.backbone.parameters():
- p.requires_grad = False
- def unfreeze_backbone(self) -> None:
- """Unfreeze convolutional backbone parameters."""
- for p in self.backbone.parameters():
- p.requires_grad = True
- def parameters_for_transfer_learning(self, tl_config: TransferLearningConfig):
- """
- Convenience method to obtain parameter groups for optimizer
- according to the specified transfer-learning strategy.
- """
- if tl_config.freeze_backbone and tl_config.train_regressor_only:
- self.freeze_backbone()
- return [
- {"params": self.regressor.parameters(), "lr": tl_config.learning_rate_regressor}
- ]
- else:
- # Fine-tune both backbone and regressor with potentially different LRs
- self.unfreeze_backbone()
- return [
- {"params": self.backbone.parameters(), "lr": tl_config.learning_rate_backbone},
- {"params": self.regressor.parameters(), "lr": tl_config.learning_rate_regressor},
- ]
- # ------------------------------------------------------------------
- # Forward
- # ------------------------------------------------------------------
- def forward(
- self,
- x: torch.Tensor,
- additional_features: Optional[torch.Tensor] = None,
- ) -> torch.Tensor:
- """
- Forward pass.
- Args:
- x: Tensor of shape (B, 3, D, H, W) containing GM/WM/CSF maps.
- additional_features: Optional tensor of shape (B, n_additional_features)
- for non-imaging covariates (e.g., site). Sex must **not** be included.
- Returns:
- Tensor of shape (B, 1): predicted brain age (in years).
- """
- # Channel-wise attention on tissue maps
- x = self.channel_attention(x)
- # Extract imaging features
- feat = self.backbone(x) # (B, C)
- # Concatenate additional covariates if provided
- if self.config.n_additional_features > 0:
- if additional_features is None:
- raise ValueError(
- f"Model configured with n_additional_features={self.config.n_additional_features}, "
- "but no additional_features were provided to forward()."
- )
- if additional_features.ndim != 2:
- raise ValueError("additional_features must be a 2D tensor of shape (B, F).")
- feat = torch.cat([feat, additional_features], dim=1)
- # Regress to brain age
- age_pred = self.regressor(feat)
- return age_pred
- # -------------------------------------------------------------------------
- # Helper: bias correction (conceptual)
- # -------------------------------------------------------------------------
- def apply_linear_bias_correction(
- predicted_age: torch.Tensor,
- chronological_age: torch.Tensor,
- slope: float,
- intercept: float,
- ) -> torch.Tensor:
- """
- Apply linear bias correction to predicted brain age.
- In practice, `slope` and `intercept` should be estimated from a validation
- set by regressing predicted age on chronological age:
- predicted_age = slope * chronological_age + intercept
- The bias-corrected age is then:
- corrected = predicted_age - (slope * chronological_age + intercept) + chronological_age
- This function expects already-estimated slope and intercept.
- """
- if predicted_age.shape != chronological_age.shape:
- raise ValueError("predicted_age and chronological_age must have the same shape.")
- bias = slope * chronological_age + intercept
- corrected = predicted_age - bias + chronological_age
- return corrected
- def compute_bag(
- bias_corrected_predicted_age: torch.Tensor,
- chronological_age: torch.Tensor,
- ) -> torch.Tensor:
- """
- Compute Brain Age Gap (BAG) = bias-corrected predicted age - chronological age.
- """
- if bias_corrected_predicted_age.shape != chronological_age.shape:
- raise ValueError("bias_corrected_predicted_age and chronological_age must have the same shape.")
- return bias_corrected_predicted_age - chronological_age
- # -------------------------------------------------------------------------
- # Quick self-test
- # -------------------------------------------------------------------------
- if __name__ == "__main__":
- # Minimal smoke test to verify shapes and forward pass
- cfg = BrainAgeModelConfig(
- in_channels=3,
- num_filters=(32, 64, 128, 256),
- n_additional_features=0, # IMPORTANT: sex is NOT used; keep this 0 unless you add other covariates
- )
- model = PostpartumBrainAgeModel(cfg)
- # Example input: batch of 2 subjects, 3 tissue maps, downsampled spatial dims
- x = torch.randn(2, 3, 64, 64, 64)
- y = model(x)
- print("Output shape:", y.shape) # Expected: torch.Size([2, 1])
postpartum_brain_age_model.py at commit d0265ae, under MIT · at the source
Overview
- Research Institute for AI Mind, Yonsei University, Seoul, Republic of Korea
- Department of Psychology, Yonsei University, Seoul, Republic of Korea
- Department of Radiology and Research Institute of Radiological Science and Center for Clinical Imaging Data Science, Yonsei University College of Medicine, Seoul, Republic of Korea
- Yonsei Institute for Digital Health, Yonsei University, Seoul, Republic of Korea
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.
chang-hyun.park/postpartum-brain-age-prediction
d0265ae061e3e4ed6f0aa4ed7b9f0435f1b4962f, 10 November 2025Availability: 1 check, the latest on 26 September 2026: the link answers
- 26 September 2026: the link answers
3 files
- postpartum_brain_age_mod
el.py — Python, 340 lines, 3 matches - LICENSE — License, 21 lines
- README.md — Text, 202 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;
- 1 script, 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.
Code and data availability statement
The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: chang-hyun.park/
postpartum-brain-age-pre diction - it says that the data are available on request
Read it in the paper: doi.org/10.1002/hbm.70608.
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, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 5 keywords, 11 MeSH terms, 1 funder, 36 references.
Cite
This paper
Park, C., Bak, Y., Han, S., Lee, S., & Shin, N. (2026). Transient Elevation and Subsequent Normalization of Brain Age Gap During the Postpartum Period. Human brain mapping, 47(13), e70608. https://
BibTeX
@article{park2026transie
author = {Park, Chang‐hyun and Bak, Yunjin and Han, Sanghoon and Lee, Seung‐Koo and Shin, Na‐Young},
title = {{Transient Elevation and Subsequent Normalization of Brain Age Gap During the Postpartum Period}},
journal = {Human brain mapping},
year = {2026},
month = sep,
volume = {47},
number = {13},
pages = {e70608},
publisher = {Wiley},
issn = {1065-9471},
doi = {10.1002/
url = {https://
pmid = {42675020},
pmcid = {PMC13529808}
}
RIS
TY - JOUR
AU - Park, Chang‐hyun
AU - Bak, Yunjin
AU - Han, Sanghoon
AU - Lee, Seung‐Koo
AU - Shin, Na‐Young
TI - Transient Elevation and Subsequent Normalization of Brain Age Gap During the Postpartum Period
T2 - Human brain mapping
J2 - Hum Brain Mapp
PY - 2026
DA - 2026/
VL - 47
IS - 13
SP - e70608
SN - 1065-9471
PB - Wiley
DO - 10.1002/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1002/
"type": "article-journal",
"title": "Transient Elevation and Subsequent Normalization of Brain Age Gap During the Postpartum Period",
"container-title": "Human brain mapping",
"author": [
{
"family": "Park",
"given": "Chang‐hyun"
},
{
"family": "Bak",
"given": "Yunjin"
},
{
"family": "Han",
"given": "Sanghoon"
},
{
"family": "Lee",
"given": "Seung‐Koo"
},
{
"family": "Shin",
"given": "Na‐Young"
}
],
"container-title-short":
"volume": "47",
"issue": "13",
"page": "e70608",
"DOI": "10.1002/
"PMID": "42675020",
"PMCID": "PMC13529808",
"ISSN": "1065-9471",
"publisher": "Wiley",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
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.21203/rs.3.rs-9235100/v1
- Structural Brain Changes Across the Female Lifespan: Puberty, Pregnancy, and Menopause Show Shared and Distinct TrajectoriesJournal: Research Square (preprint)In common: 6 references
- [2] doi:10.1007/s00737-026-01707-0
- Maternal depression symptoms as a context for longitudinal changes in the perinatal brain and infant emotion outcomes.Journal: Archives of women's mental healthIn common: 5 references
- [3] doi:10.1002/hbm.70425 [code]
- Brain Age Estimation on T2-FLAIR Scans for Application to Multiple Sclerosis.Journal: Human brain mappingIn common: PyTorch, structural MRI / diffusion, 5 references
- [4] doi:10.1162/imag.a.1352 [code]
- Brain-age in ultra-low-field MRI: How well does it work?Journal: Imaging neuroscience (Cambridge, Mass.)In common: PyTorch, structural MRI / diffusion, 4 references
- [5] doi:10.1038/s41586-026-10509-4
- Dopamine drives persistent remodelling of the maternal brain.Journal: NatureIn common: 4 references
- [6] doi:10.1038/s41467-026-74274-8 [code]
- Regional sex differences in human cortical anatomy vary in their morphometric bases and overlap with sex chromosomal and gonadal influences.Journal: Nature communicationsIn common: structural MRI / diffusion, 5 references
- [7] doi:10.7554/elife.109461 [code]
- The effect of physical activity on brain structure and cognitive function in the population-based cohort of LIFE-Adult Study.Journal: eLifeIn common: structural MRI / diffusion, cognitive, 3 references
- [8] doi:10.1038/s43856-026-01722-3 [code]
- Local and global patterns support medical imaging as a biomarker of ageing.Journal: Communications medicineIn common: PyTorch, 3 references
- [9] doi:10.1002/hbm.70627 [code]
- Investigating the Contribution of Molecular-Enriched Functional Connectivity to Brain-Age Analysis.Journal: Human brain mappingIn common: structural MRI / diffusion, 3 references
- [10] doi:10.1371/journal.pmed.1004860 [code]
- Brain aging patterns among nine neurological disorders: A case-control study.Journal: PLoS medicineIn common: structural MRI / diffusion, 3 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, 1 script, 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:fb7539ae24191ed1…
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
[.
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.
