Transient Elevation and Subsequent Normalization of Brain Age Gap During the Postpartum Period.
3 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 3 matches
- [1] § Methods › Brain Age Prediction Model Development ↔ postpartum_brain_age_model.py, lines 158 to 280 · score 0.80 · healthy women, 22–36, Transfer learning, brain age predictions, freezing, convolutional · block
oscr:b:A4PMS3RJAPT5Z-A· Report a mismatch - [2] § Methods › Brain Age Prediction Model Development ↔ postpartum_brain_age_model.py, lines 1 to 25 · score 0.68 · attention module, convolutional feature, probability maps, brain age prediction, model, channel · block
oscr:b:AQYZM05KA5GXS-M· Report a mismatch - [3] § Methods › Brain Age Prediction Model Development ↔ postpartum_brain_age_model.py, lines 287 to 309 · score 0.58 · bias corrected, chronological age, Predicted brain age, errors · block
oscr:b:CXQS7JPPG9BZ5-T· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: 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: 2 checks, the latest on 11 November 2026: the link answers
- 11 November 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.1038/s41467-026-69370-8
- The effects of a second pregnancy on women's brain structure and function.Journal: Nature communicationsIn common: structural MRI / diffusion, 13 references
- [2] doi:10.1038/s41467-025-55830-0 [code]
- Pregnancy entails a U-shaped trajectory in human brain structure linked to hormones and maternal attachment.Journal: Nature communicationsIn common: 12 references
- [3] doi:10.1038/s41593-023-01513-2 [code]
- Women's neuroplasticity during gestation, childbirth and postpartum.Journal: Nature neuroscienceIn common: cognitive, 9 references
- [4] doi:10.1126/sciadv.adt5619 [code]
- Linking birth experience and perinatal depression symptoms to neuroanatomical changes in hippocampus and amygdala.Journal: Science advancesIn common: structural MRI / diffusion, 8 references
- [5] doi:10.1038/s41593-024-01741-0
- Neuroanatomical changes observed over the course of a human pregnancy.Journal: Nature neuroscienceIn common: structural MRI / diffusion, 9 references
- [6] doi:10.1038/s41386-024-01880-9 [code]
- Temporal dissociation between local and global functional adaptations of the maternal brain to childbirth: a longitudinal assessment.Journal: Neuropsychopharmacology : official publication of the American College of NeuropsychopharmacologyIn common: 8 references
- [7] doi:10.1098/rsob.230217 [code]
- Cellular and molecular signatures of motherhood in the adult and ageing rat brain.Journal: Open biologyIn common: 7 references
- [8] doi:10.1038/s41598-024-67316-y
- Enduring maternal brain changes and their role in mediating motherhood's impact on well-being.Journal: Scientific reportsIn common: structural MRI / diffusion, 6 references
- [9] doi:10.1038/s42003-024-07414-9 [code]
- Longitudinal investigation of neurobiological changes across pregnancy.Journal: Communications biologyIn common: structural MRI / diffusion, 6 references
- [10] 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
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:09790d12191b13d6…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1002/hbm.70608)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1002/hbm.70608.svg
:target: https://openscicode.org/badge/doi/10.1002/hbm.70608
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1002/hbm.70608"><img src="https://openscicode.org/badge/doi/10.1002/hbm.70608.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
