Biophysically constrained learning from healthy neural priors improves motor decoding in pathological cortical networks.
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 · 96 lines · 3.7 KB · CC-BY-4.0
- import torch
- import torch.nn as nn
- import torch.nn.functional as F
- class MaskedEEGNet(nn.Module):
- def calculateOutSize(self, model, nChan, nTime):
- '''
- Calculate the output based on input size.
- model is from nn.Module and inputSize is a array.
- '''
- data = torch.rand(1,1,nChan, nTime)
- model.eval()
- out = model(data).shape
- return out[1:]
- def __init__(self,nchan,nTime,nClass=4,fs=250,dropoutRate=0.25,
- F1=8,D=2):
- super(MaskedEEGNet, self).__init__()
- self.F1=F1
- self.D=D
- self.F2=self.D*F1
- self.nTime=nTime
- self.nChan=nchan
- self.C1=fs//2
- self.block1=nn.Sequential(
- nn.Conv2d(1, self.F1, (1, self.C1),
- padding = (0, self.C1 // 2 ), bias =False),
- nn.BatchNorm2d(self.F1),
- Conv2dWithConstraint(self.F1, self.F1 * self.D, (self.nChan, 1),
- padding = 0, bias = False, max_norm = 1,
- groups=self.F1),
- nn.BatchNorm2d(self.F1 * self.D),
- nn.ELU(),
- nn.AvgPool2d((1,4),stride = 4),
- nn.Dropout(p = dropoutRate))
- self.block2=nn.Sequential(
- #SeparableConv2d
- nn.Conv2d(self.F1 * self.D, self.F1 * self.D, (1, 22),
- padding = (0, 22//2) , bias = False,
- groups=self.F1* self.D),#depthwise convolution
- nn.Conv2d(self.F1 * self.D, self.F2, (1,1),
- stride =1, bias = False, padding = 0),#pointwise convolution
- nn.BatchNorm2d(self.F2),
- nn.ELU(),
- nn.AvgPool2d((1,8), stride = 8),
- nn.Dropout(p = dropoutRate)
- )
- self.fSize = self.calculateOutSize(nn.Sequential(self.block1, self.block2), self.nChan, self.nTime)
- self.classifier =nn.Sequential(
- LinearWithConstraint(self.fSize[0]*self.fSize[1]*self.fSize[-1], nClass, max_norm = 0.25 ),
- nn.Softmax(dim = 1))
- # Domain Projector Block
- self.mask = nn.Parameter(torch.ones(nchan, 1))
- self.mask_norm=nn.Sequential(
- nn.BatchNorm2d(1),
- nn.ELU(),
- )
- def forward(self, x, nMCG=0):
- if nMCG:
- x = self.mask_norm(x*self.mask)
- out1=self.block1(x)
- out2=self.block2(out1)
- out2_flatten=out2.view(-1,self.fSize[0]*self.fSize[1]*self.fSize[-1])
- output=self.classifier(out2_flatten)
- return output
- class Conv2dWithConstraint(nn.Conv2d):
- def __init__(self, *args, doWeightNorm = True, max_norm=1, **kwargs):
- self.max_norm = max_norm
- self.doWeightNorm = doWeightNorm
- super(Conv2dWithConstraint, self).__init__(*args, **kwargs)
- def forward(self, x):
- if self.doWeightNorm:
- self.weight.data = torch.renorm(
- self.weight.data, p=2, dim=0, maxnorm=self.max_norm
- )#p=2
- return super(Conv2dWithConstraint, self).forward(x)
- class LinearWithConstraint(nn.Linear):
- def __init__(self, *args, doWeightNorm = True, max_norm=1, **kwargs):
- self.max_norm = max_norm
- self.doWeightNorm = doWeightNorm
- super(LinearWithConstraint, self).__init__(*args, **kwargs)
- def forward(self, x):
- if self.doWeightNorm:
- self.weight.data = torch.renorm(
- self.weight.data, p=2, dim=0, maxnorm=self.max_norm
- )
- return super(LinearWithConstraint, self).forward(x)
maskedEEGNet.py, under CC-BY-4.0 · at the source
Overview
- National Clinical Research Center for Geriatric, West China Hospital of Sichuan University, Chengdu 610017, Sichuan, China
- Med-X Center for Manufacturing, Sichuan University, Chengdu 610017, Sichuan, China
- Department of Neurosurgery, West China Hospital of Sichuan University, No. 37 Guo Xue Xiang, Chengdu 610041, China
- Laboratory for Neuro- and Psychophysiology, Department of Neurosciences, KU Leuven, Leuven 3000, Belgium
- Department of Bioengineering, Imperial College of Science, Technology and Medicine, London SW7 2AZ, UK
Abstract
High-performance brain-computer interfaces (BCIs) rely on stable neural representations, yet brain functional impairments inherently disrupt canonical encoding, creating a fundamental decoding paradox. Conventional data-driven approaches struggle to bridge this gap because of pathological data scarcity and heterogeneity. Here, we propose to leverage healthy neural priors and introduce Pathology-Aware Consensus Training (PACT), a paradigm embedding biophysical constraints into healthy neural recordings to guide neural decoding. In a gesture classification task using high-density electrocorticography from patients with gliomas infiltrating the motor cortex, PACT improved the accuracy by more than 10%, effectively restoring the distorted semantic geometry of motor commands and realigning them with healthy canonical representations (correlation increase: r = 0.66 to r = 0.94). Mechanistically, PACT induced an emergent “inverse weighting” strategy: The model autonomously suppresses high-power pathological noise while reanchoring spatial attention to functional compensatory regions. This study provides a proof of concept for improving decoding in compromised networks by harnessing healthy neural dynamics, laying the theoretical foundation for future BCI deployments in clinical populations.
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.
Zenodo 20363750
Availability: 1 check, the latest on 25 October 2026: the link answers (HTTP 200)
- 25 October 2026: the link answers (HTTP 200)
2 files
- maskedEEGNet.py, Python, 96 lines
- train_test.py, Python, 40 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;
- 2 scripts, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- 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, code, and materials availability
All data and code needed to evaluate and reproduce the results in the paper are present in the paper and/
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, 25 October 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 12 authors, 7 MeSH terms, 5 funders, 34 references.
Cite
This paper
Wu, Y., Chang, T., Chen, S., Quan, Y., Sun, Q., Van Hulle, M. M., Liu, Y., Jiang, N., Farina, D., Yang, Y., Mao, Q., & He, J. (2026). Biophysically constrained learning from healthy neural priors improves motor decoding in pathological cortical networks. Science advances, 12(43), eadx5564. https://
BibTeX
@article{wu2026biophysic
author = {Wu, Yihan and Chang, Tao and Chen, Siliang and Quan, Yuxin and Sun, Qiang and Van Hulle, Marc M. and Liu, Yanhui and Jiang, Ning and Farina, Dario and Yang, Yuan and Mao, Qing and He, Jiayuan},
title = {{Biophysically constrained learning from healthy neural priors improves motor decoding in pathological cortical networks}},
journal = {Science advances},
year = {2026},
month = oct,
volume = {12},
number = {43},
pages = {eadx5564},
publisher = {American Association for the Advancement of Science},
issn = {2375-2548},
doi = {10.1126/
url = {https://
pmid = {42913013},
pmcid = {PMC13693691}
}
RIS
TY - JOUR
AU - Wu, Yihan
AU - Chang, Tao
AU - Chen, Siliang
AU - Quan, Yuxin
AU - Sun, Qiang
AU - Van Hulle, Marc M.
AU - Liu, Yanhui
AU - Jiang, Ning
AU - Farina, Dario
AU - Yang, Yuan
AU - Mao, Qing
AU - He, Jiayuan
TI - Biophysically constrained learning from healthy neural priors improves motor decoding in pathological cortical networks
T2 - Science advances
J2 - Sci Adv
PY - 2026
DA - 2026/
VL - 12
IS - 43
SP - eadx5564
SN - 2375-2548
PB - American Association for the Advancement of Science
DO - 10.1126/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1126/
"type": "article-journal",
"title": "Biophysically constrained learning from healthy neural priors improves motor decoding in pathological cortical networks",
"container-title": "Science advances",
"author": [
{
"family": "Wu",
"given": "Yihan"
},
{
"family": "Chang",
"given": "Tao"
},
{
"family": "Chen",
"given": "Siliang"
},
{
"family": "Quan",
"given": "Yuxin"
},
{
"family": "Sun",
"given": "Qiang"
},
{
"family": "Van Hulle",
"given": "Marc M."
},
{
"family": "Liu",
"given": "Yanhui"
},
{
"family": "Jiang",
"given": "Ning"
},
{
"family": "Farina",
"given": "Dario"
},
{
"family": "Yang",
"given": "Yuan"
},
{
"family": "Mao",
"given": "Qing"
},
{
"family": "He",
"given": "Jiayuan"
}
],
"container-title-short":
"volume": "12",
"issue": "43",
"page": "eadx5564",
"DOI": "10.1126/
"PMID": "42913013",
"PMCID": "PMC13693691",
"ISSN": "2375-2548",
"publisher": "American Association for the Advancement of Science",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
10,
23
]
]
}
}
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.7554/elife.89421 [code]
- An emerging view of neural geometry in motor cortex supports high-performance decoding.Journal: eLifeIn common: systems, 9 references
- [2] doi:10.1088/1741-2552/acd3b1
- Decoding and geometry of ten finger movements in human posterior parietal cortex and motor cortex.Journal: Journal of neural engineeringIn common: systems, 8 references
- [3] doi:10.1038/s41597-025-06346-1 [code]
- 3M-CPSEED, An EEG-based Dataset for Chinese Pinyin Production in Overt, Mouthed, and Imagined Speech.Journal: Scientific dataIn common: 3 references, author Ning Jiang
- [4] doi:10.1126/sciadv.adw3876 [code]
- Intracortical brain-computer interface for navigation in virtual reality in macaque monkeys.Journal: Science advancesIn common: systems, 6 references
- [5] doi:10.7554/elife.82598 [code]
- The impact of task context on predicting finger movements in a brain-machine interface.Journal: eLifeIn common: other condition, 6 references
- [6] doi:10.1016/j.isci.2022.105418
- Learning to control a BMI-driven wheelchair for people with severe tetraplegia.Journal: iScienceIn common: 5 references
- [7] doi:10.1371/journal.pcbi.1012257 [code]
- NeuroMotion: Open-source platform with neuromechanical and deep network modules to generate surface EMG signals during voluntary movement.Journal: PLoS computational biologyIn common: PyTorch, 1 reference, author Dario Farina
- [8] doi:10.1038/s42003-024-06784-4 [code]
- Measuring instability in chronic human intracortical neural recordings towards stable, long-term brain-computer interfaces.Journal: Communications biologyIn common: 5 references
- [9] doi:10.1038/s41467-023-36707-6 [code]
- Spatial transcriptomics reveals niche-specific enrichment and vulnerabilities of radial glial stem-like cells in malignant gliomas.Journal: Nature communicationsIn common: other condition, 1 reference, author Qing Mao
- [10] doi:10.1038/s41551-025-01501-w [code]
- Minimally invasive implantation of scalable high-density cortical microelectrode arrays for multimodal neural decoding and stimulation.Journal: Nature biomedical engineeringIn common: intracranial EEG (iEEG / ECoG / SEEG), 4 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, 2 scripts, and 0 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:898597ee71112792…
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.1126/sciadv.adx5564)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1126/sciadv.adx5564.svg
:target: https://openscicode.org/badge/doi/10.1126/sciadv.adx5564
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1126/sciadv.adx5564"><img src="https://openscicode.org/badge/doi/10.1126/sciadv.adx5564.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.
