Downloads · 30 days
6
9% of all-time downloads
likan-blk/ctnet-hf
ctnet-hf is a text classification model from likan-blk. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This repository contains a trained Hugging Face Transformers implementation of CTNet, the convolutional Transformer architecture introduced by Zhao et al. (2024).
Downloads · 30 days
6
9% of all-time downloads
All-time downloads
65
Public
Parameters
27.4K
246 KB on disk
Likes
0
Public
Click a slice to open those files.
.csv599 KB · 79%
From the Hugging Face model README
This repository contains a trained Hugging Face Transformers implementation of CTNet, the convolutional Transformer architecture introduced by Zhao et al. (2024).
The checkpoint was trained as one pooled model on all BNCI2014-001 training
sessions: session 0train from subjects 1-9. It expects 22 EEG channels,
1,000 samples at 250 Hz, and microvolt values in the channel order recorded in
preprocessor_config.json.
BNCI2014_001Session 1test was evaluated during training and used to select the checkpoint.
The selected checkpoint is epoch 400, chosen by mean subject accuracy.
The scores below are therefore checkpoint-selection metrics on the nominal test sessions, not unbiased held-out test metrics.
1test| Subject | Accuracy | Cohen's kappa |
|---|---|---|
| 1 | 81.94% | 0.7593 |
| 2 | 57.99% | 0.4398 |
| 3 | 89.58% | 0.8611 |
| 4 | 76.74% | 0.6898 |
| 5 | 69.10% | 0.5880 |
| 6 | 58.33% | 0.4444 |
| 7 | 84.72% | 0.7963 |
| 8 | 78.82% | 0.7176 |
| 9 | 66.32% | 0.5509 |
| Mean subject | 73.73% | 0.6497 |
Pooled accuracy across all session 1test trials: 73.73%.
0train, 2,592 total trials.1test, 2,592 total trials.feet, left_hand, right_hand, tongue.(0.5, 0.999).See training_metadata.json and training_history.csv for the full run record.
from transformers import AutoFeatureExtractor, AutoModelForSequenceClassification
repo_id = "likan-blk/ctnet-hf"
processor = AutoFeatureExtractor.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForSequenceClassification.from_pretrained(
repo_id,
trust_remote_code=True,
).eval()
inputs = processor(eeg_trial, return_tensors="pt") # eeg_trial: (22, 1000), microvolts
logits = model(**inputs).logits
Because this repository contains custom modeling and preprocessing code, inspect
the files before enabling trust_remote_code. For reproducible use, pin
revision to a Hub commit hash.
This checkpoint is intended for research and reproducibility experiments with BNCI2014-001-style motor-imagery EEG. It is not a medical device, clinical tool, safety-critical classifier, or claim of generalization to arbitrary EEG recordings.