VarCoNet: A Variability-Aware Self-Supervised Framework for Functional Connectome Extraction From Resting-State fMRI.
The 4 matches
- [1] § Methods › Implementation Details ↔ ASD_classification_ABIDEI.py, lines 197–258 · score 0.68 · linear warmup cosine, annealing learning rate, warmup epochs, Adam, scheduler, VarCoNet
- [2] § Methods › Implementation Details ↔ subject_fingerprinting.py, lines 90–227 · score 0.68 · linear warmup cosine, annealing learning rate, warmup epochs, Adam, scheduler, VarCoNet
- [3] § Results › ASD Classification Performance ↔ result_scripts/display_results_ABIDE.py, lines 1132–1211 · score 0.64 · BAnD, CVFormer, DeepFMRI, GCDA, GCL, UCGL
- [4] § Methods › VarCoNet › rs‐fMRI Encoder ↔ model_scripts/VarCoNet.py, lines 26–60 · score 0.55 · positional encodings, Transformer encoder, trainable, kernels, CNN, layer
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 386 lines · 18 KB · MIT · 1 match
- from torch.utils.data import DataLoader
- import numpy as np
- import torch
- from utils import InfoNCE
- from tqdm import tqdm
- from torch.optim import Adam
- from utils import DualBranchContrast
- from pl_bolts.optimizers import LinearWarmupCosineAnnealingLR
- from model_scripts.VarCoNet import VarCoNet
- from utils import ABIDEDataset
- import os
- from model_scripts.classifier import LREvaluator
- import pickle
- from sklearn.model_selection import train_test_split, StratifiedKFold
- from utils import augment, removeDuplicates, test_augment_overlap
- import copy
- import argparse
- def train(x, encoder_model, contrast_model, optimizer):
- encoder_model.train()
- optimizer.zero_grad()
- z1 = encoder_model(x[0])
- z2 = encoder_model(x[1])
- loss = contrast_model(z1, z2)
- loss.backward()
- optimizer.step()
- return loss.item(), z1.shape[1]
- def test(encoder_model, train_loader, val_loader, test_loader,
- min_length, max_length, num_classes, device, num_epochs, lr):
- encoder_model.eval()
- with torch.no_grad():
- outputs_train = []
- y_train = []
- for (x,y) in train_loader:
- x = x.to(device)
- y_train.append(y)
- outputs_train.append(encoder_model(x))
- outputs_train = torch.cat(outputs_train, dim=0).clone().detach()
- y_train = torch.cat(y_train,dim=0).to(device)
- outputs_val = []
- y_val = []
- for (x,y) in val_loader:
- x = x.to(device)
- y_val.append(y)
- outputs_val.append(encoder_model(x))
- outputs_val = torch.cat(outputs_val, dim=0).clone().detach()
- y_val = torch.cat(y_val,dim=0).to(device)
- outputs_test= []
- y_test = []
- for (x,y) in test_loader:
- x = x.to(device)
- y_test.append(y)
- outputs_test.append(encoder_model(x))
- outputs_test = torch.cat(outputs_test, dim=0).clone().detach()
- y_test = torch.cat(y_test,dim=0).to(device)
- result,linear_state_dict = LREvaluator(num_epochs=num_epochs,learning_rate=lr).evaluate(encoder_model, outputs_train, y_train, outputs_val, y_val, outputs_test, y_test, num_classes, device)
- return result,linear_state_dict
- def main(config):
- path = config['path_data']
- names = []
- with open(os.path.join(path,'ABIDEI_nilearn_names.txt'), 'r') as f:
- for line in f:
- names.append(line.strip())
- data_list = np.load(os.path.join(path,'ABIDEI_nilearn_' + config['atlas'] + '.npz'))
- data = []
- for key in data_list:
- data.append(data_list[key])
- names_unique, counts = np.unique(names, return_counts=True)
- names_dupl = names_unique[counts > 1]
- pos_duplicates = []
- names_duplicate = []
- for name in names_dupl:
- temp = np.where(np.array(names) == name)[0]
- for t in temp:
- pos_duplicates.append(t)
- names_duplicate.append(name)
- names_unique = names_unique[counts == 1]
- pos_unique = []
- for name in names_unique:
- pos_unique.append(np.where(np.array(names) == name)[0][0])
- train_DATA = [data[i] for i in pos_duplicates]
- data = [data[i] for i in pos_unique]
- y = np.load(os.path.join(path,'ABIDEI_nilearn_classes.npy'))
- Y_train = y[pos_duplicates]
- y = y[pos_unique]
- ext_test = list(range(51456,51494))
- names_ext_test = []
- for name in ext_test:
- if 'sub-00'+str(name) in names_unique:
- names_ext_test.append('sub-00'+str(name))
- names = []
- for name in names_unique:
- if name not in names_ext_test:
- names.append(name)
- pos_ext_test = []
- for name in names_ext_test:
- pos_ext_test.append(np.where(np.array(names_unique) == name)[0][0])
- ext_test_data = [data[i] for i in pos_ext_test]
- y_ext_test = y[pos_ext_test]
- pos = []
- for name in names:
- pos.append(np.where(np.array(names_unique) == name)[0][0])
- data = [data[i] for i in pos]
- y = y[pos]
- device = torch.device(config['device']) if torch.cuda.is_available() else torch.device("cpu")
- max_length = data[0].shape[0]
- train_length_limits = [config['min_length'], max_length]
- eval_epochs = list(range(1, config['epochs']+1))
- model_config = config['model_config']
- model_config['max_length'] = max_length
- '''------------------------------------KFold CV------------------------------------'''
- losses_all = []
- test_result_all = []
- min_val_loss_epochs = []
- min_loss_epochs = []
- names_train_all = []
- names_val_all = []
- names_test_all = []
- for i in range(10):
- skf = StratifiedKFold(n_splits=10, shuffle = True, random_state=42+i)
- for j, (train_index, test_index) in enumerate(skf.split(data, y)):
- train_data = [data[n] for n in train_index]
- test_data = [data[n] for n in test_index]
- y_train = y[train_index]
- y_test = y[test_index]
- names_train = [names[n] for n in train_index]
- names_test = [names[n] for n in test_index]
- train_data, val_data, y_train, y_val, train_idx, val_idx = train_test_split(train_data,
- y_train,
- np.arange(len(train_data)),
- test_size=0.15,
- random_state=42,
- stratify=y_train)
- names_val = [names_train[n] for n in val_idx]
- names_train = [names_train[n] for n in train_idx]
- train_data = train_DATA + train_data
- y_train = np.concatenate((Y_train, y_train))
- names_train = names_duplicate + names_train
- train_dataset = ABIDEDataset(train_data, y_train)
- train_loader = DataLoader(train_dataset, batch_size=config['batch_size'],
- shuffle = config['shuffle'])
- val_dataset = ABIDEDataset(val_data, y_val)
- val_loader = DataLoader(val_dataset, batch_size=config['batch_size'])
- test_dataset = ABIDEDataset(test_data, y_test)
- test_loader = DataLoader(test_dataset, batch_size=config['batch_size'])
- names_train_all.append(names_train)
- names_val_all.append(names_val)
- names_test_all.append(names_test)
- roi_num = test_data[0].shape[1]
- encoder_model = VarCoNet(model_config, roi_num).to(device)
- contrast_model = DualBranchContrast(loss=InfoNCE(tau=config['tau']),mode='L2L').to(config['device'])
- optimizer = Adam(encoder_model.parameters(), lr=config['lr'])
- scheduler = LinearWarmupCosineAnnealingLR(
- optimizer=optimizer,
- warmup_start_lr = 1e-5,
- warmup_epochs=config['warm_up_epochs'],
- max_epochs=config['epochs'])
- min_val_loss = 1000
- test_result = []
- losses = []
- with tqdm(total=config['epochs'], desc='(T)') as pbar:
- for epoch in range(1,config['epochs']+1):
- total_loss = 0.0
- batch_count = 0
- for batch_idx, sample_inds in enumerate(train_loader.batch_sampler):
- sample_inds = removeDuplicates(names_train,sample_inds)
- batch_list = [train_data[i] for i in sample_inds]
- batch_loader = DataLoader(batch_list, batch_size=len(batch_list), num_workers=4)
- batch_data = next(iter(batch_loader))
- batch_data = augment(batch_data,train_length_limits,device)
- loss,input_dim = train(batch_data,encoder_model,contrast_model,
- optimizer)
- total_loss += loss
- batch_count += 1
- scheduler.step()
- average_loss = total_loss / batch_count if batch_count > 0 else float('nan')
- losses.append(average_loss)
- pbar.set_postfix({'loss': average_loss})
- pbar.update()
- if epoch in eval_epochs:
- res,linear_state_dict = test(encoder_model,train_loader,val_loader,test_loader,
- config['min_length'],max_length,config['num_classes'],
- config['device'],config['epochs_cls'],config['lr_cls'])
- test_result.append(res)
- if res['best_val_loss'] < min_val_loss:
- min_val_loss = res['best_val_loss']
- min_val_loss_model = copy.deepcopy(encoder_model.state_dict())
- min_val_loss_classifier = copy.deepcopy(linear_state_dict)
- min_val_loss_epoch = epoch
- losses_all.append(losses)
- test_result_all.append(test_result)
- min_val_loss_epochs.append(min_val_loss_epoch)
- if config['save_models']:
- if not os.path.exists(os.path.join(config['path_save'],'models_ABIDEI',config['atlas'],'VarCoNet')):
- os.makedirs(os.path.join(config['path_save'],'models_ABIDEI',config['atlas'],'VarCoNet'),exist_ok=True)
- torch.save(min_val_loss_model, os.path.join(config['path_save'],'models_ABIDEI',config['atlas'],'VarCoNet','min_val_loss_model_rs' + str(i) + '_fold' + str(j) + '.pth'))
- torch.save(min_val_loss_classifier, os.path.join(config['path_save'],'models_ABIDEI',config['atlas'],'VarCoNet','min_val_loss_classifier_rs' + str(i) + '_fold' + str(j) + '.pth'))
- '''------------------------------------Ext. test------------------------------------'''
- losses_all_ext = []
- ext_test_result_all = []
- min_val_loss_epochs_ext = []
- min_loss_epochs_ext = []
- names_train_ext_all = []
- names_val_ext_all = []
- for i in range(10):
- train_data, val_data, y_train, y_val, train_idx, val_idx = train_test_split(data,
- y,
- np.arange(len(data)),
- test_size=0.1,
- random_state=42+i,
- stratify=y)
- names_val = [names[n] for n in val_idx]
- names_train = [names[n] for n in train_idx]
- train_data = train_DATA + train_data
- y_train = np.concatenate((Y_train, y_train))
- names_train = names_duplicate + names_train
- train_dataset = ABIDEDataset(train_data, y_train)
- train_loader = DataLoader(train_dataset, batch_size=config['batch_size'], shuffle = config['shuffle'])
- val_dataset = ABIDEDataset(val_data, y_val)
- val_loader = DataLoader(val_dataset, batch_size=config['batch_size'])
- test_dataset = ABIDEDataset(ext_test_data, y_ext_test)
- test_loader = DataLoader(test_dataset, batch_size=config['batch_size'])
- names_train_ext_all.append(names_train)
- names_val_ext_all.append(names_val)
- roi_num = ext_test_data[0].shape[1]
- encoder_model = VarCoNet(model_config, roi_num).to(device)
- contrast_model = DualBranchContrast(loss=InfoNCE(tau=config['tau']),mode='L2L').to(config['device'])
- optimizer = Adam(encoder_model.parameters(), lr=config['lr'])
- scheduler = LinearWarmupCosineAnnealingLR(
- optimizer=optimizer,
- warmup_start_lr = 1e-5,
- warmup_epochs=config['warm_up_epochs'],
- max_epochs=config['epochs'])
- min_val_loss = 1000
- test_result = []
- losses = []
- with tqdm(total=config['epochs'], desc='(T)') as pbar:
- for epoch in range(1,config['epochs']+1):
- total_loss = 0.0
- batch_count = 0
- for batch_idx, sample_inds in enumerate(train_loader.batch_sampler):
- sample_inds = removeDuplicates(names_train,sample_inds)
- batch_list = [train_data[i] for i in sample_inds]
- batch_loader = DataLoader(batch_list, batch_size=len(batch_list))
- batch_data = next(iter(batch_loader))
- batch_data = augment(batch_data,train_length_limits,device)
- loss,input_dim = train(batch_data,encoder_model,contrast_model,
- optimizer)
- total_loss += loss
- batch_count += 1
- scheduler.step()
- average_loss = total_loss / batch_count if batch_count > 0 else float('nan')
- losses.append(average_loss)
- pbar.set_postfix({'loss': average_loss})
- pbar.update()
- if epoch in eval_epochs:
- res,linear_state_dict = test(encoder_model,train_loader,val_loader,test_loader,
- config['min_length'],max_length,config['num_classes'],
- config['device'],config['epochs_cls'],config['lr_cls'])
- test_result.append(res)
- if res['best_val_loss'] < min_val_loss:
- min_val_loss = res['best_val_loss']
- min_val_loss_model = copy.deepcopy(encoder_model.state_dict())
- min_val_loss_classifier = copy.deepcopy(linear_state_dict)
- min_val_loss_epoch = epoch
- losses_all_ext.append(losses)
- ext_test_result_all.append(test_result)
- min_val_loss_epochs_ext.append(min_val_loss_epoch)
- if config['save_models']:
- if not os.path.exists(os.path.join(config['path_save'],'models_ABIDEI',config['atlas'],'VarCoNet')):
- os.makedirs(os.path.join(config['path_save'],'models_ABIDEI',config['atlas'],'VarCoNet'),exist_ok=True)
- torch.save(min_val_loss_model, os.path.join(config['path_save'],'models_ABIDEI',config['atlas'],'VarCoNet','min_val_loss_model_rs' + str(i) + '.pth'))
- torch.save(min_val_loss_classifier, os.path.join(config['path_save'],'models_ABIDEI',config['atlas'],'VarCoNet','min_val_loss_classifier_rs' + str(i) + '.pth'))
- results = {}
- results['losses'] = losses_all
- results['epoch_results'] = test_result_all
- results['min_val_loss_epoch'] = min_val_loss_epochs
- results['min_loss_epoch'] = min_loss_epochs
- results['losses_ext'] = losses_all_ext
- results['epoch_results_ext'] = ext_test_result_all
- results['min_val_loss_epoch_ext'] = min_val_loss_epochs_ext
- results['min_loss_epoch_ext'] = min_loss_epochs_ext
- results['names_train'] = names_train_all
- results['names_val'] = names_val_all
- results['names_test'] = names_test_all
- results['names_train_ext'] = names_train_ext_all
- results['names_val_ext'] = names_val_ext_all
- results['names_ext_test'] = names_ext_test
- if config['save_results']:
- if not os.path.exists(os.path.join(config['path_save'],'results_ABIDEI',config['atlas'])):
- os.makedirs(os.path.join(config['path_save'],'results_ABIDEI',config['atlas']),exist_ok=True)
- with open(os.path.join(config['path_save'],'results_ABIDEI',config['atlas'],'ABIDEI_VarCoNet_results.pkl'), 'wb') as f:
- pickle.dump(results,f)
- return results
- if __name__ == '__main__':
- parser = argparse.ArgumentParser(description='Run VarCoNet on ABIDE I for ASD classification')
- parser.add_argument('--path_data', type=str,
- help='Path to the dataset')
- parser.add_argument('--path_save', type=str,
- help='Path to save results')
- parser.add_argument('--atlas', type=str, choices=['AICHA', 'AAL'], default='AICHA',
- help='Atlas type to use')
- parser.add_argument('--device', type=str, default='cuda:0',
- help='Device to use for training')
- parser.add_argument('--min_length', type=int, default=80,
- help='Minimum length for augmentation')
- parser.add_argument('--epochs', type=int, default=50,
- help='Number of epochs')
- parser.add_argument('--warm_up_epochs', type=int, default=10,
- help='Number of warm up epochs for the lr scheduler')
- parser.add_argument('--epochs_cls', type=int, default=150,
- help='Number of epochs for the linear classification layer')
- parser.add_argument('--lr_cls', type=float, default=5e-5,
- help='Learning rate for the linear classification layer')
- parser.add_argument('--num_classes', type=int, default=2,
- help='Number of classes for the classification')
- parser.add_argument('--save_models', action='store_true',
- help='Flag to save trained models')
- parser.add_argument('--save_results', action='store_true',
- help='Flag to save results')
- args = parser.parse_args()
- config = {
- 'path_data': args.path_data,
- 'path_save': args.path_save,
- 'atlas': args.atlas,
- 'min_length': args.min_length,
- 'shuffle': True,
- 'epochs': args.epochs,
- 'warm_up_epochs': args.warm_up_epochs,
- 'epochs_cls': args.epochs_cls,
- 'lr_cls': args.lr_cls,
- 'num_classes': args.num_classes,
- 'save_models': args.save_models,
- 'save_results': args.save_results,
- 'device': args.device,
- 'model_config': {}
- }
- with open(f'best_params_VarCoNet_{config["atlas"]}.pkl', 'rb') as f:
- best_params = pickle.load(f)
- config['batch_size'] = best_params['batch_size']
- config['tau'] = best_params['tau']
- config['lr'] = best_params['lr']
- config['model_config']['layers'] = best_params['layers']
- config['model_config']['n_heads'] = best_params['n_heads']
- config['model_config']['dim_feedforward'] = best_params['dim_feedforward']
- results = main(config)
ASD_classification_ABIDEI.py at commit 545a462, under MIT · at the source
Overview
- Department of Biomedical Engineering and Biotechnology Khalifa University of Science and Technology Abu Dhabi UAE
- Health Engineering Innovation Group (HEIG) Khalifa University of Science and Technology Abu Dhabi UAE
- Department of Electrical and Computer Engineering Aristotle University of Thessaloniki Thessaloniki Greece
Abstract
Accounting for interindividual variability in brain function is key to precision medicine. Here, by considering functional interindividual variability as meaningful data rather than noise, we introduce VarCoNet, an enhanced self‐supervised framework for robust functional connectome (FC) extraction from resting‐state fMRI (rs‐fMRI) data. VarCoNet employs self‐supervised contrastive learning to exploit inherent functional interindividual variability, serving as a brain function encoder that generates FC embeddings readily applicable to downstream tasks even in the absence of labeled data. Contrastive learning is facilitated by a novel augmentation strategy based on segmenting rs‐fMRI signals. At its core, VarCoNet integrates a 1D‐convolutional neural network (CNN) with a Transformer encoder for advanced time‐series processing, enhanced with robust Bayesian hyperparameter optimization. Our VarCoNet framework is evaluated on two downstream tasks: (i) subject fingerprinting, using rs‐fMRI data from the Human Connectome Project (2117 recordings), and (ii) autism spectrum disorder (ASD) classification, using rs‐fMRI data from the Autism Brain Imaging Data Exchange (ABIDE) I (995 recordings) and II (730 recordings) datasets. Using different brain parcellations, our extensive testing against state‐of‐the‐art methods, including 13 deep learning methods, demonstrates VarCoNet's superiority, robustness, interpretability, and generalizability, achieving up to 98% subject fingerprinting accuracy and an area under the curve (AUC) of 72.6% for ASD classification. Overall, VarCoNet provides a versatile and robust framework for FC analysis in rs‐fMRI.
Reproduced under the paper's license (CC BY-NC), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 4 matches between paragraphs and lines of code.
LLNL/BAnD
bd9f19e767345cc5e6ed6a323d84e395d115e27c, 22 July 2021Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
24 files
- band/
__init__.py , Python, 1 line - band/
models/ , Python, 459 linesTransformerBert.py - band/
models/ , Python, 453 linesTransformerFM.py - band/
models/ , Python, 465 linesTransformerFMAttention.p y - band/
models/ , Python, 308 linesTransformerX.py - band/
models/ , Python, 1 line__init__.py - band/
models/ , Python, 707 linesmodels.py - band/
models/ , Python, 196 linesresnet.py - band/
models/ , Python, 557 linesresnet3d.py - band/
utilities/ , Python, 1 line__init__.py - band/
utilities/ , Python, 492 linescallbacks.py - band/
utilities/ , Python, 147 linesdatasets.py - band/
utilities/ , Python, 40 linesfwriter.py - band/
utilities/ , Python, 494 linesglue.py - band/
utilities/ , Python, 109 linesmisc.py - band/
utilities/ , Python, 466 linesscaffold.py - band/
utilities/ , Python, 117 linestools.py - band/
utilities/ , Python, 640 linestransforms.py - constants.py, Python, 6 lines
- main.py, Python, 93 lines
- main_dist.py, Python, 133 lines
- main_dist_finetune.py, Python, 137 lines
- start_dist.sh, Shell, 62 lines
- README.md, Text, 15 lines
Wayfear/FBNETGEN
3ed6c813920966a40fca9ffca41f90a6384e333c, 18 May 2022Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
20 files
- dataloader.py, Python, 204 lines
- main.py, Python, 100 lines
- model/
GSL.py , Python, 434 lines - model/
__init__.py , Python, 2 lines - model/
cell.py , Python, 157 lines - model/
model.py , Python, 450 lines - train.py, Python, 474 lines
- util/
FCNet/ , Python, 62 linesfc_net_label_generation. py - util/
FCNet/ , Python, 116 linesinfer.py - util/
__init__.py , Python, 2 lines - util/
abide/ , Python, 102 lines01-fetch_data.py - util/
abide/ , Python, 100 lines02-process_data.py - util/
abide/ , Python, 72 lines03-generate_abide_datase t.py - util/
abide/ , Python, 272 linespreprocess_data.py - util/
analysis/ , Python, 32 linesextract_info_from_log.py - util/
logger.py , Python, 19 lines - util/
loss.py , Python, 55 lines - util/
meter.py , Python, 70 lines - util/
prepossess.py , Python, 82 lines - readme.md, Text, 68 lines
athms/learning-from-brains
126ab3c738ad81d50858ac90235820fae61b8b2e, 11 July 2023Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
57 files
- scripts/
analyses/ , Python, 102 linesdownstream_chance_accura cies.py - scripts/
analyses/ , Python, 175 linesfig2_upstream_data_overv iew.py - scripts/
analyses/ , Python, 209 linesfig3_hyperopt.py - scripts/
analyses/ , Python, 134 linesfig4_upstream_performanc e.py - scripts/
analyses/ , Python, 150 linesfig5_downstream_performa nce.py - scripts/
analyses/ , Python, 98 linessfig1_training_curve_lar gest_sequence_BERT.py - scripts/
analyses/ , Python, 257 linessfig2_eval_error_brain_m aps.py - scripts/
analyses/ , Python, 133 linessfig3_upstream_performan ce_pretrained_lms.py - scripts/
analyses/ , Python, 226 linessfig4_5_downstream_learn ing_curves.py - scripts/
analyses/ , Python, 55 linessfig6_downstream_perform ance_replication.py - scripts/
analyses/ , Python, 53 linessfig7_downstream_learnin g_curves_replication.py - scripts/
dataprep/ , Python, 297 linesdownstream/ hcp_dataprep.py - scripts/
dataprep/ , Python, 424 linesdownstream/ hcp_to_bids.py - scripts/
dataprep/ , Python, 303 linesdownstream/ mdtb_dataprep.py - scripts/
dataprep/ , Python, 211 linesupstream/ dataprep.py - scripts/
train.py , Python, 1,077 lines - src/
__init__.py , Python, 21 lines - src/
batcher/ , Python, 9 lines__init__.py - src/
batcher/ , Python, 304 linesbase.py - src/
batcher/ , Python, 432 linesbert.py - src/
batcher/ , Python, 100 linesmake.py - src/
decoder/ , Python, 17 lines__init__.py - src/
decoder/ , Python, 354 linesautoencoder.py - src/
decoder/ , Python, 102 linesbert.py - src/
decoder/ , Python, 165 linesgpt.py - src/
decoder/ , Python, 82 lineslinear_baseline.py - src/
decoder/ , Python, 115 linesmake.py - src/
embedder/ , Python, 19 lines__init__.py - src/
embedder/ , Python, 15 linesautoen.py - src/
embedder/ , Python, 286 linesbase.py - src/
embedder/ , Python, 225 linesbert.py - src/
embedder/ , Python, 240 linescsm.py - src/
embedder/ , Python, 122 linesdummy.py - src/
embedder/ , Python, 150 linesmake.py - src/
embedder/ , Python, 88 linesmnm.py - src/
embedder/ , Python, 62 linesmsm.py - src/
embedder/ , Python, 225 linesnetbert.py - src/
model.py , Python, 199 lines - src/
preprocessor.py , Python, 514 lines - src/
tools/ , Python, 14 lines__init__.py - src/
tools/ , Python, 354 linesbrainmap.py - src/
tools/ , Python, 169 linesdata.py - src/
tools/ , Python, 21 linesvisualize.py - src/
tools/ , Python, 39 lineswandb.py - src/
trainer/ , Python, 10 lines__init__.py - src/
trainer/ , Python, 80 linesbase.py - src/
trainer/ , Python, 220 linesmake.py - src/
unembedder.py , Python, 135 lines - tests/
__init__.py , Python, 202 lines - tests/
test_adapt.py , Python, 79 lines - tests/
test_checkpoints.py , Python, 201 lines - tests/
test_embed_dims.py , Python, 86 lines - tests/
test_freeze.py , Python, 131 lines - tests/
test_from-pretrained.py , Python, 120 lines - tests/
test_resume.py , Python, 73 lines - tests/
test_train.py , Python, 86 lines - README.md, Text, 129 lines
Wayfear/BrainNetworkTransformer
8a588aadad0166209269fa114e5df4e42209e207, 29 December 2022Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
35 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/
dataset/ , Python, 20 lines__init__.py - source/
dataset/ , Python, 58 linesabcd.py - source/
dataset/ , Python, 28 linesabide.py - source/
dataset/ , Python, 109 linesdataloader.py - source/
dataset/ , Python, 24 linespreprocess.py - source/
models/ , Python, 1 lineBNT/ __init__.py - source/
models/ , Python, 150 linesBNT/ bnt.py - source/
models/ , Python, 1 lineBNT/ components/ __init__.py - source/
models/ , Python, 25 linesBNT/ components/ transformer_encoder.py - source/
models/ , Python, 1 lineBNT/ ptdec/ __init__.py - source/
models/ , Python, 104 linesBNT/ ptdec/ cluster.py - source/
models/ , Python, 90 linesBNT/ ptdec/ dec.py - source/
models/ , Python, 11 lines__init__.py - source/
models/ , Python, 15 linesbase.py - source/
models/ , Python, 52 linesbrainnetcnn.py - source/
models/ , Python, 254 linesfbnetgen.py - source/
models/ , Python, 65 linestransformer.py - source/
training/ , Python, 104 linesFBNettraining.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 - LICENSE, License, 21 lines
- readme.md, Text, 82 lines
qbmizsj/A-GCL
08339b719642a5d886688330a4b562a031961091, 3 November 2023Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
28 files
- agcl_ABIDE.py, Python, 324 lines
- agcl_ABIDE_queue.py, Python, 385 lines
- datasets/
__init__.py , Python, 1 line - datasets/
abideDataset.py , Python, 128 lines - datasets/
tu_dataset.py , Python, 216 lines - unsupervised/
__init__.py , Python, 1 line - unsupervised/
convs/ , Python, 103 linesGraphSAGE_conv.py - unsupervised/
convs/ , Python, 97 linesGraph_conv.py - unsupervised/
convs/ , Python, 7 lines__init__.py - unsupervised/
convs/ , Python, 294 linesgat_conv.py - unsupervised/
convs/ , Python, 171 linesgatv2_conv.py - unsupervised/
convs/ , Python, 208 linesgcn_conv.py - unsupervised/
convs/ , Python, 56 linesgine_conv.py - unsupervised/
convs/ , Python, 56 linesinits.py - unsupervised/
convs/ , Python, 53 lineswgin_conv.py - unsupervised/
embedding_evaluation.py , Python, 293 lines - unsupervised/
encoder/ , Python, 3 lines__init__.py - unsupervised/
encoder/ , Python, 116 linesgatv2_encoder.py - unsupervised/
encoder/ , Python, 107 linestu_encoder.py - unsupervised/
encoder/ , Python, 161 linesuni_encoder.py - unsupervised/
learning/ , Python, 4 lines__init__.py - unsupervised/
learning/ , Python, 81 linesclassifier.py - unsupervised/
learning/ , Python, 204 linesginfomax.py - unsupervised/
learning/ , Python, 59 linesginfominmax.py - unsupervised/
learning/ , Python, 49 linesgsimclr.py - unsupervised/
utils.py , Python, 270 lines - unsupervised/
view_learner.py , Python, 37 lines - README.md, Text, 294 lines
icon-lab/BolT
f7c713f9eaf4c37855e84ba125ea2d2f14474fac, 21 June 2023Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
49 files
- Analysis/
BrainMapping/ , Python, 1 line__init__.py - Analysis/
BrainMapping/ , Python, 128 linesbrainMapper.py - Analysis/
BrainMapping/ , Python, 257 linesbrainRegressor.py - Analysis/
BrainMapping/ , Python, 157 linesbrainViz.py - Analysis/
BrainMapping/ , Python, 175 linesimpTokenExtractor.py - Analysis/
BrainMapping/ , Python, 37 linessubjectReader.py - Analysis/
BrainMapping/ , Python, 35 linesvizSticher.py - Analysis/
TaskTimings/ , Python, 1 line__init__.py - Analysis/
TaskTimings/ , Python, 1 linecalculated/ __init__.py - Analysis/
TaskTimings/ , Python, 56 linescalculated/ emotion.py - Analysis/
TaskTimings/ , Python, 67 linescalculated/ gambling.py - Analysis/
TaskTimings/ , Python, 80 linescalculated/ language.py - Analysis/
TaskTimings/ , Python, 59 linescalculated/ motor.py - Analysis/
TaskTimings/ , Python, 91 linescalculated/ relational.py - Analysis/
TaskTimings/ , Python, 60 linescalculated/ social.py - Analysis/
TaskTimings/ , Python, 59 linescalculated/ wm.py - Analysis/
TaskTimings/ , Python, 336 linestaskRelavance.py - Analysis/
__init__.py , Python, 1 line - Analysis/
analysis_extractRawData. , Python, 209 linespy - Analysis/
relevanceCalculator.py , Python, 129 lines - Dataset/
DataLoaders/ , Python, 1 line__init__.py - Dataset/
DataLoaders/ , Python, 46 linesabide1Loader.py - Dataset/
DataLoaders/ , Python, 42 lineshcpRestLoader.py - Dataset/
DataLoaders/ , Python, 42 lineshcpTaskLoader.py - Dataset/
Prep/ , Python, 1 line__init__.py - Dataset/
Prep/ , Python, 57 linesprep_abide.py - Dataset/
Prep/ , Python, 21 linesprep_atlas.py - Dataset/
__init__.py , Python, 1 line - Dataset/
dataset.py , Python, 124 lines - Dataset/
datasetDetails.py , Python, 41 lines - Models/
BolT/ , Python, 1 line__init__.py - Models/
BolT/ , Python, 171 linesbolT.py - Models/
BolT/ , Python, 459 linesbolTransformerBlock.py - Models/
BolT/ , Python, 41 lineshyperparams.py - Models/
BolT/ , Python, 108 linesmodel.py - Models/
BolT/ , Python, 156 linesrun.py - Models/
BolT/ , Python, 29 linesutil.py - Models/
SVM/ , Python, 1 line__init__.py - Models/
SVM/ , Python, 14 lineshyperparams.py - Models/
SVM/ , Python, 43 linesmodel.py - Models/
SVM/ , Python, 91 linesrun.py - Models/
SVM/ , Python, 39 linesutil.py - Models/
__init__.py , Python, 1 line - __init__.py, Python, 1 line
- prep.py, Python, 22 lines
- tester.py, Python, 93 lines
- utils.py, Python, 229 lines
- LICENSE, License, 674 lines
- README.md, Text, 88 lines
SJYuCNEL/brain-and-Information-Bottleneck
35aa63da5464e1641eff2d2ea052a446a55e84ba, 6 November 2024Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
12 files
- BrainIB_V1/
data/ , Python, 80 linescreate_data.py - BrainIB_V1/
graphCNNb.py , Python, 281 lines - BrainIB_V1/
main.py , Python, 200 lines - BrainIB_V1/
mlp.py , Python, 49 lines - BrainIB_V1/
pre_subgraph.py , Python, 34 lines - BrainIB_V1/
utilis.py , Python, 45 lines - BrainIB_V2/
SGSIB/ , Python, 77 linesGNN.py - BrainIB_V2/
SGSIB/ , Python, 75 linessub_graph_generator.py - BrainIB_V2/
SGSIB/ , Python, 225 linesutils.py - BrainIB_V2/
SGSIB_main.py , Python, 116 lines - BrainIB_V2/
data/ , Python, 48 linescreate_dataset.py - README.md, Text, 328 lines
SJYuCNEL/brain-and-Information-Bottleneck.Graph
Availability: 1 check, the latest on 30 September 2026: the link is dead
- 30 September 2026: the link is dead
CharLamp10/VarCoNet-V2
545a4624468e97b3771fc27c729cdc93761845d4, 7 November 2025Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
50 files
- ASD_classification_ABIDE
I.py , Python, 386 lines, 1 match - ASD_classification_ABIDE
II.py , Python, 174 lines - ASD_classification_ablat
ions.py , Python, 750 lines - VarCoNet_BO.py, Python, 246 lines
- competing_methods/
AE_KSVD.py , Python, 327 lines - competing_methods/
A_GCL.py , Python, 282 lines - competing_methods/
BAnD.py , Python, 450 lines - competing_methods/
BNT_gather_results.py , Python, 116 lines - competing_methods/
BolT.py , Python, 441 lines - competing_methods/
BrainIB.py , Python, 390 lines - competing_methods/
CVFormer.py , Python, 507 lines - competing_methods/
DeepFMRI.py , Python, 397 lines - competing_methods/
FBNETGEN_gather_results. , Python, 132 linespy - competing_methods/
GCDA.py , Python, 278 lines - competing_methods/
LFB_gather_results.py , Python, 69 lines - competing_methods/
PCC.py , Python, 166 lines - competing_methods/
UCGL.py , Python, 261 lines - competing_methods/
VAE_KSVD.py , Python, 334 lines - competing_methods/
__init__.py , Python, 1 line - competing_methods/
fbnetgen.py , Python, 279 lines - data_preparations/
parcellate_ABIDEI.py , Python, 99 lines - data_preparations/
parcellate_ABIDEII.py , Python, 92 lines - data_preparations/
parcellate_HCP.py , Python, 54 lines - data_preparations/
prepare_ABIDEII_data.py , Python, 88 lines - data_preparations/
prepare_ABIDEI_data.py , Python, 113 lines - data_preparations/
prepare_HCP_data.py , Python, 235 lines - data_preparations/
prepare_data_BAnD.py , Python, 87 lines - data_preparations/
rename_ABIDE_files.py , Python, 39 lines - data_preparations/
subsampling_HCP_data.py , Python, 75 lines - model_scripts/
VarCoNet.py , Python, 229 lines, 1 match - model_scripts/
__init__.py , Python, 1 line - model_scripts/
classifier.py , Python, 102 lines - model_scripts/
competing_models.py , Python, 392 lines - model_scripts/
evaluation.py , Python, 15 lines - predictions_stability.py
, Python, 229 lines - result_scripts/
ASD_feature_importance.p , Python, 44 linesy - result_scripts/
BO_plot.py , Python, 98 lines - result_scripts/
ablation_plots.py , Python, 947 lines - result_scripts/
display_results_ABIDE.py , Python, 1,275 lines, 1 match - result_scripts/
intra_inter_subject_simi , Python, 76 lineslarities.py - result_scripts/
plot_fingerprinting_resu , Python, 117 lineslts.py - result_scripts/
prepare_for_BrainNetView , R, 58 lineser.R - result_scripts/
prepare_for_rex.py , Python, 304 lines - result_scripts/
rex_plots.R , R, 59 lines - result_scripts/
rex_plots_2.R , R, 46 lines - subject_fingerprinting.p
y , Python, 289 lines, 1 match - subject_fingerprinting_a
blations.py , Python, 453 lines - utils.py, Python, 894 lines
- LICENSE, License, 21 lines
- README.md, Text, 210 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:
- 9 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 264 scripts, each with its path and the digest of its content;
- 4 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.
Data Availability Statement
The data that support the findings of this study are openly available in VarCoNet‐V2 at https://
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, 30 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 6 keywords, 9 MeSH terms, 1 funder, 51 references.
Cite
This paper
Lamprou, C., Alshehhi, A., Hadjileontiadis, L. J., & Seghier, M. L. (2026). VarCoNet: A Variability-Aware Self-Supervised Framework for Functional Connectome Extraction From Resting-State fMRI. Human brain mapping, 47(4), e70469. https://
BibTeX
@article{lamprou2026varc
author = {Lamprou, Charalampos and Alshehhi, Aamna and Hadjileontiadis, Leontios J. and Seghier, Mohamed L.},
title = {{VarCoNet: A Variability-Aware Self-Supervised Framework for Functional Connectome Extraction From Resting-State fMRI}},
journal = {Human brain mapping},
year = {2026},
month = mar,
volume = {47},
number = {4},
pages = {e70469},
publisher = {Wiley},
issn = {1065-9471},
doi = {10.1002/
url = {https://
pmid = {41810518},
pmcid = {PMC12976809}
}
RIS
TY - JOUR
AU - Lamprou, Charalampos
AU - Alshehhi, Aamna
AU - Hadjileontiadis, Leontios J.
AU - Seghier, Mohamed L.
TI - VarCoNet: A Variability-Aware Self-Supervised Framework for Functional Connectome Extraction From Resting-State fMRI
T2 - Human brain mapping
J2 - Hum Brain Mapp
PY - 2026
DA - 2026/
VL - 47
IS - 4
SP - e70469
SN - 1065-9471
PB - Wiley
DO - 10.1002/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1002/
"type": "article-journal",
"title": "VarCoNet: A Variability-Aware Self-Supervised Framework for Functional Connectome Extraction From Resting-State fMRI",
"container-title": "Human brain mapping",
"author": [
{
"family": "Lamprou",
"given": "Charalampos"
},
{
"family": "Alshehhi",
"given": "Aamna"
},
{
"family": "Hadjileontiadis",
"given": "Leontios J."
},
{
"family": "Seghier",
"given": "Mohamed L."
}
],
"container-title-short":
"volume": "47",
"issue": "4",
"page": "e70469",
"DOI": "10.1002/
"PMID": "41810518",
"PMCID": "PMC12976809",
"ISSN": "1065-9471",
"publisher": "Wiley",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
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.21203/rs.3.rs-9326213/v1 [code]
- Multi-task fMRI outperforms resting-state fMRI for revealing task-invariant organization of the human brainJournal: Research Square (preprint)In common: statannotations, Nilearn, Plotly, 9 other tools, fMRI, 7 references
- [2] doi:10.64898/2026.03.09.710558 [code]
- Multi-task fMRI outperforms resting-state fMRI for revealing task-invariant organization of the human brainJournal: bioRxiv (preprint)In common: statannotations, Nilearn, Plotly, 9 other tools, fMRI, 7 references
- [3] doi:10.1038/s41398-026-03965-z [code]
- Disentangling individual heterogeneity reveals robust network and molecular signatures of major depressive disorder with suicidal ideation.Journal: Translational psychiatryIn common: PyTorch Geometric, NetworkX, OpenCV, 9 other tools, 3 references
- [4] doi:10.1038/s42003-026-10957-8 [code]
- Brain defence by the extracellular matrix protein Cochlin.Journal: Communications biologyIn common: Hugging Face Transformers, NetworkX, Plotly, 11 other tools
- [5] doi:10.1038/s42003-026-10011-7 [code]
- Learning brain dynamics across distinct scaling regimes reveals psychiatric signatures.Journal: Communications biologyIn common: Hugging Face Transformers, Nilearn, NetworkX, 8 other tools, autism, 2 references
- [6] doi:10.1016/j.patter.2026.101560 [code]
- Automating region selection with genetic algorithms for energy landscape analyses of brain dynamics.Journal: Patterns (New York, N.Y.)In common: statannotations, Nilearn, NetworkX, 6 other tools, autism, fMRI, methods / tools, 3 references
- [7] doi:10.64898/2026.08.18.26360725 [code]
- Temporal pole blurring in hippocampal sclerosis reflects seizure-disrupted myelinationJournal: medRxiv (preprint)In common: statannotations, PyTorch Geometric, Nilearn, 9 other tools, 1 reference
- [8] doi:10.1162/imag.a.1198 [code]
- MEPrep: A robust pipeline for multi-echo fMRI denoising and preprocessing.Journal: Imaging neuroscience (Cambridge, Mass.)In common: TemplateFlow, Nilearn, NiBabel, 5 other tools, fMRI, methods / tools, 4 references
- [9] doi:10.1038/s41467-026-75959-w [code]
- Charting higher-order models of brain function beyond pairwise interactions.Journal: Nature communicationsIn common: Nilearn, NetworkX, NiBabel, 6 other tools, 5 references
- [10] doi:10.1002/hbm.70557 [code]
- Efficient Deep Learning Models for Predicting Individualized Task Activation From Resting-State Functional Connectivity.Journal: Human brain mappingIn common: PyTorch Geometric, Nilearn, NiBabel, 7 other tools, fMRI, 3 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: 9 repositories of the authors' code, each at its verified commit and with its license, 264 scripts, and 4 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:abd5c566be01c313…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
- LLNL/BAnD: README.md on GitHub
- Wayfear/FBNETGEN: readme.md on GitHub
- athms/learning-from-brains: README.md on GitHub
- Wayfear/BrainNetworkTransformer: readme.md on GitHub
- qbmizsj/A-GCL: README.md on GitHub
- icon-lab/BolT: README.md on GitHub
- SJYuCNEL/brain-and-Information-Bottleneck: README.md on GitHub
- SJYuCNEL/brain-and-Information-Bottleneck.Graph on GitHub (add a README there)
- CharLamp10/VarCoNet-V2: README.md on GitHub
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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
