Heart condition determination based on MET value to NYHA Classification and abnormal ST segment identification

Cardiovascular diseases have always been among the top causes of death. Thus, there were variety of research focuses on cardiac stress test and on self-stress test as well. However, the portable device existed for heart monitoring were still insufficient where most device are for fitness monitoring rather than functional capacity. Thus, this paper determines heart condition based on New York Heart Classification (NYHA) for The Rockport Walking Fitness Test (TRWFT). TRWFT gave out parameters to calculate maximum oxygen consumption (VO2max) to find metabolic equivalent (MET) value. The MET values were compared with NYHA functional capacity classes. Hence, the comparison simplified the heart condition to the urgency to visit hospitals. Plus, ST segments of MIT-BIH ECG database were extracted and assessed for abnormality. Accordingly, a mobile application was developed. The prototype is built using Genuino 101 microcontroller, an AD8232 ECG module with leads to sense heart pulse, and a SD card module. Meanwhile, simulation test on the prototype shows that the prototype succeeds in produce the same values with manual calculation and managed to assess ST segments as programmed. In conclusion, a prototype to demonstrate the implementation of TRFWT and prediction of cardiac condition based on MET value is successful.


Introduction
Heart disease is a very critical disease since long time ago.The disease or familiarly called cardiovascular disease (CVD) was always in attention of many health association.American Heart Association (AHA) annually release heart disease and stroke statistics report [1].On the other hand, The World Health Organization (WHO) in their latest edition of Global Health Estimates (GHE), concluded that the number one and two of the top ten global causes of death in 2019 are ischemic heart disease and stroke, which are types of CVD [2].On top of that, the Department of Statistics Malaysia published a press release on Statistics on Causes of Death in Malaysia annually.Recorded in the press releases, Ischemic Heart Disease (IHD) has always been the number one causes of death until the pandemic Covid-19 strikes the world [3][4].Hold the figures, CVD does bring fatal to the patients.Thus, the heart activity of the CVD patients was monitored using electrocardiogram (ECG).If we look on the etymology of the word, electrocardiogram is a written record of the heart's electrical activity [5].The way the record showing the heart activity is through electrical signal or can be called as PQRS-T wave with known duration (ms) and amplitude (mV) [6].Basically, the heart monitoring methods for CVD were done together with stress test at hospital with a supervision by expertise such as cardiology technologist, nurse and such alike.
The stress test is a test on heart activity which heart disease patients perform exercise while wearing heart monitoring device.The most familiar exercise for stress test is treadmill-walk exercise.In terms of portable stress test device, there are a variety of portable devices and sensors available that are able to be used in the context of functional capacity assessment [7][8][9].For example, wearable fitness trackers and smartwatches often include sensors such as accelerometers, gyroscopes, and GPS to calculate distance.However, the utilization of the sensor is not being used widely for surface texture and gradients.In this era, smart phones have capabilities to run cardiac monitoring applications.Some of current mobile cardiac monitoring devices are RhythmStar by RhythMedix, and SmartWatch by Apple [10] .Not only that, there were wearable technology to monitor cardiac activities such as Nymi Band, CardioWheel, AliveCor's Kardia device and miBeat [11][12].In addition, there are specialized sensors such as inclinometers and theodolites that are specifically designed for measuring slope [13][14].Nevertheless, there may be a need for the development of new portable stress tests that are specifically tailored to certain populations or clinical conditions.Furthermore, further research may be needed to evaluate the use of these tests in different settings, including their feasibility, accuracy, and reliability when conducted without the presence of cardiology technologists.
Along with the portable device, the self-stress test exercise would also be an exercise which is convenient and simple to perform.There are three most commonly practiced exercise for self-stress test which are The Rockport Fitness Walking Test (TRFWT), The Cooper Test, and The 1-Mile Jog Test [15].In general, TRFWT is a test that requires the test subject to walk as fast as possible for 1.6 kilometers (km) which approximately one mile [15,16].The duration of the exercise being performed is recorded.Besides that, as the exercise stresses heart and produce exerted heart activity, the heart rate at the end of the exercise will be a parameter to estimate maximal oxygen uptake.In opposite to the TRFWT, The Cooper Test is a test procedure that requires the test subject to run continuously for twelve minutes where the time is kept constant and the distance is varied [17].Hence, the estimated maximal oxygen uptake is withdrawn from a mathematical equation with the distance passed when running as the parameter.Meanwhile, The 1-Mile Jog Test differs from TRFWT in test execution and their mathematical model for maximal oxygen uptake estimation.This test required the test subject to jog for one mile instead of walking [18].The time for the test to be completed is depending on the gender.The times are more than eight minutes for men and more than nine minutes for women by jogging [16,19].The final heart rate is taken 5 or 15 seconds after the test ended.
On the other hand, self-stress test should also be a practical assessment that can assist CVD patients on their daily activities.The New York Heart Association (NYHA) functional capacity classification system is widely used to assess the severity of heart conditions based on the patient's ability to perform physical activities [20].This system categorizes patients into four classes based on their symptoms and limitations.Class I patients have no limitations and can perform physical activities without any discomfort.Class II patients have slight limitations, experiencing mild symptoms with normal physical activity.Class III patients have marked limitations, experiencing symptoms with less than ordinary physical activity.Class IV patients have severe limitations, experiencing symptoms even at rest [21].Understanding a patient's NYHA functional capacity classification can help healthcare professionals determine the appropriate treatment and management plan for their heart condition.Apart from that, pre-diagnosis of heart using self-stress test can be considered as precaution when doing daily activities.Consequently, with the advisable physical activities, the day of the CVD patients can be planned to achieve a better quality of life (QoL).
Therefore, a portable heart monitoring device was prototyped based on the concept of cardiac selfstress test with TRFWT as the exercise.The objective is to determine MET value of the cardiac self-stress in the determination of heart condition based on NYHA functional capacity classification.The software application is designed using MIT App Inventor 2 and integrated with hardware which consisted of Genuino 101 microcontroller, SparkFun Heart Monitor AD8232 and an SD card module which is used for data acquisition.As a complimentary research, this study also includes abnormal ST segment detection on MIT-BIH ECG database for abnormality detection for future implementation on portable self-stress test.Finally, the prototype is believed able to provide a reliable pre-diagnosis to CVD patients and to improve their QoL.

