{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/single-channel-eeg-tokenization-through-time","title":"Single-Channel EEG Tokenization Through Time-Frequency Modeling","arxiv_id":"2502.16060","date":"2025-02-22","proceeding":null,"authors":["Jathurshan Pradeepkumar","Xihao Piao","Zheng Chen","Jimeng Sun"],"abstract":"We introduce TFM-Tokenizer, a novel tokenization framework tailored for EEG analysis that transforms continuous, noisy brain signals into a sequence of discrete, well-represented tokens for various EEG tasks. Conventional approaches typically rely on continuous embeddings and inter-channel dependencies, which are limited in capturing inherent EEG features such as temporally unpredictable patterns and diverse oscillatory waveforms. In contrast, we hypothesize that critical time-frequency features can be effectively captured from a single channel. By learning tokens that encapsulate these intrinsic patterns within a single channel, our approach yields a scalable tokenizer adaptable across diverse EEG settings. We integrate the TFM-Tokenizer with a transformer-based TFM-Encoder, leveraging established pretraining techniques from natural language processing, such as masked token prediction, followed by downstream fine-tuning for various EEG tasks. Experiments across four EEG datasets show that TFM-Token outperforms state-of-the-art methods. On TUEV, our approach improves balanced accuracy and Cohen's Kappa by 5% over baselines. Comprehensive analysis of the learned tokens demonstrates their ability to capture class-distinctive features, enhance frequency representation, and ability to encode time-frequency motifs into distinct tokens, improving interpretability.","url_abs":"https://arxiv.org/abs/2502.16060v1","url_pdf":"https://arxiv.org/pdf/2502.16060v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[],"tasks":[{"task_slug":"eeg-1","task_name":"EEG"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2502.16060","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.16060"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/Jathurshan0330/TFM-Tokenizer","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"unverified":7},"by_repo_kind":{"found_in_text":{"samples":8,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"eca6cdf05972a95e","entry":"l2norm","repo":"Jathurshan0330/TFM-Tokenizer","repo_kind":"found_in_text","path":"models/tfm_token.py","file_url":"https://github.com/Jathurshan0330/TFM-Tokenizer/blob/HEAD/models/tfm_token.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eca6cdf05972a95e"}},{"code_sha256_prefix":"88ceb990f4b4ac35","entry":"BCE","repo":"Jathurshan0330/TFM-Tokenizer","repo_kind":"found_in_text","path":"utils/utils.py","file_url":"https://github.com/Jathurshan0330/TFM-Tokenizer/blob/HEAD/utils/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"88ceb990f4b4ac35"}},{"code_sha256_prefix":"374324616b0617af","entry":"collate_fn_unsupervised_pretrain","repo":"Jathurshan0330/TFM-Tokenizer","repo_kind":"found_in_text","path":"datasets/data_loaders.py","file_url":"https://github.com/Jathurshan0330/TFM-Tokenizer/blob/HEAD/datasets/data_loaders.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"374324616b0617af"}},{"code_sha256_prefix":"4156bae98d1b1972","entry":"focal_loss","repo":"Jathurshan0330/TFM-Tokenizer","repo_kind":"found_in_text","path":"utils/utils.py","file_url":"https://github.com/Jathurshan0330/TFM-Tokenizer/blob/HEAD/utils/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4156bae98d1b1972"}},{"code_sha256_prefix":"10e428f98b559617","entry":"freq_bin_temporal_masking","repo":"Jathurshan0330/TFM-Tokenizer","repo_kind":"found_in_text","path":"models/tfm_token.py","file_url":"https://github.com/Jathurshan0330/TFM-Tokenizer/blob/HEAD/models/tfm_token.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"10e428f98b559617"}},{"code_sha256_prefix":"fdc79b98f54b0725","entry":"get_finetuned_path","repo":"Jathurshan0330/TFM-Tokenizer","repo_kind":"found_in_text","path":"push_to_hub.py","file_url":"https://github.com/Jathurshan0330/TFM-Tokenizer/blob/HEAD/push_to_hub.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fdc79b98f54b0725"}},{"code_sha256_prefix":"734b478c6fc895d2","entry":"process_metadata","repo":"Jathurshan0330/TFM-Tokenizer","repo_kind":"found_in_text","path":"datasets_processing/CHB-MIT/process_1.py","file_url":"https://github.com/Jathurshan0330/TFM-Tokenizer/blob/HEAD/datasets_processing/CHB-MIT/process_1.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"734b478c6fc895d2"}},{"code_sha256_prefix":"8d43078a11ac49b4","entry":"read_hyp_params","repo":"Jathurshan0330/TFM-Tokenizer","repo_kind":"found_in_text","path":"utils/utils.py","file_url":"https://github.com/Jathurshan0330/TFM-Tokenizer/blob/HEAD/utils/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8d43078a11ac49b4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}