# Grammatical Evolution-Based Feature Extraction for Hemiplegia Type Detection
## 4 System Architecture  
The proposed system uses the RehaGait mobile gait analysis system [6]. This system has seven sensors that are placed in various patient body parts. Each sensor is equipped with an accelerometer, a magnetometer, and a gyroscope. Only the signals taken from the accelerometer are utilized, and they are windowed into 2-second windows before undergoing a pre-processing and feature extraction stage. The RehaGait mobile gait analysis system is equipped with a wireless module that allows signal transmission to a personal computer (PC) without a data cable. The pre-processing procedure involves the adoption of a low-pass filter to smoothen the captured signals. The low-pass filter contains a 6 Hz pass-band frequency, and each captured signal was sampled at 1000 Hz.  
The feature extraction stage utilizes four time-domain and two frequency-domain features. The time-domain features are the mean (\(\mu\)), the standard deviation (\(S\)), the kurtosis (\(k\)), and the peak-magnitude-to-RMS ratio (\(RMS\)). The mean can be seen in Equation (4), where \(N\) is the number of scalar observations, and \(A\) defines a random variable vector.  
\[\mu=\frac{1}{N}\sum_{i=1}^{N}A_{i} \tag{4}\]  
The standard deviation is depicted in Equation (5) where \(N\) defines the number of scalar observations, \(A\) determines a random variable vector, and \(\mu\) is its mean.  
\[S=\sqrt{\frac{1}{N-1}\sum_{i=1}^{N}(A_{i}-\mu)^{2}} \tag{5}\]  
A distribution's kurtosis is defined in Equation (6) where \(E(t)\) is the expected quantity value \(t\), \(\mu\) defines the mean of \(x\) and \(\sigma\) denotes the standard deviation of \(x\).  
\[k=\frac{E(x-\mu)^{4}}{\sigma^{4}} \tag{6}\]  
The peak-magnitude-to-RMS ratio is defined in Equation (7).  
\[RMS=\frac{\|A\|_{\infty}}{\sqrt{\frac{1}{N}\sum_{i=1}^{N}|A_{i}|^{2}}} \tag{7}\]  
The frequency-domain features are the acceleration energy and the acceleration signal energy. The acceleration energy is shown in Equation (8) where \(A_{i}\) is the acceleration signal's \(i\)th spectral line and \(N\) defines the total number of lines.  
\[Eng=\frac{\sum_{i=1}^{N}A_{i}^{2}}{N} \tag{8}\]  
The acceleration signal entropy completes the frequency-domain feature selection. It is defined in Equation (9) where \(p_{i}\) is the probability of \(A_{i}\) to occur in the amplitude spectrum.  
\[Ent=-\sum_{i=1}^{N}p_{i}\log_{2}p_{i} \tag{9}\]  
The combination of time-domain and frequency-domain features forms the input vector to the FSC4 RBF method, which creates optimized features that increase the classification accuracy of the RBF network. The RBF network classified the data taken from a custom-made dataset into three classes (healthy, left, or right hemiplegia). The system architecture can be seen in Figure 2.  
Visualization of three input patterns after the pre-processing and manual feature extraction stages are applied to the accelerometer's signals dataset is depicted in Figure 3. These input patterns correspond to three signal types (normal, left, and right hemiplegia).  
Figure 3: A visualization of three input patterns. The current figure depicts three input patterns after the pre-processing and feature extraction stages are applied to the accelerometer’s signals dataset corresponding to three signal types (normal, left, and right hemiplegia).  
Figure 2: The system architecture. The system utilizes seven sensors placed in various body parts of the patient. The data from the accelerometer signals are received by a PC using a wireless connection and undergo a pre-processing and feature extraction procedure. Then, they introduced it as input to the FSC4 RBF method, which creates optimized features that increase the classifier’s accuracy (RBFNN). Finally, the classifier categorizes the input data into three classes (healthy, left, or right hemiplegia).