Papers › BrainCodec: Neural fMRI codec for the decoding of cognitive brain states

BrainCodec: Neural fMRI codec for the decoding of cognitive brain states

6 Oct 2024arXiv:2410.04383archive 2025-07-28

Yuto Nishimura, Masataka Sawayama, Ayumu Yamashita, Hideki Nakayama, Kaoru Amano

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2410.04383")

Code

Syntology Ran 9 of 12 code samples harvested from 2 repositories linked to this paper; 3 have no recorded run. Of those that ran: 9 ran with no contract checked.

By repository: official repository: 9 samples from 1 repository, 7 ran; found in paper text by Syntology: 3 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

amano-k-lab/braincodec officialmentioned in paperpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 9 ran; 0 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

9ran
3unverified

Licence: 3 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

calculate_l1_dist amano-k-lab/BrainCodec/braincodec/422_F3_create_mean_fMRI_data.py official repository ran fingerprinted MIT (permissive) · d907b9008d2a240d · report
get_adv_criterion amano-k-lab/BrainCodec/audiocraft/adversarial/losses.py official repository ran MIT (permissive) · b94d3dcb2a918be3 · report
get_fake_criterion amano-k-lab/BrainCodec/audiocraft/adversarial/losses.py official repository ran MIT (permissive) · 88b0022a7cb492a1 · report
get_real_criterion amano-k-lab/BrainCodec/audiocraft/adversarial/losses.py official repository ran MIT (permissive) · 31e35a10d885d5a5 · report
get_reconstructed_fMRI amano-k-lab/BrainCodec/braincodec/422_calc_acc_for_each_layer_with_CSM.py official repository ran MIT (permissive) · c7080127ea64de29 · report
sinkhorn amano-k-lab/BrainCodec/braincodec/F2_sinkhorn_algorithm/compare_two_encodec.py official repository ran MIT (permissive) · 8fbfa70ae7d40c40 · report
tr_preprocess amano-k-lab/BrainCodec/braincodec/422_F3_create_mean_fMRI_data.py official repository ran MIT (permissive) · 4b5d01111e61e37f · report
wasserstein_distance_numpy amano-k-lab/BrainCodec/braincodec/F2_sinkhorn_algorithm/compare_two_encodec.py official repository unverified MIT (permissive) · a533f7d40bb7d99f · report
wasserstein_distance_pytorch amano-k-lab/BrainCodec/braincodec/F2_sinkhorn_algorithm/compare_two_encodec.py official repository unverified MIT (permissive) · d1bde2ba56eebe75 · report
AutoEncoder athms/learning-from-brains/src/decoder/autoencoder.py found in paper text by Syntology ran no licence file found · pointer only · 2774fa5e9b700603 · report
Decoder athms/learning-from-brains/src/decoder/autoencoder.py found in paper text by Syntology ran fingerprinted no licence file found · pointer only · cfe872713d672311 · report
Encoder athms/learning-from-brains/src/decoder/autoencoder.py found in paper text by Syntology unverified no licence file found · pointer only · 5daefb708a8f4720 · report

Tasks

Denoising

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections