OSCR

TSCNet: transformer-simplicial convolutional network for functional brain network classification

Code ↔ Paper

2 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 2 matches
  1. [1] § Method › Simplicial complex construction ↔ source/dataset/dataloader.py, lines 11 to 29 · score 0.67 · distance matrix, edge length, simplicial complex, threshold, dimensional · Report a mismatch
  2. [2] § Results and discussion › Experiment settings ↔ source/cross_demo.py, lines 4 to 41 · score 0.54 · cross validation, Adam, split, stratified, fold, PyTorch · 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 · 147 lines · 6.2 KB · no license · 1 match

  1. import torch
  2. import torch.utils.data as utils
  3. from omegaconf import DictConfig, open_dict
  4. from typing import List
  5. from sklearn.model_selection import StratifiedShuffleSplit
  6. import numpy as np
  7. import torch.nn.functional as F
  8. import gudhi
  9. def build_simplicial_complex(pearson_matrix: torch.Tensor, max_dim: int = 2, threshold: float = 0.5):
  10. """
  11. 根据 Pearson 相关矩阵构造 Vietoris-Rips 单纯复形。
  12. pearson_matrix: [N, N] torch.Tensor, 对称相似度矩阵
  13. max_dim: 最大单纯形维度
  14. threshold: 构造复形的阈值
  15. """
  16. # 将相似度转换为距离
  17. distance_matrix = 1 - pearson_matrix.abs().cpu().numpy()
  18. rips_complex = gudhi.RipsComplex(distance_matrix=distance_matrix, max_edge_length=threshold)
  19. simplex_tree = rips_complex.create_simplex_tree(max_dimension=max_dim)
  20. # 你可以返回单纯形列表或计算 Betti 数
  21. betti_numbers = []
  22. for dim in range(max_dim + 1):
  23. betti_numbers.append(simplex_tree.betti_numbers()[dim] if dim < len(simplex_tree.betti_numbers()) else 0)
  24. return simplex_tree, betti_numbers
  25. def init_dataloader_with_complex(cfg, final_timeseires, final_pearson, labels):
  26. complexes = []
  27. betti_features = []
  28. for i in range(final_pearson.shape[0]):
  29. simplex_tree, betti = build_simplicial_complex(final_pearson[i], max_dim=2, threshold=cfg.dataset.complex_threshold)
  30. complexes.append(simplex_tree)
  31. betti_features.append(betti)
  32. betti_features = torch.tensor(betti_features, dtype=torch.float32)
  33. # 把 betti 特征拼接到原始特征
  34. final_features = torch.cat([final_timeseires, betti_features.unsqueeze(1).repeat(1, final_timeseires.shape[1], 1)], dim=-1)
  35. # 然后用你已有的 init_dataloader 逻辑
  36. return init_dataloader(cfg, final_features, final_pearson, labels)
  37. def init_dataloader(cfg: DictConfig,
  38. final_timeseires: torch.tensor,
  39. final_pearson: torch.tensor,
  40. labels: torch.tensor) -> List[utils.DataLoader]:
  41. labels = F.one_hot(labels.to(torch.int64))
  42. length = final_timeseires.shape[0]
  43. train_length = int(length*cfg.dataset.train_set*cfg.datasz.percentage)
  44. val_length = int(length*cfg.dataset.val_set)
  45. if cfg.datasz.percentage == 1.0:
  46. test_length = length-train_length-val_length
  47. else:
  48. test_length = int(length*(1-cfg.dataset.val_set-cfg.dataset.train_set))
  49. with open_dict(cfg):
  50. # total_steps, steps_per_epoch for lr schedular
  51. cfg.steps_per_epoch = (
  52. train_length - 1) // cfg.dataset.batch_size + 1
  53. cfg.total_steps = cfg.steps_per_epoch * cfg.training.epochs
  54. dataset = utils.TensorDataset(
  55. final_timeseires[:train_length+val_length+test_length],
  56. final_pearson[:train_length+val_length+test_length],
  57. labels[:train_length+val_length+test_length]
  58. )
  59. train_dataset, val_dataset, test_dataset = utils.random_split(
  60. dataset, [train_length, val_length, test_length])
  61. train_dataloader = utils.DataLoader(
  62. train_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=cfg.dataset.drop_last)
  63. val_dataloader = utils.DataLoader(
  64. val_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=False)
  65. test_dataloader = utils.DataLoader(
  66. test_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=False)
  67. return [train_dataloader, val_dataloader, test_dataloader]
  68. def init_stratified_dataloader(cfg: DictConfig,
  69. final_timeseires: torch.tensor,
  70. final_pearson: torch.tensor,
  71. labels: torch.tensor,
  72. stratified: np.array) -> List[utils.DataLoader]:
  73. labels = F.one_hot(labels.to(torch.int64))
  74. length = final_timeseires.shape[0]
  75. train_length = int(length*cfg.dataset.train_set*cfg.datasz.percentage)
  76. val_length = int(length*cfg.dataset.val_set)
  77. if cfg.datasz.percentage == 1.0:
  78. test_length = length-train_length-val_length
  79. else:
  80. test_length = int(length*(1-cfg.dataset.val_set-cfg.dataset.train_set))
  81. with open_dict(cfg):
  82. # total_steps, steps_per_epoch for lr schedular
  83. cfg.steps_per_epoch = (
  84. train_length - 1) // cfg.dataset.batch_size + 1
  85. cfg.total_steps = cfg.steps_per_epoch * cfg.training.epochs
  86. split = StratifiedShuffleSplit(
  87. n_splits=1, test_size=val_length+test_length, train_size=train_length, random_state=42)
  88. for train_index, test_valid_index in split.split(final_timeseires, stratified):
  89. final_timeseires_train, final_pearson_train, labels_train = final_timeseires[
  90. train_index], final_pearson[train_index], labels[train_index]
  91. final_timeseires_val_test, final_pearson_val_test, labels_val_test = final_timeseires[
  92. test_valid_index], final_pearson[test_valid_index], labels[test_valid_index]
  93. stratified = stratified[test_valid_index]
  94. split2 = StratifiedShuffleSplit(
  95. n_splits=1, test_size=test_length)
  96. for test_index, valid_index in split2.split(final_timeseires_val_test, stratified):
  97. final_timeseires_test, final_pearson_test, labels_test = final_timeseires_val_test[
  98. test_index], final_pearson_val_test[test_index], labels_val_test[test_index]
  99. final_timeseires_val, final_pearson_val, labels_val = final_timeseires_val_test[
  100. valid_index], final_pearson_val_test[valid_index], labels_val_test[valid_index]
  101. train_dataset = utils.TensorDataset(
  102. final_timeseires_train,
  103. final_pearson_train,
  104. labels_train
  105. )
  106. val_dataset = utils.TensorDataset(
  107. final_timeseires_val, final_pearson_val, labels_val
  108. )
  109. test_dataset = utils.TensorDataset(
  110. final_timeseires_test, final_pearson_test, labels_test
  111. )
  112. train_dataloader = utils.DataLoader(
  113. train_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=cfg.dataset.drop_last)
  114. val_dataloader = utils.DataLoader(
  115. val_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=False)
  116. test_dataloader = utils.DataLoader(
  117. test_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=False)
  118. return [train_dataloader, val_dataloader, test_dataloader]

