Wavelet Transform and SVM Based Heart Disease Monitoring for Flexible Wearable Devices

INTRODUCTION: Heart disease has been a major health challenge globally; therefore the development of reliable and real-time heart disease monitoring methods is crucial for the prevention and management of heart health. The aim of this study is to explore a flexible wearable device approach based on wavelet transform and support vector machine (SVM) to improve the accuracy and portability of heart disease monitoring. OBJECTIVES: The main objective of this study is to develop a wearable device that combines wavelet transform and SVM techniques to achieve accurate monitoring of physiological signals of heart diseases. METHODS: An integrated method for heart disease monitoring was constructed using flexible sensor technology combined with a wavelet transform and support vector machine. The Marr wavelet transform was applied to the ECG signals, and the feature vectors were constructed by feature parameter extraction. Then, the radial basis kernel SVM was utilized to identify the three ECG signals. The performance of the algorithm was optimized by adjusting the SVM parameters to improve the accurate monitoring of heart diseases. RESULTS: The experimental results show that the proposed wavelet transform and SVM-based approach for flexible wearable devices achieves satisfactory results in heart disease monitoring. In particular, the algorithm successfully extracted feature vectors and accurately classified different ECG signals by skilfully combining the wavelet transform and SVM techniques for the processing of premature beat signals. CONCLUSION: The potential application value of the wavelet transform and SVM-based flexible wearable device approach in heart disease monitoring is emphasized. By efficiently processing ECG signals, the method provides an innovative and comfortable solution for real-time monitoring of cardiac diseases.


Introduction
The rise of wearable sensors has revolutionized the medical field.While traditional medical monitoring usually requires patients to travel to hospitals or clinics, wearable sensors enable real-time monitoring of health conditions in patients' daily lives, greatly improving the convenience and efficiency of monitoring.Additionally, these sensors are capable of monitoring a wide range of physiological parameters, including blood pressure, oxygen saturation, heart rate, and more.By giving medical professionals timely and accurate data, they can better understand their patients' conditions and determine the best course of treatment.A completely new era of health management and medical monitoring has been made possible by the introduction of flexible, wearable sensors.These sensors monitor not only key biosignals such as pulse rate, respiratory rate, body temperature, movement, and blood B. Han et al.

2
pressure in real time but also provide timely and accurate health assessments and early warnings through data analytics and algorithmic processing, which can help in the early detection and diagnosis of important diseases such as heart disease.Behind wearable devices, the continuous development and convergence of the fields of materials science, sensing technology, wireless technology, and the Internet of Things (IoT) play a crucial role [1] .Highly flexible and flexible materials, sophisticated sensor technologies, advances in wireless communication technologies, and the construction of IoT platforms have collectively contributed to the performance enhancement and functionality expansion of wearable devices.This interdisciplinary fusion of innovations has endowed wearable devices with a wider and deeper range of application scenarios, making them an important tool for maintaining a healthy life, and wearable devices have a high market demand [2] .Wearable devices for health monitoring are usually miniaturized with rigid circuit boards and block power supplies embedded in them to ensure that the device is lightweight and comfortable and can be worn continuously without interfering with daily activities.The wrist is one of the most common wearable positions, as the wrist area is ideal for monitoring physiological metrics such as heart rate, exercise, and sleep [3] .Dynamic data from the wrist can provide important information about physical activity, resting state, and overall health [4] .In recent years, significant research progress has been made in PVC (premature heartbeat) signal recognition methods based on wavelet feature extraction [5] .The application of SVM is particularly prominent when flexible wearable devices are used in the field of heart disease monitoring.By using SVM algorithms to analyze and classify the collected biosignal data, accurate assessment and timely warning of heart health can be achieved [6] .This data-driven approach can not only help healthcare professionals better understand patients' cardiac conditions but also provide an important reference for personalized treatment plans, thus improving treatment outcomes and patients' quality of life.In this study, SVM is applied to classify the extracted PVC signal features for automatic detection and monitoring of heart diseases.Its rigorous mathematical theoretical foundation and excellent generalization ability enable SVM to perform well in processing complex biosignal data and provide reliable classification performance for the monitoring system.

