Adaptable and Robust EEG Bad Channel Detection Using Local Outlier Factor (LOF)
Abstract
:1. Introduction
- (i)
- Removing noisy segments of EEG in the presence of bad channels can lead to severe data loss due to a misleading overall rejection threshold.
- (ii)
- The presence of bad channels can produce a strong bias on the overall statistics of the extracted neural features leading to the wrong interpretation of the experiments.
- (iii)
- Further, bad channels can also bias the source level analysis as they often suppress the information from the adjacent good channels, resulting in a wrong source reconstruction.
2. Materials and Methods
2.1. LOF Algorithm
- The optimal k value (i.e., the number of nearest neighbors) is first computed using the Natural Neighbors algorithm (NaN [39]), a data-centric non-parametric approach.
- For a given channel p, the LOF algorithm identifies k neighbor channels based on the predefined distance metric (e.g., Euclidean) using the k-nearest neighbors algorithm [31].
- Then, a reachability distance is computed between channels. For example, let us consider two channels, namely p and o. The reachability distance between p and o is computed as follows:
- Once the reachability distance of each channel with respect to its neighbors is computed, then the local reachability density (LRD) is determined as follows:To put it in words, the LRD of the channel p is the inverse of the average reachability distance based on the k-nearest neighbors of p. Intuitively, channel p will have a lower LRD if it were an outlier (i.e., bad) channel because it is not easily "reachable" by most of its neighbors.
- As a final step, the local outlier factor (LOF) is computed as follows:The LOF of channel p is the ratio of the average LRD of k neighbors of p to the LRD of p. The lower p’s LRD is, and the higher the LRD of p’s k-nearest neighbors are, the higher the LOF value of p is (and, therefore, possibly an outlier). In other words, an outlier channel would display a lower LRD (therefore, larger in distance) compared to its neighbors (on average). Note that if channel p has a similar LRD value compared to its k neighbors, the LOF score would be approximately 1.
2.2. LOF Threshold Computation
2.3. Bad Channel Detection based on Statistical Measures
2.4. State-of-the-Art Bad Channel Detection Methods
- KurtosisKurtosis is a higher-order statistical measure that reflects the Gaussianity of a distribution. Positive kurtosis indicates a super-Gaussian distribution, while negative kurtosis denotes a sub-Gaussian distribution. Despite being a simple measure, it has been widely used as a reliable feature for several artifact removal methods in EEG [44,45,46]. We used the EEGLAB function pop_rejspec to detect bad channels with default parameter settings. In particular, the kurtosis values computed for each channel were normalized to have zero mean and unit standard deviation (using z-score). Channels with a z-score of more than five were identified as bad channels.
- FASTER
- Clean Raw Data (CRD)EEGLAB offers an automated approach to clean continuous raw EEG data using the Clean Raw Data (CRD) plugin [36]. CRD first looks for “Flat-Line” channels (i.e., channels that recorded constant values for at least 5 seconds). Then, it looks for bad channels that had predominantly recorded power-line interference noise, and finally, it looks for spatially uncorrelated channels.
- HAPPEWhile all the above-mentioned techniques were developed for adult EEG, the HAPPE pipeline is one of the first preprocessing pipelines for removing artifacts from pediatric EEG [25]. In such data, the level of noisiness is comparatively higher and difficult to process. To detect bad channels, HAPPE uses the joint probability measure of the average log power computed between 1 and 125 Hz across all channels. Precisely, channels are predicted as bad if the computed probability falls more than three standard deviations from the mean. Since developmental EEG presents severe contamination of artifacts compared to adult EEG, the authors performed the computations twice for each file.
3. Description of EEG Datasets
3.1. Simulated EEG
3.2. Newborn EEG
3.3. Infant EEG
3.4. Adult EEG
4. Results
4.1. LOF vs. Statistical Measures
4.2. Simulation EEG
4.3. Real EEG
4.4. LOF Optimal Threshold
5. Discussion
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Appendix A. Simulating EEG Using SEREEGA Toolbox
1 | % generate two symmetrical sources in the early visual cortex |
2 | source1 = lf_get_source_nearest(leadfield, [−8 −76 10]); %left hemisphere |
3 | source2 = lf_get_source_nearest(leadfield, [8 −76 10]); %right hemisphere |
4 | sourceV1=[source1 source2]; % combined |
1 SSVEP = struct(); % empty struct |
2 SSVEP.data = sin(2*pi*0.8*t); % 0.8 Hz sinusoidal signal |
3 SSVEP.index = {‘e’, ‘:’}; |
4 SSVEP.amplitude = 0.5; % this value is derived from a real newborn EEG dataset |
5 SSVEP.amplitudeType = ‘relative’; |
1 SSVEP_component = utl_create_component(sourceV1, SSVEP, leadfield); |
2 SSVEP_scalp = generate_scalpdata(SSVEP_component, leadfield, config); % ... scalp EEG is generated |
1 | % generate 62 sources of noise in random voxels |
2 | noise_source = lf_get_source_spaced(leadfield, 62, 25); |
3 | noise_signal = struct(‘type’, ‘noise’, ‘color’, ‘brown’, ‘amplitude’, 1); |
4 | noise_components = utl_create_component([noise_source sourceV1], ... noise_signal, leadfield); |
5 | noise_scalp = generate_scalpdata(noise_components, leadfield, config); |
1 signal_scalp = utl_mix_data(SSVEP_scalp, noise_scalp, snr); % SSVEP and ... background EEG are mixed |
References
- Shih, J.J.; Krusienski, D.J.; Wolpaw, J.R. Brain-Computer Interfaces in Medicine. Mayo Clin. Proc. 2012, 87, 268–279. [Google Scholar] [CrossRef] [PubMed]
- Lee, M.H.; Kwon, O.Y.; Kim, Y.J.; Kim, H.K.; Lee, Y.E.; Williamson, J.; Fazli, S.; Lee, S.W. EEG dataset and OpenBMI toolbox for three BCI paradigms: An investigation into BCI illiteracy. GigaScience 2019, 8, giz002. [Google Scholar] [CrossRef] [PubMed]
- Minguillon, J.; Lopez-Gordo, M.A.; Pelayo, F. Trends in EEG-BCI for daily-life: Requirements for artifact removal. Biomed. Signal Process. Control 2017, 31, 407–418. [Google Scholar] [CrossRef]
- Jiang, X.; Bian, G.B.; Tian, Z. Removal of Artifacts from EEG Signals: A Review. Sensors 2019, 19, 987. [Google Scholar] [CrossRef] [PubMed]
- Makeig, S.; Bell, A.; Jung, T.P.; Sejnowski, T.J. Independent Component Analysis of Electroencephalographic Data. In Advances in Neural Information Processing Systems; Touretzky, D., Mozer, M., Hasselmo, M., Eds.; MIT Press: Cambridge, MA, USA, 1995; Volume 8. [Google Scholar]
- Winkler, I.; Haufe, S.; Tangermann, M. Automatic classification of artifactual ICA-components for artifact removal in EEG signals. Behav. Brain Funct. 2011, 7, 30. [Google Scholar] [CrossRef]
- Mognon, A.; Jovicich, J.; Bruzzone, L.; Buiatti, M. ADJUST: An automatic EEG artifact detector based on the joint use of spatial and temporal features. Psychophysiology 2011, 48, 229–240. [Google Scholar] [CrossRef]
- Pion-Tonachini, L.; Kreutz-Delgado, K.; Makeig, S. ICLabel: An automated electroencephalographic independent component classifier, dataset, and website. NeuroImage 2019, 198, 181–197. [Google Scholar] [CrossRef]
- Leach, S.C.; Morales, S.; Bowers, M.E.; Buzzell, G.A.; Debnath, R.; Beall, D.; Fox, N.A. Adjusting ADJUST: Optimizing the ADJUST algorithm for pediatric data using geodesic nets. Psychophysiology 2020, 57, e13566. [Google Scholar] [CrossRef]
- Mullen, T.R.; Kothe, C.A.E.; Chi, Y.M.; Ojeda, A.; Kerth, T.; Makeig, S.; Jung, T.P.; Cauwenberghs, G. Real-time neuroimaging and cognitive monitoring using wearable dry EEG. IEEE Trans. Biomed. Eng. 2015, 62, 2553–2567. [Google Scholar] [CrossRef]
- Blum, S.; Mirkovic, B.; Debener, S. Evaluation of Riemannian ASR on cEEGrid data: An artifact correction method for BCIs. In Proceedings of the 2019 IEEE International Conference on Systems, Man and Cybernetics (SMC), Bari, Italy, 6–9 October 2019; pp. 3625–3630. [Google Scholar] [CrossRef]
- Kumaravel, V.P.; Kartsch, V.; Benatti, S.; Vallortigara, G.; Farella, E.; Buiatti, M. Efficient Artifact Removal from Low-Density Wearable EEG using Artifacts Subspace Reconstruction. In Proceedings of the 2021 43rd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), Jalisco, Mexico, 31 October–4 November 2021; pp. 333–336. [Google Scholar] [CrossRef]
- Kumaravel, V.; Farella, E.; Parise, E.; Buiatti, M. NEAR: An artifact removal pipeline for human newborn EEG data. Dev. Cogn. Neurosci. 2022, 54, 101068. [Google Scholar] [CrossRef]
- Buiatti, M.; Di Giorgio, E.; Piazza, M.; Polloni, C.; Menna, G.; Taddei, F.; Baldo, E.; Vallortigara, G. Cortical route for facelike pattern processing in human newborns. Proc. Natl. Acad. Sci. USA 2019, 116, 4625–4630. [Google Scholar] [CrossRef] [PubMed]
- Ramaswamy, S.; Rastogi, R.; Shim, K. Efficient Algorithms for Mining Outliers from Large Data Sets. SIGMOD Rec. 2000, 29, 427–438. [Google Scholar] [CrossRef]
- Goldstein, M.; Uchida, S. A Comparative Evaluation of Unsupervised Anomaly Detection Algorithms for Multivariate Data. PLoS ONE 2016, 11, e0152173. [Google Scholar] [CrossRef] [PubMed]
- Breunig, M.M.; Kriegel, H.P.; Ng, R.T.; Sander, J. LOF: Identifying Density-Based Local Outliers. SIGMOD Rec. 2000, 29, 93–104. [Google Scholar] [CrossRef]
- Kriegel, H.P.; Kröger, P.; Schubert, E.; Zimek, A. LoOP: Local Outlier Probabilities. In Proceedings of the 18th ACM Conference on Information and Knowledge Management (CIKM’09), Hong Kong, China, 2–6 November 2009; Association for Computing Machinery: New York, NY, USA, 2009; pp. 1649–1652. [Google Scholar] [CrossRef]
- Hofmann, M.; Klinkenberg, R. RapidMiner: Data Mining Use Cases and Business Analytics Applications; Chapman & Hall/CRC: Boca Raton, FL, USA, 2013. [Google Scholar]
- Yuen, K.V.; Mu, H.Q. A novel probabilistic method for robust parametric identification and outlier detection. Probabilistic Eng. Mech. 2012, 30, 48–59. [Google Scholar] [CrossRef]
- Yuen, K.V.; Ortiz, G.A. Outlier detection and robust regression for correlated data. Comput. Methods Appl. Mech. Eng. 2017, 313, 632–646. [Google Scholar] [CrossRef]
- Delorme, A.; Makeig, S. EEGLAB: An open source toolbox for analysis of single-trial EEG dynamics including independent component analysis. J. Neurosci. Methods 2004, 134, 9–21. [Google Scholar] [CrossRef] [Green Version]
- Bigdely-Shamlo, N.; Mullen, T.; Kothe, C.; Su, K.; Robbins, K. The PREP pipeline: Standardized preprocessing for large-scale EEG analysis. Front. Neuroinform. 2015, 9, 16. [Google Scholar] [CrossRef]
- Nolan, H.; Whelan, R.; FASTER, R.R. Fully Automated Statistical Thresholding for EEG artifact Rejection. J. Neurosci. Methods 2010, 192, 152–162. [Google Scholar] [CrossRef] [PubMed]
- Gabard-Durnam, L.; Mendez Leal, A.; Wilkinson, C.; Levin, A. The Harvard Automated Processing Pipeline for Electroencephalography (HAPPE): Standardized Processing Software for Developmental and High-Artifact Data. Front. Neurosci. 2018, 12, 97. [Google Scholar] [CrossRef]
- Sugimoto, H.; Ishii, N.; Iwata, A.; Suzumura, N.; Tomita, T. On the stationarity and normality of the electroencephalographic data during sleep stages. Comput. Programs Biomed. 1978, 8, 224–234. [Google Scholar] [CrossRef]
- Zhang, H.; Zhao, M.; Wei, C.; Mantini, D.; Li, Z.; Liu, Q. EEGdenoiseNet: A benchmark dataset for deep learning solutions of EEG denoising. J. Neural Eng. 2021, 18, 056057. [Google Scholar] [CrossRef] [PubMed]
- Paissan, F.; Kumaravel, V.; Farella, E. Interpretable CNN for Single-Channel Artifacts Detection in Raw EEG Signals. In Proceedings of the 2022 IEEE Sensors Applications Symposium (SAS), Sundsvall, Sweden, 1–3 August 2022. [Google Scholar]
- Ho, T.K.K.; Armanfard, N. Self-Supervised Learning for Anomalous Channel Detection in EEG Graphs: Application to Seizure Analysis. arXiv 2022, arXiv:2208.07448. [Google Scholar] [CrossRef]
- Han, J.; Kamber, M.; Pei, J. 12—Outlier Detection. In Data Mining, 3rd ed.; Han, J., Kamber, M., Pei, J., Eds.; The Morgan Kaufmann Series in Data Management Systems; Morgan Kaufmann: Boston, MA, USA, 2012; pp. 543–584. [Google Scholar] [CrossRef]
- Fix, E.; Hodges, J. Discriminatory Analysis, Nonparametric Discrimination: Consistency Properties; Technical Report 4; USAF School of Aviation Medicine; Randolph Field: San Antonio, TX, USA, 1951. [Google Scholar] [CrossRef]
- Krol, L.R.; Pawlitzki, J.; Lotte, F.; Gramann, K.; Zander, T.O. SEREEGA: Simulating event-related EEG activity. J. Neurosci. Methods 2018, 309, 13–24. [Google Scholar] [CrossRef] [PubMed]
- Parise, E.; Csibra, G. Electrophysiological Evidence for the Understanding of Maternal Speech by 9-Month-Old Infants. Psychol. Sci. 2012, 23, 728–733. [Google Scholar] [CrossRef] [Green Version]
- Schneider, C.; Pereira, M.; Tonin, L.; del R. Millan, J. Real-time EEG feedback on alpha power lateralization leads to behavioral improvements in a covert attention task. Brain Topogr. 2020, 33, 48–59, This data was obtained from the Open Neuro database. [Google Scholar] [CrossRef]
- FASTER Bad Channel Function. Available online: https://github.com/mortonne/.../eeglab/faster/channel_properties.m (accessed on 25 February 2022).
- EEGLAB Plugin: Clean_rawdata. Available online: https://github.com/sccn/clean_rawdata (accessed on 25 February 2022).
- Dalianis, H. Evaluation Metrics and Evaluation. In Clinical Text Mining; Springer International Publishing: Cham, Switzerland, 2018; pp. 45–53. [Google Scholar] [CrossRef]
- EEGLAB Plugin: NEAR. Available online: https://github.com/vpKumaravel/NEAR (accessed on 25 February 2022).
- Zhu, Q.; Feng, J.; Huang, J. Natural neighbor: A self-adaptive neighborhood method without parameter K. Pattern Recognit. Lett. 2016, 80, 30–36. [Google Scholar] [CrossRef]
- MATLAB. Version 7.10.0 (R2018b); The MathWorks Inc.: Natick, MA, USA, 2018. [Google Scholar]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine Learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar]
- Kuhn, M.; Johnson, K. Applied Predictive Modeling, 1st ed.; Springer: New York, NY, USA, 2013. [Google Scholar]
- James, G.; Witten, D.; Hastie, T.; Tibshirani, R. An Introduction to Statistical Learning: With Applications in R; Springer: New York, NY, USA, 2013. [Google Scholar]
- Mahajan, R.; Morshed, B.I. Unsupervised Eye Blink Artifact Denoising of EEG Data with Modified Multiscale Sample Entropy, Kurtosis, and Wavelet-ICA. IEEE J. Biomed. Health Inform. 2015, 19, 158–165. [Google Scholar] [CrossRef]
- Greco, A.; Mammone, N.; Morabito, F.C.; Versaci, M. Kurtosis, Renyi’s entropy and independent component scalp maps for the automatic artifact rejection from EEG data. Int. J. Signal Process. 2006, 2, 240–244. [Google Scholar]
- Delorme, A.; Sejnowski, T.; Makeig, S. Enhanced detection of artifacts in EEG data using higher-order statistics and independent component analysis. NeuroImage 2007, 34, 1443–1449. [Google Scholar] [CrossRef] [PubMed]
- Bian, N.Y.; Wang, B.; Cao, Y.; Zhang, L. Automatic Removal of Artifacts from EEG Data Using ICA and Exponential Analysis. In Advances in Neural Networks—ISNN 2006; Springer: Berlin/Heidelberg, Germany, 2006; pp. 719–726. [Google Scholar] [CrossRef]
- Vorobyov, S.; Cichocki, A. Blind noise reduction for multisensory signals using ICA and subspace filtering, with application to EEG analysis. Biol. Cybern. 2002, 86, 293–303. [Google Scholar] [CrossRef] [PubMed]
- Fransson, P.; Metsäranta, M.; Blennow, M.; Åden, U.; Lagercrantz, H.; Vanhatalo, S. Early Development of Spatial Patterns of Power-Law Frequency Scaling in fMRI Resting-State and EEG Data in the Newborn Brain. Cereb. Cortex 2012, 23, 638–646. [Google Scholar] [CrossRef] [PubMed]
- EEGLAB Plugin: TrimOutlier. Available online: https://github.com/sccn/trimOutlier (accessed on 25 February 2022).
- Schneider, C.; Pereira, M.; Tonin, L.; del R. Millán, J. Real-time EEG Feedback on Alpha Power Lateralization Leads to Behavioral Improvements in a Covert Attention Task. Brain Topogr. 2019, 33, 48–59. [Google Scholar] [CrossRef]
- Nayak, C.S.; Anilkumar, A. EEG Normal Waveforms. [Updated 2022 May 8]. StatPearls 2022, 54, 8406–8420. [Google Scholar]
Channel ID | 1, 49 | 6, 35 | 16 | False Positives | F1 Score |
---|---|---|---|---|---|
Methods | Kind of Artifacts | Flat Line | Motion | Aperiodic | ||
Kurtosis | PD | FD | FD | 2 | 0.73 |
FASTER | ND | FD | ND | 1 | 0.4 |
CRD | FD | FD | ND | 0 | 0.89 |
HAPPE | FD | FD | ND | 0 | 0.89 |
LOF | ND | FD | FD | 0 | 0.75 |
LOF + Flat Line Detector | FD | FD | FD | 0 | 1 |
Data/Method | Mean F1 Score (s.e.m.) | ||||
---|---|---|---|---|---|
Kurtosis | FASTER | CRD | HAPPE | LOF | |
Newborn | 0.30 (0.022) | 0.40 (0.014) | 0.38 (0.019) | 0.45 (0.016) | 0.63 (0.018) |
Infant | 0.23 (0.012) | 0.17 (0.011) | 0.21 (0.006) | 0.25 (0.008) | 0.35 (0.007) |
Adult | 0.14 (0.008) | 0.15 (0.006) | 0.11 (0.008) | 0.24 (0.006) | 0.45 (0.016) |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Kumaravel, V.P.; Buiatti, M.; Parise, E.; Farella, E. Adaptable and Robust EEG Bad Channel Detection Using Local Outlier Factor (LOF). Sensors 2022, 22, 7314. https://doi.org/10.3390/s22197314
Kumaravel VP, Buiatti M, Parise E, Farella E. Adaptable and Robust EEG Bad Channel Detection Using Local Outlier Factor (LOF). Sensors. 2022; 22(19):7314. https://doi.org/10.3390/s22197314
Chicago/Turabian StyleKumaravel, Velu Prabhakar, Marco Buiatti, Eugenio Parise, and Elisabetta Farella. 2022. "Adaptable and Robust EEG Bad Channel Detection Using Local Outlier Factor (LOF)" Sensors 22, no. 19: 7314. https://doi.org/10.3390/s22197314
APA StyleKumaravel, V. P., Buiatti, M., Parise, E., & Farella, E. (2022). Adaptable and Robust EEG Bad Channel Detection Using Local Outlier Factor (LOF). Sensors, 22(19), 7314. https://doi.org/10.3390/s22197314