{"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/braincodec-neural-fmri-codec-for-the-decoding","title":"BrainCodec: Neural fMRI codec for the decoding of cognitive brain states","arxiv_id":"2410.04383","date":"2024-10-06","proceeding":null,"authors":["Yuto Nishimura","Masataka Sawayama","Ayumu Yamashita","Hideki Nakayama","Kaoru Amano"],"abstract":"Recently, leveraging big data in deep learning has led to significant performance improvements, as confirmed in applications like mental state decoding using fMRI data. However, fMRI datasets remain relatively small in scale, and the inherent issue of low signal-to-noise ratios (SNR) in fMRI data further exacerbates these challenges. To address this, we apply compression techniques as a preprocessing step for fMRI data. We propose BrainCodec, a novel fMRI codec inspired by the neural audio codec. We evaluated BrainCodec's compression capability in mental state decoding, demonstrating further improvements over previous methods. Furthermore, we analyzed the latent representations obtained through BrainCodec, elucidating the similarities and differences between task and resting state fMRI, highlighting the interpretability of BrainCodec. Additionally, we demonstrated that fMRI reconstructions using BrainCodec can enhance the visibility of brain activity by achieving higher SNR, suggesting its potential as a novel denoising method. Our study shows that BrainCodec not only enhances performance over previous methods but also offers new analytical possibilities for neuroscience. Our codes, dataset, and model weights are available at https://github.com/amano-k-lab/BrainCodec.","url_abs":"https://arxiv.org/abs/2410.04383v1","url_pdf":"https://arxiv.org/pdf/2410.04383v1.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":"braincodec-neural-fmri-codec-for-the-decoding","repo_url":"https://github.com/amano-k-lab/braincodec","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.04383","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.04383"}},"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/athms/learning-from-brains","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/amano-k-lab/BrainCodec","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":9,"unverified":3},"by_repo_kind":{"official":{"samples":9,"ran":7,"repositories":1},"found_in_text":{"samples":3,"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":3,"samples":[{"code_sha256_prefix":"2774fa5e9b700603","entry":"AutoEncoder","repo":"athms/learning-from-brains","repo_kind":"found_in_text","path":"src/decoder/autoencoder.py","file_url":"https://github.com/athms/learning-from-brains/blob/HEAD/src/decoder/autoencoder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2774fa5e9b700603"}},{"code_sha256_prefix":"cfe872713d672311","entry":"Decoder","repo":"athms/learning-from-brains","repo_kind":"found_in_text","path":"src/decoder/autoencoder.py","file_url":"https://github.com/athms/learning-from-brains/blob/HEAD/src/decoder/autoencoder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cfe872713d672311"}},{"code_sha256_prefix":"d907b9008d2a240d","entry":"calculate_l1_dist","repo":"amano-k-lab/BrainCodec","repo_kind":"official","path":"braincodec/422_F3_create_mean_fMRI_data.py","file_url":"https://github.com/amano-k-lab/BrainCodec/blob/HEAD/braincodec/422_F3_create_mean_fMRI_data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d907b9008d2a240d"}},{"code_sha256_prefix":"b94d3dcb2a918be3","entry":"get_adv_criterion","repo":"amano-k-lab/BrainCodec","repo_kind":"official","path":"audiocraft/adversarial/losses.py","file_url":"https://github.com/amano-k-lab/BrainCodec/blob/HEAD/audiocraft/adversarial/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b94d3dcb2a918be3"}},{"code_sha256_prefix":"88b0022a7cb492a1","entry":"get_fake_criterion","repo":"amano-k-lab/BrainCodec","repo_kind":"official","path":"audiocraft/adversarial/losses.py","file_url":"https://github.com/amano-k-lab/BrainCodec/blob/HEAD/audiocraft/adversarial/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"88b0022a7cb492a1"}},{"code_sha256_prefix":"31e35a10d885d5a5","entry":"get_real_criterion","repo":"amano-k-lab/BrainCodec","repo_kind":"official","path":"audiocraft/adversarial/losses.py","file_url":"https://github.com/amano-k-lab/BrainCodec/blob/HEAD/audiocraft/adversarial/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"31e35a10d885d5a5"}},{"code_sha256_prefix":"c7080127ea64de29","entry":"get_reconstructed_fMRI","repo":"amano-k-lab/BrainCodec","repo_kind":"official","path":"braincodec/422_calc_acc_for_each_layer_with_CSM.py","file_url":"https://github.com/amano-k-lab/BrainCodec/blob/HEAD/braincodec/422_calc_acc_for_each_layer_with_CSM.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c7080127ea64de29"}},{"code_sha256_prefix":"8fbfa70ae7d40c40","entry":"sinkhorn","repo":"amano-k-lab/BrainCodec","repo_kind":"official","path":"braincodec/F2_sinkhorn_algorithm/compare_two_encodec.py","file_url":"https://github.com/amano-k-lab/BrainCodec/blob/HEAD/braincodec/F2_sinkhorn_algorithm/compare_two_encodec.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8fbfa70ae7d40c40"}},{"code_sha256_prefix":"4b5d01111e61e37f","entry":"tr_preprocess","repo":"amano-k-lab/BrainCodec","repo_kind":"official","path":"braincodec/422_F3_create_mean_fMRI_data.py","file_url":"https://github.com/amano-k-lab/BrainCodec/blob/HEAD/braincodec/422_F3_create_mean_fMRI_data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4b5d01111e61e37f"}},{"code_sha256_prefix":"5daefb708a8f4720","entry":"Encoder","repo":"athms/learning-from-brains","repo_kind":"found_in_text","path":"src/decoder/autoencoder.py","file_url":"https://github.com/athms/learning-from-brains/blob/HEAD/src/decoder/autoencoder.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5daefb708a8f4720"}},{"code_sha256_prefix":"a533f7d40bb7d99f","entry":"wasserstein_distance_numpy","repo":"amano-k-lab/BrainCodec","repo_kind":"official","path":"braincodec/F2_sinkhorn_algorithm/compare_two_encodec.py","file_url":"https://github.com/amano-k-lab/BrainCodec/blob/HEAD/braincodec/F2_sinkhorn_algorithm/compare_two_encodec.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":"a533f7d40bb7d99f"}},{"code_sha256_prefix":"d1bde2ba56eebe75","entry":"wasserstein_distance_pytorch","repo":"amano-k-lab/BrainCodec","repo_kind":"official","path":"braincodec/F2_sinkhorn_algorithm/compare_two_encodec.py","file_url":"https://github.com/amano-k-lab/BrainCodec/blob/HEAD/braincodec/F2_sinkhorn_algorithm/compare_two_encodec.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":"d1bde2ba56eebe75"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}