## 5 Methods
### Independent Component Analysis for Artifact Removal  
The third algorithm we implemented, which was used to separate and remove muscle artifacts from the EEG signals, was independent component analysis. This technique decomposes the EEG recordings into independent components, some of which may be associated with EMG artifacts. Once these artifact-related components have been identified, they are discarded, and the remaining signals are reconstructed to obtain a cleaned EEG signal. ICA is a popular method for cleaning EEG data. Its primary advantage lies in its ability to separate the signal into independent components without the need for artifact indicator channels [22; 23]. As a result, ICA is often used in situations where artifacts cannot easily be modeled through methods requiring artifact indicator channels. The goal of ICA is to decompose the signals recorded by each electrode into independent components, the number of which is specified by the user but typically does not exceed the number of electrodes used in the recording. In principle, among these components are those responsible for noise sources (artifacts such as blinking, muscle tension, ECG interference, etc.). Components containing artifacts are discarded either automatically or by an expert, and the remaining components are recombined via the ICA mixing matrix to yield artifact-free signals. A critical step in the ICA algorithm is whitening, which transforms the data so that they have a unit variance and are mutually uncorrelated. This process simplifies solving the source separation problem by eliminating correlations between components. In practice, it means that before running ICA, the EEG signals are transformed into a form in which their correlation coefficients are zero. Among the assumptions of ICA [3] is that the source signals are statistically independent. This means that the signals representing both noise sources (artifacts) and neuronal activity must be statistically independent so that their statistics (mean, variance, skewness, and kurtosis) are uncorrelated. Additionally, the model allows for at most one normally (Gaussian) distributed source signal [3]. After applying ICA to the recorded signals, one obtains the requested number of independent components, each potentially corresponding to neuronal activity or artifacts. To remove artifacts, one identifies the components responsible for the interference and sets them to zero. The final signal is then reconstructed from the remaining components using the modified mixing matrix. One of ICA's main benefits is that it does not require artifact indicator channels. Unlike regression, ICA does not need predefined artifact indicator electrodes, which can be a significant advantage when artifacts may originate from different locations or multiple indicator electrodes would be required. This method is particularly useful when no suitable indicator electrodes are available or when setting them up would be difficult. Another notable strength of ICA is its effectiveness in separating signal sources. It can effectively isolate components related to artifacts (e.g., blinking, muscle tension, or ECG interference) from those reflecting neuronal activity, allowing the removal of unwanted artifacts without affecting the valuable brain signals. By doing so, ICA reduces the impact of artifacts on subsequent EEG analyses, retaining only clean neural activity. Furthermore, ICA is highly versatile and can be applied to various types of artifacts, including eye movements, muscle tension, ECG, and other interferences. Despite its advantages, ICA has some limitations. One important consideration is the assumption of statistical independence among source signals. While neuronal activity can sometimes correlate with certain artifacts, ICA can still effectively separate overlapping signals if they differ in spatial topography or temporal dynamics. The main challenge in such cases is often not the separation itself, but rather the correct identification and interpretation of the resulting components.