{"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/cbramod-a-criss-cross-brain-foundation-model","title":"CBraMod: A Criss-Cross Brain Foundation Model for EEG Decoding","arxiv_id":"2412.07236","date":"2024-12-10","proceeding":null,"authors":["Jiquan Wang","Sha Zhao","Zhiling Luo","Yangxuan Zhou","Haiteng Jiang","Shijian Li","Tao Li","Gang Pan"],"abstract":"Electroencephalography (EEG) is a non-invasive technique to measure and record brain electrical activity, widely used in various BCI and healthcare applications. Early EEG decoding methods rely on supervised learning, limited by specific tasks and datasets, hindering model performance and generalizability. With the success of large language models, there is a growing body of studies focusing on EEG foundation models. However, these studies still leave challenges: Firstly, most of existing EEG foundation models employ full EEG modeling strategy. It models the spatial and temporal dependencies between all EEG patches together, but ignores that the spatial and temporal dependencies are heterogeneous due to the unique structural characteristics of EEG signals. Secondly, existing EEG foundation models have limited generalizability on a wide range of downstream BCI tasks due to varying formats of EEG data, making it challenging to adapt to. To address these challenges, we propose a novel foundation model called CBraMod. Specifically, we devise a criss-cross transformer as the backbone to thoroughly leverage the structural characteristics of EEG signals, which can model spatial and temporal dependencies separately through two parallel attention mechanisms. And we utilize an asymmetric conditional positional encoding scheme which can encode positional information of EEG patches and be easily adapted to the EEG with diverse formats. CBraMod is pre-trained on a very large corpus of EEG through patch-based masked EEG reconstruction. We evaluate CBraMod on up to 10 downstream BCI tasks (12 public datasets). CBraMod achieves the state-of-the-art performance across the wide range of tasks, proving its strong capability and generalizability. The source code is publicly available at https://github.com/wjq-learning/CBraMod.","url_abs":"https://arxiv.org/abs/2412.07236v5","url_pdf":"https://arxiv.org/pdf/2412.07236v5.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":[{"paper_slug":"cbramod-a-criss-cross-brain-foundation-model","repo_url":"https://github.com/wjq-learning/cbramod","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"eeg-1","task_name":"EEG"},{"task_slug":"eeg-decoding","task_name":"Eeg Decoding"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"conditional-positional-encoding","method_name":"Conditional Positional Encoding"},{"method_slug":"depthwise-convolution","method_name":"Depthwise Convolution"},{"method_slug":"positional-encoding-generator","method_name":"Positional Encoding Generator"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2412.07236","atlas_url":"https://app.syntology.ai/?focus=2412.07236","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2412.07236"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/wjq-learning/CBraMod","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wjq-learning/cbramod","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":5,"ran":2,"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":"a7d6d3ad25e3783f","entry":"TransformerEncoder","repo":"wjq-learning/cbramod","repo_kind":"official","path":"models/cbramod.py","file_url":"https://github.com/wjq-learning/cbramod/blob/HEAD/models/cbramod.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a7d6d3ad25e3783f"}},{"code_sha256_prefix":"6dc6173b618ea485","entry":"_get_activation_fn","repo":"wjq-learning/cbramod","repo_kind":"official","path":"models/cbramod.py","file_url":"https://github.com/wjq-learning/cbramod/blob/HEAD/models/cbramod.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6dc6173b618ea485"}},{"code_sha256_prefix":"8fadfc49fd4c6729","entry":"CBraMod","repo":"wjq-learning/cbramod","repo_kind":"official","path":"models/cbramod.py","file_url":"https://github.com/wjq-learning/cbramod/blob/HEAD/models/cbramod.py","link_basis":"first_harvest_node","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":"8fadfc49fd4c6729"}},{"code_sha256_prefix":"ae3827b2ef2f34c9","entry":"PatchEmbedding","repo":"wjq-learning/cbramod","repo_kind":"official","path":"models/cbramod.py","file_url":"https://github.com/wjq-learning/cbramod/blob/HEAD/models/cbramod.py","link_basis":"first_harvest_node","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":"ae3827b2ef2f34c9"}},{"code_sha256_prefix":"2eb20bea3af6aa67","entry":"TransformerEncoderLayer","repo":"wjq-learning/cbramod","repo_kind":"official","path":"models/cbramod.py","file_url":"https://github.com/wjq-learning/cbramod/blob/HEAD/models/cbramod.py","link_basis":"first_harvest_node","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":"2eb20bea3af6aa67"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}