Difference between revisions of "P300 GUI Guide"

From BCI2000 Wiki
Jump to: navigation, search
Line 83: Line 83:
  
 
MUD is BCI2000’s moniker for the feature weight matrix.  As illustrated in Figure 1, *.mud files appear in the MUD Files Pane, numbered in order of simulation and having the following identifier: ‘''ChS1CAR0DF20RS100SW’'', where ChS1 indicates Channel Set 1, the value following CAR indicates whether a common average reference was used (0 no CAR used, 1 CAR used), the value following DF indicates the decimation factor, value following RS indicates the random sample value, and the final two characters indicate the regression method (SW: SWLDA, LS: least squares, or LG: logistic).
 
MUD is BCI2000’s moniker for the feature weight matrix.  As illustrated in Figure 1, *.mud files appear in the MUD Files Pane, numbered in order of simulation and having the following identifier: ‘''ChS1CAR0DF20RS100SW’'', where ChS1 indicates Channel Set 1, the value following CAR indicates whether a common average reference was used (0 no CAR used, 1 CAR used), the value following DF indicates the decimation factor, value following RS indicates the random sample value, and the final two characters indicate the regression method (SW: SWLDA, LS: least squares, or LG: logistic).
 +
{|
 +
|-valign="top"
 +
|<span style="color: red">[13]</span>||<u>Add *.mud Files Button</u> Use this button to load previously saved *.mud files.  The information for the selected files will appear below the button.
 +
|-
 +
|height=10px|
 +
|-valign="top"
 +
|<span style="color: red">[14]</span>||<u>Clear All *.mud files</u> Button Clears all feature weight (MUD) files currently stored in the GUI (those listed in the Feature Weights Pane).  This does not delete previously saved *.mud or *.prm files.
 +
|-
 +
|height=10px|
 +
|-valign="top"
 +
|<span style="color: red">[15]</span>||<u>File prefix</u> Appends the specified prefix to the feature weight files when saved as a *.mud or *.prm for identification purposes.
 +
|-
 +
|height=10px|
 +
|-valign="top"
 +
|<span style="color: red">[16]</span>||<u>File #’s to Save</u> Used to specify the feature weight files to save according to those currently listed in the Feature Weights Pane.  Multiple values can be entered that must be a subset of the currently listed of the feature weight files.
 +
|-
 +
|height=10px|
 +
|-valign="top"
 +
|<span style="color: red">[17]</span>||<u>Save *.mud Button</u> Generates *.mud files of the selected File #’s to Save in the training data directory.  The file name contains the selected prefix and assigned identifier.  The *.mud files are used solely for the purposes of the GUI to evaluate feature weights generated from prior sessions in the GUI.
 +
|-
 +
|height=10px|
 +
|-valign="top"
 +
|<span style="color: red">[18]</span>||<u>Save *.prm Button</u> Generates *.prm files of the selected File #’s to Save in the training data directory.  The file name contains the selected prefix and assigned identifier.  The *.prm files are BCI2000 parameter file fragments that can be imported into BCI2000 for online testing of the feature weights (see BCI2000 documentation for details).  '''''Important: Only the BCI2000 parameters regarding the MUD weights, channels, and spatial filter are changed when the *.prm fragment is imported into BCI2000, be sure to verify the BCI2000 parameters before conducting an online session!!!'''''
 +
|-
 +
|height=10px|
 +
|}
 +
  
  
  
 +
'''''Test Data Pane'''''
 
