Implementation of Tools for Lessening the Influence of Artifacts in EEG Signal Analysis
Abstract
:1. Introduction
2. EEG Database
2.1. Equipment
2.2. Experiment
2.3. EEG Processing
3. Tools and Methods
4. Implementation
4.1. Complete Removal of Independent Components: fta_ica_removed_components_method
- ft_selectdata: Fieltrip function to select EOG data.
- ft_componentanalysis: Fieldtrip function that obtains ICs from EEG data for all channels.
- fta_corrcoeff: Ad hoc function that calculates correlation coefficients (see Section 4.2).
- fta_select_comp_from_coeff_correlation: Ad hoc function to select ICs with a high correlation between EOG signals and ICs (see Section 4.3).
- fta_channels_from_ica_reject_components: Ad hoc function to reject components previously selected, e.g., using fta_select_comp_from_coeff_correlation (see Section 4.4).
- Obtain the vertical and horizontal electro-oculogram channels: VEOG and HEOG.
- Obtain the ICs from all EEG channels using the Fieldtrip function ft_componentanalysis.
- Calculate the correlation coefficients between the ICs and EOG signals using the function fta_corrcoeff (see Section 4.2). A matrix of coefficients is returned, where each row corresponds to each EOG channel and each column to the ICs of the EEG signals.
- The sum of all the modulus of correlation coefficients of the EOG channels with each of the independent components is obtained.
- ICs to be removed are selected using the function fta_select_comp_from_coeff_correlation (see Section 4.3). To do this, outliers are selected. In addition, the sum of the correlation coefficients is ordered from highest to lowest to show these components can be selected using a different criterion. These components are the ones selected for elimination.
- The selected ICs are removed using the function fta_channels_from_ica_reject_components (see Section 4.4). This function reconstructs the EEG channels from ICA components, except those selected for removal.
- data_eeg: Fieldtrip-structured data with EEG data to remove ocular artifacts.
- fig: Integer (optional) scalar value (1 or 0) to plot, for illustration, the sum of the correlation coefficients before and after applying the method.
- cleaned_data: Fieldtrip-structured data with less influence from ocular artifacts.
4.2. Similarity between EEG and EOG Data: fta_corrcoeff
- eog_data: Preprocessed data structure that contains only the channels corresponding to EOG data measures.
- data: Preprocessed data structure with the EEG channels selected.
- corrcoef_matrix_output: Matrix with one row per EOG channel and one column per data channel with the corresponding correlation coefficients.
4.3. Selection of Components to Remove: fta_select_comp_from_coeff_correlation
- corrcoef_ica_sum: Contains the sum of the coefficients of the correlation matrix.
- reject_comp: Contains the selected components to remove.
4.4. Reconstruction of EEG Channels from Independent Components: fta_channels_from_ica_reject_components
- fta_select_comp_from_coeff_correlation: Ad hoc function that selects the ICs to be rejected for EEG signal reconstruction (see Section 4.3).
- ICA_comp: Data structure as given by ICA_comp = ft_componentanalysis (cfg_ica, data)
- data_orig: Original data before applying ICA.
- corrcoef_ica_original_sum: Sum of correlation coefficients between the EOG channels and the rest of the EEG data channels.
- data_reconstructed: EEG data reconstructed from the accepted ICs.
4.5. Creation of Artifact Membership Function: fta_create_msf_fieldtrip
- Channels: EOG (HEOG and VEOG).
- Cut-off: Threshold of the Z-transformed values, above which the samples are considered as artifacts. A value of is used.
- Band-Pass Filter: Order 3 Butterworth filter between 2 and 15 Hz.
- Artifact padding: Used to extend the temporal extent of artifacts on both sides. A value of is used.
- Trial padding: Used to include data segments before or after the trial. A value of 0 is used.
- ft_artifact_zvalue: Scans data segments of interest for artifacts by means of thresholding the Z-transformed value using the pre-processing options to find ocular artifacts.
- data_eeg: EEG data to remove artifact influence.
- MSF: Logical sequence with Fieldtrip structure where artifacts are defined as 1 and other samples as 0.
4.6. Partial Removal of Independent Components: fta_ica_partially_removed_components_method
- Obtain the VEOG and HEOG channels.
- Obtain ICs of all the EEG channels.
- Calculate the correlation coefficients between the ICs and the EOG signals, as in the previous method.
- Sum all the correction coefficients between the EOG channels and each of the ICs.
- Partial elimination of ICs related to ocular artifacts using the function fta_channels_from_ic_partial_reject_components.
- ft_selectdata to select EOG data.
- ft_componentanalysis to obtain the ICs of all the EEG channels.
- fta_corrcoeff, which calculates correlation coefficients.
- fta_channels_from_ica_partial_reject_components, to partially reject components for reconstruction, where MSF = 1.
- data_eeg: EEG data to process.
- MSF: Logical sequence with Fieldtrip structure compatible with data_eeg, where artifacts are marked as 1 and other samples as 0, as created by fta_create_msf_fieldtrip (see Section 4.5).
- fig: Logical value: 1 or 0 to plot, or not, the sum of the correlation coefficients before and after applying the method.
- cleaned_data: Fieldtrip-structured data with reduced influence of ocular artifacts.
4.7. Reconstruction of EEG Channels from Independent Components Partially Rejected: fta_channels_from_ica_partial_reject_components
- fta_select_comp_from_coeff_correlation: Ad hoc function that selects the ICs to be rejected for EEG signal reconstruction (see Section 4.3).
- ICA_comp: Data structure of ICs, as given by ft_componentanalysis.
- data_orig: Original data before applying ICA.
- corrcoef_ica_original_sum: Sum of the correlation coefficients between EOG channels and the rest of the channels (EEG data).
- MSF: Logical sequence with Fieldtrip structure compatible with data_eeg, where artifacts are marked as 1 and other samples as 0, as created by fta_create_msf_fieldtrip (see Section 4.5).
- data_reconstructed: EEG data reconstructed from ICs, where some of them were removed, or attenuated, at the time instants indicated by the MSF.
4.8. Calculation of Artifact-Free Unmixing Matrix: fta_artifacts_free_ica_partially_removed_components _method
- Obtain VEOG and HEOG channels.
- Obtain the unmixing matrix from ICA of the EEG data free of artifacts.
- Recalculate the ICs of the complete EEG data using the artifact-free unmixing matrix calculated previously.
- Calculate the correlation coefficients between the ICs and EOG signals, as in the previous method.
- Perform the partial elimination of the ICs related to ocular artifacts using the correlation coefficients, as in the previous method.
- ft_selectdata(cfg, data_eeg) to select EOG data.
- fta_ica_from_artifact_free_data to obtain artifact-free ICs and the unmixing matrix.
- ft_componentanalysis to apply ICA using the artifact-free unmixing matrix.
- fta_corrcoeff to calculate the correlation coefficients.
- fta_select_comp_from_coeff_correlation to select the ICs with a high correlation with EOG signals.
- fta_channels_from_ic_partial_reject_components to partially reject ICs, where MSF = 1.
- data_eeg: EEG data with artifacts.
- MSF: Logical sequence with Fieldtrip structure compatible with data_eeg, where artifacts are marked as 1 and other samples as 0.
- fig: Logical value that takes the value of 1 to plot the sum of the correlation coefficients, before and after applying the method.
- clean_data: Fieldtrip-structured data with the influence of ocular artifacts diminished by partially removing artifacts using an artifact-free ICA unmixing matrix and MSF.
4.9. Independent Component Analysis with Artifact-Free Data: fta_ica_from_artifact_free_data
- ft_componentanalysis: To perform ICA on EEG data.
- data: EEG data channels, as obtained after initial pre-processing.
- MSF: Logica sequence with Fieldtrip structure compatible with data_eeg, where artifacts are marked as 1 and other samples as 0.
- comp_ica_from_artifact_free_ica: Reconstructed ICA data with partial removal of the ICs related to artifacts.
5. Examples
%%EEG file filename = ‘SUJ_001_EXP_001_1.eeg’; %%Preprocessing EEG files cfg = []; cfg.dataset = filename; %Remove the audio cfg.channel = {‘all’, ‘-Audio’}; %Reference channel cfg.refchannel = ‘FCz’; %Correction by the reference point cfg.demean = ‘yes’; cfg.detrend = ‘yes’; cfg.lpfilter = ‘yes’; cfg.lpfreq = 250; cfg.lpfilttype = ‘fir’; cfg.lpfiltdir = ‘twopass’; cfg.hpfilter = ‘yes’; cfg.hpfreq = 1; cfg.hpfilttype = ‘fir’; cfg.hpfiltdir = ‘twopass’; data_eeg = ft_preprocessing(cfg); %%FIRST METHOD fig = 1; clean_data = fta_ica_removed_components_method(data_eeg, fig); %Visualize the clean EEG data ft_databrowser([],clean_data);
%%EEG file filename = ‘SUJ_001_EXP_001_1.eeg’; %%Preprocessing EEG files cfg = []; cfg.dataset = filename; %Remove the audio cfg.channel = {‘all’, ‘-Audio’}; %Reference channel cfg.refchannel = ‘FCz’; %Corretion by the reference point cfg.demean = ‘yes’; cfg.detrend = ‘yes’; cfg.lpfilter = ‘yes’; cfg.lpfreq = 250; cfg.lpfilttype = ‘fir’; cfg.lpfiltdir = ‘twopass’; cfg.hpfilter = ‘yes’; cfg.hpfreq = 1; cfg.hpfilttype = ‘fir’; cfg.hpfiltdir = ‘twopass’; data_eeg = ft_preprocessing(cfg); %MSF creation MSF_ft = fta_create_msf_fieldtrip(data_eeg); %%SECOND METHOD fig = 0; cleaned_data = fta_ica_partially_removed_components_method(data_eeg, MSF_ft,fig); %Visualize the cleaned EEG data ft_databrowser([],cleaned_data);
%%EEG file filename = ‘SUJ_001_EXP_001_1.eeg’; %%Preprocessing EEG files cfg = []; cfg.dataset = filename; %Remove the audio cfg.channel = {‘all’, ‘-Audio’}; %Reference channel cfg.refchannel = ‘FCz’; %Corretion by the reference point cfg.demean = ‘yes’; cfg.detrend = ‘yes’; cfg.lpfilter = ‘yes’; cfg.lpfreq = 250; cfg.lpfilttype = ‘fir’; cfg.lpfiltdir = ‘twopass’; cfg.hpfilter = ‘yes’; cfg.hpfreq = 1; cfg.hpfilttype = ‘fir’; cfg.hpfiltdir = ‘twopass’; data_eeg = ft_preprocessing(cfg); %MSF creation MSF_ft = fta_create_msf_fieldtrip(data_eeg); %%THIRD METHOD fig = 0; cleaned_data = fta_artefacts_free_ica_partially_removed _components_method(data_eeg, MSF_ft,fig); %Visualize the cleaned EEG data ft_databrowser([],cleaned_data);
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Verleger, R.; Gasser, T.; Möcks, J. Correction of EOG Artifacts in Event-Related Potentials of the EEG: Aspects of Reliability and Validity. Psychophysiology 1982, 19, 472–480. [Google Scholar] [CrossRef] [PubMed]
- Woestenburg, J.; Verbaten, M.; Slangen, J. The Removal of the Eye-Movement Artifact from the EEG by Regression Analysis in the Frequency Domain. Biol. Psychol. 1983, 16, 127–147. [Google Scholar] [CrossRef] [PubMed]
- Arnold, M.; Milner, X.H.R.; Witte, H.; Bauer, R.; Braun, C. Adaptive AR Modeling of Nonstationary Time Series by Means of Kalman Filtering. IEEE Trans. Biomed. Eng. 1998, 45, 553–562. [Google Scholar] [CrossRef] [PubMed]
- Joyce, C.; Gorodnitsky, I.; Kutas, M. Automatic Removal of Eye Movement and Blink Artifacts from EEG Data using Blind Component Separation. Psychophysiology 2004, 41, 313–325. [Google Scholar] [CrossRef] [PubMed]
- Jiang, X.; Bian, G.B.; Tian, Z. Removal of Artifacts from EEG Signals: A Review. Sensors 2019, 19, 987. [Google Scholar] [CrossRef] [PubMed]
- Uddin, Z.; Altaf, M.; Ahmad, A.; Qamar, A.; Orakzai, F. Isolation of Multiple Electrocardiogram Artifacts using Independent Vector Analysis. PeerJ Comput. Sci. 2023, 9, e1189. [Google Scholar] [CrossRef] [PubMed]
- Shukla, P.K.; Roy, V.; Shukla, P.K.; Gupta, A.K.; Goel, V.; Shukla, S. Taxonomy on EEG Artifacts Removal Methods, Issues, and Healthcare Applications. J. Organ. End User Comput. 2021, 33, 19–46. [Google Scholar] [CrossRef]
- Gorjan, D.; Gramann, K.; Pauw, K.D.; Marusic, U. Removal of Movement-Induced EEG Artifacts: Current State of the Art and Guidelines. J. Neural Eng. 2022, 19, 011004. [Google Scholar] [CrossRef] [PubMed]
- Yasoda, K.; Ponmagal, R.S.; Bhuvaneshwari, K.S.; Venkatachalam4, K. Automatic Detection and Classification of EEG Artifacts using Fuzzy Kernel SVM and Wavelet ICA (WICA). Soft Comput. 2020, 24, 16011–16019. [Google Scholar] [CrossRef]
- Bajaj, N.; Requena-Carrión, J.; Bellotti, F.; Berta, R.; De-Gloria, A. Automatic and Tunable Algorithm for EEG Artifact Removal using Wavelet Decomposition with Applications in Predictive Modeling during Auditory Tasks. Biomed. Signal Process. Control 2020, 55, 101624. [Google Scholar] [CrossRef]
- Noorbasha, S.K.; Sudha, G.F. Removal of EOG Artifacts and Separation of Different Cerebral Activity Components from Single Channel EEG—An Efficient Approach Combining SSA–ICA with Wavelet Thresholding for BCI Applications. Biomed. Signal Process. Control 2021, 63, 102168. [Google Scholar] [CrossRef]
- Dora, M.; Holcman, D. Adaptive Single-Channel EEG Artifact Removal With Applications to Clinical Monitoring. IEEE Trans. Neural. Syst. Rehabil. Eng. 2022, 30, 286–295. [Google Scholar] [CrossRef] [PubMed]
- Mumtaz, W.; Rasheed, S.; Irfan, A. Review of Challenges Associated with the EEG Artifact Removal Methods. Biomed. Signal Process. Control 2021, 68, 102741. [Google Scholar] [CrossRef]
- Villena, A.; Tardón, L.J.; Barbancho, I.; Barbancho, A.M.; Brattico, E.; Haumann, N.T. Preprocessing for Lessening the Influence of Eye Artifacts in EEG Analysis. Appl. Sci. 2019, 9, 1757. [Google Scholar] [CrossRef]
- Psychology Software Tools. E-Prime, Psychology Software Tools: Pittsburgh, PA, USA, 2022.
- Oostenveld, R.; Fries, P.; Maris, E.; Schoffelen, J.M. FieldTrip: Open Source Software for Advanced Analysis of MEG, EEG, and Invasive Electrophysiological Data. Comput. Intell. Neurosci. 2011, 2011, 1–9. [Google Scholar] [CrossRef] [PubMed]
- Donders Institute for Brain, Cognition and Behaviour. Fieldtrip Matlab Software Toolbox for MEG, EEG and iEEG Analysis; Donders Institute for Brain, Cognition and Behaviour: Nijmegen, The Netherlands, 2024. [Google Scholar]
- The MathWorks Inc. MATLAB, version: 9.13.0 (R2022b); MathWorks Inc.: Natick, MA, USA, 2022.
- Behrens, F.; MacKeben, M.; Schröder-Preikschat, W. An Improved Algorithm for Automatic Detection of Saccades in Eye Movement Data and for Calculating Saccade Parameters. Behav. Res. Methods 2010, 42, 701–708. [Google Scholar] [CrossRef] [PubMed]
- Behrens, F.; Weiss, L.R. An Algorithm Separating Saccadic from Nonsaccadic Eye Movements Automatically by use of the Acceleration Signal. Vis. Res. 1992, 32, 889–893. [Google Scholar] [CrossRef] [PubMed]
- Toivanen, M.; Pettersson, K.; Lukander, K. A Probabilistic Real-Time Algorithm for Detecting Blinks, Saccades, and Fixations from EOG Data. J. Eye Mov. Res. 2015, 8, 1–14. [Google Scholar] [CrossRef]
- Rashida, M.; Habib, M.A. Feature Extraction from Regenerated EEG – A Better Approach for ICA Based Eye Blink Artifact Detection. Front. Biomed. Technol. 2023, 11, 569–576. Available online: https://fbt.tums.ac.ir/index.php/fbt/article/view/569, (accessed on 3 December 2023).
- Dimigen, O. Optimizing the ICA-based Removal of Ocular EEG Artifacts from Free Viewing Experiments. NeuroImage 2020, 207, 116117. [Google Scholar] [CrossRef] [PubMed]
- Lee, S.S.; Lee, K.; Kang, G. EEG Artifact Removal by Bayesian Deep Learning & ICA. In Proceedings of the 2020 42nd Annual International Conference of the IEEE Engineering in Medicine Biology Society (EMBC), Montreal, QC, Canada, 20–24 July 2020; pp. 932–935. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 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
Molina-Molina, M.; Tardón, L.J.; Barbancho, A.M.; Barbancho, I. Implementation of Tools for Lessening the Influence of Artifacts in EEG Signal Analysis. Appl. Sci. 2024, 14, 971. https://doi.org/10.3390/app14030971
Molina-Molina M, Tardón LJ, Barbancho AM, Barbancho I. Implementation of Tools for Lessening the Influence of Artifacts in EEG Signal Analysis. Applied Sciences. 2024; 14(3):971. https://doi.org/10.3390/app14030971
Chicago/Turabian StyleMolina-Molina, Mario, Lorenzo J. Tardón, Ana M. Barbancho, and Isabel Barbancho. 2024. "Implementation of Tools for Lessening the Influence of Artifacts in EEG Signal Analysis" Applied Sciences 14, no. 3: 971. https://doi.org/10.3390/app14030971
APA StyleMolina-Molina, M., Tardón, L. J., Barbancho, A. M., & Barbancho, I. (2024). Implementation of Tools for Lessening the Influence of Artifacts in EEG Signal Analysis. Applied Sciences, 14(3), 971. https://doi.org/10.3390/app14030971