Wavelet theory
The mother wavelet ψ(t) has an important place in wavelet analysis and can be used to obtain a series of wavelet functions by stretching and translating.This process involves the parameters a and b, where a represents the scaling factor and b represents the translation factor [7] .The scaling factor (a) is used to adjust the scale of the wavelet function, and by increasing or decreasing the value of a, the wavelet function can be made to change accordingly in either the time or frequency domain.Smaller values correspond to higher-frequency wavelets, while larger values correspond to lower-frequency wavelets [8] .The translation factor (b) is then used to control the translation of the wavelet function on the time axis.By varying the value of b, the wavelet function can be shifted left and right on the time axis, thus capturing local features of the signal at different time points.Specifically, by transforming the mother wavelet, the following wavelet function is obtained: Here, ψ a,b (t) denotes the adjusted wavelet function.ψ a,b (t) is introduced to make wavelet analysis a flexible and powerful tool that can provide detailed information in the time-frequency domain at the same time, which provides more choices and possibilities for signal processing and analysis.For specific application scenarios, effective capture and analysis of different types of signals can be achieved by skillfully selecting and adjusting a and b.
For a function f (t) ∈ L2 (R), its continuous wavelet transform is a powerful mathematical tool that provides the ability to gain insight into the local characteristics of a signal at different scales and frequencies.Mathematically, L2 (R) denotes the space of integrable squared functions on the real number axis, where the integral of the square of f (t) is finite, and the mathematical form of the continuous wavelet transform is Where a is the scale factor, and b is the translation factor.
The constant Q property of the wavelet transform, i.e., the Q-value (the ratio of the bandwidth to the center frequency), endows wavelet analysis with a unique timefrequency localization capability.When a small scaling factor a is chosen for high-frequency analysis, the resulting wavelet function exhibits a narrow time window in the time domain and a wide frequency window in the frequency domain [9] .This essentially corresponds to a detailed view of the signal using a high-frequency wavelet, allowing us to analyze the rapid changes and local details in the signal more finely.In contrast, when a larger scaling factor a is chosen for low-frequency analysis, the resulting wavelet function exhibits a wide time window in the time domain and a narrower frequency window in the frequency domain.This is actually equivalent to using low-frequency wavelets to generalize the signal, which better captures the overall structure and trend of the signal.
If the Lie index of f(t) at a singularity is α, then there exists a constant A such that the modulo maxima of the continuous wavelet transform at scale a with respect to this singularity can be expressed in the following form: (3) The wavelet transforms of signals near singularities at various scales exhibit unique conical features, which provide an effective way to detect singularities in signals.
By performing wavelet transforms at different scales, it can be observed that singularities exhibit conical localized polar structures in the transformed coefficients.To further process these wavelet transform coefficients, thresholding is often used, where the smaller values in the coefficients are set to zero by setting an appropriate threshold.This processing step helps to reduce the effect of noise and highlight important features in the signal.Structures and features in the signal can be traced through the results of the wavelet transform to locate singularities more accurately.The linear phase property makes the wavelet transform an effective tool for creating mappings between the time and frequency domains, providing more intuitive and interpretable results for signal analysis.

Support Vector Machines
Statistical learning theory provides a solid theoretical foundation for SVMs by analyzing the statistical properties of the sample space to derive performance guarantees for learning algorithms.VC-dimensional theory provides theoretical bounds on the complexity and generalization performance of the learning model.The design of SVMs within these theoretical frameworks allows for superior performance when dealing with complex problems with small samples, high dimensional spaces, and nonlinear decision boundaries.SVMs construct an optimal classification hyperplane, a strategy that is advantageous because it allows the SVM to take advantage of linear classification even when dealing with nonlinear problems.By choosing different kernel functions, SVMs are able to adapt to a variety of complex data structures, thereby improving classification accuracy and generalization.
For n m-dimensional linearly indivisible samples: The optimal hyperplane constructed in a higher dimensional space satisfies: (5) Transform the problem into a quadratic programming problem: where C is the penalty factor, and ξ is the relaxation factor.
Solving the above quadratic programming problem, the final decision function is as follows.

