Introduction
Study the electro-physiological relationship between EEG and ECoG, and then develop a model to estimate ECoG signals from EEG signals, in attempt to improve the non-invasive BCI performance. This is also my Master Thesis work.
Master Thesis: Signal Translation between EEG and ECoG to improve non-invasive based BCI performance
An electroencephalography (EEG) / electrocorticography (ECoG) inverse model for the Brain-Computer Interface (BCI) was developed, and the analysis of the signals was simulated in Python environment. The inverse solution, in an attempt to estimate ECoG from EEG, can significantly improve the performance of noninvasive based BCI. NonLinear Principal Component Analysis (NLPCA) is employed to reduce the complexity of computation. Here I used keras to build an autoencoder.
def NLPCA(n_PC):
## Autoencoder (Auto-associative neural network)
# n_PC: number of principle components
# Input placeholder
input_model = Input(shape=(16,))
# 1st to 2nd layer
encoded_1 = Dense(64, activation='tanh', use_bias=True)(input_model)
# 2nd to 3rd layer (PC)
encoded_2 = Dense(n_PC, activation='linear', use_bias=True)(encoded_1)
# 3rd to 4th layer
decoded_1 = Dense(64, activation='tanh', use_bias=True)(encoded_2)
# 4th to 5th layer (Output)
decoded_2 = Dense(16, activation='linear', use_bias=True)(decoded_1)
# Create a separate model: autoencoder, encoder, and decoder
autoencoder = Model(input_model, decoded_2)
# encoder
encoder = Model(input_model, encoded_2)
# decoder
encoded_input = Input(shape=(n_PC,))
decoder_layer_1 = autoencoder.layers[-2]
decoder_layer_2 = autoencoder.layers[-1]
decoded_output = decoder_layer_1(encoded_input)
decoded_output = decoder_layer_2(decoded_output)
decoder = Model(encoded_input, decoded_output)
# Configure the model using mean_squared_error loss and Stochastic gradient descent optimizer
autoencoder.compile(optimizer='Adamax', loss='mean_squared_error', metrics=['accuracy'])
# Train the model using the training data
history = autoencoder.fit(ECoG_Data_Train.T, ECoG_Data_Train.T,
epochs=1000,
batch_size=1000,
shuffle=True,
validation_data=(ECoG_Data_Test.T, ECoG_Data_Test.T)).history
# Save the model
autoencoder.save('Autoencoder_' + EEGchannel_name + '.h5')
encoder.save('DimReduction_' + EEGchannel_name + '.h5')
decoder.save('invDimReduction_' + EEGchannel_name + '.h5')
with open('trainHistoryDict_NLPCA_' + EEGchannel_name, 'wb') as file_pi:
pickle.dump(history, file_pi)
Forward model is then derived from the electro-physiological perspective to capture the dynamic of the signals. To represent nonlinear approximations, a Neuro-Bond-Graph (NBG) approach is introduced to model both the system dynamics and the nonlinearity with a Sparse Recurrent Neural Network in a more efficient way.
Inverse solution is then established based on forward model architecture integrating with the de-mapping part of NLPCA. The simulation results are demonstrated by the comparison between original signals and reconstructed signals from our model. More details can be referred to my Master Thesis.