# Ballistocardiogram Artifact Removal for Concurrent EEG-fMRI Recordings Using Blind Source Separation Based on Dictionary Learning

Yuxi Liu, Jianhai Zhang, Bohui Zhang, Wanzeng Kong

► To cite this version:

Yuxi Liu, Jianhai Zhang, Bohui Zhang, Wanzeng Kong. Ballistocardiogram Artifact Removal for Concurrent EEG-fMRI Recordings Using Blind Source Separation Based on Dictionary Learning. 11th International Conference on Intelligent Information Processing (IIP), Jul 2020, Hangzhou, China. pp.180-191, 10.1007/978-3-030-46931-3_17. hal-03456964

HAL Id: hal-03456964

https://inria.hal.science/hal-03456964

Submitted on 30 Nov 2021

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Ballistocardiogram artifact removal for concurrent EEG-fMRI
recordings using blind source separation based on dictionary
learning

Yuxi Liu¹, Jianhai Zhang¹,², Bohui Zhang³(*), Wanzeng Kong¹,²

¹ School of Computer Science, Hangzhou Dianzi University, Hangzhou 310018, China

² Key laboratory of Brain Machine Collaborative Intelligence of Zhejiang Province, Hangzhou 310018, China

³University of Southern California, Los Angeles, California 90007, USA

bohuizha@usc.edu

**Abstract.** Simultaneous recording of electroencephalography (EEG) and functional magnetic resonance imaging (fMRI) have attracted extensive attention and research owing to their high spatial and temporal resolution. However, EEG data are easily influenced by physiological causes, gradient artifact (GA) and ballistocardiogram (BCG) artifact. In this paper, a new blind source separation technique based on dictionary learning is proposed to remove BCG artifact. The dictionary is learned from original data which represents the features of clean EEG signals and BCG artifact. Then, the dictionary atoms are classified according to a list of standards. Finally, clean EEG signals are obtained from the linear combination of the modified dictionary. The proposed method, ICA, AAS, and OBS are tested and compared using simulated data and real simultaneous EEG-fMRI data. The results suggest the efficacy and advantages of the proposed method in the removal of BCG artifacts.

**Keywords:**EElectroencephalography (EEG), functional Magnetic Resonance Imaging (fMRI), Ballistocardiogram, Dictionary Learning, Signal Processing.

# 1 Introduction

With the development of brain science, the simultaneous acquisition of electroencephalography (EEG) and functional magnetic resonance imaging (fMRI) has attracted extensive attention and research. EEG signal has the characteristics of low spatial resolution and high temporal resolution, while fMRI has the characteristics of low temporal resolution and high spatial resolution. Therefore, the combination of EEG signal and fMRI is very important for the study of brain function, pathogenesis and cognition of mental diseases [1,2].

However, we face a serious problem: during recording data in an MRI scanner, EEG signals are easy to be affected by the gradient artifact (GA) and ballistocardiogram (BCG) artifact [9]. Fortunately, the gradient artifacts have time-shift invariance and their amplitude is more than 100 times higher than that of an EEG signal [3]. Thus, gradient artifacts are easily discernable, and they can be removed from the EEG signal by average artifact subtraction (AAS) [4]. However, the original EEG signals still contain another serious artifact, the most difficult one to remove: the ballistocardiogram artifact (BCG). The BCG artifact is caused by the hall effect induced by blood flow and the scalp twitch caused by blood pulsation, which mainly covers the frequency of EEG signal at alpha (8-13Hz) and below [15]. Therefore, BCG artifacts are a major bottleneck to the wide application of simultaneous EEG-fMRI, and it is also a problem we need to solve urgently.
To ensure the quality of EEG signals in EEG-fMRI, many methods have been used to remove BCG artifact. 1) Averaged artifact subtraction (AAS), in which a BCG artifact template is estimated by averaging over the intervals of EEG signal that are corrupted by the artifact and subsequent subtraction of the template from the corrupted segments to obtain clean signal [4]. 2) Independent Component Analysis (ICA) [5] and 3) Principal Component Analysis (PCA) [6] are used to separate the original EEG signal into different components, identify the artifact components and then remove them. The primary challenge with these two methods is the definition of a consistent standard for artificial component selection. There is always a trade-off in selecting the number of components: removing a small number of components may still leave traces in the EEG signal, on the contrary, removing a large number of components may lead to the loss of important information in the EEG signal [14].

