Hand Gesture recognition and classification by Discriminant and Principal Component Analysis using Machine Learning techniques

This paper deals with the recognition of different hand gestures through machine learning approaches and principal component analysis. A Bio-Medical signal amplifier is built after doing a software simulation with the help of NI Multisim. At first a couple of surface electrodes are used to obtain the Electro-Myo-Gram (EMG) signals from the hands. These signals from the surface electrodes have to be amplified with the help of the Bio-Medical Signal amplifier. The BioMedical Signal amplifier used is basically an Instrumentation amplifier made with the help of IC AD 620.The output from the Instrumentation amplifier is then filtered with the help of a suitable Band-Pass Filter. The output from the Band Pass filter is then fed to an Analog to Digital Converter (ADC) which in this case is the NI USB 6008.The data from the ADC is then fed into a suitable algorithm which helps in recognition of the different hand gestures. The algorithm analysis is done in MATLAB. The results shown in this paper show a close to One-hundred per cent (100%) classification result for three given hand gestures. Keywords-Surface EMG; Bio-medical; Principal Component Analysis; Discriminant Analysis.


INTRODUCTION
Machine Learning is a branch of artificial intelligence, it is a scientific discipline that is concerned with the development of algorithms that take as input empirical data from sensors or databases, and yield patterns or predictions thought to be features of the underlying mechanism that generated the data.A major focus of machine learning research is the design of algorithms that recognize complex patterns and make intelligent decisions based on input data.[1] Principal component analysis (PCA) is a mathematical procedure that uses an orthogonal transformation to convert a set of observations of possibly correlated variables into a set of values of linearly uncorrelated variables called principal components.The number of principal components is less than or equal to the number of original variables.

Gesture
recognition is a topic in computer science and language technology with the goal of interpreting human gestures via mathematical algorithms.Gesture recognition can be seen as a way for computers to begin to understand human body language, thus building a richer bridge between machines and humans.Gestures can originate from any bodily motion or state but commonly originate from the face or hand.[2] Raheja used PCA as a tool for real-time robot control.PCA is assumed to be a faster method for classification as it does not necessarily require a training database.[3] Huang also used PCA for dimensionality reduction and Support Vector Machines (SVM) for gesture classification.[4] Morimoto also used PCA and maxima methods.[5] Gastaldi used PCA for image compression and then used Hidden Markov Models (HMM) for gesture recognition.[6] Zaki also used PCA and HMM for his gesture recognition approaches.[7] Hyun also adopted a similar technique using PCA and HMM for his gesture classification and recognition methods.[8] In this paper we use Machine Learning approaches and Principal Component Analysis for Hand Gesture Recognition.

II. HARDWARE PLATFORM
The biomedical circuit simulation is done using NI MULTISIM.The circuit required for this is actually an Instrumentation Amplifier which can provide a gain of 1000.This high gain is required to convert the Electro-Myo-Gram signals which are in microvolts (µV) to signals in the millivolts (mV) range, so as to be able to analyze them in future.An instrumentation amplifier is a type of differential amplifier that has been outfitted with input buffers, which eliminate the need for input impedance matching and thus make the amplifier particularly suitable for use in measurement and test equipment.
The gain of the Instrumentation Amplifier in Fig. 1 is given below:-  The simulated results show that a gain of 1000 is realised by the circuit using suitable resistor values and the input signal gets amplified.The output of the amplifier was then connected to a Band-pass filter of frequency 10-500Hz.In this way only the useful EMG signals in that specified range was preserved and all the remaining noise was filtered out.After the simulation was done, the circuit was implemented hands-on with the required electronic components and soldered on to a Vero board.After the circuit was implemented it was hooked up to a NI USB-6008 Analog to Digital Convertor (ADC) for converting the Analog signals to its digital form.
The ADC was then in turn connected to a computer through a USB cable, for logging the live EMG data into the computer.www.ijarai.thesai.orgThe main idea is to acquire the live EMG signals from the forearm muscles of hands.[9][10] For that surface electrodes are placed suitably on two positions of the hand, so that the required data can be obtained and later used for detecting various hand gestures.[11] The electrode sites are preprocessed by drying them with some abrasive skin creams so as to reduce the skin-electrode impedance and increase the conduction.[12] [13] The steps that are followed during the process are given below:-

A. Signal Acquisition
The first step of the process is Signal Acquisition.At first the live analog EMG signals are converted to digital signals and are fed into the MATLAB workspace using the DAQ toolbox in MATLAB.The NI-USB 6008[14] is properly configured and its channels are set-up to receive the data from the output of the amplifier and filter circuit.After this the required Sampling rate of data acquisition and also the number of samples to be acquired at a time are set.Finally a continuous loop is set-up to start the data acquisition process.After the data is acquired, it is stored in the MATLAB workspace.

B. Normalization
In statistics and applications of statistics, normalization can have a range of meanings.In the simplest cases, normalization of ratings means adjusting values measured on different scales to a notionally common scale, often prior to averaging.In more complicated cases, normalization may refer to more sophisticated adjustments where the intention is to bring the entire probability distributions of adjusted values into alignment.
In this paper the acquired EMG signals are adjusted to a specific given scale on the time axis.This process basically helps the machine in detecting each and every signal clearly and properly as they are from the same scale on the time axis.This particular adjustment i.e. normalization is done by the software itself by developing a code for normalization.The reference value used for Normalization in this work is 1000.
The normalized signals of the three hand gestures are given as follows:-