dataloader.py at commit 5c6bdcb, no license · at the source

Overview

Authors: Libing Bai1, Guorong Zhang1, Liping Feng1, Lu Shen2,3, Bin Zhou2,3, Feng Hu2,3
  1. Department of Artificial Intelligence and Data Science, XinZhou Normal University, Xinzhou, China
  2. Computer College, Qinghai Normal University, Xining, China
  3. The State Key Laboratory of Tibetan Intelligence, Qinghai Normal University, Xining, China
Journal: Frontiers in medicine, volume 13, article 1974555
Dates: received 21 August 2026; accepted 29 September 2026; published online 28 October 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI · PMCID PMC13751393
Status: code verified (how the code is found and verified)
Methods: Smoothing, state filtering, decompositions, Machine learning, Connectivity
Keywords: functional brain network, higher-order network, simplicial complex, simplicial convolutional network, transformer
Citations: not cited yet (Europe PMC); 36 references in the paper

Abstract

Functional brain network modeling provides an important tool for analyzing disease-related abnormalities in functional connectivity. Conventional graph models, however, treat nodes and edges as their basic objects and mainly encode pairwise relationships between brain regions, making it difficult to explicitly represent higher-order topological units jointly formed by multiple regions. We therefore propose TSCNet, a functional brain network classification framework that integrates simplicial convolution with a Transformer. TSCNet first maps multi-site-harmonized functional connectivity matrices to hierarchical simplicial complexes containing 0-, 1-, and 2-simplices. Hodge-Laplacian-driven simplicial convolutions then extract local topological features separately at each order. These order-specific features are projected into a shared representation space and passed to a Transformer to model global dependencies across simplices and brain regions. We evaluated TSCNet on three public fMRI datasets, ABIDE, ADHD-200, and Haxby, using stratified 10-fold cross-validation repeated five times. The complete model achieved classification accuracies of 81.23% on ABIDE and 82.42% on ADHD-200. Removing either the SCNN or Transformer component reduced performance, indicating that local higher-order topology and global information integration provide complementary information. Parameter-sensitivity analyses and topological-pattern visualizations further characterized the model’s responses to simplex order and construction threshold. TSCNet provides a framework for jointly analyzing local higher-order topology and whole-brain dependencies, although its generalization to unseen scanners and the clinical specificity of the identified higher-order patterns require validation in independent cohorts.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 2 matches between paragraphs and lines of code.

