Subscribe Now Subscribe Today
Abstract
Fulltext PDF
References

Research Article
VHDL Modeling of EMG Signal Classification using Artificial Neural Network

M.R. Ahsan, M.I. Ibrahimy, O.O. Khalifa and M.H. Ullah
 
ABSTRACT
Electromyography (EMG) signal based research is ongoing for the development of simple, robust, user friendly, efficient interfacing devices/systems. An EMG signal based reliable and efficient hand gesture identification system has been developed for human computer interaction which in turn will increase the quality of life of the disabled or aged people. The acquired and processed EMG signal requires classification before utilizing it in the development of interfacing which is the most difficult part of the development process. A back-propagation neural network with Levenberg-Marquardt training algorithm has been used for the classification of EMG signals. This study presents the neural network based classifier modeling using Hardware Description Language (HDL) for hardware realization. VHDL (Very High Speed Integrated Circuit Hardware Description Language) has been used to model the algorithm implemented into the target device FPGA (Field Programmable Gate Array). The designed model has been synthesized and fitted into Altera’s Stratix III, chipset EP3SE50F780I4L using the Quartus II version 9.1 Web Edition.
Services
Related Articles in ASCI
Similar Articles in this Journal
Search in Google Scholar
View Citation
Report Citation

 
  How to cite this article:

M.R. Ahsan, M.I. Ibrahimy, O.O. Khalifa and M.H. Ullah, 2012. VHDL Modeling of EMG Signal Classification using Artificial Neural Network. Journal of Applied Sciences, 12: 244-253.

DOI: 10.3923/jas.2012.244.253

URL: http://scialert.net/abstract/?doi=jas.2012.244.253

INTRODUCTION

EMG signal is the electrical muscle activity that reflects the physiological behavior of the neuromuscular system upon certain excitation. There are various applications in the field of EMG signals. The signal can be used in detecting neuromuscular disorders (Moghtaderi et al., 2006), operating prosthetic or orthotic limbs; controlling human-computer interfaces and virtual-reality games, developing excise equipment; rehabilitation engineering etc. (Ahsan et al., 2009). In the past couple of decades, development of EMG based control has got the focus in the sense that it will increase the social acceptance of the disabled and aged people by improving their quality of life. However, for developing myoelectric control based interfaces, the most challenging part is the classification of EMG signals according to the requirement of application field. It is due to large variations in EMG signal’s characteristics in terms of age, motor unit patterns, muscles activity, muscle movement styles, skin-fat layer etc. Like other biomedical signals, EMG signals also easily affected by different types of noise that are caused by inherent equipment and environment noise, electromagnetic radiation, motion artifacts and the interaction of different tissues (Reaz et al., 2006). Additionally, sometimes it becomes difficult to extract most significant features from EMG signals which are recorded from residual muscles of an amputee or disabled person. Even more difficulties may be added while resolving a multiclass classification problem (Ahsan et al., 2011a).

