Brain Signal Classification using Genetic Algorithm for Right-Left Motion Pattern

Brain signals or EEG are non-stationary signals and are difficult to analyze visually. The brain signal has five waves alpha, beta, delta, gamma, and theta. The five waves have their frequency to describe the level of attention, alertness, character and external stimuli. The five waves can be used to analyze stimulation patterns when turning left and right. Giving weight to the five brain waves utilizes genetic algorithms to get one signal. Genetic algorithms can be used to find the best signal for classification. In this paper, the EEG signal will be classified to determine the right or left movement pattern. After combining the five brain waves with genetic algorithms is then classified using the Logistic Regression, Linear Discriminant Analysis, KNeighbors Classifier, Decision Tree, Naïve Bayes Gaussian, and Support Vector Machine. From the six methods above that have the highest accuracy is 56% and SVM is a method that has better accuracy than others on this problem. Keywords—Brain wave; EEG; genetic algorithm; classification; left right movement


I. INTRODUCTION
When the body does a job or movement, it basically coordinates with the mind.These conditions, focus on one object without being affected by other things and focus on doing the movement.Knowing someone's focus condition is not easy, one way to find out the condition of one's focus is through information on brain signals or often called an Electroensephalogram (EEG) signal.
EEG is an instrument used to record static electricity activity resulting from stimuli received by the brain.Research on the classification of EEG signals has been carried out, including classification of fatigue levels, identification of EEG signals for sound stimulation, identification of alertness, emotional conditions, attention classification, identification of epilepsy, and other studies classifying EEG signals against imagination of body movements, classification visual stimulation, classification of EEG signals with two mental conditions with an introduction of up to 83%, identification of epilepsy waves, and to recognize movements of artifacts [1][2] [3].
Transforming EEG signals into a model is an effective way of analysis to classify EEG signals.An EEG signal in a person generally consists of wave components which are differentiated based on their frequency region, delta, theta, alpha, beta, and gamma [4][5] [6].In Table 1 it can be seen that Delta waves have a frequency of 0-4 Hz.Delta waves appear when someone is sleeping soundly.Theta waves have a frequency of 4 -8 Hz.Theta waves appear when a person sleeps lightly and is in a happy state.Some recent research links these waves such as rapid eye movements during sleep, and hypnosis.Alfa waves have a frequency of 8-13 Hz.Alpha waves appear when a person relaxes, and eyes are closed.These waves are often used to see normal or abnormal brain functions.Beta waves have a frequency of 13-30 Hz.Beta waves appear when someone is doing activities concerning remembering such conditions as thinking.Gamma waves have a frequency of 30-100 Hz.Gamma waves are related to brain activity to integrate various stimuli [7]- [9].
The EEG signal analysis in this paper will be used to analyze for control an object for right-left movement.EEG analysis uses a genetic algorithm to combine five brain signals.the genetic algorithm is one of the heuristic methods which is a branch of an evolutionary algorithm, which is a technique for solving complex optimization problems by imitating the evolutionary process of living things.genetic algorithm proved to be suitable to be used to solve multi-objective problems.genetic algorithm develops along with the rapid development of information technology.This algorithm is widely used in the fields of physics, biology, economics, sociology, and others who often face optimization problems with complex or even difficult mathematical models.by using the genetic algorithm, one brain signal from the five brain signals is obtained.one signal will be used for classification in the next process.

II. METHODS
In this paper, several stages are carried out.These stages can be seen in figure 1.
In Figure 2 it is explained that the method proposed.Where each of the five brain waves signals will be weighted by the genetic algorithm method.The result a signal that will be used for classification.

A. Data
The data is taken using a brain signal reader.The tool is MindWave Mobile Brainwave Starter Kit from NeuroSky.The device can directly read the five brain waves.The use of this tool utilizes Bluetooth technology, and this tool is compatible with operating systems such as Windows, Mac, Android or Linux.The device can be seen in figure 3.
Brainwave data is taken from 10 people where each person is recorded 10 times.5 times the brainwave recording for the condition of the right moves and 5 times the brainwave recording for the condition of the left movement.So the total data captured is 100 data.Recording of brain wave is done when the subject controls the right or left of the remote control car toy and recording is done for one minute.The data took 15 seconds in the middle for the next analysis.Example and visualization of data can be seen at table 2 and figure 4.

B. Preprocessing
At this stage, the data will be normalized using the minmax method.This normalization is done to adjust the signal magnitude.All waves will be mapped with a range between 0 and 1. Min-max normalization calculations are carried out following equation 1.