(7)
For Support Vector Machines (SVMs), the classes of the samples to be classified are completely determined by the support vectors, which is their unique classification property.It is particularly noteworthy that SVMs were originally designed to solve binary classification problems, but the author can extend their application by constructing decision binary trees to make them suitable for multiclassification problems.Decision binary trees are a common approach in multicategorization problems that divide the dataset layer by layer, with each node representing a classifier.This hierarchical structure allows SVMs to focus on different classes at different nodes, thus realizing the goal of multiclassification.The LIBSVM toolbox developed by Chih-Jen Lin provides convenient tools and interfaces to realize this extension, and this paper also mainly uses this LIBSVM toolbox.

Application of flexible wearable devices in heart disease monitoring
Flexible sensors show sensitivity in monitoring human physiological signals [10] .can be divided into two categories: biophysical and biochemical signals.

Temperature
Changes in body temperature can reflect the body's metabolic state, immune function, and environmental adaptability.By monitoring body temperature regularly, the author can find out whether our body is in a healthy state or whether there are potential health risks [11] .Temperatures between 36.5°C and 37.1°C are normal, and abnormal temperatures are often a sign of a threat to the patient's health.It is essential for metabolism, immunological system enzyme activity, and circulation to keep the body temperature within a healthy range.Certain disorders frequently exhibit irregular temperature fluctuations, and doctors can precisely determine the efficacy of a treatment based on a patient's body temperature.Because of this, body temperature is a crucial and essential signal for healthcare surveillance.
Researchers have developed a flexible temperature sensor array with great sensitivity and accuracy that is made of single-walled carbon nanotubes.Under the impact of the external environment, the sensor array retains its mechanical properties, and its flexible substrate of polyaniline nanofibers conforms tightly to the skin.The sensor reaction time is accurate to 1.8 seconds with good resistance sensitivity through the incorporated electrical connection mechanism.The flexible temperature sensor system's integrated design reduces the sensor's overall size and complexity by tightly integrating the energy supply and temperature sensing capabilities into one single unit.The sensor system's structure is made simpler by this integrated design, which also increases the system's stability and dependability.A transparent, flexible smart patch with an autonomous function is shown in Figure 1A [12] .The sensor precisely detects variations in the ambient temperature outside in addition to tracking variations in the temperature of the human body.Because of its adaptability, the sensor may be utilized in a variety of situations and is more versatile.In the realm of health monitoring, for instance, the sensor's real-time ability to track variations in a person's body temperature enables users to assess their own health and take necessary action.In the field of environmental monitoring, sensors can be used to monitor the temperature changes in the surrounding environment, providing important data support for climate change research and environmental protection.

Heart rate and pulse
Heart rate and pulse are important indicators of heart activity and have an irreplaceable role in cardiovascular health monitoring.Heart rate is the number of times the heart beats per minute, while the pulse is the beat produced in the arteries when blood is pumped by the heart.Monitoring changes in heart rate and pulse provides insight into how the heart is functioning, how the blood is circulating, and the health of the cardiovascular system.In its early stages, cardiovascular disease often has no obvious symptoms but can cause changes in the arterial pulse, resulting in an altered pulse waveform at the wrist.Conventional cuff sphygmomanometers do not allow for continuous monitoring, and in order to address this issue, an innovative, flexible blood pressure monitoring device has been clinically designed.The device utilizes an ultralight and thin graphene tattoo sheet that can be easily attached to the body surface.(Figure 1B shows a flexible blood pressure monitoring device with a schematic diagram of the Z-BP measurement method.)By positioning this tattoo sheet at the wrist's artery site and applying a little current to the skin to measure the bioimpedance, blood pressure variations can be monitored.A database for continuous blood pressure monitoring can be developed by analyzing the link between bioimpedance and changes in blood pressure using machine learning models.