In recent years, dictionary learning has been widely used in multiple denoising study areas concerning images and medical signals. Abolghasemi et al. [11] firstly used dictionary learning to removal BCG artifact. The method first learns a sparse dictionary from the given data. Then, the dictionary is used to model the existing BCG contribution in the original signals. The obtained BCG model is then subtracted from the original EEG to achieve clean EEG. The results show that dictionary learning is better than AAS, OBS and DHT. However, their methods lack the study of learned dictionary. Their work proved the reliability from the evaluation index while not from the dictionary itself. The features of atoms is not fully explained and the amount of useful EEG features in the dictionary on real-time data has not been proved.

In this paper, based on the previous approach, we propose a new blind source separation technique for removing BCG artifacts EEG data based on dictionary learning. The original EEG signal is firstly studied through dictionary learning, while the dictionary contains all of the features of the dictionary, which can ensure that all BCG features are fitted. Then, the atoms contain only EEG features are sorted according to a list of standards. Finally, the clean EEG signal is obtained by the linear combination of the sorted atoms. The proposed method is tested on synthetic data and real data, and compared with ICA, AAS and OBS, which proves that the method has better performance.

# 2 Method

## 2.1 Dictionary Learning

Dictionary learning is a machine learning algorithm that has been widely used in image denoising and classification, medical signals analyzing and so on. The learning method aims at inferring a dictionary matrix which can give a sparse representation of the input image or signal. Each column of the dictionary is called an atom which describes the features of the input data. The method is also called sparse dictionary learning which means the signal is represented as a sparse linear combination of atoms [16]. Assume a dictionary matrix $D=[d_1, \cdots, d_K] \in R^{n \times K}$, $n < K$, has been found from the input dataset $X=[x_1, \cdots, x_m]$, $x_i \in R^n$. Each column of the dataset matrix which usually represents a signal $x_i$ can be represented as the linear combination of the atoms of dictionary, i.e. $x_i = D \cdot s_i$. Representations $s_i$, the elements of sparse matrix $S=[s_1, \cdots, s_m]$ need to achieve enough sparsity. Thus, the learning process can be formulated as:

$$ \min_{D, s_i} \sum_{i=1}^{m} \|x_i - Ds_i\|_2^2 + \lambda \|s_i\|_0, \quad \lambda > 0 \quad (1) $$

The $l_0$-norm in the minimization problem (1) is commonly substituted by $l_1$-norm for measurement of sparsity since the previous is NP-hard [20]. A usual procedure to solve the problem is iteratively updating dictionary and sparse coding, i.e. solve dictionary $D$ while sparse coding $S$ is fixed then solve $S$ when $D$ is fixed, until convergence. K-SVD [22] is a powerful algorithm that based on Singular Value Decomposition (SVD) and K-means implements the alternating minimization process well. And the paper uses K-SVD as the core algorithm to complete the dictionary learning.
## 2.2 The Proposed Technique

The input data for the proposed method which is the original signal added by all 32 EEG channels with length L is segmented into m pieces of data of length n. Each segment is a piece of continuous EEG signal. The segments would increase the amount of the input which means there would be a certain amount of duplication between each other. This strategy, which is quite similar to the one between decision tree and random forest, has the advantage that it can capture most of the local features in the given sample [11]. Each segment can be formulated as:

$$x_i = P_i X, \quad P_i \in R^{n \times L} \qquad (2)$$

$P_i$ is a binary matrix. Hence the proposed method can be formulated as:

$$\min_{D, s_i} \sum_{i=1}^{m} \| P_i X - D s_i \|_2^2 + \lambda \| s_i \|_0, \quad \lambda > 0 \qquad (3)$$

After solving the above problem, a dictionary D with atoms contain all of the features will be obtained.