Methodology
The research methodology for the study revolves around metabolic equivalent (MET), data acquisition during TRFWT self-stress test, MET value comparison with NYHA functional capacity classifications and ST segment detection.The following subsections will elaborate the methodology steps further.

The Rockport Fitness Walking Test procedure
In this study, the exercise for the stress test is a modified TRFWT.The modification is the distance of the test.The interval has been shortened to a quarter-mile: 400 meters, because the heart rate can reach a steady state after three minutes of walking [33,34].Prior to the test, the subjects are advised to performed warm-up slow walk for five to ten minutes.Then, subjects will let their heart rate be measured before start walking briskly for 400 meters.A stopwatch was kept ready and started as soon as the subject started TRFWT.At the end of the 1 mile, the stopwatch is stopped and the heart rate is measured again.The heart rate is measured by placing three leads of electrode connected to a hardware called i-Stress onto subjects' wrist as in figure 1 a).

Metabolic equivalent
Metabolic Equivalent is a measure of the amount of energy expended during physical activity.The MET value of an activity can varies depending on the intensity of the activity, with higher values indicating greater energy expenditure [22,23].Hence, the MET concept is commonly used in exercise physiology and in the development of physical activity guidelines, whereas for this study, it is compared to NYHA functional capacity classification.One MET is equal to the energy expended while sitting quietly, which is approximately 3.5 milliliters of oxygen uptake per kilogram of body weight per minute (3.5 mL of O 2kg - 1 min -1 or 1.2 kcalmin -1 ) [22].Nowadays, MET has been widely used together with maximal oxygen uptake to interpret cardiac conditions.That was by implementation of Dolgener equation.Based on equation (1), BM is body mass in kilograms, A is age, G stands for gender (0 if female, 1 if male), T is completion time, and HR is heart rate.Following the calculation of VO2 max, the MET value calculation as per equation (2).