{|
 
{|
 
|-valign="top"
 
|-valign="top"
|<span style="color: red">[1]</span>||
+
|<span style="color: red">[19]</span>||<u>Add Test files</u> Button Use this button to load BCI2000 data files for testing of the feature weights.  Multiple groupings of test files can be added for comparison.
 
|-
 
|-
 
|height=10px|
 
|height=10px|
 
|-valign="top"
 
|-valign="top"
 +
|<span style="color: red">[20]</span>||<u>Clear All Test files</u> Button Clears all test files currently stored in the GUI (those listed in the Test Data Pane).  This does not delete the actual data files.
 +
|-
 +
|height=10px|
 +
|-valign="top"
 +
|<span style="color: red">[21]</span>||<u>Apply Weights</u> Use this button to test the classification accuracy of each of the MUD files on each of the test files currently stored in the GUI.  The classification results will appear in the Matlab command window and as figures.
 +
|-
 +
|height=10px|
 +
|}
 +
 +
 +
 +
 +
'''''Status Window'''''
 +
{|
 +
|-valign="top"
 +
|<span style="color: red">[22]</span>||Messages and current status of the GUI are displayed in this window.
 +
|-
 +
|height=10px|
 
|}
 
|}
 +
 +
 +
 +
{|
 +
|-valign="top"
 +
|<span style="color: red">[22]</span>||
 +
|-
 +
|height=10px|
 +
|}
 +
 +
 +
 +
 +
'''Credits:'''
 +
Dean Krusienski
 +
Assistant Professor
 +
Electrical Engineering
 +
University of North Florida
 +
email: deankrusienski@ieee.org

Revision as of 18:59, 14 January 2009

Introduction

The P300 GUI (Graphical User Interface) can be used to train and test a linear classifier for detection of evoked potentials collected with BCI2000[6] and visualize the waveforms and classification results. It is designed for analysis of BCI2000 data collected using the P3Speller or P3AV paradigms. The program generates feature weights derived via various regression techniques. The specifics of the feature space and training routine can be manipulated using the GUI. The feature weights derived by the GUI can be saved and imported into BCI2000 as a parameter file fragment for online testing.

The GUI is capable of performing several functions independently:

  • Classifier Training: generates feature weights from BCI2000 P3Speller or P3AV data files (classifier weights can be saved and imported into BCI2000)
  • Classifier Testing: applies current or previously created feature weights to BCI2000 P3Speller or P3AV data files and compares the results
  • Visualizing evoked potentials from BCI2000 P3Speller or P3AV data files

The details and operation of each of these functions are described subsequently.


Using the GUI

Getting Started

System Requirements

  • MatLab 7 with the Statistics Toolbox and 1 GB of RAM is recommended