Since the dictionary matrix contains the features of signals, it has similar mathematical forms with Independent Component Analysis (ICA), which the signals can be represented by the linear combination of independent components. Compared with ICA, dictionary learning has allowed the dimensionality of atoms to be higher than the number of EEG channels. This property leads to adding redundant information to the dictionary, in this case, which mainly is the clean EEG but also provides an improvement in sparsity and precision of the signal features representation. To improve the result of dictionary learning, we modify the dimension of the dictionary and sort the atoms we learned through atoms classification and rearrangement. For the learned redundant dictionary matrix D, principal component analysis (PCA) is first applied to reduce the dimensionality and figure out the number k of the first principal components.

<figure><img src="image_2.png" /><figcaption>**Fig. 2.1.** The single values of PCA. In this situation, the first 3 single values mainly describe the features of dictionary.</figcaption></figure>

The space spanned by the first k principal components is considered to capture the most important characteristics of the original signal that mainly depend on BCG artifacts. For the reduced dictionary atoms, k-means clustering algorithm is applied to classified BCG atoms and EEG atoms. The clustering result can be plotted to 3D-space spanned by the first 3 principal components, as shown on Fig. 2.2.
<figure><img src="image_3.png" /><figcaption>**Fig. 2.2.** Atom clustering of dictionary atoms learned from synthetic data. Red dots are BCG artifacts atoms; gray dots are EEG atoms.</figcaption></figure>

After identifying the atoms which describe the features of the BCG, we return BCG atoms to zero to avoid returning artifact information. Therefore, the dictionary would have a better description of clean EEG signal.

<figure><img src="image_4.png" /><figcaption>**Fig. 2.3.** Schematic diagram for dictionary atom selection and rearrangement. The green atoms in the dictionary are clean EEG atoms. The grey atoms are BCG atoms. White girds in sparse code matrix are 0.</figcaption></figure>

# 3 Experiment

In this section, we divide the experimental results into two parts: synthetic and real data. The performance of AAS, OBS, ICA and dictionary learning was evaluated by experiments on these two data types, which proved the superiority of the proposed method.

## 3.1 Data Acquisition

### 1) Synthetic Data
The synthetic EEG data used in this paper was proposed by Vahid abolghasemi et al in 2015 [11]. The synthesized signal consists of two parts: 1/f noise (also known as pink noise) and BCG artifact. For the non-uniform characteristics of EEG signal, 1/f noise is selected as EEG signal [17], while the synthesized BCG artifact is overlapped by cosine waves of different frequencies and amplitudes. For the final synthesized signal, 10dB white Gaussian noise is added, and these signals and their synthesized signals are shown in Figure 3.1.

<figure><img src="image_5.png" /><figcaption>Fig. 3.1. Synthetic data: (a) BCG; (b) EEG (1/f noise); (c) Summation of a and b; (d) Summation of a and b. The SNR is 10 dB.</figcaption></figure>

It can be seen from Figure 3.1 that as the 1/f noise of EEG signal, its amplitude is significantly smaller than that of simulated BCG signal. In fact, the EEG signal of synchronous acquisition of EEG and fMRI obtained from actual acquisition is the same.

## 2) Public Data

The experimental data is provided by FMRIB research center of Oxford University. The test data (FMRIB_Data.set) downloaded from the open-source EEG signal processing website includes EEG signal, BCG artifact, gradient artifact and other noises [6].

## 3) Clinical Data

The experimental data were provided by the sleep neuroimaging center of Southwest University. Two healthy subjects with no history of nerve or heart disease participated in the experiment. Indicates that the object rests in the scanner with the eyes open and closed, without performing any specific tasks. Among the 32 channels recorded, 30 EEG channels used 10-20 international system. In addition, there are two bipolar channels for EMG and ECG. The data sampling rate is 5000Hz.

## 3.2 Data Preprocessing

The premise of effectively suppressing BCG artifacts is that there are no gradient artifacts that seriously distort EEG signals in EEG signals, so it is necessary to preprocess the collected EEG data first.
Matlab (2017b; MathWorks, Inc., Natick, MA) and eeglab 12.0 (Delorme and makeig, 2004) were used to preprocess the EEG data. Firstly, the FMRIB 2.1 plug-in in EEGLAB [18] is used to remove the gradient artifact in EEG data of MRI scan. In order to save memory, we can down sample the data to 250Hz. All EEG data are then bandpass filtered at 0.5-50Hz. The data is finally converted to a 32 channel EEG with sampling frequency of 250 Hz.

