Skip to main content

NeuroXAI: Adaptive, robust, explainable surrogate framework for determination of channel importance in EEG application

Project description

NeuroXAI: Adaptive, Robust, Explainable Surrogate Framework for Determination of Channel Importance in EEG Application

Choel-Hui Lee, Daesun Ahn, Hakseung Kim, Eun Jin Ha, Jung-Bin Kim and Dong-Joo Kim

[Paper]] [BibTeX] [Paper With Code]

Abstract 🔥

Electroencephalogram (EEG)-based applications often require numerous channels to achieve high performance, which limits their widespread use. Various channel selection methods have been proposed to identify minimum EEG channels without compromising performance. However, most of these methods are limited to specific data paradigms or prediction models. We propose NeuroXAI, a novel method that identifies channel importance regardless of the type of EEG application. It integrates the surrogate analysis algorithm to optimize EEG signals and the data sampling algorithm, which effectively selects from highly voluminous EEG data. The efficacy of channel selection via the proposed method was evaluated through three datasets acquired under different paradigms (motor imagery, steady-state visually evoked potentials, and event-related potentials). On datasets based on these paradigms, NeuroXAI-based channel selection reduced the number of channels while maintaining or enhancing performance. The advantages of the proposed method include enhanced performance and robustness over varying data paradigms and the type of prediction model. The XAI technique enables intuitive interpretation regarding the constructed model operation, making it applicable in various fields such as model debugging and model interpretation. NeuroXAI has the potential to be used as a practical tool to develop better EEG applications.

NeuroXAI Architecture

Installation 💿

The code requires python>=3.5, as well as lime and mne >= 1.8.0.

install NeuroXAI

>> pip install neuroxai

or clone the repository locally and install with

>> git clone git@github.com:dlcjfgmlnasa/NeuroXAI.git
>> cd NeuroXAI
>> pip install -e .

Usage 🤖

(Example 1) NeuroXAI for sinlge EEG sample

from neuroxai.explanation import BrainExplainer

kernel_width = 25            # exponential smoothing kernel size
num_samples = 500            # training sample size
replacement_method = 'mean'  # permutation type {mean, zero, noise}
label_idx_list = [i for i, _ in enumerate(class_names)]

explainer = BrainExplainer(kernel_width=kernel_width, class_names=class_names)
exp = explainer.explain_instance(data=x,                       # x => (channel_num, signal_length)
                                 classifier_fn=classifier_fn,  # pretrained model
                                 labels=label_idx_list,
                                 num_samples=num_samples,
                                 replacement_method=replacement_method)

exp.as_list(label=class_idx)                                   # [result] => channel importance for each class

(Example 2) NeuroXAI for entire EEG samples

from neuroxai.explanation import BrainExplainer
from neuroxai.explanation import GlobalBrainExplainer

kernel_width = 25            # exponential smoothing kernel size
num_samples = 500            # training sample size
replacement_method = 'mean'  # permutation type {mean, zero, noise}

explainer = BrainExplainer(kernel_width=kernel_width, class_names=class_names)
global_exp = GlobalBrainExplainer(explainer=explainer)
global_exp.explain_instance(x=x,                          # x => (epoch_size, channel_num, signal_length)
                            y=y,                          # y => (epoch_size, 1)
                            classifier_fn=classifier_fn,  # pretrained model
                            num_samples=num_samples,
                            replacement_method=replacement_method)

global_exp.explain_classes_channel_importance()           # [result1] => Global channel importance for each class
global_exp.explain_global_channel_importance()            # [result2] => Global channel importance

Tutorials

License and Citation 📰

The software is licensed under the Apache License 2.0. Please cite the following paper if you have used this code

@article{lee2025neuroxai,
  title={NeuroXAI: Adaptive, robust, explainable surrogate framework for determination of channel importance in EEG application},
  author={Lee, Choel-Hui and Ahn, Daesun and Kim, Hakseung and Ha, Eun Jin and Kim, Jung-Bin and Kim, Dong-Joo},
  journal={Expert Systems with Applications},
  volume={261},
  pages={125364},
  year={2025},
  publisher={Elsevier}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuroxai-0.0.0.4.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuroxai-0.0.0.4-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file neuroxai-0.0.0.4.tar.gz.

File metadata

  • Download URL: neuroxai-0.0.0.4.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.13

File hashes

Hashes for neuroxai-0.0.0.4.tar.gz
Algorithm Hash digest
SHA256 a8144db85b955cf646a65ac3b95cf10c9b2e6595f193148f0b750e3b952d81be
MD5 cd326e73f6c98205d93c88687bfc6b26
BLAKE2b-256 2ec93eabfe76327f4f4fd2867f82864854955ec410b3752ec34b212c55f27046

See more details on using hashes here.

File details

Details for the file neuroxai-0.0.0.4-py3-none-any.whl.

File metadata

  • Download URL: neuroxai-0.0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.13

File hashes

Hashes for neuroxai-0.0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7ef978e1d21c8252a8af7073c62a512c78cf2d4b52225f31f3f124b3b803cba0
MD5 f7991c7e16ba57a61c9e4d86465d7721
BLAKE2b-256 2e9c229e51aedbea51beddd1b662072df6cf186c80134eeb5c4967ce24998dc8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page