Figure 1.
Example of wearable, flexible sensors for temperature and blood pressure monitoring [13] EAI Electrocardiogram (ECG) signalling is a commonly used method for detecting and monitoring the electrical signals of heart activity in the human body.Conventional ECG monitoring methods typically use Ag/AgCl electrodes that require gel-assisted adhesion to the surface of the body, which is then passed through a conductive gel to ensure good signal transmission.However, this traditional method has some drawbacks, such as cumbersome operation, unsuitable for prolonged wear, and prone to cause skin allergic reactions.Flexible skin contact ECG sensors have come to the fore in recent years to address these issues.These sensors are made of soft materials that fit more comfortably on the surface of the skin, reducing discomfort and the potential for skin irritation.The design of the flexible sensors allows users to easily wear them for extended periods of time, resulting in longer-lasting monitoring, which is especially important for patients who need to track their heart health over time.In addition to improved comfort and wear time, the Flexible Skin Contact ECG Sensor is also highly flexible and adaptable, allowing it to fit different shapes and sizes of skin surfaces for a more accurate and stable signal [14] .This is a huge advantage for people of different ages and sizes, especially for special groups such as infants, children, and the elderly.In addition, flexible dry electrodes are attracting attention as an emerging technology.Compared to traditional gel-based electrodes, flexible dry electrodes are more convenient because they do not require the use of gels or other liquid media.The user only needs to fit the sensor to the skin's surface, eliminating any inconvenience that would arise from taping or cleaning, thanks to the flexible wearable electrodes' design, which simplifies ECG signal monitoring.Although volume tracing and ultrasonography are frequently used to track heart rate and pulse, they are not appropriate for use as wearable sensors due to their heavy weight and short range of usage.Flexible strain sensors have recently been proposed for real-time pulse monitoring.These sensors are lightweight, simple, and easily affixed to the skin [15] .High sensitivity and adaptability are provided by patch-type sensors that use polyaniline to efficiently measure pressure changes brought on by blood flow.The newly developed flexible pressure sensor combines contemporary sensor technology with conventional pulse theory to monitor three pulse positions concurrently.Threedimensional pulse mapping is made possible by an array of ionogel pressure sensors based on PET flexible substrates.This allows the presentation of pulse waveform and intensity as a map, mimicking the feeling of a physician touching a patient's pulse.Excellent pulse monitoring performance is achieved by another effective flexible sensor based on PVDF-TrFE, which can detect a weak pressure of 10 kPa and amplify the electrical signal by a factor of 10.

Human Movement
This study is unique in that it utilizes a biomechanical analysis of knee motion to guide the sensor design process.By delving into the motion characteristics of the human knee, researchers are able to better understand the challenges that sensors may face during motion and design and optimize them accordingly to ensure that the sensors work accurately and stably.To minimize errors, the sensing elements are encapsulated, which protects them from the external environment and improves their stability and reliability.This encapsulation design not only reduces sensor errors but also extends their service life, making them more suitable for long-term monitoring and real-time tracking.Another notable feature is the personalized design, which means that the sensors can be tailored to the needs of different wearers.Skin characteristics and comfort needs can vary from person to person, so personalization ensures that the sensors provide optimal comfort and fit while being worn.In addition, by avoiding the use of metal electrodes, this personalized design can also effectively prevent skin problems that may arise from long-term use, providing users with a safer and more reliable monitoring experience [16] .Friction nanogenerator (TENG) yarn was used to produce a human motion detecting device with exceptional skin friendliness and washability.It combines an 11×11 array sensing fabric for multi-channel sensing and a fivelayer construction with internal coil springs to monitor motion through flexible TENG fabric connected to the arms, knees, and other body parts.For the production of surfaceparallel TENGs intended for large-scale energy harvesting, polytetrafluoroethylene yarns are employed.This invention offers substantial backing for ongoing bodily movement tracking and has numerous potential uses in the field of medical monitoring in the future.In addition to monitoring the movements of the knees and wrists, the subtle movements of the eyes are also important.To prevent eye diseases, piezoelectric sensors are used to monitor blinking activity and alert users to take timely breaks.Non-invasive, attachable to the skin, and connected to the temple area via a flexible piezoelectric film, this sensor is small, noninvasive, highly sensitive, and promises to continuously monitor eye movements.The piezoelectric sensors can be used to alert the eye when it is overloaded by blink monitoring.Figure 2A shows a sensor attached to the skin using a flexible piezoelectric film to monitor blinking.

