Control of a Prosthetic Arm Using fNIRS, a Neural-Machine Interface

Development in the field of bio-mechatronics has provided diverse ways to mimic and improve the function of human limbs. Without an elbow joint, the hand remains stiff because all the muscles tension passes through this joint. Advanced myoelectric prosthetic devices are limited due to the lack of appropriate signal sources on residual amputee muscles and insufficient real-time control. Neural-machine interfaces (NMI) are representing a recent approach to develop effective applications. In this research study, an NMI is designed that presents real-time signal processing for command generation. The human brain hemodynamic responses are, therefore, translated into control commands for people suffering from transhumeral amputation. A novel and first of its kind scheme is proposed which utilizes functional near-infrared spectroscopy (fNIRS) to generate the control commands for a three-degree-of-freedom (DOF) prosthetic arm. The time window for fNIRS signals was set to 1 second. The average accuracy was found to be 82% which is a state-of-the-art result for such a technique. The accuracy ranged from 65 to 85% subject-wise. The data were trained and tested on both artificial neural network (ANN) and linear discriminant analysis (LDA). Eight out of 10 motions were correctly predicted in real time by both classifiers.


Introduction
Amputation is taken from the Latin terminology "amputare" meaning to cut out. It is a removal of a limb due to medical reasons such as diseases and accidents. After this, an artificial device (prosthetics) is provided to fulfill all the desired needs. A prosthesis is an artificial device that replaces a missing body part that may be lost due to any traumatic accidents or medical reasons.
In the nineteenth century, hooks and wooden limbs were used as a replacement to fulfill the supporting needs to overcome support as well as the psychological effects experienced during the time. Prosthetic arm is a biomedical device consisting of links and joints in an open or closed system, which is also a combination of electronics. Thus, there is a need for a specified prosthetic which would help in fulfilling the requirements of the patient.
Prosthetics also come under different categories concerning the patient's demand and desirable need. Table 1 lists the type of amputation and their respective prosthesis type.
Controlling a prosthetic arm could be done in several ways. Some of them are by using Invasive Methods, which reflects a process in which an instrument is introduced in the human body. In such a process, electrodes are implanted inside the body, which would receive and implement the process. The other referred to as the non-invasive method. A non-invasion process does not introduce instruments into the body but uses the surface information to get its details and the desired output that is to be determined.
In the previous studies, various strategies have been practiced to monitor muscle activations all through activities, as reported by Lobo Prat et al. [1] To carry out a valuation of muscular contraction, sonomyography (SMG), mechanomyography (MMG) [2,3], miokinemetric (MK), and electric impedance estimations are classically applied. Though muscular intentions and/or contraction are often determined using electromyography (EMG) and near-infrared spectroscopy (NIRS) [4], it allows continuous monitoring of the muscle during motor actions or rehabilitative movements. Further practices, such as ultrasonography [5] and lactate sampling, offer only a representation of the muscular status at the moment of the study, and not an effective trace in time.
Optical brain imaging is a frequently applied methodology in human-machine interaction technically acknowledged as functional near-infrared spectroscopy (fNIRS). It allows them to monitor the quantification of the relative changes in concentration of oxygenated and deoxygenated hemoglobin in tissue blood based on artificial diffuse spectroscopy. Functional neuroimaging suggests a non-invasive method of indirect as well as direct monitoring of brain activity. The hardware involved is portable hence making it easy to carry out experiments in any environment. fNIRS is a non-invasive brain imaging method including the quantification of chromophore concentration determined from the measurement of near-infrared (NIR) light attenuation or time-based changes [6]. It exploits the optical window in which the fundamental elements found in the human body typically cause no hindrance to infrared light of small wavelength range that is 700-900 nm. In addition to that, oxygenated hemoglobin (Hb) and deoxygenated-hemoglobin (deoxy-Hb) are strong absorbers of light which are the key components to translate the brain response [7]. The peculiarity in the absorption bands of deoxy-Hb and oxy-Hb permit the estimation of near changes in hemoglobin concentration by methods of estimating light attenuation at a couple of known wavelengths [8]. The reason behind choosing more than one wavelength is to take care of the isosbestic point that occurs at around 810 nm. At this value of light wavelength both the absorbing coefficients are indistinguishable [9].
Via the improved Beer-Lambert law [10], relative concentration is evaluated concerning the entire length covered by the light photon [11,12]. Now, for an incident ray of light an emitter and to detect that reflected light, a detector is positioned. The distance between them is also defined. Hence, a state of brain hemodynamic is captured. The raw light concentrations that are further transformed into hemodynamic responses by the implementation of renowned Beer-Lambert Law and further utilized for feature extraction and classification. The extracted light intensity patterns can be viewed in Figure 1. Several research institutions have undertaken the design and construction of robotic arms. These structures diverge depending upon the proposed utilization of the human hand. Diverse knowledge of actuation approaches has been considered and implemented. Earlier design approaches have focused on the mechanical problems of the construction and operation of the prosthetic devices. Most of these hardware devices are controlled via methods that are not natural, such as using the contraction of muscles of the opposite arm. This research attempts to lay the foundation for a scheme that can offer functionality similar to the human arm, with an intuitive technique of control.
A search carried out using Web of Science engine, to review work done in this area along with the gap identification, revealed no work done so far in this field of study.