922397935/tscnet_main_v1

License: none: the authors keep all their rights
State: the link answers, verified on 12 November 2026
Evidence: files inventoried
Commit: 5c6bdcbc79a197e6446e89ee652e2636e54747db, 27 September 2026
Languages: Python (29)
Size: 66 files, 29 scripts
Software Heritage: not archived
Found in: “Data availability statement”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (18 files), NumPy (5 files), scikit-learn (3 files)
Availability: 1 check, the latest on 12 November 2026: the link answers
  • 12 November 2026: the link answers
30 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;
  • 29 scripts, each with its path and the digest of its content;
  • 2 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

Datasets cited

Data availability statement

ABIDE, ADHD-200, and Haxby are publicly available de-identified datasets that can be accessed via the links below. The source code required to reproduce the reported results can be found at https://github.com/922397935/TSCNet_main_v1/tree/main. The ABIDE dataset: The Autism Brain Imaging Data Exchange (ABIDE) dataset (containing 1112 anonymized neuroimaging samples from 16-17 international sites) is accessible through the Preprocessed Connectomes Project (PCP) repository: https://preprocessed-connectomes-project.org/abide/. This dataset contains structural/resting-state functional magnetic resonance imaging data and phenotypic information; all protected health information has been removed. The ADHD-200 dataset: The ADHD-200 dataset (containing 776 unrestricted samples from 8 imaging centers, including fMRI/anatomical data and phenotypic metadata) is available through the Neuro Bureau project on NITRC (http://www.nitrc.org/projects/neurobureau) and Amazon S3 buckets (http://preprocessed-connectomes-project.org/adhd200/download.html). Access to this dataset requires a registered NITRC account and adherence to non-commercial attribution requirements. The Haxby dataset: The Haxby dataset (neural response data to natural stimuli organized according to the BIDS standard) is hosted on OpenNeuro (dataset ID: ds000233; https://openneuro.org/datasets/ds000233 and the Datalad platform (http://datasets.datalad.org/?dir=/labs/haxby/attention). It can be directly accessed through neuroimaging tools (such as Nilearn) without any access restrictions.

Reproduced under the paper's license (CC BY), 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, 12 November 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 6 authors, 5 keywords, 24 references.

Cite

This paper

Bai, L., Zhang, G., Feng, L., Shen, L., Zhou, B., & Hu, F. (2026). TSCNet: transformer-simplicial convolutional network for functional brain network classification. Frontiers in medicine, 13, 1974555.

BibTeX

@article{bai2026tscnet,
author = {Bai, Libing and Zhang, Guorong and Feng, Liping and Shen, Lu and Zhou, Bin and Hu, Feng},
title = {{TSCNet: transformer-simplicial convolutional network for functional brain network classification}},
journal = {Frontiers in medicine},
year = {2026},
month = nov,
volume = {13},
pages = {1974555},
publisher = {Frontiers Media SA},
issn = {2296-858X},
pmcid = {PMC13751393}
}

RIS