To Launch GUI

  1. Open Matlab and select the path containing the P300_GUI code.
    Launch GUI.png
  2. From the Matlab command window, type P300_GUI and press Enter. The P300_GUI control panel will appear.
    Figure 1: The GUI Control Panel[#'s] correspond to subsequent descriptions of function



Training Data Pane

[1] Select Training Data Button Use this button to load BCI2000 data files for training. The information for the selected files will appear below the button.
[2] Regression Method Selects the regression method used to derive feature weights. Select from SWLDA (Stepwise Linear Discriminant Analysis), Ordinary Least Squares Regression, and Logistic Regression.
[3] Resp. Window Used to specify the begin and end time points in milliseconds (ms) following the stimuli collected for the analysis. This automatically converted into samples according to the sampling rate of the data (rounded). Only a single data window can be entered and will be evaluated. Negative values are accepted and begin < end.
[4] % random sample Used to train on a sub-sample of the responses randomly selected from the training data. The default (100%) uses all of the data for training.
[5] Spatial Filter Pull-Down Menu Selects the spatial filter applied to the training data. Select 'RAW & CAR', 'RAW only', or 'CAR only' from the drop-down menu. RAW is no spatial filter applied to the data and CAR is a common average reference filter using all of the channels contained in the data file (not just the channels specified in the GUI channel set!!!). The RAW & CAR option will evaluate both types simultaneously for comparison purposes.
[6] Decimation Frequencies Used to specify the temporal decimation frequency of the data in Hz. Multiple values can be entered for simultaneous evaluation and comparison. Set to the sampling rate for no decimation. The lower the Decimation Frequency, the less original data retained for processing.
[7] Max model features Used to specify the maximum number of features to be kept in the SWLDA model (has no effect on the LG or LS regression options). Only a single value can be entered for evaluation.
[8] Channel Set 1 Used to specify the primary channel set that will be used to create feature weights. The specified channels must be a subset of the channels contained in the training data file.
[9] Channel Set 2 Used to specify a secondary channel set to evaluate simultaneously for comparison purposes. The specified channels must be a subset of the channels contained in the training data file. Can be enabled by clicking the check-box.
[10] Create Spreadsheet enable Used to create a Microsoft Excel spreadsheet that summarizes the classification results. Can be enabled by clicking the check-box. If enabled, a spreadsheet having the same name as the training set will be created in the directory of the training files. The results of the training classification will be located in the worksheet having the same name of the training set within the file. If no training file is used, the spreadsheet will use the name and location of the first test file. The results in the spreadsheet will be overwritten if an analysis is performed again using data from the same training set, therefore the spreadsheet should be manually renamed after analysis is complete to prevent accidental deletion of results.
[11] Generate Weights Use this button to generate the feature weights after properly configuring all of the above parameters. The generated weight file labels will appear in the MUD Files Pane and the classification results will appear in the Matlab command window and as figures.
[12] Create R2 Plots Use this button to visualize the training data. This can be performed independently of the weight generation.



Feature Weights Pane

MUD is BCI2000’s moniker for the feature weight matrix. As illustrated in Figure 1, *.mud files appear in the MUD Files Pane, numbered in order of simulation and having the following identifier: ‘ChS1CAR0DF20RS100SW’, where ChS1 indicates Channel Set 1, the value following CAR indicates whether a common average reference was used (0 no CAR used, 1 CAR used), the value following DF indicates the decimation factor, value following RS indicates the random sample value, and the final two characters indicate the regression method (SW: SWLDA, LS: least squares, or LG: logistic).

[13] Add *.mud Files Button Use this button to load previously saved *.mud files. The information for the selected files will appear below the button.
[14] Clear All *.mud files Button Clears all feature weight (MUD) files currently stored in the GUI (those listed in the Feature Weights Pane). This does not delete previously saved *.mud or *.prm files.
[15] File prefix Appends the specified prefix to the feature weight files when saved as a *.mud or *.prm for identification purposes.
[16] File #’s to Save Used to specify the feature weight files to save according to those currently listed in the Feature Weights Pane. Multiple values can be entered that must be a subset of the currently listed of the feature weight files.
[17] Save *.mud Button Generates *.mud files of the selected File #’s to Save in the training data directory. The file name contains the selected prefix and assigned identifier. The *.mud files are used solely for the purposes of the GUI to evaluate feature weights generated from prior sessions in the GUI.
[18] Save *.prm Button Generates *.prm files of the selected File #’s to Save in the training data directory. The file name contains the selected prefix and assigned identifier. The *.prm files are BCI2000 parameter file fragments that can be imported into BCI2000 for online testing of the feature weights (see BCI2000 documentation for details). Important: Only the BCI2000 parameters regarding the MUD weights, channels, and spatial filter are changed when the *.prm fragment is imported into BCI2000, be sure to verify the BCI2000 parameters before conducting an online session!!!



Test Data Pane

[19] Add Test files Button Use this button to load BCI2000 data files for testing of the feature weights. Multiple groupings of test files can be added for comparison.
[20] Clear All Test files Button Clears all test files currently stored in the GUI (those listed in the Test Data Pane). This does not delete the actual data files.
[21] Apply Weights Use this button to test the classification accuracy of each of the MUD files on each of the test files currently stored in the GUI. The classification results will appear in the Matlab command window and as figures.



Status Window

[22] Messages and current status of the GUI are displayed in this window.


[22]



Credits: Dean Krusienski Assistant Professor Electrical Engineering University of North Florida email: deankrusienski@ieee.org