## 3.3 Evaluation

Various evaluation indexes are used to determine the ability to inhibit BCG artifacts (more importantly, to retain brain activity), and to compare the experimental results of various methods.

The evaluation is mainly carried out from the following aspects: a) the amplitude changes; b) Power Spectral Density [19]; c) Improvement in Normalized Power Spectral Density Ratio (INPS) [12]; d) Peak-to-peak Value (PPV) [13]. In addition, INPS and PPV can be calculated as follows:

$$ \text{INPS} = \frac{1}{n} \sum_{i=1}^{n} 10 \log_{10} \frac{\sum \phi_{P_{\text{before},i}}(f)}{\sum \phi_{P_{\text{after},i}}(f)} \quad (4) $$

$$ \text{PPV} = \frac{\frac{1}{n} \sum_{i=1}^{n} V_{\text{before},i}}{\frac{1}{n} \sum_{i=1}^{n} V_{\text{after},i}} = \frac{\sum_{i=1}^{n} V_{\text{before},i}}{\sum_{i=1}^{n} V_{\text{after},i}} \quad (5) $$

# 4 Result

Fig. 4.1 gives the results using AAS, OBS and ICA and dictionary learning methods to the synthetic signal.

<figure><img src="image_6.png" /><figcaption>Fig 4.1. Extracted BCG from synthetic data using (a) AAS, (b) OBS, (c) ICA, and (d) the proposed method.</figcaption></figure>

According to the method in section 3.3, the normalized power spectral density (INPS) is 13.16, the peak-to-peak value is 8.44. The values of the two performance evaluation indexes are much higher than 1, indicating that dictionary learning plays an important role in inhibiting BCG artifacts.
Figure 4.2 shows a segment of EEG data with a length of 10s processed by various methods. Visualization results of EEG records before and after BCG artifact correction (AAS, OBS, ICA, proposed) of DATA 3. With the application of BCG removal method, BCG artifact contribution is attenuated, so EEG signal strongly decreases. However, it is obvious that the BCG residuals significantly decreased when using the proposed method.

<figure><img src="image_7.png" /><figcaption>Fig. 4.2. Result of 10s signal from channel Fp1 (for DATA 3) between the EEG recordings before (RAW) and after BCG artifact correction (ICA, AAS, OBS).</figcaption></figure>

Figure 4.3 shows averaged power spectral density of EEG data using different artifact removal algorithms. It shows that our procedure can effectively reduce the artifacts in different EEG frequency bands without affecting alpha (8-13 Hz) and beta (13-15 Hz in Fig. 4.3) activities.
<figure><img src="image_8.png" /><figcaption>**Fig.4.3.** Averaged power spectral density of channel Fp1 (for DATA 3) using different artifact removal algorithms.</figcaption></figure>

Figure 4.4 and Table 1 compares the performance of AAS, OBS, ICA and the proposed method in terms of INPS ratio. It can be concluded that the proposed method is obviously superior to other methods.

<table><caption>**Table 1.** INPSs for all channels using different artifact removal methods.</caption><thead><tr><th></th><th>DATA 1</th><th>DATA2</th><th>DATA 3</th><th>DATA 4</th><th>DATA 5</th></tr></thead><tbody><tr><td>Dictionary Learning</td><td>8.13</td><td>6.68</td><td>12.16</td><td>5.91</td><td>4.23</td></tr><tr><td>ICA</td><td>7.12</td><td>6.21</td><td>9.66</td><td>5.6</td><td>4.76</td></tr><tr><td>AAS</td><td>3.61</td><td>-1.6</td><td>7.16</td><td>3.66</td><td>-0.77</td></tr><tr><td>OBS</td><td>5.78</td><td>2.77</td><td>8.6</td><td>3.83</td><td>1.33</td></tr></tbody></table>