TY - JOUR
AU - Bai, Libing
AU - Zhang, Guorong
AU - Feng, Liping
AU - Shen, Lu
AU - Zhou, Bin
AU - Hu, Feng
TI - TSCNet: transformer-simplicial convolutional network for functional brain network classification
T2 - Frontiers in medicine
J2 - Front Med (Lausanne)
PY - 2026
DA - 2026/11/12
VL - 13
SP - 1974555
SN - 2296-858X
PB - Frontiers Media SA
LA - en
ER -

CSL-JSON

{
"id": "pmcid:PMC13751393",
"type": "article-journal",
"title": "TSCNet: transformer-simplicial convolutional network for functional brain network classification",
"container-title": "Frontiers in medicine",
"author": [
{
"family": "Bai",
"given": "Libing"
},
{
"family": "Zhang",
"given": "Guorong"
},
{
"family": "Feng",
"given": "Liping"
},
{
"family": "Shen",
"given": "Lu"
},
{
"family": "Zhou",
"given": "Bin"
},
{
"family": "Hu",
"given": "Feng"
}
],
"container-title-short": "Front Med (Lausanne)",
"volume": "13",
"page": "1974555",
"PMCID": "PMC13751393",
"ISSN": "2296-858X",
"publisher": "Frontiers Media SA",
"language": "en",
"issued": {
"date-parts": [
[
2026,
11,
12
]
]
}
}

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.1016/j.neuroimage.2024.120909 [code]
A simple but tough-to-beat baseline for fMRI time-series classification.
Journal: NeuroImage
In common: PyTorch, scikit-learn, NumPy, 3 references
[2] doi:10.3390/brainsci12091219 [code]
Assessing Multi-Site rs-fMRI-Based Connectomic Harmonization Using Information Theory.
Journal: Brain sciences
In common: scikit-learn, NumPy, 4 references
[3] doi:10.1016/j.media.2025.103462 [code]
DSAM: A deep learning framework for analyzing temporal and spatial dynamics in brain networks.
Journal: Medical image analysis
In common: PyTorch, scikit-learn, NumPy, 2 references
[4] doi:10.1007/s10278-025-01399-5 [code]
MHNet: Multi-view High-Order Network for Diagnosing Neurodevelopmental Disorders Using Resting-State fMRI.
Journal: Journal of imaging informatics in medicine
In common: PyTorch, scikit-learn, NumPy, 2 references
[5] doi:10.3390/brainsci16050455 [code]
Spec-RWKV: A Spectrum-Guided Multi-Scale Recurrent Modeling Framework for Multi-Center Resting-State fMRI-Assisted Diagnosis.
Journal: Brain sciences
In common: PyTorch, scikit-learn, NumPy, 2 references
[6] doi:10.1016/j.neuroimage.2022.119737 [code]
Through the looking glass: Deep interpretable dynamic directed connectivity in resting fMRI.
Journal: NeuroImage
In common: PyTorch, scikit-learn, NumPy, 2 references
[7] doi:10.1002/hbm.26403 [code]
The robustness of persistent homology of brain networks to data acquisition-related non-neural variability in resting state fMRI.
Journal: Human brain mapping
In common: scikit-learn, NumPy, 3 references
[8] doi:10.1016/j.patter.2024.101081 [code]
An objective quantitative diagnosis of depression using a local-to-global multimodal fusion graph neural network.
Journal: Patterns (New York, N.Y.)
In common: PyTorch, scikit-learn, NumPy, 2 references
[9] doi:10.3389/fnetp.2025.1681597 [code]
Empirical evidence for structural balance theory in functional brain networks.
Journal: Frontiers in network physiology
In common: 3 references
[10] doi:10.3390/tomography11020014 [code]
Graph Neural Network Learning on the Pediatric Structural Connectome.
Journal: Tomography (Ann Arbor, Mich.)
In common: PyTorch, scikit-learn, NumPy, 2 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/repo/github.com/922397935/tscnet_main_v1.svg)](https://openscicode.org/badge/repo/github.com/922397935/tscnet_main_v1)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/repo/github.com/922397935/tscnet_main_v1.svg
   :target: https://openscicode.org/badge/repo/github.com/922397935/tscnet_main_v1
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/repo/github.com/922397935/tscnet_main_v1"><img src="https://openscicode.org/badge/repo/github.com/922397935/tscnet_main_v1.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

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)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.