## Materials and Methods
### Neural Networks and Data Classification  
This set-up should later be able to be used for machine learning applications. Those applications can cover, but are not limited to, the classification of gait phases, the detection of gait events, and the detection of gait disorders based on EEG data. To show the principle applicability, we chose the following classification problem as a proof of concept: the network should classify gait phases of single and double support times, i.e., time intervals where only the left or the right foot is on the ground (single support) or both (double support). As the EEG data were highly patient-specific, we trained a neural network for each patient separately. The networks were trained using Mathworks MATLAB(r) R2019b, Deep Learning Toolbox. We used the fused data from the EEG and pressure plate, preprocessed as described above using EEGLab. The channel data of C3, C4, CP1, and CP2 were selected as input (cf. above). The events of the pressure plate were used as labels, leading to the three classes:  
* class 1: left single support
* class 2: right single support
* class 3: double support  
A total of approx. 1250 IC events were contained in each sequence. A sliding window of 1100 samples was moved over the whole EEG data with an increment of 10 samples. The size of the window resembled the duration of one gait cycle. In order to split data into disjoint training, validation, and test data, the data were split into multiple segments prior to sliding the window. Each window had a size of 10 * window size (11,000 samples). Afterwards, those segments were randomly assigned to training (70%), validation (10%), and test sets (20%). All windows were randomly shuffled before the training of each epoch.  
We chose a recurrent deep learning approach because this end-to-end learning strategy requires no manual feature extraction step, which itself is a separate optimization problem. A simple but effective network architecture based on long short-term memory cells (LSTMs) [24] was chosen, which is often applied to time sequence classification and regression problems in many different areas [28; 29; 30]. This approach was chosen to resemble the time dependency of the EEG data, which provide important information for the classification of each sequence.  
We chose the following layer architecture of the network:  
1. Input layer of size \(2\times 1100\) (according to the number of EEG channels and window size)
2. LSTM layer with 10 LSTM units (returning whole sequence)
3. LSTM layer with 10 LSTM units (returning only the last value of the sequence)
4. Dense layer with 64 neurons
5. Dense layer with three neurons (according to the number of classes)
6. Softmax layer
7. Classification layer  
Each layer was followed by a dropout layer with dropout probability of 0.2. Training was done using a maximum of 30 epochs and a mini-batch size of 1000. As an optimizer, Adam (adaptive moment estimation) was used and a learning rate of 0.01.  
An LSTM network has multiple hyper parameters, which can be optimized based on the dataset. We empirically chose the abovementioned hyper parameters. However, they may be systematically optimized with different approaches, like grid search or random search, in further work.