TSCNet: transformer-simplicial convolutional network for functional brain network classification
The 2 matches
- [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] § 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
- import torch
- import torch.utils.data as utils
- from omegaconf import DictConfig, open_dict
- from typing import List
- from sklearn.model_selection import StratifiedShuffleSplit
- import numpy as np
- import torch.nn.functional as F
- import gudhi
- def build_simplicial_complex(pearson_matrix: torch.Tensor, max_dim: int = 2, threshold: float = 0.5):
- """
- 根据 Pearson 相关矩阵构造 Vietoris-Rips 单纯复形。
- pearson_matrix: [N, N] torch.Tensor, 对称相似度矩阵
- max_dim: 最大单纯形维度
- threshold: 构造复形的阈值
- """
- # 将相似度转换为距离
- distance_matrix = 1 - pearson_matrix.abs().cpu().numpy()
- rips_complex = gudhi.RipsComplex(distance_matrix=distance_matrix, max_edge_length=threshold)
- simplex_tree = rips_complex.create_simplex_tree(max_dimension=max_dim)
- # 你可以返回单纯形列表或计算 Betti 数
- betti_numbers = []
- for dim in range(max_dim + 1):
- betti_numbers.append(simplex_tree.betti_numbers()[dim] if dim < len(simplex_tree.betti_numbers()) else 0)
- return simplex_tree, betti_numbers
- def init_dataloader_with_complex(cfg, final_timeseires, final_pearson, labels):
- complexes = []
- betti_features = []
- for i in range(final_pearson.shape[0]):
- simplex_tree, betti = build_simplicial_complex(final_pearson[i], max_dim=2, threshold=cfg.dataset.complex_threshold)
- complexes.append(simplex_tree)
- betti_features.append(betti)
- betti_features = torch.tensor(betti_features, dtype=torch.float32)
- # 把 betti 特征拼接到原始特征
- final_features = torch.cat([final_timeseires, betti_features.unsqueeze(1).repeat(1, final_timeseires.shape[1], 1)], dim=-1)
- # 然后用你已有的 init_dataloader 逻辑
- return init_dataloader(cfg, final_features, final_pearson, labels)
- def init_dataloader(cfg: DictConfig,
- final_timeseires: torch.tensor,
- final_pearson: torch.tensor,
- labels: torch.tensor) -> List[utils.DataLoader]:
- labels = F.one_hot(labels.to(torch.int64))
- length = final_timeseires.shape[0]
- train_length = int(length*cfg.dataset.train_set*cfg.datasz.percentage)
- val_length = int(length*cfg.dataset.val_set)
- if cfg.datasz.percentage == 1.0:
- test_length = length-train_length-val_length
- else:
- test_length = int(length*(1-cfg.dataset.val_set-cfg.dataset.train_set))
- with open_dict(cfg):
- # total_steps, steps_per_epoch for lr schedular
- cfg.steps_per_epoch = (
- train_length - 1) // cfg.dataset.batch_size + 1
- cfg.total_steps = cfg.steps_per_epoch * cfg.training.epochs
- dataset = utils.TensorDataset(
- final_timeseires[:train_length+val_length+test_length],
- final_pearson[:train_length+val_length+test_length],
- labels[:train_length+val_length+test_length]
- )
- train_dataset, val_dataset, test_dataset = utils.random_split(
- dataset, [train_length, val_length, test_length])
- train_dataloader = utils.DataLoader(
- train_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=cfg.dataset.drop_last)
- val_dataloader = utils.DataLoader(
- val_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=False)
- test_dataloader = utils.DataLoader(
- test_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=False)
- return [train_dataloader, val_dataloader, test_dataloader]
- def init_stratified_dataloader(cfg: DictConfig,
- final_timeseires: torch.tensor,
- final_pearson: torch.tensor,
- labels: torch.tensor,
- stratified: np.array) -> List[utils.DataLoader]:
- labels = F.one_hot(labels.to(torch.int64))
- length = final_timeseires.shape[0]
- train_length = int(length*cfg.dataset.train_set*cfg.datasz.percentage)
- val_length = int(length*cfg.dataset.val_set)
- if cfg.datasz.percentage == 1.0:
- test_length = length-train_length-val_length
- else:
- test_length = int(length*(1-cfg.dataset.val_set-cfg.dataset.train_set))
- with open_dict(cfg):
- # total_steps, steps_per_epoch for lr schedular
- cfg.steps_per_epoch = (
- train_length - 1) // cfg.dataset.batch_size + 1
- cfg.total_steps = cfg.steps_per_epoch * cfg.training.epochs
- split = StratifiedShuffleSplit(
- n_splits=1, test_size=val_length+test_length, train_size=train_length, random_state=42)
- for train_index, test_valid_index in split.split(final_timeseires, stratified):
- final_timeseires_train, final_pearson_train, labels_train = final_timeseires[
- train_index], final_pearson[train_index], labels[train_index]
- final_timeseires_val_test, final_pearson_val_test, labels_val_test = final_timeseires[
- test_valid_index], final_pearson[test_valid_index], labels[test_valid_index]
- stratified = stratified[test_valid_index]
- split2 = StratifiedShuffleSplit(
- n_splits=1, test_size=test_length)
- for test_index, valid_index in split2.split(final_timeseires_val_test, stratified):
- final_timeseires_test, final_pearson_test, labels_test = final_timeseires_val_test[
- test_index], final_pearson_val_test[test_index], labels_val_test[test_index]
- final_timeseires_val, final_pearson_val, labels_val = final_timeseires_val_test[
- valid_index], final_pearson_val_test[valid_index], labels_val_test[valid_index]
- train_dataset = utils.TensorDataset(
- final_timeseires_train,
- final_pearson_train,
- labels_train
- )
- val_dataset = utils.TensorDataset(
- final_timeseires_val, final_pearson_val, labels_val
- )
- test_dataset = utils.TensorDataset(
- final_timeseires_test, final_pearson_test, labels_test
- )
- train_dataloader = utils.DataLoader(
- train_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=cfg.dataset.drop_last)
- val_dataloader = utils.DataLoader(
- val_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=False)
- test_dataloader = utils.DataLoader(
- test_dataset, batch_size=cfg.dataset.batch_size, shuffle=True, drop_last=False)
- return [train_dataloader, val_dataloader, test_dataloader]
dataloader.py at commit 5c6bdcb, no license · at the source
Overview
- Department of Artificial Intelligence and Data Science, XinZhou Normal University, Xinzhou, China
- Computer College, Qinghai Normal University, Xining, China
- The State Key Laboratory of Tibetan Intelligence, Qinghai Normal University, Xining, China
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
5c6bdcbc79a197e6446e89ee652e2636e54747db, 27 September 2026Availability: 1 check, the latest on 12 November 2026: the link answers
- 12 November 2026: the link answers
30 files
- source/
__init__.py , Python, 1 line - source/
__main__.py , Python, 46 lines - source/
components/ , Python, 3 lines__init__.py - source/
components/ , Python, 41 lineslogger.py - source/
components/ , Python, 55 lineslr_scheduler.py - source/
components/ , Python, 79 linesoptimizer.py - source/
cross_demo.py , Python, 44 lines, 1 match - source/
dataset/ , Python, 21 lines__init__.py - source/
dataset/ , Python, 30 linesabide.py - source/
dataset/ , Python, 147 lines, 1 matchdataloader.py - source/
dataset/ , Python, 24 linespreprocess.py - source/
models/ , Python, 1 lineSNT/ __init__.py - source/
models/ , Python, 1 lineSNT/ components/ __init__.py - source/
models/ , Python, 23 linesSNT/ components/ scnn.py - source/
models/ , Python, 25 linesSNT/ components/ transformer_encoder.py - source/
models/ , Python, 1 lineSNT/ ptdec/ __init__.py - source/
models/ , Python, 104 linesSNT/ ptdec/ cluster.py - source/
models/ , Python, 90 linesSNT/ ptdec/ dec.py - source/
models/ , Python, 13 lines__init__.py - source/
models/ , Python, 15 linesbase.py - source/
training/ , Python, 27 lines__init__.py - source/
training/ , Python, 199 linestraining.py - source/
utils/ , Python, 4 lines__init__.py - source/
utils/ , Python, 27 linesaccuracy.py - source/
utils/ , Python, 11 linescount_params.py - source/
utils/ , Python, 36 linesgumbel_softmax.py - source/
utils/ , Python, 153 lineshyperboloid.py - source/
utils/ , Python, 75 linesmeter.py - source/
utils/ , Python, 91 linesprepossess.py - README.md, Text, 71 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;
- 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
- openneuro:ds000233, at OpenNeuro; found in “Data availability statement”
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://
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/
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":
"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: NeuroImageIn 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 sciencesIn 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 analysisIn 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 medicineIn 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 sciencesIn 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: NeuroImageIn 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 mappingIn 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 physiologyIn 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.
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, 29 scripts, and 2 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:cfc92e09690b9321…
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/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:endHTML
<!-- 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.