C. Genetic Alghorithm
A genetic algorithm is a search heuristic that is inspired by Charles Darwin's theory of natural evolution.This algorithm reflects the process of natural selection where the fittest individuals are selected for reproduction to produce offspring of the next generation.
The process of natural selection starts with the selection of fittest individuals from a population.They produce offspring which inherit the characteristics of the parents and will be added to the next generation.If parents have better fitness, their offspring will be better than parents and have a better chance of surviving.This process keeps on iterating, and at the end, a generation with the fittest individuals will be found [10].
This notion can be applied to a search problem.We consider a set of solutions for a problem and select the set of best ones out of them.Five phases are considered in a genetic algorithm is the initial population, fitness function, selection, crossover, and mutation.www.ijacsa.thesai.org The initial population is processed begins with a set of individuals which is called a Population.Each is a solution to the problem you want to solve.On this EEG problem at equation 2, it is known that y is the new value of combining five signals and x is the signal captured by the reader.while w is the weight sought for each type of wave where the sum of w must be 1 like equation 3.In the process of the genetic algorithm we will find the best w weights to be multiplied by each of the types of waves that have been taken on average to determine that weight [10], [11]. = 1.ℎ() + 2.() + 3.() + 4.() + 5.ℎ() (2) An individual is characterized by a set of parameters (variables) known as Genes.Genes are joined into a string to form a Chromosome (solution).In a genetic algorithm, the set of genes of an individual is represented using a string, regarding an alphabet.Usually, binary values are used (string of 1s and 0s).We say that we encode the genes in a chromosome [10].

The fitness function determines how to fit an individual is (the ability of an individual to compete with other individuals).
It gives a fitness score to each.The probability that an individual will be selected for reproduction is based on its fitness score [12].
The idea of the selection phase is to select the fittest individuals and let them pass their genes to the next generation.Two pairs of individuals (parents) are selected based on their fitness scores.Individuals with high fitness have more chance to be selected for reproduction [12].
Crossover is the most significant phase in a genetic algorithm.For each pair of parents to be mated, a crossover point is chosen at random from within the genes.Offspring are created by exchanging the genes of parents among themselves until the crossover point is reached.The new offspring are added to the population [11].
In particular new offspring formed, some of their genes can be subjected to a mutation with a low random probability.This implies that some of the bits in the bit string can be flipped.The mutation occurs to maintain diversity within the population and prevent premature convergence [10].
The algorithm terminates if the population has converged (does not produce offspring which are significantly different from the previous generation).Then it is said that the genetic algorithm has provided a set of solutions to our problem [10].

D. Classification
From the process of genetic algorithm each data produces a signal that can be classified.In this paper uses six classification methods to get the best classification.

• Logistic Regression (LR)
In the statistical model with two categories, with response variables contain elements of "success" or "failure".This binary data is the simplest form of data category.The most frequently used model for data two the category is binary logistic regression [13].
Logistic Regression (LR) is used to measure the functional relationship between one dependent variable from a qualitative type of dichotomous with independent variables of type quantitative and qualitative.It is somewhat similar to multiple linear regression.It is usually appropriate for models where dependent variables are of the qualitative type of dichotomous.Model parameters are estimated using the maximum-likelihood method [13].Form a logistic regression model with variables i predictors are as follows equation ( 4) By using a logit transformation from π (x), then the logit function regression model can be defined as following equation (5).
The logit form g(x) is a logit model, a linear function in its parameters, and is within the distance between -∞ to + ∞ depends on variable X.
• Linear Discriminant Analysis (LDA) LDA performs linear analysis has its representation (vectors base) from dimensionless EEG vector space high, depending on the statistical point of view.By projecting an EEG vector into its base vector, representation will be obtained the feature of the wave per unit time [14].
Similarity measurements will then be made between EEG representations with data testing.Representations in this method are considered as a linear transformation from the original EEG vector to in a projection space (base vectors) [14].
• K-Neighbours Classifier (KNN) K-nearest neighbor algorithm is a classification technique a very popular one introduced by Fix and Hodges (1951), which have been proven to be a good simple algorithm.KNN is one method used in classification by using a supervised algorithm (Chan et al. 2010).The purpose of this algorithm is to classify new objects based on the distance of an object to be classified to sample data.Classifier only uses the distance function from new data to training data.K-Nearest Neighbor is to find the closest distance between data will be evaluated with neighbor K closest neighbors in training data.Training data is projected into space many dimensions, where each dimension represent features of data.This space is divided into parts based on the classification of training data.A point in this space is marked class c, if class c is a classification that is most commonly found in neighboring fruit closest to that point [15].Near or far neighbors are usually calculated based on distance Euclidean with the following equation (6).

IV. CONCLUSION
The brain signal has five different frequency waves.The five signals will be combined using Genetic Algorithm into one signal that can be used for classification.The signal classification is intended to determine the pattern of right-left movement thoughts.The results of the classification with the highest accuracy were 56% using the Logistic Regression method.However, the highest average accuracy is owned by SVM with 48%.This research can be further developed by further shortening the time unit in retrieving signals and changing the weight values for each type of wave to have better accuracy.

TABLE III .
TESTING RESULTS