Due to the lack of computer facilities and successful classifiers, EMG based device controlling did not see much improvement. In early 90’s, the pattern classification and recognition approach was improved with the help of applying Artificial Neural Network (ANN) classifiers. Extensive research work has been done afterwards keeping ANN as the core processing technique for the analysis. It can be used as classifier in diagnosis system (El-Ramsisi and Khalil, 2007), automatic heart disease detection system (Khorasani et al., 2011), classifying heart beats (Hendel et al., 2010), predicting cardiovascular disease (Fidele et al., 2009; Sekar et al., 2011), predicting neoplasm (Alsaade, 2011) etc. Some other biosignal based applications of ANN can be mentioned here as ECG based cardiac arrhythmia classification (Jadhav et al., 2010), EEG based classification for epilepsy diagnosis (EL-Gohary et al., 2008), EEG based classification to diagnosis subnormal eyes (Guven and Kara, 2006) and mixed signal analysis to find sleep stages (Tagluk et al., 2010). There are many pattern classification techniques available and applicable for EMG signal classification by using the extracted features from signal. Through extensive review, it has already been found that most of the researchers claimed successful utilization of ANN for the processing of biosignals especially in the context of classification (Ahsan et al., 2010). ANNs are particularly useful for complex pattern recognition and classification tasks by simulating the low-level functions of biological neurons. ANNs are capable of learning from examples, able to reproduce random non-linear functions from unknown inputs and have highly paralleled structure which make them especially fit for classifying patterns (Subasi et al., 2006). Considering these properties, many researchers have successfully employed ANN to classify EMG signals using numerous types of extracted features. As for example (Hiraiwa et al., 1989) applied ANN based on Integral Absolute Value (IAV) feature (Naik et al., 2006) applied ANN with Independent Component Analysis (ICA) feature set, different Multi-Layer Perceptron (MLP) based neural network used by (Englehart et al., 1995; Kelly et al., 1990; Ito et al., 1992; Karlik et al., 1994), prominent researcher (Hudgins et al., 1993) have used Hopfield and ART and later FIRNN. Most of the ANN based research works have performed with MLP that consist of one hidden layer and back-propagation learning algorithm. Many of the research work which have been carried out with multichannel EMG signals except the recent work of (Kim et al., 2008). The EMG signals from increased numbers of channels obviously will increase the classification efficiency. Some of the previous studies by Englehart and Hudgins (2003) and Lyman et al. (1977) present that it is advantageous to use multiple channels. It has also found that though the average classification accuracy will increase with increased numbers of channels but a diminishing return may observed after the numbers of channels more than four (Tsenov et al., 2006). Many researchers had chosen multichannel i.e., multi electrode scheme for a specific muscle to perform some specific function. Whereas, some of the researchers interested to consider best and effective features other than using multiple channel EMG signals or array of electrodes or a combination of these strategies (Kim et al., 2008). Placing the electrodes in different muscle sites may facilitate the classification process depending on whether or not additional signal features are utilized for the classification. For the case of EMG amplitude feature based multifunctional controlling, the electrodes are targeted to specific muscles for the elimination of crosstalk and maximizing channel independence (Bu et al., 2003; Fukuda et al., 1999; Tsuji et al., 2000). Another important thing is that the classification accuracy decreases with the increased number of classes. It is very much normal to the decreasing nature of accuracy because the increasing number of output classes will further subdivide the feature space. Therefore, this will certainly reduce the feature space associated with each class. The previous studies show that the classification efficiency decrease with increase in class and vice versa (Naik et al., 2007; Englehart et al., 1995). It has found that different types of ANN structure have been used by many researchers because of its ability to adapt and learn from various arbitrary data to classify EMG signals. Different types of ANN models are composed of many interconnected network elements which can develop internal pattern classification strategies based on a set of training data. The ANN models in work in parallel thus providing higher computational performance than traditional classifiers which function sequentially. The presence of inconsistency in accuracy in most of the above mentioned classification methods is possibly due to the fidelity of collected signals, signal conditioning along with physiological characteristics of the subject etc.

This research work is a continuation of previous work which involved in designing of a back-propagation neural network to classify the pre-processed EMG signals which are obtained for different hand motion (Ahsan et al., 2011b). Seven statistical time and time-frequency based features are extracted from EMG signals which are used as inputs to the neural network. The features includes Moving Average (MAV), RMS (Root Mean Square), VAR (Variance), SD (Standard Deviation), ZC (Zero-crossing), SSC (Slope Sign Change) and WL (Waveform Length). There are a very few contribution of VHDL development can be observed in the area of EMG signal processing and ANN modeling (Bu et al., 2004; Reaz et al., 2011). This study describes the processes of developing a VHDL model of neural network classifier to classify EMG signal. Later on, the VHDL model could be loaded into the physical FPGA chip for intermediate hardware realization.

MATERIALS AND METHOD

Neural network architecture for EMG classification: Back-propagation neural network is based on the generalized form of Widrow-Hoff learning rule to multiple-layer network and nonlinear differentiable transfer function. Here, the input vectors and corresponding target vectors are used to train the neural network until it can approximate a function or associate input vectors with specific output vectors or classify input vectors in an appropriate way based on certain criteria.

Fig. 1: Architecture of artificial neural network

Fig. 2: Neural network input to output architecture

The designed network consists of three-layers: input layer, tan-sigmoid hidden layer and linear output layer. Each layer except input layer has a weight matrix W, a bias vector b and an output vector a. The weight matrices connected to inputs called Input Weights (IW) and weight matrices coming from hidden layer outputs called Layer Weights (LW). Additionally, superscripts are used to denote the source (second index) and the destination (first index) for the various weights and other elements of the network.