Respiratory rate
The thoracic impedance method is a commonly used technique for monitoring respiratory rate and is widely used in clinical and scientific research.In impedance volumetric tracing, respiratory activity is monitored by placing electrodes on specific parts of the body (usually the chest and abdomen) in order to measure impedance changes between the electrodes [17] .This technique is based on the volumetric changes in the chest and abdomen during respiratory movements, as the expansion and contraction of the lungs during respiration results in changes in the impedance of the body tissues.Specifically, as the volume of the lung's changes, the conductivity of the body tissue changes accordingly, which affects the impedance between the electrodes.Fiber optic grating sensors monitor respiratory rate using two main methods: The first involves tracking variations in chest volume, and the second involves spotting variations in temperature and humidity during breathing [18] .A recently proposed sensor for monitoring workers' respiratory rates in high-pressure environments uses fiber optic grating attached to a smart clothing system with polyimide (PI) as the fiber coating.This improves the sensor's performance by encasing the FBG in a flexible substrate that can be adjusted to fit individuals of varying body sizes.

Experimental results and analysis
The MIT-BIH arrhythmia database is an important database of ECG signals containing 48 records, and eight of these records (T103, T106, T119, T207, T208, T209, T214, and T222) were selected for the study, from which full samples were obtained.These samples were taken primarily by extracting the signal in the first lead.This study focused on the analysis of ECG bands to understand the characteristics of arrhythmias [19] .Recordings covering different types of beats were specifically selected, including T103, T106, T119, T207, T208, T209, T214, and T222.Of these, T106, T208, and T214 recordings contained more premature ventricular contractions (PVC) recordings, while T209 and T222 recordings contained more atrial premature contractions (APB) recordings.In order to synthesize the different types of beats, a total of 2800 samples were selected, of which 1150 were used for training and the rest for testing.Such sample selection and distribution aim to create a representative dataset for a more comprehensive understanding of the problem of arrhythmia recognition and classification.
The LIBSVM toolbox, a potent support vector machine implementation tool, is used for the trials, and Matlab R2010b is employed as the experimental platform.The test samples are forecast, and various kernel functions are used to investigate the support vector machine's performance.The linear kernel, polynomial kernel, and RBF radial basis kernel function are the three different kernel functions that are tested.These three kernel functions are essential to the support vector machine and have a big influence on the model's decision boundary shape, which in turn affects the model's classification performance.The experimental results are shown in Figure 3.The application of the radial basis kernel function in SVM is usually better able to capture complex nonlinear relationships, which may be the reason why it achieves the best classification accuracy in this problem.The SVM's kernel function width σ and penalty factor C were optimized using the Particle Swarm Optimization (PSO) algorithm.The PSO method searches iteratively until it finds the ideal set of parameters, which is C = 100 and σ = 0.1.The PSO method, which emulates the behavior of swarm intelligence, is essential to this process since it continuously updates the particle's position and velocity in order to identify the best solution in the parameter space.With the obtained ideal parameters, the SVM model performs optimally on the current dataset [20] .Under this optimized condition, the SVM model achieved an average classification accuracy of 92.61%.This means that the model was able to correctly identify 92.61% of the samples when classifying the three types of ECG signals [21] .Such a high classification accuracy provides strong support for the classification of ECG signals using the SVM algorithm, indicating that after parameter tuning, the model performs more accurately and reliably in recognizing different types of heartbeats.
As the width of the kernel function σ increases, the classification accuracy improves.The existence of a σ allows the classification accuracy to reach an optimal value, i.e., at which point the model is better able to adapt to the features of the data.However, continuing to increase σ may lead to an overlearning phenomenon, where the model focuses too much on the details of the training data, thus reducing its ability to generalize to new data.This  Observation of the above figure reveals the existence of a stable region of σ (the bandwidth parameter of the RBF kernel function).Within this stable region, the RBF kernel SVM has relatively better classification results for the test samples, and the impact of the penalty factor on the classification results is relatively small.This indicates that the model exhibits better generalization performance in processing the test samples within a specific range of σ values.To further understand the performance within this σ-stable region, detailed test results using RBF kernel SVM on the test samples are provided, as shown in Table 1.After a detailed analysis of the test results, it was found that the samples with discrimination errors were mainly concentrated on record T207.The main reason for this phenomenon is that some of the waveforms in this record are dense and show disorder.Misdetection or omission of detection may lead to the inaccuracy of the subsequent feature extraction, which in turn affects the final classification results.In the T207 record, due to the dense and disordered waveforms and the similarity between the S-T segment and the R-wave peak amplitude, the traditional adaptive thresholding method may fail in the R-wave detection, resulting in false detection.Therefore, to further improve the accuracy of the classifier, it is crucial to achieve accurate and real-time identification of R-wave peaks.Possible improvements include adopting a more flexible R-wave detection algorithm that combines waveform features and time-frequency domain information for comprehensive analysis to cope with the complex and variable waveform situations in T207 records.Meanwhile, considering the waveform differences between different records, customized processing strategies may positively improve the classifier performance.