<figure><img src="image_9.png" /><figcaption>**Fig.4.4.** INPS Reduction for all channels using different artifact correction methods versus the EEG data after removing imaging artifacts.</figcaption></figure>
Table 2 compares the peak-to-peak ratio of BCG artifact suppression methods based on AAS, OBS and ICA, and the results prove the advantages of dictionary learning.

<table><caption>**Table 2.** Peak-to-peak value for all channels using different artifact removal methods.</caption><thead><tr><th></th><th>DATA 1</th><th>DATA2</th><th>DATA 3</th><th>DATA 4</th><th>DATA 5</th></tr></thead><tbody><tr><th>Dictionary Learning</th><td>13.40</td><td>9.18</td><td>20.03</td><td>4.22</td><td>3.71</td></tr><tr><th>ICA</th><td>10.74</td><td>9.03</td><td>15.44</td><td>5.57</td><td>3.11</td></tr><tr><th>AAS</th><td>5.57</td><td>1.52</td><td>8.72</td><td>2.08</td><td>1.30</td></tr><tr><th>OBS</th><td>6.15</td><td>2.63</td><td>11.16</td><td>2.69</td><td>1.52</td></tr></tbody></table>

TABLE 3 is the averaged INPS and peak-to-peak ratio using different method. It is obvious that the performance indexes of dictionary-based learning methods are allmost higher than those of ICA, AAS and OBS methods, except DATA 3, so it can be considered that the dictionary-based learning method studied in this paper is more effective in inhibiting BCG artifacts.

<table><caption>**TABLE 3.** Averaged INPS and peak-to-peak ratio.</caption><thead><tr><th></th><th>DATA 1</th><th>DATA2</th><th>DATA 3</th><th>DATA 4</th><th>DATA 5</th></tr></thead><tbody><tr><th>Dictionary Learning</th><td>13.40</td><td>9.18</td><td>20.03</td><td>4.22</td><td>3.71</td></tr><tr><th>ICA</th><td>10.74</td><td>9.03</td><td>15.44</td><td>5.57</td><td>3.11</td></tr><tr><th>AAS</th><td>5.57</td><td>1.52</td><td>8.72</td><td>2.08</td><td>1.30</td></tr><tr><th>OBS</th><td>6.15</td><td>2.63</td><td>11.16</td><td>2.69</td><td>1.52</td></tr></tbody></table>

## 5 Conclusion

In this study, a set of new algorithms based on dictionary learning has been developed to remove BCG artifact from EEG recordings simultaneously acquired with continuous fMRI scanners. This method can reduce the BCG related artifacts in EEG fMRI records without using additional hardware. The validity of this method is verified by the experiments of synthetic data and real data.

It is gratifying that we still have a lot of room for progress. The classification standards still need further study, such as classifying the atoms through mutual information, the features of ECG are considered to sort m atoms with the largest mutual information with the ECG [21]. At present, most of the EEG-fMRI researches are on-line data artifact removal, only a few involve real-time correction. We can consider applying the proposed method to real-time detection and removal of artifacts. One of the limitations of our study is that we did not compare the results with the data recorded outside the MRI. In fact, we can design specific paradigms involving in and out of scanner experiments, so that we can how BCG was considered affecting EEG signals from these recorded data.

**Acknowledgement.** This work was supported by NSFC (61633010,61671193,61602140), National Key Research & Development Project (2017YFE0116800), Key Research & Development Project of Zhejiang Province (2020C04009, 2018C04012).
References

1. Mulert, C., Pogarell, O., & Hegerl, U. Simultaneous EEG-fMRI: Perspectives in Psychiatry. CEN, 39(2), 61-64 (2008). https://doi.org/10.1177/155005940803900207

2. Shams, N., Alain, C., and Strother, S. Comparison of BCG artifact removal methods for evoked responses in simultaneous EEG-fMRI. J. Neurosci. Methods 245, 137-146 (2015)

3. Iannotti G.R., Pittau F., Michel C.M., Vulliemoz S., Grouiller F. Pulse artifact detection in simultaneous EEG-fMRI recording based on EEG map topography. Brain Topography; 28(1):21-32 (2015)