The feedforward back-progpagation network architecture has shown in Fig. 1 with seven neurons in input layer, 10 tan-sigmoid neurons in hidden layer and four linear neurons in output layer. Since, there is no specific way to find out the number of hidden neurons, so it has been determined from best classification result by selecting different numbers of neurons. The predefined features were extracted for four types of hand movements from five different EMG signals. Two hunedred and four sets of input feature vectors from four EMG signals and their corresponding target vectors were fed to the network for training purpose. The feature vectors from remaining EMG signal used for testing the performance of network. The input feature vectors were normalized before feeding for the purpose of efficient training of neural network.

Design entry for neural network classifier scheme: The VHDL model for Neural Network classifier has been designed with the guidelines from John Bullinaria’s Step by Step Guide to Implementing a Neural Network in C (http://www.cs.bham.ac.uk/~jxb/NN/nn.html). Figure 2 and 3 are presented the complete structure of ANN and backpropagation, respectively. It is mentioned before that the ANN has 7 (seven) inputs which are MAV, RMS, VAR, SD, ZC, SSC and WL.

According to Fig. 2, the inputs are first multiplied by corresponding weight, bias added with it and finally pass through sigmoid function. As for example, to calculate the neuron value N1 in hidden layer, inputs are first multiplied by WeightIH (W 1). After that the BiasIH (Bias1) is added and stored in SumH (N1). Then the value in SumH (N1) is passes to the Hidden through sigmoid function.

Fig. 3: Neural network architecture for back-propagation

For calculating the output, the Hidden neurons are multiplied by WeightHO (W1) and BiasHO is added with it before storing in SumO. At the end, SumO is send to output terminal through pureling function.

When output is generated, the error is being calculated from the difference between target and output vector as shown in Fig. 3. If the error meets the criteria (MSE<=0.001), then the actual output is produced. However, if the error doesn’t meet the criteria then the error is passed through sigmoid function and MSE function the finally stored into DeltaO. After that DeltaWeightHO has been calculated from DeltaO. This DeltaWeightHO is then summed up with current WeightHO to get updated WeightHO. Similarly, BiasO is being updated from the calculated DeltaBiasO and current BiasO. For updating the weights and biases in between input and hidden layer, DeltaH is calculated with the help of SumDOW where sumDOW is the multiplication of corresponding WeightHO and DeltaO. From DeltaH, the DeltaWeightIH and DeltaBiasIH is estimated and then WeightIH and BiasIH is updated accordingly.

The final VHDL model for ANN has been developed with 3 (three) module and one package. The top entity NeuralNet as shown in Fig. 4 is the main module to manage and control other components of it. The components as a module are Data_buff, net_Train and net_Run (Fig. 5). The first module to read and store data, second module to train the network and last one to classify the data by utilizing the trained network. A modified version of floating point number system is used. In this case each number inside the VHDL code is converted and calculated by splitting two parts (Mantissa and Exponential). A user defined package is also added namely utilitypack which defines the different data structure, saves some constants values of the network architecture and maintains 3 (three) functions namely power, Conv_Exp and tanSigmoid.

Compilation and functional simulation: After designing every VHDL module, it requires to compile separately for getting the better result and for debugging and testing perfection. If any fault found in the designed model, then it requires to modify the architecture and configuration to map the desired function of the module. However, modifying the architecture that contains the component instantiation statements requires recompilation of module which contains the architecture. All the modules for the designed model are compiled for the purpose of testing the Analysis and Synthesis check, Place and Route (Fitter) check Assembler check and Classic Timer Analyzer check by using the Quartus II software. Simulation is the most important part for VHDL based hardware modeling flow. It is also one of the most difficult part, not for the mechanism of the processes but because it needs to evaluate all possible processes and failure modes and also requires to test them carefully.

Fig. 4: Top entity for VHDL model of ANN classifier

Fig. 5: Components of NeuralNet entity

Fig. 6: Compilation summary of ANN based classifier

These may include understanding the required operations of the design, creating set of conditions for testing correct operation and possible modes of failure and finally testing all possibilities. The most systematic and thorough way to test the designed model is to apply all possible inputs or combination of inputs in an ascending binary sequence. The EDA software Quartus II has the facility to create Vector Waveform File (vwf) in the form of graphical waveforms that represents simulation inputs and outputs. To perform functional simulation, in this study, the inputs are given by using .vwf format through designing proper waveform for corresponding process modeling. A simulation summary report is generated after performing the compilation and functional simulation. As an empirical method of design verification, the simulation report presents that whether for a given set of inputs, the simulation model gives the desired output response or not and if there is any design error in the model. In other way, simulation can be considered as a verification tool can only be considered as a fist order approximation before designing physical hardware model. If the outputs from the simulation run satisfy the desired requirements then the designed model is considered as ok. Otherwise, it may require re-designed the design entry part again and perform continuous debugging process until the simulation run gives satisfactory output.

RESULTS AND DISCUSSION

After designing the VHDL model of the ANN based EMG signal classifier, the feature sets and corresponding targets are fed as input. Before feeding the feature sets, all the data are multiplied first by 1000 to treat as integer. Since, the internal calculations of VHDL model are of floating point based but there is no other way to input the data as floating point. Quartus II software is not also able to show any data as floating point through vector waveform. Hence, the input-output data deals by VHDL model of ANN as integer. The same device (StratixIII, chipset EP3SE50F780I4L) is used for VHDL model of ANN synthesizing and simulation. The compilation summary is shown in Fig. 6 and also in tabular form in Table 1. The RTL diagrams are shown in Fig. 7 and 8.

The neural network itself is a complex structure with various kinds of variables in input layer, hidden layer and output layer. Additionally, the back-propagation based training and learning added much more complexity with some more variables. The VHDL model of ANN classifier is first train with 15 feature sets and corresponding targets. Furthermore, the number of epochs was set to 10 to avoid huge amount of time consumption. The reasons behind the time consumption are: large numbers of variables are used inside the VHDL model of ANN, every calculation involves with both mantissa and exponential part and most of the processes has multiple iterations. Still it takes 6 to 7 h on average to complete the training through analysis and synthesis in Quartus II software.

Table 1: Compilation summary for ANN based classifier

Fig. 7: Part of RTL view of the designed ANN classifier (a)

Fig. 8: Part of RTL view of the designed ANN classifier (b)

However, after a single successful training, the designed VHDL based ANN classifier can be used to classify EMG signal that will take less time.

Fig. 9: Simulation output for ANN classifier (with input feature sets and targets)

Fig. 10: Simulation output for ANN classifier (with run data and corresponding classification result)

For this purpose a control flag is introduced namely fTr_Ru (flag for Training and Running), if it is set to high then the neural network will simulate to give classification result by using previously trained weights and biases. The result becomes ‘1’ for the corresponding hand movement if the mantissa part of the output from neural network is greater than or equal to ‘1’. The sample simulation outputs are given in Fig. 9 and 10.

The network was tested 3 (three) times to obtain its classification performance with 12 and 11 different feature sets each time. Table 2 summarizes the classification performance of the designed VHDL model for ANN. It has been found that the average classification rate for this testing is 71.46%.

Table 2: Classification output from VHDL model of ANN

CONCLUSION

The VHDL model of ANN based EMG signal classifier has been successfully developed and its average classification performance is 71.46% in accuracy. The classification performance is not same as achieved in MATLAB, due to several reasons. Hardware model of the network is designed for 800 epochs to complete training but only 10 epochs are set for optimum structure of the network. This structure consumes 6 to 7 h to complete the training of the network. Till date, the design of neural network requires utilization of trial-error method to find out optimum structure by highly experienced person. The VHDL model of ANN has been developed directly from C++ programming based ANN structure. There are lots of variables regarding input, output and hidden layers which are related to weights and biases. In VHDL modeling, all the variables are considered. This is because, still now there is no way to find out which weights and biases are significant to obtain best classification output. Besides that, there are various iterations for every kind of calculations in each layer. As it was mentioned before that the internal calculations of VHDL model was based on modified floating point where each number is split into two parts: mantissa and exponential. All these above criteria make the network structure complex and hence huge amount of time is required during training. However, implementation of whole VHDL model in IEEE format floating point number system may reduce the time consumption but that will require expert knowledge in utilizing float type mathematical calculation.

REFERENCES
Ahsan, M.D.R., M.I. Ibrahimy and O.O. Khalifa, 2010. Advances in electromyogram signal classification to improve the quality of life for the disabled and aged people. J. Comput. Sci., 6: 706-715.

Ahsan, M.R., M.I. Ibrahimy and O.O. Khalifa, 2009. MG signal classification for human computer interaction: A review. Eur. J. Sci. Res., 33: 480-501.
Direct Link  |  

Ahsan, M.R., M.I. Ibrahimy and O.O. Khalifa, 2011. Hand motion detection from EMG signals by using ANN based classifier for human computer interaction. Proceedings of the 4th International Conference on Modeling, Simulation and Applied Optimization, April 19-21, 2011, Kuala Lumpur, Malaysia, pp: 1-6.

Ahsan, M.R., M.I. Ibrahimy and O.O. Khalifa, 2011. Neural network classifier for hand motion detection from EMG signal. Proc. Kuala Lumpur Int. Conf. Biomed. Eng., 35: 536-541.

Alsaade, F., 2011. An enhanced classification and prediction of neoplasm using neural network. Asian J. Applied Sci., 4: 618-629.
CrossRef  |  

Bu, N., O. Fukuda and T. Tsuji, 2003. EMG-based motion discrimination using a novel recurrent neural network. J. Intell. Inform. Syst., 21: 113-126.
CrossRef  |  

Bu, N., T. Hamamoto, T. Tsuji and O. Fukuda, 2004. FPGA implementation of a probabilistic neural network for a bioelectric human interface. Midwest Symp. Circuits Syst., 3: 29-32.
CrossRef  |  

El-Gohary, M.I., A.S.A. Mohamed, M.M. Dahab, M.A. Ibrahim, A.A. El-Saeid and H.A. Ayoub, 2008. Diagnosis of epilepsy by artificial neural network. J. Biol. Sci., 8: 451-455.
CrossRef  |  Direct Link  |  

El-Ramsisi, A.M. and H.A. Khalil, 2007. Diagnosis system based on wavelet transform, fractal dimension and neural network. J. Applied Sci., 7: 3971-3976.
CrossRef  |  Direct Link  |  

Englehart, K., B. Hudgins, M. Stevenson and P.A. Parker, 1995. A dynamic feedforward neural network for subset classification of myoelectric signal patterns. Eng. Med. Biol. Soc., 1: 819-820.
CrossRef  |  Direct Link  |  

Englehart, K., and B. Hudgins, 2003. A robust, real-time control scheme for multifunction myoelectric control. Biomed. Eng. IEEE Trans., 50: 848-854.
CrossRef  |  Direct Link  |  

Fidele, B., J. Cheeneebash, A. Gopaul and S.S.D. Goorah, 2009. Artificial neural network as a clinical decision-supporting tool to predict cardiovascular disease. Trends Applied Sci. Res., 4: 36-46.
CrossRef  |  Direct Link  |  

Fukuda, O., T. Tsuji and M. Kaneko, 1999. An EMG controlled pointing device using a neural network. Proc. IEEE Int. Conf. Syst. Man Cybernet., 4: 63-68.
CrossRef  |  Direct Link  |  

Guven, A. and S. Kara, 2006. Classification of electro-oculogram signals using artificial neural network. Expert Syst. Appl., 1: 199-205.
CrossRef  |  

Hendel, M., A. Benyettou, F. Hendel and H. Khelil, 2010. Automatic heartbeats classification based on discrete wavelet transform and on a fusion of probabilistic neural networks. J. Applied Sci., 10: 1554-1562.
CrossRef  |  Direct Link  |  

Hiraiwa, A., K. Shimohara and Y. Tokunaga, 1989. EMG pattern analysis and classification by neural network. Proceedings IEEE Int. Conf. Syst. Man Cybernet., 3: 1113-1115.
CrossRef  |  Direct Link  |  

Hudgins, B., P. Parker and R.N. Scott, 1993. A new strategy for multifunction myoelectric control. IEEE Trans. Biomed. Eng., 40: 82-94.

Ito, K., T. Tsuji, A. Kato and M. Ito, 1992. EMG pattern classification for a prosthetic forearm with three degrees of freedom. Proceedings of the IEEE International Workshop on Robot and Human Communication, September 1-3, 1992, Tokyo, Japan, pp: 69-74.

Jadhav, S.M., S.L. Nalbalwar and A. Ghatol, 2010. Artificial neural network based cardiac arrhythmia classification using ECG signal data. Proceedings of the International Conference on Electronics and Information Engineering, August 1-3, 2010, Kyoto, pp: V1-228-V1-231.

Karlik, B., H. Pastaci and M. Korurek, 1994. Myoelectric neural networks signal analysis. Proceedings of the 7th Mediterranean Electrotechnical Conference, April 12-14, 1994, Antalya, Turkey, pp: 262-264.

Kelly, M.F., P.A. Parker and R.N. Scott, 1990. The application of neural networks to myoelectric signal analysis: A preliminary study. IEEE Trans. Biomed. Eng., 37: 221-230.
CrossRef  |  Direct Link  |  

Khorasani, E.S., S. Doraisamy and A. Azman, 2011. Automatic heart diseases detection techniques using musical approaches. J. Applied Sci., 11: 3161-3168.
CrossRef  |  Direct Link  |  

Kim, J., S. Mastnik and E. Andre, 2008. EMG-based hand gesture recognition for realtime biosignal interfacing. Proceedings of the 13th International Conference on Intelligent User Interfaces, January 13-16, 2008, Canary Islands, Spain, pp: 30-39.

Lyman, J., A. Freedy and M. Solomonow, 1977. System integration of pattern recognition, adaptive aided, upper limb prostheses. Mech. Mach. Theory, 12: 503-514.
CrossRef  |  Direct Link  |  

Moghtaderi, A., R. Alavi-Naini, M. Mohammadi and H. Rashidi, 2006. Diabetic neuropathy: Determining the sensitivity of peripheral nerves during a short course of glycemic control. J. Medical Sci., 6: 818-822.
CrossRef  |  Direct Link  |  

Naik, G.R., D.K. Kumar, S.P. Arjunan, H. Weghorn and M. Palaniswami, 2007. Limitations and applications of ICA in facial sEMG and hand gesture sEMG for human computer interaction. Proceedings of the 9th Biennial Conference of the Australian Pattern Recognition Society on Digital Image Computing Techniques and Applications, December 3-5, 2007, Glenelg, Australia, pp: 15-22.

Naik, G.R., D.K. Kumar, V.P. Singh and M. Palaniswami, 2006. Hand gestures for HCI using ICA of EMG. Proc. HCSNet Workshop Use Vision Hum. Comput. Interaction, 56: 67-72.
Direct Link  |  

Reaz, M.B.I., M.S. Hussain and F. Mohd-Yasin, 2006. Techniques of EMG signal analysis: detection, processing, classification and applications. Biol. Proced. Online, 8: 11-35.
Direct Link  |  

Reaz, M.B.I., Md.S. Amin, F.H. Hashim and K. Asaduzzaman, 2011. Hardware approach of ANN based iris recognition for real-time biometric identification. J. Applied Sci., 11: 2984-2992.
CrossRef  |  

Sekar, B.D., J.Y. Dou, B.B. Fu, X.L. Fei and M.C. Dong, 2011. Complexity and similarity analysis of heart sound for cardiovascular disease detection. Biotechnology, 10: 316-322.
CrossRef  |  

Subasi, A., M. Yilmaz and H.R. Ozcalik, 2006. Classification of EMG signals using wavelet neural network. J. Neurosci. Methods, 156: 360-367.
CrossRef  |  Direct Link  |  

Tagluk, M.E., N. Sezgin and M. Akin, 2010. Estimation of sleep stages by an artificial neural network employing EEG, EMG and EOG. J. Med. Syst., 34: 717-725.
CrossRef  |  

Tsenov, G., A.H. Zeghbib, F. Palis, N. Shoylev and V. Mladenov, 2006. Neural networks for online classification of hand and finger movements using surface EMG signals. Proceedings of the 8th Seminar on Neural Network Applications in Electrical Engineering, September 25-27, 2006, Belgrade, Serbia and Montenegro, pp: 167-171.

Tsuji, T., O. Fukuda, M. Kaneko and K. Ito, 2000. Pattern classification of time-series EMG signals using neural networks. Int. J. Adapt. Control Signal Process., 14: 829-848.
CrossRef  |  Direct Link  |  

©  2014 Science Alert. All Rights Reserved
Fulltext PDF References Abstract