Analyzing Electroencephalograms Using Cloud Computing Techniques Kathleen Ericson Shrideep Pallickara Charles W. Anderson Colorado State University December 1, 2010 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Outline 1 Background BCI Gathering EEG Artificial Neural Networks 2 Benefits of the cloud 3 Approach 4 Frameworks 5 Network Setup 6 Results Basic Tests Granules Stress Tests 7 Conclusions and Future Work CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 2/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work BCI Gathering EEG Artificial Neural Networks Outline 1 Background BCI Gathering EEG Artificial Neural Networks 2 Benefits of the cloud 3 Approach 4 Frameworks 5 Network Setup 6 Results Basic Tests Granules Stress Tests 7 Conclusions and Future Work CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 3/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work BCI Gathering EEG Artificial Neural Networks Brain Computer Interfaces (BCIs) Allows users who have lost voluntary motor control to interact with a computer BCIs work by analyzing electroencephelograms (EEGs) to interpret the users intent EEG signals are gathered in a non-invasive method Typing interface (Doug Hains, Elliott Forney) Weelchair (Millan) CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 4/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work BCI Gathering EEG Artificial Neural Networks Gathering EEG data Non–invasive methods User wears a cap which holds electrodes to the scalp Electrode placement followed the international 10-20 system of electrode placement CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 5/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work BCI Gathering EEG Artificial Neural Networks Artificial Neural Networks Number of input and output nodes are defined by the data Number of hidden units can vary More hidden units can model more complex data More hidden units take longer to train Weights are added between input and hidden and hidden and output layers 0 1 2 3 CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 6/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Outline 1 Background BCI Gathering EEG Artificial Neural Networks 2 Benefits of the cloud 3 Approach 4 Frameworks 5 Network Setup 6 Results Basic Tests Granules Stress Tests 7 Conclusions and Future Work CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 7/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Benefits of the cloud Current BCI applications are limited All computation happens with the user Mobile BCI applications (such as a wheelchair) are tied to a laptop CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 8/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Benefits of the cloud Current BCI applications are limited All computation happens with the user Mobile BCI applications (such as a wheelchair) are tied to a laptop A single user is classified by a single machine A dedicated machine for a single user is under–utilized CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 8/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Benefits of the cloud Current BCI applications are limited All computation happens with the user Mobile BCI applications (such as a wheelchair) are tied to a laptop A single user is classified by a single machine A dedicated machine for a single user is under–utilized Computing capabilities are limited NN complexity is limited by what can be trained on a laptop CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 8/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Benefits of the cloud Multiple users can access the same cloud Aggregation of data More data leads to better trained neural networks Cloud servers are separate from the users Users not limited to the computational power of laptops Possibility for massive scaling Thousands of users can be supported simultaneously Complex pipelines for classification can be developed Computations can be chained through MapReduce or graph-based paradigms CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 9/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Outline 1 Background BCI Gathering EEG Artificial Neural Networks 2 Benefits of the cloud 3 Approach 4 Frameworks 5 Network Setup 6 Results Basic Tests Granules Stress Tests 7 Conclusions and Future Work CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 10/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Approach R backend Optimized for matrix multiplication Existing code available for EEG manipulation, as well as neural network code CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 11/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Approach R backend Optimized for matrix multiplication Existing code available for EEG manipulation, as well as neural network code Group of experts approach Fits the map reduce framework – mappers classify, reducer produces expert opinion CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 11/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Approach R backend Optimized for matrix multiplication Existing code available for EEG manipulation, as well as neural network code Group of experts approach Fits the map reduce framework – mappers classify, reducer produces expert opinion 3 sets of experiments: Baseline times in R Cloud communication overhead with Snowfall Cloud and bridge communication overhead with Granules and JRI CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 11/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Outline 1 Background BCI Gathering EEG Artificial Neural Networks 2 Benefits of the cloud 3 Approach 4 Frameworks 5 Network Setup 6 Results Basic Tests Granules Stress Tests 7 Conclusions and Future Work CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 12/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Frameworks Used Snowfall Parallel computing package for R Builds on the Snow package Executes sequential code on multiple machines simultaneously Does not require strong parallel computing background CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 13/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Frameworks Used Snowfall Parallel computing package for R Builds on the Snow package Executes sequential code on multiple machines simultaneously Does not require strong parallel computing background Granules Lightweight cloud computing runtime Java based Allows user to specify run semantics – can enter a dormant state while waiting for more data to become available CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 13/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Frameworks Used Snowfall Parallel computing package for R Builds on the Snow package Executes sequential code on multiple machines simultaneously Does not require strong parallel computing background Granules Lightweight cloud computing runtime Java based Allows user to specify run semantics – can enter a dormant state while waiting for more data to become available JRI Java R Interface Allows R computations to be run through Java Communication is string–based CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 13/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Outline 1 Background BCI Gathering EEG Artificial Neural Networks 2 Benefits of the cloud 3 Approach 4 Frameworks 5 Network Setup 6 Results Basic Tests Granules Stress Tests 7 Conclusions and Future Work CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 14/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Snowfall Network Setup Cloud Input Results Source Nodes CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 15/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Granules Network Setup Mappers Input Resource User CSU – K. Ericson, S. Pallickara, C. W. Anderson Results Reducer Analyzing EEG Using Cloud Computing Techniques 16/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Outline 1 Background BCI Gathering EEG Artificial Neural Networks 2 Benefits of the cloud 3 Approach 4 Frameworks 5 Network Setup 6 Results Basic Tests Granules Stress Tests 7 Conclusions and Future Work CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 17/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Baseline Results Table: Loading a single training set (200MB) in ms Mean(ms) 6581.602 Min(ms) 6439.742 Max(ms) 6822.34 SD(ms) 101.3716 Table: Training a neural network from 1 training set in ms Mean(ms) 194463.7 Min(ms) 192433.3 CSU – K. Ericson, S. Pallickara, C. W. Anderson Max(ms) 197094.9 SD(ms) 1300.87 Analyzing EEG Using Cloud Computing Techniques 18/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Baseline Results Table: Classification times with 1 neural net in ms Stream Time 5s 1s 250ms Mean(ms) 23.0432 5.28194 1.710529 Min(ms) 22.17889 4.909039 1.673937 CSU – K. Ericson, S. Pallickara, C. W. Anderson Max(ms) 23.56791 11.16085 1.926184 SD(ms) 0.4734237 0.8568976 0.03777157 Analyzing EEG Using Cloud Computing Techniques 19/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Snowfall and Granules Training Comparisons NNs Training Sets 1 1 3 1 1 4 3 4 Approach Snowfall Granules Snowfall Granules Snowfall Granules Snowfall Granules Mean(ms) 409860.5 313304.2 462626.2 675968.8 1001631 1933540 988410.4 1964255.0 CSU – K. Ericson, S. Pallickara, C. W. Anderson Min(ms) 403364.3 306402.0 401475.9 610550.0 971224 1782531 964499 1779853 Max(ms) 419965.7 329149.0 483235.9 772679.0 1020680 2057664 1023549 2131574 Analyzing EEG Using Cloud Computing Techniques SD(ms) 4216.875 5141.031 23512.64 52823.21 17743.27 110686.70 17513.37 136452.10 20/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Classification Times Method Snowfall Granules Snowfall Granules Snowfall Granules Stream Time 5s 1s 250ms Mean(ms) 8884.60 141.69 5825.71 93.16 2831.32 87.25 CSU – K. Ericson, S. Pallickara, C. W. Anderson Min(ms) 8797.745 136.42 5815.38 47.51 2830.38 48.57 Max(ms) 9069.47 266.63 5857.98 492.68 2849.83 92.67 SD(ms) 85.82 12.75 10.09 32.13 2.03 4.49 Analyzing EEG Using Cloud Computing Techniques 21/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Maximum Supported Users on a Single Machine CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 22/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Scaling to multiple machines Gathered statistics for classification on 5 and 10 machines Each machine supported 15 users While 17 users per 8-core machine could be supported, the network was swamped with 150 simultaneous users 12MB/s CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 23/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Scaling to multiple machines Gathered statistics for classification on 5 and 10 machines Each machine supported 15 users While 17 users per 8-core machine could be supported, the network was swamped with 150 simultaneous users 12MB/s 1GB/83s CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 23/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Scaling to multiple machines Gathered statistics for classification on 5 and 10 machines Each machine supported 15 users While 17 users per 8-core machine could be supported, the network was swamped with 150 simultaneous users 12MB/s 1GB/83s 1TB/23h CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 23/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Scaling to multiple machines Gathered statistics for classification on 5 and 10 machines Each machine supported 15 users While 17 users per 8-core machine could be supported, the network was swamped with 150 simultaneous users 12MB/s 75 Users 150 Users 1GB/83s Mean(ms) 64.33 69.81 1TB/23h Min(ms) 21.69 22.01 CSU – K. Ericson, S. Pallickara, C. W. Anderson Max(ms) 268.30 352.82 SD(ms) 20.51 22.49 Analyzing EEG Using Cloud Computing Techniques 23/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Stress Histograms – 75 users 10000 0 5000 Frequency 15000 Communications Overheads with 75 Concurrent Users 0 50 100 150 200 250 Classification Times (ms) CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 24/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Basic Tests Granules Stress Tests Stress Histograms – 150 users 30000 20000 0 10000 Frequency 40000 Communications Overheads with 150 Concurrent Users 0 50 100 150 200 250 Classification Times (ms) CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 25/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Outline 1 Background BCI Gathering EEG Artificial Neural Networks 2 Benefits of the cloud 3 Approach 4 Frameworks 5 Network Setup 6 Results Basic Tests Granules Stress Tests 7 Conclusions and Future Work CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 26/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Conclusions Granules is a viable option for real-time EEG classification in the cloud While a pure R implementation can train a network more quickly, there is no native R support for continuous streaming data JRI carries a heavy overhead for communications Compression is needed to scale further With 150 users, we are processing 1GB of EEG signals every 83 seconds At this rate, over 1TB of data is processed in a day CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 27/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Future Work Develop a byte-based Granules Bridge for R Implement an online learning algorithm Implement compression CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 28/29 Background Benefits of the cloud Approach Frameworks Network Setup Results Conclusions and Future Work Questions Questions? ericson@cs.colostate.edu CSU – K. Ericson, S. Pallickara, C. W. Anderson Analyzing EEG Using Cloud Computing Techniques 29/29