OSCR

Biophysically constrained learning from healthy neural priors improves motor decoding in pathological cortical networks.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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

  1. import torch
  2. import torch.nn as nn
  3. import torch.nn.functional as F
  4. class MaskedEEGNet(nn.Module):
  5. def calculateOutSize(self, model, nChan, nTime):
  6. '''
  7. Calculate the output based on input size.
  8. model is from nn.Module and inputSize is a array.
  9. '''
  10. data = torch.rand(1,1,nChan, nTime)
  11. model.eval()
  12. out = model(data).shape
  13. return out[1:]
  14. def __init__(self,nchan,nTime,nClass=4,fs=250,dropoutRate=0.25,
  15. F1=8,D=2):
  16. super(MaskedEEGNet, self).__init__()
  17. self.F1=F1
  18. self.D=D
  19. self.F2=self.D*F1
  20. self.nTime=nTime
  21. self.nChan=nchan
  22. self.C1=fs//2
  23. self.block1=nn.Sequential(
  24. nn.Conv2d(1, self.F1, (1, self.C1),
  25. padding = (0, self.C1 // 2 ), bias =False),
  26. nn.BatchNorm2d(self.F1),
  27. Conv2dWithConstraint(self.F1, self.F1 * self.D, (self.nChan, 1),
  28. padding = 0, bias = False, max_norm = 1,
  29. groups=self.F1),
  30. nn.BatchNorm2d(self.F1 * self.D),
  31. nn.ELU(),
  32. nn.AvgPool2d((1,4),stride = 4),
  33. nn.Dropout(p = dropoutRate))
  34. self.block2=nn.Sequential(
  35. #SeparableConv2d
  36. nn.Conv2d(self.F1 * self.D, self.F1 * self.D, (1, 22),
  37. padding = (0, 22//2) , bias = False,
  38. groups=self.F1* self.D),#depthwise convolution
  39. nn.Conv2d(self.F1 * self.D, self.F2, (1,1),
  40. stride =1, bias = False, padding = 0),#pointwise convolution
  41. nn.BatchNorm2d(self.F2),
  42. nn.ELU(),
  43. nn.AvgPool2d((1,8), stride = 8),
  44. nn.Dropout(p = dropoutRate)
  45. )
  46. self.fSize = self.calculateOutSize(nn.Sequential(self.block1, self.block2), self.nChan, self.nTime)
  47. self.classifier =nn.Sequential(
  48. LinearWithConstraint(self.fSize[0]*self.fSize[1]*self.fSize[-1], nClass, max_norm = 0.25 ),
  49. nn.Softmax(dim = 1))
  50. # Domain Projector Block
  51. self.mask = nn.Parameter(torch.ones(nchan, 1))
  52. self.mask_norm=nn.Sequential(
  53. nn.BatchNorm2d(1),
  54. nn.ELU(),
  55. )
  56. def forward(self, x, nMCG=0):
  57. if nMCG:
  58. x = self.mask_norm(x*self.mask)
  59. out1=self.block1(x)
  60. out2=self.block2(out1)
  61. out2_flatten=out2.view(-1,self.fSize[0]*self.fSize[1]*self.fSize[-1])
  62. output=self.classifier(out2_flatten)
  63. return output
  64. class Conv2dWithConstraint(nn.Conv2d):
  65. def __init__(self, *args, doWeightNorm = True, max_norm=1, **kwargs):
  66. self.max_norm = max_norm
  67. self.doWeightNorm = doWeightNorm
  68. super(Conv2dWithConstraint, self).__init__(*args, **kwargs)
  69. def forward(self, x):
  70. if self.doWeightNorm:
  71. self.weight.data = torch.renorm(
  72. self.weight.data, p=2, dim=0, maxnorm=self.max_norm
  73. )#p=2
  74. return super(Conv2dWithConstraint, self).forward(x)
  75. class LinearWithConstraint(nn.Linear):
  76. def __init__(self, *args, doWeightNorm = True, max_norm=1, **kwargs):
  77. self.max_norm = max_norm
  78. self.doWeightNorm = doWeightNorm
  79. super(LinearWithConstraint, self).__init__(*args, **kwargs)
  80. def forward(self, x):
  81. if self.doWeightNorm:
  82. self.weight.data = torch.renorm(
  83. self.weight.data, p=2, dim=0, maxnorm=self.max_norm
  84. )
  85. return super(LinearWithConstraint, self).forward(x)

maskedEEGNet.py, under CC-BY-4.0 · at the source

Overview

  1. National Clinical Research Center for Geriatric, West China Hospital of Sichuan University, Chengdu 610017, Sichuan, China
  2. Med-X Center for Manufacturing, Sichuan University, Chengdu 610017, Sichuan, China
  3. Department of Neurosurgery, West China Hospital of Sichuan University, No. 37 Guo Xue Xiang, Chengdu 610041, China
  4. Laboratory for Neuro- and Psychophysiology, Department of Neurosciences, KU Leuven, Leuven 3000, Belgium
  5. Department of Bioengineering, Imperial College of Science, Technology and Medicine, London SW7 2AZ, UK
Journal: Science advances, volume 12, issue 43, article eadx5564
Dates: received 6 February 2026; accepted 21 September 2026; published online 23 October 2026; in print October 2026
Type: Research article · Language: English
License: CC BY-NC
Identifiers: DOI 10.1126/sciadv.adx5564 · PMID 42913013 · PMCID PMC13693691 · OpenAlex W7223383702
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: intracranial EEG (iEEG / ECoG / SEEG) (modality), human (organism), other condition (population), systems (subfield)
Methods: Spectral & time-frequency, Preprocessing, Smoothing, state filtering, decompositions, Machine learning, Connectivity, Statistics, fMRI & imaging
MeSH: Brain-Computer Interfaces*, Glioma*, Learning*, Motor Cortex*, Nerve Net*, Electrocorticography, Humans (* major topic)
Journal subjects: Physical and Materials Sciences, Neuroscience, Machine Learning
Topic: EEG and Brain-Computer Interfaces (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: National Natural Science Foundation of China (82072773, 82573942); Fundamental Research Funds for the Central Universities (YJ202373); West China Hospital, Sichuan University (ZYYC22001); Sichuan Science and Technology Program (2023YFG0127); China Foundation for Youth Entrepreneurship and Employment (HX-H2506250)
Citations: not cited yet (Europe PMC); 35 references in the paper

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

License: CC-BY-4.0
State: the link answers, verified on 25 October 2026
Evidence: files inventoried
Languages: Python (2)
Size: 4 files, 2 scripts
Software Heritage: not checked
Found in: “Data, code, and materials availability:”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (1 file)
Availability: 1 check, the latest on 25 October 2026: the link answers (HTTP 200)
  • 25 October 2026: the link answers (HTTP 200)
2 files

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/or the Supplementary Materials. Additional data and code are available on the Zenodo database at https://doi.org/10.5281/zenodo.20363750. No new materials have been created for this work.

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://doi.org/10.1126/sciadv.adx5564

BibTeX

@article{wu2026biophysically,
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/sciadv.adx5564},
url = {https://doi.org/10.1126/sciadv.adx5564},
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/10/23
VL - 12
IS - 43
SP - eadx5564
SN - 2375-2548
PB - American Association for the Advancement of Science
DO - 10.1126/sciadv.adx5564
UR - https://doi.org/10.1126/sciadv.adx5564
LA - en
ER -

CSL-JSON

{
"id": "10.1126/sciadv.adx5564",
"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": "Sci Adv",
"volume": "12",
"issue": "43",
"page": "eadx5564",
"DOI": "10.1126/sciadv.adx5564",
"PMID": "42913013",
"PMCID": "PMC13693691",
"ISSN": "2375-2548",
"publisher": "American Association for the Advancement of Science",
"URL": "https://doi.org/10.1126/sciadv.adx5564",
"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: eLife
In 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 engineering
In 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 data
In 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 advances
In 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: eLife
In 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: iScience
In 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 biology
In 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 biology
In 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 communications
In 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 engineering
In 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.

Add the badge to the code's README

OSCR: the badge of this paper

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 -->
[![OSCR](https://openscicode.org/badge/doi/10.1126/sciadv.adx5564.svg)](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:end
HTML
<!-- 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.