# AI-Based Stroke Disease Prediction System Using Real-Time Electromyography Signals
## 4 Experiments and Analysis  
### Dataset and Experimental Analysis  
This section describes the process of measuring and collecting bio-signal data for verification of the proposed AI-based stroke disease prediction system. The main bio-signal used will be real-time electromyography (EMG) data. EMG is a diagnostic tool that records electrical activity inside a specific muscle or measures nerve conduction velocity through electrical stimulation using electrodes. Comprehensive studies of strokes using EMG have shown that there is a slight imbalance in the body both before and after a stroke, along with imbalances in gait and locomotion [48,49]. In this paper, we analyze these imbalances and gait disorders in terms of EMG bio-signal data, which has the potential to be a stroke risk factor.  
The measurement and collection of EMG biometric data were conducted from 2015 to 2017 at the emergency medical center and the department of rehabilitation medicine at Chungnam National University Hospital. Our stroke group consisted of patients aged 65 or older who were undergoing rehabilitation treatment for stroke within one month of stroke confirmation. In total, 287 patients from the rehabilitation department fit our criteria. Various biological signals were collected, such as EMG, ECG (electrocardiogram), EEG (electroencephalogram), foot pressure, and voice recordings. Figure 2 shows the location of each sensor on the patient. Before collecting bio-signal data through experimentation, the sensors were checked to confirm they were operating normally. Patients who were undergoing rehabilitation other than a stroke were considered as the normal group, and data were collected from 271 individuals. Each patient was put through various scenarios such as standing, walking, sitting, raising arms, and sleeping to simulate everyday activities. For each scenario, all subjects had one practice before executing the measurement protocol. Despite this prior practice, the first measured and collected values were not used as experimental data, because human noise due to the subject's tension and discomfort could be reflected. At the same time, the last measurement protocol was also not reflected because repetitive experiments cause fatigue to elderly subjects. Each bio-signals  
Figure 1: Overall structural diagram of AI-based stroke disease prediction system using EMG bio-signals.  
data collection information was delivered to the relay in real time and the BLE (bluetooth low energy) protocol was used for communication. In addition, data was forwarded to the Wi-Fi communication protocol to the server that collects and predicts bio-signals from the gateways. At this time, the entire process of the measurement experiment was monitored by the medical doctor and re-measurement was performed if there was a loss of bio-signal data transmitted. The raw data transmitted from the four locations of the EMG was set in the system to have a false value of 4 bytes per sampling rate in the form of a voltage.  
Figure 3 shows the measurement locations used to collect the EMG bio-signals. EMG signals were collected with a sampling rate of 1500 Hz per second from a total of four locations: the left and right legs, biceps femoris, and gastrocnemius muscle. As a stroke patient and a normal person should be classified based on LSTM of machine learning and a deep learning model, it is necessary to ensure an equal amount of experimental data for the two classes for predicting a stroke. Therefore, 271 out of 287 stroke patients were randomly extracted, and 271 normal subjects' data were used.  
Figure 4 shows raw EMG signals for a random stroke patient and a normal patient collected at the four muscle locations while walking, which will be used in the model training and the testing of LSTM.  
Figure 3: Real-time measurement location for EMG bio-signal (Left image: biceps femoris, right image: gastrocnemius muscle).  
Figure 2: Sensor specific location attachment for collecting multiple bio-signals.