NYHA functional capacity classification comparison to MET value
In this study, the MET value is measured on TRFWT intensity.Therefore, the MET value obtained after TRFWT is performed was correlated to the symptoms as per NYHA functional capacity classification.The metabolic equivalent quantifies the intensity of physical activity which means for healthy person, certain physical activity produces a standard range of MET values.MET values of 1.0-1.5 is called sedentary, less than 3.0 MET is for light intensity physical activity, 3.0-6.0MET is for moderate intensity physical activity and more than 6.0 MET representing vigorous intensity physical activity [30,31,32].Whereas, the NYHA functional capacity suggested limitation to perform physical activity in each of the classes corresponding to usual symptoms which are fatigue, palpitation and dyspnea, when doing ordinary activity.Class I suggesting no limitation on physical activity as ordinary physical activity does not cause the usual symptoms; Class II has slight limitation of physical activity and ordinary physical activity results in the usual symptoms; Class III marked limitation of physical activity when less than ordinary activity causes usual symptoms; lastly, Class IV unable to carry on any physical activity without discomfort [20,21].Thus, the table consisting the MET value in comparison to NYHA functional classification is tabulated and is shown in table 1.

Data acquisition of self-stress test
This section focuses on data collection and self-stress testing.To calculate VO2max and MET, we need to gather heart rate and self-stress completion time.For this purpose, we developed a mobile application called i-Stress using MIT App Inventor 2. The application utilizes a 3-piece electrode leads hardware interface, Genuino 101 microcontroller, SparkFun Heart Monitor AD8232, and an SD card module.It is equipped with Bluetooth, a stopwatch, and a GPS module.
The subjects for the test are 2 female and 1 male aged between 20 to 32 years old.This study was performed in accordance with the Declaration of Helsinki.This study was performed in accordance with the Nurenberg Code.This human study was approved by National Medical Research Registrar.All adult participants provided written informed consent to participate in this study.During the test, the subject places electrodes on their right arm, left arm, and right leg.They activate the application and the device, ensuring that the Bluetooth and GPS modules are active.Then, they start the stopwatch within the application and begin brisk walking.The distance is pre-set to 400m and measured using the GPS functionality in the application.When the GPS detects the completion of 400m, the stopwatch automatically stops.At this point, a user prompt appears on the application screen (see figure 1 b), where the subject provides necessary information.The calculated MET value is then compared to the NYHA functional capacity, indicating the subject's recommended physical activity level and indirectly reflecting their heart condition.), the detection of R-peak will initiate the gating process.The STsegment detection function starts by storing the corresponding time of the largest value detected into the variable "  ".The "  " represent the initial point of the gating process.The value stored in the variable "  " is then used to mark the "  " and "  ".The "  " and "  " are the final and middle points of the gating respectively.The "  " is ideally assumed as the J-point; the starting point of the ST-segment.The value within "  " and "  " is set as input for abnormalities detection once the variable "  " and "  " are known.Meanwhile, the ECG signal used has a sampling frequency of 100Hz and the number of samples can be found by dividing one to the sampling frequency.Hence, 12 is the number of samples for the ST segment.
The amplitude values of each samples within the second gate were summed up to find the average value.Average value is used because ST segment is supposedly isoelectric or 0 volt and lies flat on the baseline [27,28,29].If the average value is below 0 volts, it is deduced that the ST segment is depressed and classified as abnormal as in figure 3.If the ST segment is severely depressed, it could lead to ischemia stroke.

Figure 3. The ST segment depression
Finally, when the abnormalities are identified, they were counted and the number of abnormalities is the results to represents abnormal heart conditions.

Comparison of MET value to NYHA functional classification
The VO2max value for TRFWT is calculated using the Dolgener equation and the MET value computed using the VO2max were than compared to the NYHA functional classification as in table 1. User may refer to the table to constraint their physical activity by performing TRFWT, find their MET value using i-STress, and compare the MET value to the NYHA functional capacity classification noted in the table.The following table 2 shows MET values mapped to NYHA functional capacity classification of three healthy subjects which the information such as gender and age are in the table as well.Class I *GENDER is referring to sex of the subject and is noted as F for female, and M for male.
Based on results in table 2, all three subjects were fit as their functional capacity classification is in Class I. all subject above are fit to pursue daily activities without having usual symptoms such as undue fatigue, shortness breath and heart palpitations.However, Subject A has longer completion up to thrice of Subject B and C. It is believed is caused by the Subject A body mass index (BMI) which is 32.9 (overweight).Whereas, Figure 4 shows the test results of another subject displayed on the device screen.

The number of abnormal ST segment detection
The algorithm in detecting abnormal ST segment is applied in this study as explained from section 2.2.Additionally, the sample taken for this procedure is also mentioned in section 2.2 which are from MIT-BIH ST changes ECG database.There were 28 samples which there are 299 ST segments in totals.After the abnormal ST segment detection was performed on the samples, the number of abnormal ST segment samples were compared to the total samples in the respective ST segment.Figure 5 shows an example of extracted ST segment and was marked with gates to find the depressed ST-segment which also means abnormal ST segment.The next step after was to get the amplitudes at each millisecond in each gate.The average amplitude values that are below 0 volt is considered depressed.Hence, when this happened, it means that an abnormal ST segment is detected.Other than that, another method of detecting abnormal samples was also carried out using excel to validate the result.The summary of the comparison is as in figure 6.As shown in figure 6, 22 out of 28 samples were showing accurate results between the two methods, the total number of ST segment samples detected by the algorithm is consistent with the number traced in excel spreadsheet.However, the number of depressed ST-segment counted by the algorithm does not fit with the number in the excel spreadsheet.Six attempts shown unsimilar number of abnormalities between both methods which also bound to 78 percent of accuracy.

Conclusion
In conclusion, the research has successfully demonstrated the implementation of the cardiac stress test by developing a prototype based on the device-app ecosystem.The i-STress App enables the user to conduct cardiac stress tests independently.The procedure implemented on the apps is a modified version of TRFWT.The maximal oxygen uptake produced is converted to MET value for cardiac condition prediction based on NYHA Classification.The app successfully displays the correct value calculated based on the mathematical model of maximal oxygen uptake and MET value.Besides, the value displayed has correctly classified the prediction of cardiac condition based on the NYHA Classification Table .On the other hand, the hardware prototype also undergone a testing and analysis process with an ECG signal retrieved from an online cardiac signal database that is Physionet.The result analysis shows that the prototype successfully identifies the ST segment and classifies its condition.
This research proves that the current technology enables the test to be conducted independently and anywhere.However, it is reminded that any self-testing device only provides the prediction result.The user still needs a medical professional view to confirm the cardiac condition.Therefore, here are some recommendations suggested for future study.Instead of developing a hardware prototype with Arduino, it is suggested to develop the prototype by using Raspberry Pi.The function of Arduino is limited to control and limit the desired features to be included in the prototype.Meanwhile, Raspberry Pi is a microprocessor and there is a wide range of possibilities and features that can be included.Finally, several characteristics of ST-segment abnormality should be included to affirm the detection of ischemia.

Figure 1 :Figure 2 :
Figure 1: Overall prototype.(a) Heart rate measurement.(b) User prompt on i-Stress application screen

Figure 5 .
Figure 5. Example of extracted ST segment marked with ECG gating points.

Figure 6 .
Figure 6.Chart of abnormal ST segment on MIT-BIH ST changes database.

Table 1 .
The MET value corresponded to the NYHA functional classification

Table 2 .
The MET value calculated from 3 subjects to the NYHA functional classification