# Detection of Movement and Lead-Popping Artifacts in Polysomnography EEG Data
## 6 Discussion  
PSG EEG artifacts are unavoidable. Although some PSG EEG artifacts are detected by sleep technicians, additional artifacts are likely, despite technicians' best efforts. Not only is manual inspection of a large number of PSG studies not feasible [16], but manual artifact annotation can be inconsistent among technicians [3]. Automated methods for EEG artifact removal can be categorized into artifact minimization and artifact identification methods [3]. Not all published works explicitly state which of these two categories the proposed method falls into. This matters because artifact minimization tries to remove contaminated signals in EEG but not epochs where contamination is present. On the other hand, artifact identification methods usually designate epochs as artifacts and subsequently eliminate those epochs entirely from further consideration in the downstream analysis. Methods for artifact minimization include those proposed in [4; 5; 10; 11; 20; 21; 22]. A notable method for artifact minimization is the ICA method [4; 5], which assumes that intrinsic EEG signals and artifacts are independent components of the data signal [3]; however, if a channel is an outlier channel, i.e., with an excessive number of epochs containing artifacts, including such a channel in the ICA analysis can be problematic. Thus, it is important that channels with excessive outliers be identified first and removed before applying ICA. A limited number of artifact identification and immunization methods for PSG EEG data have been reported [8; 9; 10; 12; 13]; however, those methods largely focus on identifying contaminated epochs but not on identifying artifactual EEG channels. In this study, we developed a correlation-based approach for outlier detection. Our method is different from the existing methods in several ways. First, our method can be applied uniformly to the entire overnight sleep period or separately to NREM and REM sleep periods using sleep-period-specific local and global cutoffs. Secondly, our method uses an iterative procedure to identify and remove channels with excessive outliers to obtain an accurate representation of the channel-specific correlations with other channels. Thirdly, our streamlined method applies the same iterative procedure to all channels to identify artifacts, unlike some of the existing methods that use different procedures for different channels and different types of artifacts. Lastly, our method identifies potential outliers ranging in duration from seconds to minutes, channel by channel. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Local 1** & **Global 2** & \multicolumn{4}{c}{**Confusion Matrix**} & \multirow{2}{*}{**Kappa**} & **Accuracy** \\
**Threshold** & **Threshold** & **TP** & **FP** & **FN** & **TN** & **(\%)** \\ \hline
2/3 & 1/2 & 11,259 & 4198 & 1700 & 29,265 & 0.702 & 87.3 \\  & 1/4 & 11,216 & 4198 & 1743 & 29,265 & 0.699 & 87.2 \\  & 1/2 & 11,112 & 3751 & 1847 & 29,712 & 0.713 & 87.9 \\  (default) & 1/4 (default) & 10,343 & 3019 & 2616 & 30,444 & 0.701 & 87.9 \\ \hline \hline \end{tabular}  
* TP: true positive; FP: false positive; FN: false negative; TN: true negative. 1 Local threshold is set at the stated fraction of the median of the average correlation for all segments in the window for the channel. 2 Global threshold is set at the stated fraction of the 75 th percentile of all average correlations in the “good” segment pool for that channel.  
\end{table} 
Table 1: Comparative performance in identification of outlying segments between annotation by an expert and the use of the proposed algorithm with different thresholds. Our idea is similar to that of the FASTER algorithm [17], which was designed for high-density routine EEGs. We took a similar approach by computing the correlation in the EEG spectra between two channels at each time stamp but not the correlation between one channel and another channel across time.