Skip to content

Potential Labeling Issue in Kalunga2016 SSVEP Dataset #813

Closed

Description

@ponpopon

When performing a frequency analysis for Kalunga2016 SSVEP dataset, the data labeled as 17Hz appears to have its main peak at 21Hz. Conversely, the data labeled as 21Hz shows a peak at 17Hz. The peak for the 13Hz label appears to be correct.

This suggests that the labels for the 17Hz and 21Hz conditions might have been accidentally swapped.


How to Reproduce

This issue can be reproduced using the following code, which calculates and plots the power spectral density for each condition.

from moabb.datasets import Kalunga2016
dataset = Kalunga2016()
from moabb.paradigms import SSVEP
paradigm = SSVEP(fmin=1, fmax=40, n_classes=4)
X, labels, meta = paradigm.get_data(dataset=dataset, subjects=list(range(1,13)))
label_lists = ['13', '17', '21']
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
freqs, Pxx = signal.welch(X, 256, nperseg=256, detrend=False)
Pxx = np.log(Pxx)*10
Pxx_classified = [Pxx[labels == label] for label in label_lists]
Pxx_means = np.array([np.mean(Pxx_task, axis=0) for Pxx_task in Pxx_classified])

for ch_i in range(8):
    for task_i in range(len(Pxx_means)):
        Pxx_mean_ch = Pxx_means[task_i, ch_i]
        plt.plot(freqs, Pxx_mean_ch, label=f"{label_lists[task_i]} Hz")
    plt.xlim(0,40)
    plt.ylim(100, 150)
    plt.legend(loc='upper right')
    plt.xlabel('Frequency (Hz)')
    plt.ylabel('Power (dB)')
    plt.tight_layout()
    plt.show()

Observed Outcome

Image

Could you please look into this? It seems like a simple label swap might have occurred.

Thanks!

Activity

  1. bruAristimunha commented on Aug 21, 2025

    @bruAristimunha
    Collaborator

    Wow! Thank you so much for reporting @ponpopon!

    Can you open a PR to solve this? You would need to swap the level at the event class and put some notes warning that the event's label has changed.

            events={"13": 2, "17": 3, "21": 4, "rest": 1},
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions