Hi authors,
Thank you for releasing the BioFoundation/LUNA codebase. I am trying to reproduce the LUNA fine-tuning results on the TUAR dataset and would like to clarify the expected preprocessing and configuration for the TUAR multiclass setting.
In the paper/OpenReview discussion, TUAR seems to be described as a multiclass single-label task, where each segment is assigned one artifact label from five classes. My understanding is that this corresponds to:
classification_type=mcc
model.num_classes=5
- each sample label
y should be a scalar class index, e.g. one of the five artifact types.
However, when I follow the current preprocessing script for TUAR, the available modes appear to be:
Binary
MultiBinary
MultiLabel
When I preprocess TUAR with:
python make_datasets/process_raw_eeg.py tuar \
--root_dir /path/to/TUAR/edf \
--output_dir /path/to/processed_eeg \
--mode MultiLabel
the generated .pkl files contain labels with shape (22,), for example:
X shape: (22, 1280)
y: [3 3 0 0 3 3 0 0 0 0 0 0 0 0 3 3 0 0 3 3 0 0]
y shape: (22,)
This looks like a channel-wise multiclass/multi-output setting, where each channel receives one label from {0, 1, 2, 3, 4, 5}. So this seems closer to classification_type=mmc rather than standard segment-level mcc.
When I try to run the LUNA fine-tuning script under the MCC assumption:
python -u run_train.py +experiment=LUNA_finetune model=LUNA_base \
pretrained_safetensors_path=/path/to/checkpoints/LUNA/Base/LUNA_base.safetensors \
classification_type=mcc \
model.num_classes=5 \
data_module.train.hdf5_file=$DATA_PATH/TUAR_data/train.h5 \
data_module.val.hdf5_file=$DATA_PATH/TUAR_data/val.h5 \
data_module.test.hdf5_file=$DATA_PATH/TUAR_data/test.h5 \
io.base_output_path=$CHECKPOINT_DIR \
trainer.devices=1 \
gpus=1 \
batch_size=32 \
trainer.max_epochs=1
I get the following error during data loading:
File "BioFoundation/datasets/tuh_dataset.py", line 84, in __getitem__
y = int(grp["y"][sample_idx])
TypeError: only length-1 arrays can be converted to Python scalars
This makes sense because the current TUH_Dataset loader expects a scalar y, while the preprocessed TUAR MultiLabel data has a vector label per segment.
Could you please clarify the intended pipeline for reproducing the TUAR MCC results reported in the LUNA paper?
Specifically:
Which process_raw_eeg.py --mode should be used for the TUAR multiclass single-label setting?
Is there a separate preprocessing script or dataset conversion step that produces scalar 5-class labels for TUAR MCC?
For the MCC setting, are clean/background windows removed, or is background included as an additional class?
Should the TUAR MCC label space be five classes only, e.g. CHEW/ELEC/EYEM/MUSC/SHIV, or six classes including background?
What are the exact recommended fine-tuning overrides for LUNA on TUAR MCC, especially classification_type and model.num_classes?
Thank you very much for your help. I may have missed something in the preprocessing instructions, so I would appreciate any clarification on the expected TUAR data format for the paper’s MCC setting.
Hi authors,
Thank you for releasing the BioFoundation/LUNA codebase. I am trying to reproduce the LUNA fine-tuning results on the TUAR dataset and would like to clarify the expected preprocessing and configuration for the TUAR multiclass setting.
In the paper/OpenReview discussion, TUAR seems to be described as a multiclass single-label task, where each segment is assigned one artifact label from five classes. My understanding is that this corresponds to:
classification_type=mccmodel.num_classes=5yshould be a scalar class index, e.g. one of the five artifact types.However, when I follow the current preprocessing script for TUAR, the available modes appear to be:
BinaryMultiBinaryMultiLabelWhen I preprocess TUAR with:
the generated .pkl files contain labels with shape (22,), for example:
This looks like a channel-wise multiclass/multi-output setting, where each channel receives one label from {0, 1, 2, 3, 4, 5}. So this seems closer to classification_type=mmc rather than standard segment-level mcc.
When I try to run the LUNA fine-tuning script under the MCC assumption:
I get the following error during data loading:
This makes sense because the current TUH_Dataset loader expects a scalar y, while the preprocessed TUAR MultiLabel data has a vector label per segment.
Could you please clarify the intended pipeline for reproducing the TUAR MCC results reported in the LUNA paper?
Specifically:
Which process_raw_eeg.py --mode should be used for the TUAR multiclass single-label setting?
Is there a separate preprocessing script or dataset conversion step that produces scalar 5-class labels for TUAR MCC?
For the MCC setting, are clean/background windows removed, or is background included as an additional class?
Should the TUAR MCC label space be five classes only, e.g. CHEW/ELEC/EYEM/MUSC/SHIV, or six classes including background?
What are the exact recommended fine-tuning overrides for LUNA on TUAR MCC, especially classification_type and model.num_classes?
Thank you very much for your help. I may have missed something in the preprocessing instructions, so I would appreciate any clarification on the expected TUAR data format for the paper’s MCC setting.