Conclusion
Flexible sensors have demonstrated compelling advantages in cardiac vital signs monitoring, offering unrivaled advantages over traditional rigid sensors in portability, comfort, low cost, and convenience.This makes flexible sensors ideal, especially for wearable devices, for real-time monitoring of cardiovascular vital signs, including metrics such as heart rate, blood pressure, oxygen saturation, and blood glucose.In this paper, advanced flexible wearable sensors for non-invasive real-time cardiac vital signs monitoring are systematically demonstrated and discussed to obtain reliable biosignals related to cardiac diseases.The Marr wavelet transform was used to process the signals for cardiac diseases, and feature vectors were constructed using a feature parameter extraction algorithm.This algorithm is simple and intuitive and can better characterize the differences between heart diseases.A radial basis kernel SVM was built from the extracted feature vectors to recognize the three ECG signals, and the effect of SVM parameters on the classification results was investigated, which showed that the radial basis kernel EAI Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024 | B. Han et al. 4 Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024 |

EAI
Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024 |

Figure 2
Figure 2 Comparison of test results of three kernel functionsBy looking at Figure3, it is clear that among the three kernel functions, the radial basis kernel function performs best in classifying the three types of ECG signals.The application of the radial basis kernel function in SVM is usually better able to capture complex nonlinear relationships, which may be the reason why it achieves the best classification accuracy in this problem.The SVM's kernel function width σ and penalty factor C were optimized using the Particle Swarm Optimization (PSO) algorithm.The PSO method searches iteratively until it finds the ideal set of parameters, which is C = 100 and σ = 0.1.The PSO method, which emulates the behavior of swarm intelligence, is essential to this process since it continuously updates the particle's position and velocity in order to identify the best solution in the parameter space.With the obtained ideal parameters, the SVM model performs optimally on the current dataset[20] .Under this

EAI
Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024 | phenomenon may manifest itself in the form of the model performing well on the training set but degrading its performance on the test set.The effect of kernel function width σ on the classification results is shown in Figure 4.

Figure 3
Figure 3 Curve of the effect of σ on the classification result

EAI
Endorsed Transactions on Pervasive Health and Technology | Volume 10 | 2024 |

Table 1
Test results of the RBF-SVM classifier