4. Allen, P. J., Polizzi, G., Krakow, K., Fish, D. R. & Lemieux, L. Identification of EEG events in the MR scanner: the problem of pulse artifact and a method for its subtraction. Neuroimage 8(3), 229-239 (1998)

5. C. Bénar, Y. Aghakhani, Y. Wang, et al., Quality of EEG in simultaneous EEG-fMRI for epilepsy, Clin. Neurophysiol. 114 (3), 569-580 (2003)

6. K. Niazy, C.F. Beckmann, G.D. Iannetti, et al., Removal of FMRI environment artifacts from EEG data using optimal basis sets, Neuroimage 28 (3), 720-737 (2005)

7. Kruggel F, Wiggins C J, Herrmann C S, et al. Recording of the event-related potentials during functional MRI at 3.0 Tesla field strength. Magn Reson Med, 44(2): 277-282 (2000)

8. Niazy, R. K., Beckmann, C. F., Iannetti, G. D., Brady, J. M. & Smith, S. M. Removal of FMRI environment artifacts from EEG data using optimal basis sets. Neuroimage 28(3), 720-737 (2005)

9. Li Hu, Zhiguo Zhang: EEG Signal Processing and Feature Extraction. Springer Nature (2019)

10. Ibrahim Sadek, Jit Biswas, Bessam Abdulrazak. Ballistocardiogram signal processing: a review. Health Information Science and Systems, Vol.7 (1), pp.1-23 (2019)

11. Abolghasemi V, Ferdowsi S. EEG-fMRI: Dictionary learning for removal of ballistocardiogram artifact from EEG[J]. Biomedical Signal Processing and Control, 18:186-194 (2015)

12. Ghaderi F, Nazarpour K, Mcwhirter J G, et al. Removal of ballistocardiogram artifacts using the cyclostationary source extraction method. IEEE Transactions on Biomedical Engineering, 57(11): 2667-2676 (2010)

13. Mantini, D., Perrucci, M. G., Cugini, S., Ferretti, A., Romani, G. L., and Del Gratta, C. Complete artifact removal for EEG recorded during continuous fMRI using independent component analysis. Neuroimage 34, 598-607 (2007)

14. Winkler, I., Haufe, S., & Tangermann, M. Automatic classification of artifactual ICA-Components for artifact removal in EEG signals. BBF, 7, Article 30 (2011). https://doi.org/10.1186/1744-9081-7-30

15. Jan C. de Munck, Petra J. van Houdt, Sonia I. Gonçalves, Erwin E. H. van Wegen, Pauly P. W. Ossenblok: Novel artefact removal algorithms for co-registered EEG/fMRI based on selective averaging and subtraction. NeuroImage 64: 407-415 (2013)

16. Quan Y., Xu Y., Sun Y., Huang Y., Ji H. Sparse coding for classification via discrimination ensemble. Proceedings of the Conference on Computer Vision and Pattern Recognition (CVPR), pp. 5839-5847 (2016)

17. Demanuele, C., James, C.J. & Sonuga-Barke, E.J. Behav Brain Funct (2007) 3: 62, https://doi.org/10.1186/1744-9081-3-62

18. The FMRIB Plug-in for EEGLAB, https://fsl.fmrib.ox.ac.uk/eeglab/fmribplugin/

19. O. Dressler, G. Schneider, G. Stockmanns, E. F. Kochs. Awareness and the EEG power spectrum: analysis of frequencies. BJA, Vol 93, pp. 806-809 (2004), https://doi.org/10.1093/bja/aeh270

20. Mairal, Julien, Francis Bach, Jean Ponce, and Guillermo Sapiro. "Online Dictionary Learning for Sparse Coding." Proceedings of the 26th Annual International Conference on Machine Learning - ICML '09 (2009).

21. Liu, Z., de Zwart, J.A., van Gelderen, P., Kuo, L.-W., Duyn, J.: Statistical feature extraction for artifact removal from concurrent fMRI-EEG recordings. Neuroimage, 2073-2087 (2012)

22. M. Aharon, M. Elad, A. Bruckstein, K-SVD: an algorithm for designing overcom-plete dictionaries for sparse representation, IEEE Trans. Signal Process. 54 (11)(2006) 4311-4322.