Common Spatial Patterns Feature Extraction and Support Vector Machine Classification for Motor Imagery with the SecondBrain

Document Type : Original Article


1 Department of Computer Engineering, Babol Noshirvani University of Technology, Babol, Iran

2 Department of Physics, Babol Noshirvani University of Technology, Babol, Iran


Recently, a large set of electroencephalography (EEG) data is being generated by several high-quality labs worldwide and is free to be used by all researchers in the world. On the other hand, many neuroscience researchers need these data to study different neural disorders for better diagnosis and evaluating the treatment. However, some format adaptation and pre-processing are necessary before using these available data. In this paper, we introduce the SecondBrain as a new lightweight and simplified module that can easily apply various major analysis on EEG data with common data formats. The characteristics of the SecondBrain shows that it is suitable for everyday usage with medium analyzing power. It is easy to learn and accept many data formats. The SecondBrain module has been developed with Python and has the power to windowing data, whitening transform, independent component analysis (ICA), downloading the public datasets, computing common spatial patterns (CSP) and other useful analysis. The SecondBrain, also, employs a common spatial pattern (CSP) to extract features and classifying the EEG MI-based data through support vector machine (SVM). We achieved a satisfactory result in terms of speed and performance.