C. Feature Extraction
In gesture recognition, feature extraction is a special form of dimensionality reduction.This also helps to extract important information from the EMG signals.When the input data to an algorithm is too large to be processed and it is suspected to be redundant, then the input data will be transformed into a reduced representation set of features.www.ijarai.thesai.orgTransforming the input data into the set of features is called feature extraction.The process of feature extraction helps the machine to learn the algorithm quickly instead of just training the machine with bulky raw data which would have made it computationally expensive.
The Feature extracted in this work is the Power Spectral Density (PSD) of the EMG signals.PSD is an example of the Joint Time-Frequency domain feature and effectively captures the most important features needed to be selected from the raw EMG data in order to perform accurate gesture classification.The concept of using the Short Time Fourier Transforms of the signal is followed to achieve this process.

D. Principal Component Analysis
Principal component analysis (PCA) is a mathematical procedure that uses an orthogonal transformation to convert a set of observations of possibly correlated variables into a set of values of linearly uncorrelated variables called principal components.The number of principal components is less than or equal to the number of original variables.This transformation is defined in such a way that the first principal component has the largest possible variance, and each succeeding component in turn has the highest variance possible under the constraint that it be orthogonal to the preceding components.
In this work, PCA is used as a statistical tool to perform the Unsupervised Learning and develop the algorithm.The developed algorithm is then tested on the feature data, i.e., the PSD of the EMG signals.As a result, not only the dimension of the original data is reduced further, but also we are able to form distinct and different clusters in the data, which helps us subsequently in performing the classification using discriminant analysis tools.

E. Clustering
Clustering can be considered the most important unsupervised learning problem; so, as every other problem of this kind, it deals with finding a structure in a collection of unlabeled data.A cluster is a collection of objects which are "similar" between them and are "dissimilar" to the objects belonging to other groups or classes.
We can show this with a simple graphical example:  This step is used just as the preceding step to develop the algorithm for Supervised learning.We provide nomenclature (or labels) for this unlabelled data and perform discriminant analysis on it to test the accuracy and learning outcomes as well as the efficiency of the system.

IV. RESULTS AND DISCUSSION
Ten sets of data are selected as features for each of the three hand gestures.We employ a scheme of Naïve Bayes' classifiers in this work to test our goal.For this the diagquadratic discriminant function is chosen as the adopted mechanism.
Label 1 is chosen for the Palm grasp, label 2 for the Palm up-down and label 3 for the Palm rotation gesture.One important step to be kept in mind while implementing the supervised learning algorithm is that we need to subtract the column means of the extracted PSD feature matrix from the normalized raw EMG data.This step is essential and important because a similar technique was adopted previously by the PCA algorithm when we implemented it on the PSD feature matrix to compute its result.
After this step features matrix is computed by matrix manipulation methods and is selected as the samples matrix for the algorithm.Finally, in the discriminant analysis step a comparison is made between the newly developed features www.ijarai.thesai.orgmatrix as samples and the original result matrix of the PCA algorithm as the training set.
After testing the algorithm, the test results are as follows:-Palm grasp result:- 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 Palm rotation Result:- In this way a generalized way of testing both the training data and any new datasets of hand gestures is formulated and documented.
V. CONCLUSION There are several points to be kept in mind for this work.For example, muscle fatigue is a very important issue to be looked at.Sufficient rest should be provided to the subject, so as to ensure proper recording of the EMG signals.Also the classification results will vary from person to person, as there is considerable difference in the profile of the EMG signals from one person to another.In summary, this paper presents a study of multi-class classification of different hand gestures by both Supervised and Unsupervised Machine Learning techniques.Normalization and proper Feature Extraction from the raw EMG data plays a considerable role in getting accurate results.Principal Component Analysis and Discriminant Analysis are the main tools used to achieve the desired results.Future work will be to control an embedded robot based on the classified hand-gestures, so as to build a prototype of a gesture-controlled robot based on EMG signals.Another interesting work can be to control a future robotic arm using the classified EMG signals, which can be used for external prosthesis.

Figure 1 .
Figure 1.Basic diagram of an Instrumentation amplifier

Figure 2 .
Figure 2. The simulated design of the Instrumentation Amplifier and filter The response of the circuit is seen in a Virtual Oscilloscope, in the NI Multisim environment.

Figure 3 .
Figure 3.The simulated amplifier output

Figure 4 .Figure 5 .
Figure 4. Lower cut-off frequency of Band-Pass filter at 10Hz

Figure 6 .
Figure 6.The implemented electronic circuit III.EXPERIMENTAL EVALUATION The algorithm of this work is developed using the MATLAB software.MATLAB (Matrix Laboratory) is a numerical computing environment and fourth-generation programming language.Developed by Math Works Inc., MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages.

Figure 13 .
Figure 13.Normalized signal for Palm Grasp

Figure 16 .
Figure 16.General picture of clustering

Figure 17 .
Figure 17.Clustering of the data from different hand gestures Close to 100% classification accuracy is obtained, with the exception of just one Palm rotation being wrongly classified as a Palm grasp.