A closed-loop deep neural network (DNN) is used to filter the noise from the Delta and Alpha regions of EEG signals. The EEG signals were obtained from 12 subjects using a novel smart 3D printed electrode consisting of a central and a ring electrodes.
- Install the Fir1 library from https://github.com/berndporr/fir1 by running:
sudo add-apt-repository ppa:berndporr/dsp
sudo apt-get install fir1
sudo apt-get install fir1-dev
- Install openCV library by running:
sudo apt install libopencv-dev -y
- Install boost library by running:
sudo apt-get install libboost-all-dev
- And make sure you have
cmakeinstalled.
- Clone this repository:
git clone https://github.com/berndporr/deepNeuronalFilter.git
- Navigate to the folder:
cd Deep_Neuronal_Filter
- execute the shell file:
./run_all_stat.sh
This will create the necessary folders, build the program and the DNF library, and will run the executable. An interactive GUI will appear as below.
- To pre-filter the Inner and Outer signals:
- Use the provided python script
pyFiles/generateFirFilters.pyto generate thepyFiles/forInner.datandpyFiles/forOuter.datfiles before running the program. - In
parameters.hfile make sure thatdoOuterPreFilteranddoInnerPreFilterare defined. - Insert the max length of filter buffers in the
parameters.hfile as the#define maxFilterLengthvariable.
- Use the provided python script
- Delay line for the Outer signal (small Ts in the diagram above):
- In
parameters.hfile make sure thatdoOuterDelayLineis defined - In the same file, use
define outerDelayLineLengthto specify the length of the delay line. - This defines the number of inputs to the DNF.
- In
- Delay the Inner signal (the large T in the diagram):
- In
parameters.hfile make sure thatdoInnerDelayis defined - In the same file, use
define innerDelayLineLengthto specify the duration of the delay - This synchronises the correlation of the signals for optimised learning
- In
- Number of layers and Neurons in DNF:
- In
parameters.huse#define NLAYERS ito set the number of layers toi - Make sure the same number of
#define Ni xare provided to set the number of neuronsxin each layer - In
main.cppchange the lineint nNeurons[NLAYERS]={..., N3, N2, N1};to add or removeNi
- In
- Learning rates:
- The learning rate for updating the weights and biases are defined in the form of Eta.10(power). Use the Eta and power sliders to change the two learning rates.
Use the Esc key on the interactive window to close the program safely and avoid corrupted files.
The output data will be saved in the cppData folder for all subjects.
You can then use the provided python scripts to plot and analyse the final results.