Materials and methods
The human arm is capable of performing seven basic motions associated with joints in the human arm. To account for transhumeral amputation, three of the main arm motions are considered i.e. one elbow and two motions affiliated with the wrist joint. These motions comprise wrist extension (WE), elbow flexion (EF), wrist supination (WS), wrist flexion (WF), elbow extension (EE), and wrist pronation (WP).
This section elaborates on the data acquisition of the defined motions. These motions were captured using The NIRsport manufactured by NIRx Technologies. It is an accessible, segmental, and robust functional near-infrared spectroscopy (fNIRS) machine that measures hemodynamic responses generated by neuroactivation of the inside brain via oxy-, deoxy-, and total hemoglobin variations in the cerebral cortex.
The updated version, NIRsport-2 proposes a host prepared to implement advancements and units to meet the requirements of wide-ranging cognitive Data Acquisition -Recent Advances and Applications in Biomedical Engineering 4 neuroscience applications. The major advantage of this device is that it is designed to work in a rugged environment and also this device is portable. This feature aids in the development of a wearable and portable system.

Sample
A total of 15 healthy subjects were engaged who were reported to be righthand dominant males having a mean age of 30 with a standard deviation of 4. Righthanders had been pursued to confine any dissimilarities in the hemodynamic responses because of the hemispheric domination difference [13]. All participants were chosen wisely as no one of the selected subjects had engaged in any prior study associated with brain signal acquisition experiments. None was accounted for to have a past filled with any mental, neurological, or visual affliction. Every one of them had an ordinary vision, and all signed and agreed to a composed consent after being briefed in detail regarding the test procedure. Three amputee subjects also participated in the study. Their demographics are given in Table 2.
Trials employing fNIRS were permitted by the Air University Human Research Ethics Committee (HREC). These research experiments were held regarding ethical standards dictated by the world medical association in the recent declaration of Helsinki [14].
The generic methodology can be seen in Figure 2.

Preparation
The specially designed fNIRS headset i.e. Easycap by NIRx technologies follows the international standard of source-detector separations i.e. 3 cm [15][16][17][18][19][20][21][22][23][24]. After the subject wears the cap, the optodes are calibrated. The result of this calibration can be analyzed as in Figure 3. The faulty setting is shown in Figure 3(b). The boxes represent optodes. The color bar indicates if the optodes are in contact with the scalp or not and hence the colors are assigned. The white color depicts no connection between scalp and optodes. The red color indicated that the connection between the scalp and optode is critical, i.e. it needs to be adjusted. Sometimes hair comes as a hindrance and just by plugging the optode again in the cap would help establish a better connection. If the issue is not resolved by then, a clinical gel (EASYCAP Supervisc, high-viscosity electrolyte-gel) is used to make sure no hair absorbed the light. The gel is rated healthy and is safe to use with optodes. The yellow color indicates that the connection is acceptable. The signals can be acquired. In this scenario, the machine conditions are calibrated by the machine itself. The machine adds a gain factor to the optodes where the connection is acceptable and it  is saved in conditions file which is used in signal processing later. The green color shows that the optodes are perfectly placed on the head surface and an excellent connection is established for data acquisition. It can be analyzed in Figure 3(a).

Acquisition
When the optodes are aligned, signal acquisition is started. The test strategy was segmented into training and testing. The subjects were asked to complete six tasks that were identified by fNIRS.
A comfortable chair was set up roughly 100 cm away from the subjects so that the motion cues are visible to them while the screen backlight does not interfere with the optical sensors [25][26][27][28][29][30][31][32][33][34][35][36][37][38]. This environment was set up for signal extraction. The Easycap was prepared in advance to minimize the time consumption during the optode placement process. Yet some of the detectors/sources had to be optimized during the calibration process by fixing hair via gel. The session commenced with an undeveloped span of 30 seconds to create a reference point. Later the screen indicated the participants to perform one of six definite tasks the training was  additionally divided into two parts. In the first part, all the tasks were recorded sequentially, i.e. the sequence of the tasks was pre-defined. In the second stage, the subjects were demanded to perform similar motions but with random intentions. All these six tasks were logged by fNIRS. Each task comprised of 10-second trials separated by a 20-second rest session. Particulars about the experimental model are given below in Figure 4.
The acquired data was then processed and is briefly illustrated in the coming section.

Pre-processing
This section explores and explains the signal processing which includes signal pre-processing, optode selection criteria, statistical feature computation, and the signal classification method to generate a control command for the control of a 3-DOF prosthetic arm designed for transhumeral amputees.
Functional near-infrared spectroscopy is the raw light intensity values recorded during a change in oxygenation and de-oxygenation of the blood in the human brain. With the help of dual-tip optodes, this concentration is recorded with two different wavelengths i.e. 760 and 850 nm. In the nirsLAB environment, the data is further processed. nirsLAB is the signal processing software that comes with the machine. nirsLAB is fully aware of the specifications and conditions applied during signal acquisition, hence the best choice for signal processing. The unwanted data is truncated along with unusual spikes or discontinuities that occurred during acquisition. It is then filtered to compute the hemodynamic states. These hemodynamic states are now utilized to extract the features.
As soon as the light intensities are acquired, they are fed to nirsLAB where first the time of stimulus is defined which in our case is 10 seconds as per the designed experimental paradigm. The data is further marked according to the conditions i.e. motion and rest. Figure 5 represents the raw fNIRS data of both wavelengths i.e. 760 and 850 nm. It is evident that the amplitude for both data sets is different as the concentration of hemodynamic response is varying from healthy to the amputated subject. This is because of the absence of an arm. As the brain generates these signals, the unwanted responses die due to the absence of neuron carrier in the brain. The connection of arm and brain is cut because there is nothing present at the receiving end. Further, the discontinuities are removed along with the spikes if there exists any. The data is then fed for filtration. nirsLAB provides the commonly practiced filters for fNIRS data. Band-pass filter was implemented to smooth the acquired light intensities. The filtered and raw data at both the wavelengths are illustrated below in Figure 6. nirsLAB makes use of firls and filtfilt MATLAB® commands to filter the data. firls returns the parameters of a linear-phase filter, while filtfilt applies the filter parameters into the data. The latter is set to work as finite impulse response (FIR). The roll-off defines the width of the transition frequency band, i.e. how steep the transition between frequencies which are cut and frequencies which are passed for each of the upper and lower limits of frequency. The width of the transition band is calculated as Eqs. (1) and (2): This noise-free and minimum artifact data are then used to find the hemodynamic states by using the modified Beer-Lambert Law [10,[39][40][41].
This light intensity raw data is then used to compute the hemodynamic response of the brain. The hemodynamic changes computed offline in nirsLAB are based on the modified Beer-Lambert law for scattering media, as mentioned above. While in nirsLAB the operator can modify all input parameters of the Beer-Lambert law where the variables can be defined as A: light reduction, or ∆A(λ): changes in light reduction at a given wavelength (λ); ε(λ): loss of the chromophore at a certain wavelength (λ); ∆c: changes observed in the chromophore absorption; d: distance between source and detector; DPF(λ): differential path length factor (DPF) for a certain wavelength (λ); g(λ): the scattering of the light wave at a certain wavelength (λ), where g is annulled since it is presumed to be insignificant when only light attenuation (as in continuous-wave NIRS) is considered [20,36,[42][43][44][45][46][47].
The differential path length factor (DPF) is a dimensionless modification factor that takes care of the increase in the optical path length that is produced by the scattering of light in organic tissue. The product of DPF and source-detector separation evaluates the "true" path length that the light has traveled inside the biological tissue cell [37,38,48,49]. For NIRx technologies, this value is set constant for wavelengths 7.25/6.38 for 760/850 nm respectively.

Feature extraction
The mathematical representation of statistical features extracted during the study is given as follows.
Signal mean (SM) was computed as Eq. (4) where N denotes the length of the data points within a segment and X i represents the signal values.
Signal peak (SP) is defined by the change in signals amplitude among two adjacent segments which surpass a predefined threshold to reduce noise. It is given by Eq. (5) ( ) where N represents the samples while X i and X i+1 represent the successive peaks in the signal. These features are extracted and fed to the classifier to predict the motion.

Classification process
The statistical features extracted from the data sample are then fed to the classifier. Classifying methods are employed to predict the motion intention. To comprehensively evaluate the performance of features, the two widely used classifiers in pattern recognition were implemented, namely, linear discriminant analysis (LDA) and artificial neural network (ANN). A generic yet comprehensive process is illustrated in Figure 7.

Linear discriminant analysis
Fisher's discriminant analysis or linear discriminant analysis is a method used to dimensionally contract samples of two or more classes to separate them, linearly. This classification method projects all the samples on an imaginary line which is useful for data classification. To cater for the word linear, it suggests that the classifier will dimension the given samples to represent the class information. It characterizes the resulting combinations to reduce the number of arbitrary samples by tracing a set of values in a distinct form. It anticipates the sample information so that each class is isolated without any problem. It decreases intraclass variance and increases the interclass mean. By doing this, unlike data samples become segmented from each other and their set point shrinks together so that they cannot be mixed with other classes.
LDA is commonly used for pattern classification in offline and online systems. This technique projects all the data points on a line in such a way that each data sample that corresponds to a class is separated effectively. It decreases the intra-class variance and increases the inter-class mean. By doing this, different classes become separated from each other, and their data points get closer together so that they cannot be mixed with other classes. LDA works by maximizing the Fisher's criterion given in Eq. (6) Between classes scatter matrix S_B is defined as in Eq. (7) where n i represents several samples that belong to class i, the class scatter matrix S w is defined as in Eq. (8)  A generalized eigenvector problem can be represented as Eq. (9) The optimal v is the eigenvector corresponding to the largest eigenvalue can be written represented as in Eq. (10) provided that S w is nonsingular.
The classifier results were validated using the cross-validation scheme. The number of folds/layers was set to 10. It means that the entire data was mixed randomly into 10 groups, out of which nine took part to train the classifier while one remains untouched for testing purposes. This process was repeated 10 times until all groups were tested against each other.
As an initial measure, the attributes of the dataset which need to be classified or dimensionally contracted will lead to the choice of applying this method as a classifier or a dimensionality reduction algorithm to play out any desired task. The primary thought of Fisher's analysis is fundamentally to isolate sample classes linearly moving them to an alternate feature-space. In this way, if the considered data set is linearly distinguishable, just using the algorithm as a classifier will yield better results. In any case, if the dataset is not truly distinct the classifier will attempt to sort out this dataset in another space. Yet despite every measure, the classes sample data may overlap due to the non-linear characteristic present in the sampled dataset. For this situation, there emerges a need to utilize another grouping model to manage nonlinearities governing the dataset. Hence, a neural network that comprise of hidden layers is also implemented. As for the neural network, raw data is used as input rather than featured data. This will give a broader idea of how to predict any output based on the input that have non-linear characteristic.

Artificial neural network (ANN)
ANN utilizes multiple neuron layers to map data from one distribution to another for better and optimized classification. A technique called backpropagation helps ANN to learn the relationship between input and output class label. The neural network toolbox provided by MATLAB® was utilized to train the classifier. First, network topology and an activation function were defined and then weights were randomized. The model uses all training data to approximate the error of the predicted output as compared to the actual output. Then it uses the error to adjust the weights so that it could be minimized for the next training data and this process was repeated until the error was minimized. For this network we employed Relu as the activation function; the weights were initialized using the Xavier distribution, the network utilized the Adam optimizer function for gradient descent. We used 60% of data for training, and 20% for testing and validation each. A confusion matrix was generated afterward, which had a class number corresponding to each arm motion. The number of hidden layers was specified i.e. 10, and system training was initiated. Ten neurons were present in each of the intermediate hidden layer. The number of neurons in output or last layer was set to be 6, which is equal to the number of elements in the target vector.
After classifying the information, their real-time testing was performed to ensure the behavior of both classifying techniques. But bear in mind that both of these classifiers have different parameters and methodologies. They are not compared with each other here but they are implemented to grasp a comprehensive idea of how these different brain hemodynamic intentions can be evaluated. LDA and ANN were both applied separately and the outcomes are discussed in next section.

Results and discussions
In research, the neural-machine interfaces can have a control foundation of either a single modality or via hybrid activity. This present study dwells on capturing hemodynamic responses from the human brain and generating the control command that can be translated to activate a prosthetic arm for transhumeral amputees. The results found by this particular research are discussed as follows.
These hemodynamic states are mapped using nirsLAB in Figure 8. The color bar represents the concentration of oxygenation.

Channel selection
The changes in oxygenated hemoglobin ΔHbO for all 20 channels and six activities of subject 6 are demonstrated in Figure 9. All of the optodes were not capturing the true concentration changes while brain activity was performed by the subject. Nevertheless, it was observed that similar channels were active when identical motions were executed while signal acquisition.
The channel outputs in Figure 8 serve to highlight the need for choosing good channels for recognizing true brain activities. According to our channel choice standard, signal averaging was used. It is understandable by human brain studies that when the right side of the human body is in motion, the left hemisphere of Figure 8. The color bar represents the concentration of oxygenation. Brain activity is shown in (a) the illustration represents condition 1 i.e. motion. It can be seen that the motor region is "hot" when compared to the color bar. It depicts motion state whereas the (b) shows that the brain is undergoing significantly low or minimal hemodynamic changes hence the "cool" values depicting the condition 2 i.e. rest. The red and yellow dots seen in the motor cortex region are representations of optodes and they were positioned according to the international system. the human brain is activated. As in our case, the subjects were asked to move their right hand, it is obvious that the hemodynamic patterns occurring in the right hemisphere are merely noise. It can be seen in Figure 8 that all the channels of right hemisphere i.e. channels 1-10 do not show significant activity and later they were discarded while classification. The left side of the motor cortex was however active and the channels from 11 to 20 were used to extract the statistical features which took part in the classification. Features were computed spatially which allowed the overall brain activity on the left side of the motor cortex region of the human brain.
Window sizing of diverse spans has been utilized in several studies for the detection of fNIRS features [50,51]. It is intended to minimize the window size to generate a fast response for real-time applications. So, the time spans of 0-0.5, 0-1, and 0-2 second windows were selected. These split seconds were employed for investigation of hemodynamic features to secure the best window size that will aid in decreased calculation time.

Classification accuracy
The stated performance outcomes were statistically evaluated based on the number of correctly predicted samples while the activity was completed during the period of 0-10 seconds. These actions were assessed by MATLAB® implementing the 10-fold cross-validation course. Student's t-test was performed to establish the statistical significance of the obtained results. The confidence interval was set to 95% (p < 0.05). The quantitative comparison between healthy subjects and amputees was not possible due to a limited number of amputees. The computed p-value was 0.0337 considering a 95% confidence interval. The classification accuracies of the subjects are shown in Figure 10.
A confusion matrix is illustrated in Table 3 where it is evident that the wrist pronation and supination cause the most confusion. From time to time the subject executes the actions and sometimes put a break to them. In so doing the muscle intention power descend below the threshold and is not detected, and subsequently tagged as uncounted or undetected.
In common practices, in addition to muscular fatigue, mental fatigue could likewise show up. This would affect the unwavering quality of the fNIRS signal. Frequent use of nicotine substances involving tea or coffee and weak eyesight are accounted for in such reliability. The motion prediction accuracy of an individual can be changed under the influence of such conditions.

Control command generation
After the results from the classifier are returned, they are translated into a control command. The motions are assigned abbreviations identical as used in Section 2. They are listed here as in Table 4.
While testing, the machine responds as the variables illustrated in Table 4 that are assigned to each class motion. The controllers further single-out one definitive motion which can be analyzed while testing the data.
These control commands can be further translated to motor action via a controller such as Arduino, Raspberry Pi, Odroid, etc. as the program routine is written in a language supported by all these controllers. A three degree of freedom device can be actuated using this neural-machine interface scheme.
To eliminate the channel selection part, manufacturers are working on bundled optodes. Using these bundled optodes will not only eliminate the channel selection  Table 3. Confusion matrix of motion prediction.

Figure 10.
A representation of subject-wise accuracies. Healthy subjects are presented as S1-S15 whereas amputees are labeled A1-A3. All concerning classifying technique as LDA and ANN.
Control of a Prosthetic Arm Using fNIRS, a Neural-Machine Interface DOI: http://dx.doi.org /10.5772/intechopen.93565 complications but it will also help in physical attributes as the whole head will not be covered. It will be easy to wear the head cap because of a smaller number of optodes and wires going around.
Also, using a different feature set may aid in the increase in accuracy. Rather than extracting three or four features, only one optimal feature can be evaluated. Hybridization of bio-signals can be done using advanced probability models or neural networks can be trained and implemented to hybridize different modalities.

Conclusion
fNIRS signals were acquired using the NIRSport machine developed by NIRx technology. These signals were recorded for six motions i.e. elbow extension (EE), elbow flexion (EF), wrist supination (WS), wrist pronation (WP), wrist extension (WE) and wrist flexion (WF) and were further analyzed. Mean and peak feature was extracted from the hemodynamic response of the brain. Also, minimum values were extracted for channel selection. The hemodynamic responses acquired from the brain were trained and tested by two widely used classifiers in pattern recognition i.e. LDA and ANN. The highest value of accuracy for an individual subject was recorded at 85% which is not yet achieved with six control commands employed by fNIRS. Both the classifiers were also active for real-time analysis. As a result of such high value of training accuracy, 8 out of 10 motions were correctly predicted in real-time setting. Possible extension of this work could be to hybridize these fNIRS signals together with another signal modality to not only increase the accuracy but also the number of control commands. Arm movement pattern for different age groups can be further explored. The number of amputed subjects could be increased to acquire data which will aid in better understanding of hemodynamic behavior of human brain and how it can be used to predict the arm motions. effect of acute mild exercise on executive function via arousal-related prefrontal activations: An fNIRS study. NeuroImage. 2014;98:336-345